@nice2dev/ui 1.0.10 → 1.0.12
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/README.md +44 -0
- package/dist/NiceErrorBoundary-BZEHCXNM.cjs +1 -0
- package/dist/NiceErrorBoundary-D6jw6wwD.js +762 -0
- package/dist/NiceErrorBoundary-DT5XPTeu.cjs +1 -0
- package/dist/NiceErrorBoundary-SqPtbIxK.js +762 -0
- package/dist/NiceForm-BgR-m8T9.cjs +382 -0
- package/dist/NiceForm-CI_vgkD4.cjs +382 -0
- package/dist/NiceForm-DYKciCeR.js +5131 -0
- package/dist/NiceForm-t9zdH8kU.js +5343 -0
- package/dist/NiceForm.css +1 -1
- package/dist/NiceModal-Br3J9jOV.cjs +1 -0
- package/dist/NiceModal-DQ7u-xVm.cjs +1 -0
- package/dist/NiceModal-DVAsBzHP.js +95 -0
- package/dist/NiceModal-IkSunDgK.js +95 -0
- package/dist/NiceModuleLifecyclePanel-Cj4x54sw.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-D-xBAp1_.js +5228 -0
- package/dist/NiceModuleLifecyclePanel-D3azLDdj.js +5249 -0
- package/dist/NiceModuleLifecyclePanel-DEfAIhFf.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-CbB5P1N_.js +171 -0
- package/dist/NicePagination-DDFkSRr9.js +171 -0
- package/dist/NicePagination-DGHtXqy1.cjs +1 -0
- package/dist/NicePagination-UGjzvRUS.cjs +1 -0
- package/dist/NicePinCodeInput-BhIABBTV.cjs +419 -0
- package/dist/NicePinCodeInput-BmRO9HSQ.js +11830 -0
- package/dist/NicePinCodeInput-D91uvVsF.cjs +419 -0
- package/dist/NicePinCodeInput-jMNfPqOx.js +11866 -0
- package/dist/NicePinCodeInput.css +1 -1
- package/dist/NiceSavedQueryPanel-7nZe46t8.cjs +596 -0
- package/dist/NiceSavedQueryPanel-BSGzs7Oc.js +6449 -0
- package/dist/NiceSavedQueryPanel-BkYRk5cX.js +6441 -0
- package/dist/NiceSavedQueryPanel-CmFSi21-.cjs +596 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceTabs-BeaxZzAO.js +1636 -0
- package/dist/NiceTabs-C4H5un8J.cjs +1 -0
- package/dist/NiceTabs-DcbYFIWR.cjs +1 -0
- package/dist/NiceTabs-DlsCMth_.js +1622 -0
- package/dist/NiceWindow-BNrA5Dxq.js +1409 -0
- package/dist/NiceWindow-Bga9fOkg.js +1409 -0
- package/dist/NiceWindow-CbzJmurQ.cjs +1 -0
- package/dist/NiceWindow-CxWTj5xH.cjs +1 -0
- package/dist/charts-BcvKWYUl.cjs +759 -0
- package/dist/charts-DZvmvfhM.js +4621 -0
- package/dist/charts-F_b5-OR8.js +4621 -0
- package/dist/charts-e10jGjuF.cjs +759 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-B4b1BmHt.js +22177 -0
- package/dist/core-CSfXTICE.cjs +96 -0
- package/dist/core-CjmLbclt.cjs +96 -0
- package/dist/core-ClmvtMVZ.js +22253 -0
- package/dist/data-branching-B_9C6-hE.cjs +1 -0
- package/dist/data-branching-BmCKIXgr.js +6121 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +2 -2
- package/dist/data.mjs +1 -1
- package/dist/devops-BL39OCVh.js +7660 -0
- package/dist/devops-CkuTC7RJ.cjs +17 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +92 -6
- package/dist/editors.mjs +3 -3
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +2 -2
- package/dist/index-BU6KCDpP.js +57872 -0
- package/dist/index-D7i7sZGV.cjs +5194 -0
- package/dist/index-DlHlXz8e.js +57319 -0
- package/dist/index-Dx726U90.cjs +5192 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +448 -20
- package/dist/index.mjs +881 -868
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.mjs +24 -24
- package/dist/no-code-Bb3QFKdm.cjs +332 -0
- package/dist/no-code-snLY0d6I.js +7065 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.mjs +81 -81
- package/dist/vendor-DF586kuF.js +271 -0
- package/dist/vendor-DHEorsoy.cjs +1 -0
- package/package.json +5 -4
package/dist/NiceForm.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.nice-country-picker{position:relative;display:inline-block;width:100%;max-width:320px;font-family:inherit}.nice-country-picker--sm{font-size:12px}.nice-country-picker--md{font-size:14px}.nice-country-picker--lg{font-size:16px}.nice-country-picker__trigger{display:flex;align-items:center;justify-content:space-between;width:100%;padding:8px 12px;border:1px solid var(--border-color, var(--nice-border-color, #d1d5db));border-radius:6px;background:var(--bg-primary, var(--nice-bg, #fff));cursor:pointer;text-align:left;font-size:inherit;color:var(--text-primary, var(--nice-text, #1f2937));transition:border-color .2s,box-shadow .2s}.nice-country-picker--sm .nice-country-picker__trigger{padding:6px 10px}.nice-country-picker--lg .nice-country-picker__trigger{padding:10px 14px}.nice-country-picker__trigger:hover:not(:disabled){border-color:var(--nice-primary, #3b82f6)}.nice-country-picker__trigger:focus{outline:none;border-color:var(--nice-primary, #3b82f6);box-shadow:0 0 0 3px
|
|
1
|
+
.nice-country-picker{position:relative;display:inline-block;width:100%;max-width:320px;font-family:inherit}.nice-country-picker--sm{font-size:12px}.nice-country-picker--md{font-size:14px}.nice-country-picker--lg{font-size:16px}.nice-country-picker__trigger{display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);border:1px solid var(--border-color, var(--nice-border-color, #d1d5db));border-radius:var(--nice-radius-md, 6px);background:var(--bg-primary, var(--nice-bg, #fff));cursor:pointer;text-align:left;font-size:inherit;color:var(--text-primary, var(--nice-text, #1f2937));transition:border-color .2s,box-shadow .2s}.nice-country-picker--sm .nice-country-picker__trigger{padding:var(--nice-space-1-5, 6px) var(--nice-space-2-5, 10px)}.nice-country-picker--lg .nice-country-picker__trigger{padding:var(--nice-space-2-5, 10px) var(--nice-space-3-5, 14px)}.nice-country-picker__trigger:hover:not(:disabled){border-color:var(--nice-primary, #3b82f6)}.nice-country-picker__trigger:focus{outline:none;border-color:var(--nice-primary, #3b82f6);box-shadow:0 0 0 3px var(--nice-primary-tint-20, rgba(59, 130, 246, .2))}.nice-country-picker--open .nice-country-picker__trigger{border-color:var(--nice-primary, #3b82f6);box-shadow:0 0 0 3px var(--nice-primary-tint-20, rgba(59, 130, 246, .2))}.nice-country-picker--disabled .nice-country-picker__trigger{background:var(--nice-disabled-bg, #f3f4f6);color:var(--nice-disabled-text, #9ca3af);cursor:not-allowed}.nice-country-picker__value{display:flex;align-items:center;gap:var(--nice-space-2, 8px);flex:1;overflow:hidden}.nice-country-picker__flag{font-size:1.2em;line-height:1;flex-shrink:0}.nice-country-picker__name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nice-country-picker__dial-code{color:var(--nice-text-secondary, #6b7280);font-size:.9em;flex-shrink:0}.nice-country-picker__code{color:var(--nice-text-secondary, #6b7280);font-size:.85em;font-variant:tabular-nums;text-transform:uppercase;letter-spacing:.04em;flex-shrink:0}.nice-country-picker__placeholder{color:var(--nice-placeholder, #9ca3af)}.nice-country-picker__icons{display:flex;align-items:center;gap:var(--nice-space-1, 4px);margin-left:var(--nice-space-2, 8px);flex-shrink:0}.nice-country-picker__clear{display:flex;align-items:center;justify-content:center;width:18px;height:18px;font-size:10px;color:var(--nice-text-secondary, #6b7280);background:var(--nice-hover-bg, #f3f4f6);border-radius:var(--nice-radius-full, 50%);cursor:pointer;transition:background .2s,color .2s}.nice-country-picker__clear:hover{background:var(--nice-danger, #ef4444);color:#fff}.nice-country-picker__arrow{font-size:10px;color:var(--nice-text-secondary, #6b7280);transition:transform .2s}.nice-country-picker__dropdown{position:absolute;top:100%;left:0;right:0;margin-top:var(--nice-space-1, 4px);background:var(--bg-primary, var(--nice-bg, #fff));color:var(--text-primary, var(--nice-text, #1f2937));border:1px solid var(--border-color, var(--nice-border-color, #d1d5db));border-radius:var(--nice-radius-md, 6px);box-shadow:0 10px 25px var(--nice-overlay-15, rgba(0, 0, 0, .15));z-index:1000;max-height:320px;display:flex;flex-direction:column;overflow:hidden}.nice-country-picker__search{padding:var(--nice-space-2, 8px);border-bottom:1px solid var(--nice-border-color, #e5e7eb);flex-shrink:0}.nice-country-picker__search-input{width:100%;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);border:1px solid var(--nice-border-color, #d1d5db);border-radius:var(--nice-radius-sm, 4px);font-size:inherit;background:var(--nice-bg, #fff);color:var(--nice-text, #1f2937)}.nice-country-picker__search-input:focus{outline:none;border-color:var(--nice-primary, #3b82f6);box-shadow:0 0 0 2px var(--nice-primary-tint-15, rgba(59, 130, 246, .15))}.nice-country-picker__search-input::placeholder{color:var(--nice-placeholder, #9ca3af)}.nice-country-picker__list{flex:1;overflow-y:auto;padding:var(--nice-space-1, 4px)}.nice-country-picker__option{display:flex;align-items:center;gap:var(--nice-space-2, 8px);padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);cursor:pointer;border-radius:var(--nice-radius-sm, 4px);transition:background .15s}.nice-country-picker__option:hover,.nice-country-picker__option--highlighted{background:color-mix(in srgb,var(--color-primary, #3b82f6) 14%,transparent);color:var(--text-primary, var(--nice-text, #1f2937))}.nice-country-picker__option--selected{background:color-mix(in srgb,var(--color-primary, #3b82f6) 22%,transparent);color:var(--text-primary, var(--nice-text, #1f2937));font-weight:600}.nice-country-picker__option--selected:hover,.nice-country-picker__option--selected.nice-country-picker__option--highlighted{background:color-mix(in srgb,var(--color-primary, #3b82f6) 30%,transparent)}.nice-country-picker__option .nice-country-picker__dial-code{margin-left:auto}.nice-country-picker__empty{padding:var(--nice-space-4, 16px);text-align:center;color:var(--nice-text-secondary, #6b7280)}@media(prefers-color-scheme:dark){.nice-country-picker__trigger{background:var(--nice-bg, #1f2937);border-color:var(--nice-border-color, #374151);color:var(--nice-text, #f3f4f6)}.nice-country-picker--disabled .nice-country-picker__trigger{background:var(--nice-disabled-bg, #374151);color:var(--nice-disabled-text, #6b7280)}.nice-country-picker__dropdown{background:var(--nice-bg, #1f2937);border-color:var(--nice-border-color, #374151);box-shadow:0 10px 25px var(--nice-overlay-40, rgba(0, 0, 0, .4))}.nice-country-picker__search{border-color:var(--nice-border-color, #374151)}.nice-country-picker__search-input{background:var(--nice-bg, #111827);border-color:var(--nice-border-color, #374151);color:var(--nice-text, #f3f4f6)}.nice-country-picker__option:hover,.nice-country-picker__option--highlighted{background:var(--nice-hover-bg, #374151)}.nice-country-picker__option--selected,.nice-country-picker__option--selected:hover,.nice-country-picker__option--selected.nice-country-picker__option--highlighted{background:var(--nice-primary-dark, #1e3a8a)}.nice-country-picker__clear{background:var(--nice-hover-bg, #374151);color:var(--nice-text-secondary, #9ca3af)}}.nice-country-picker__list::-webkit-scrollbar{width:8px}.nice-country-picker__list::-webkit-scrollbar-track{background:transparent}.nice-country-picker__list::-webkit-scrollbar-thumb{background:var(--nice-border-color, #d1d5db);border-radius:var(--nice-radius-sm, 4px)}.nice-country-picker__list::-webkit-scrollbar-thumb:hover{background:var(--nice-text-secondary, #9ca3af)}.nice-country-picker--compact{display:inline-block;width:auto;max-width:none}.nice-country-picker--compact .nice-country-picker__trigger{width:auto;min-width:0;padding:var(--nice-space-1, 4px) var(--nice-space-2, 8px);gap:var(--nice-space-1, 4px)}.nice-country-picker--compact .nice-country-picker__value{gap:var(--nice-space-1, 4px);flex:0 0 auto}.nice-country-picker--compact .nice-country-picker__icons{margin-left:var(--nice-space-1, 4px)}.nice-country-picker__dropdown--align-left{left:0;right:auto;min-width:100%}.nice-country-picker__dropdown--align-right{right:0;left:auto;min-width:240px}.nice-theme-picker__option{position:relative}.nice-theme-picker__edit-btn{margin-left:auto;background:transparent;border:1px solid transparent;color:var(--nice-text-secondary, #6b7280);cursor:pointer;width:22px;height:22px;border-radius:var(--nice-radius-sm, 4px);display:inline-flex;align-items:center;justify-content:center;font-size:12px;opacity:0;transition:opacity .15s,background .15s,color .15s}.nice-theme-picker__option:hover .nice-theme-picker__edit-btn,.nice-theme-picker__option--highlighted .nice-theme-picker__edit-btn,.nice-theme-picker__edit-btn:focus{opacity:1}.nice-theme-picker__edit-btn:hover{background:var(--nice-hover-bg, #f3f4f6);color:var(--nice-primary, #3b82f6);border-color:var(--nice-border-color, #d1d5db)}.nice-theme-picker__add-btn{display:flex;align-items:center;justify-content:center;gap:var(--nice-space-1, 4px);width:100%;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);border:none;border-top:1px solid var(--nice-border-color, #e5e7eb);background:var(--nice-bg, #fff);color:var(--nice-primary, #3b82f6);font-size:inherit;font-weight:600;cursor:pointer;flex-shrink:0;transition:background .15s}.nice-theme-picker__add-btn:hover{background:color-mix(in srgb,var(--nice-primary, #3b82f6) 10%,transparent)}.nice-theme-picker__add-btn--top{border-top:none;border-bottom:1px solid var(--nice-border-color, #e5e7eb)}@media(prefers-color-scheme:dark){.nice-theme-picker__add-btn{background:var(--nice-bg, #1f2937);border-top-color:var(--nice-border-color, #374151)}.nice-theme-picker__add-btn--top{border-bottom-color:var(--nice-border-color, #374151)}.nice-theme-picker__edit-btn:hover{background:var(--nice-hover-bg, #374151)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),t=require("./core-CjmLbclt.cjs"),a=require("react"),g=require("react-dom"),E=({open:l,onClose:c,title:n,size:f="md",children:h,footer:r,closeOnOverlay:v=!0,closeOnEscape:i=!0,fullscreenable:y,zIndex:d,className:x,style:_,displayStyle:u})=>{const{t:b}=t.Wo(),j=a.useContext(t.Qt),m=a.useRef(null),[o,N]=a.useState(!1),k=t.Ui("modal",u),w=t.Gi("modal",u);if(t.fs(m,l),a.useEffect(()=>{if(!l||!i)return;const s=L=>{L.key==="Escape"&&c()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[l,i,c]),a.useEffect(()=>(l?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[l]),!l||typeof document>"u")return null;const C=e.jsx("div",{className:"nice-modal-overlay",style:d?{zIndex:d}:void 0,onClick:v?c:void 0,children:e.jsxs("div",{ref:m,className:`nice-modal nice-modal--${o?"full":f} nice-modal--ds-${w} ${x||""}`,style:{...k,..._},role:"dialog","aria-modal":"true","aria-label":n,onClick:s=>s.stopPropagation(),children:[n&&e.jsxs("div",{className:"nice-modal__header",children:[e.jsx("h2",{className:"nice-modal__title",children:n}),e.jsxs("div",{className:"nice-modal__header-actions",children:[y&&e.jsx("button",{type:"button",className:"nice-modal__fullscreen",onClick:()=>N(s=>!s),"aria-label":o?"Exit fullscreen":"Fullscreen",children:o?"⇲":"⇱"}),e.jsx("button",{type:"button",className:"nice-modal__close",onClick:c,"aria-label":b("controls.close","Close"),children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]})]}),e.jsx("div",{className:"nice-modal__body",children:h}),r&&e.jsx("div",{className:"nice-modal__footer",children:r})]})});return g.createPortal(C,j?.portalTarget??document.body)};exports.NiceModal=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),t=require("./core-CSfXTICE.cjs"),a=require("react"),g=require("react-dom"),E=({open:l,onClose:c,title:o,size:f="md",children:h,footer:r,closeOnOverlay:v=!0,closeOnEscape:d=!0,fullscreenable:y,zIndex:i,className:x,style:_,displayStyle:u})=>{const{t:b}=t.$o(),j=a.useContext(t.tr),m=a.useRef(null),[n,N]=a.useState(!1),k=t.os("modal",u),w=t.is("modal",u);if(t.ks(m,l),a.useEffect(()=>{if(!l||!d)return;const s=L=>{L.key==="Escape"&&c()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[l,d,c]),a.useEffect(()=>(l?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[l]),!l||typeof document>"u")return null;const C=e.jsx("div",{className:"nice-modal-overlay",style:i?{zIndex:i}:void 0,onClick:v?c:void 0,children:e.jsxs("div",{ref:m,className:`nice-modal nice-modal--${n?"full":f} nice-modal--ds-${w} ${x||""}`,style:{...k,..._},role:"dialog","aria-modal":"true","aria-label":o,onClick:s=>s.stopPropagation(),children:[o&&e.jsxs("div",{className:"nice-modal__header",children:[e.jsx("h2",{className:"nice-modal__title",children:o}),e.jsxs("div",{className:"nice-modal__header-actions",children:[y&&e.jsx("button",{type:"button",className:"nice-modal__fullscreen",onClick:()=>N(s=>!s),"aria-label":n?"Exit fullscreen":"Fullscreen",children:n?"⇲":"⇱"}),e.jsx("button",{type:"button",className:"nice-modal__close",onClick:c,"aria-label":b("controls.close","Close"),children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]})]}),e.jsx("div",{className:"nice-modal__body",children:h}),r&&e.jsx("div",{className:"nice-modal__footer",children:r})]})});return g.createPortal(C,j?.portalTarget??document.body)};exports.NiceModal=E;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { W as g, Q as E, U as F, G as $, f as j } from "./core-B4b1BmHt.js";
|
|
3
|
+
import { useContext as G, useRef as M, useState as P, useEffect as u } from "react";
|
|
4
|
+
import { createPortal as Q } from "react-dom";
|
|
5
|
+
const S = ({
|
|
6
|
+
open: l,
|
|
7
|
+
onClose: o,
|
|
8
|
+
title: t,
|
|
9
|
+
size: f = "md",
|
|
10
|
+
children: h,
|
|
11
|
+
footer: s,
|
|
12
|
+
closeOnOverlay: v = !0,
|
|
13
|
+
closeOnEscape: d = !0,
|
|
14
|
+
fullscreenable: y,
|
|
15
|
+
zIndex: c,
|
|
16
|
+
className: _,
|
|
17
|
+
style: b,
|
|
18
|
+
displayStyle: i
|
|
19
|
+
}) => {
|
|
20
|
+
const { t: N } = g(), k = G(E), m = M(null), [r, p] = P(!1), w = F("modal", i), x = $("modal", i);
|
|
21
|
+
if (j(m, l), u(() => {
|
|
22
|
+
if (!l || !d)
|
|
23
|
+
return;
|
|
24
|
+
const a = (L) => {
|
|
25
|
+
L.key === "Escape" && o();
|
|
26
|
+
};
|
|
27
|
+
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
28
|
+
}, [l, d, o]), u(() => (l ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
29
|
+
document.body.style.overflow = "";
|
|
30
|
+
}), [l]), !l || typeof document > "u")
|
|
31
|
+
return null;
|
|
32
|
+
const C = /* @__PURE__ */ e(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: "nice-modal-overlay",
|
|
36
|
+
style: c ? { zIndex: c } : void 0,
|
|
37
|
+
onClick: v ? o : void 0,
|
|
38
|
+
children: /* @__PURE__ */ n(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref: m,
|
|
42
|
+
className: `nice-modal nice-modal--${r ? "full" : f} nice-modal--ds-${x} ${_ || ""}`,
|
|
43
|
+
style: { ...w, ...b },
|
|
44
|
+
role: "dialog",
|
|
45
|
+
"aria-modal": "true",
|
|
46
|
+
"aria-label": t,
|
|
47
|
+
onClick: (a) => a.stopPropagation(),
|
|
48
|
+
children: [
|
|
49
|
+
t && /* @__PURE__ */ n("div", { className: "nice-modal__header", children: [
|
|
50
|
+
/* @__PURE__ */ e("h2", { className: "nice-modal__title", children: t }),
|
|
51
|
+
/* @__PURE__ */ n("div", { className: "nice-modal__header-actions", children: [
|
|
52
|
+
y && /* @__PURE__ */ e(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
type: "button",
|
|
56
|
+
className: "nice-modal__fullscreen",
|
|
57
|
+
onClick: () => p((a) => !a),
|
|
58
|
+
"aria-label": r ? "Exit fullscreen" : "Fullscreen",
|
|
59
|
+
children: r ? "⇲" : "⇱"
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ e(
|
|
63
|
+
"button",
|
|
64
|
+
{
|
|
65
|
+
type: "button",
|
|
66
|
+
className: "nice-modal__close",
|
|
67
|
+
onClick: o,
|
|
68
|
+
"aria-label": N("controls.close", "Close"),
|
|
69
|
+
children: /* @__PURE__ */ e(
|
|
70
|
+
"svg",
|
|
71
|
+
{
|
|
72
|
+
width: "24",
|
|
73
|
+
height: "24",
|
|
74
|
+
viewBox: "0 0 20 20",
|
|
75
|
+
fill: "currentColor",
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
children: /* @__PURE__ */ e("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] })
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ e("div", { className: "nice-modal__body", children: h }),
|
|
85
|
+
s && /* @__PURE__ */ e("div", { className: "nice-modal__footer", children: s })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
return Q(C, k?.portalTarget ?? document.body);
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
S as N
|
|
95
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { $ as g, t as $, o as E, a as F, k as j } from "./core-ClmvtMVZ.js";
|
|
3
|
+
import { useContext as M, useRef as P, useState as R, useEffect as u } from "react";
|
|
4
|
+
import { createPortal as B } from "react-dom";
|
|
5
|
+
const A = ({
|
|
6
|
+
open: l,
|
|
7
|
+
onClose: o,
|
|
8
|
+
title: t,
|
|
9
|
+
size: f = "md",
|
|
10
|
+
children: h,
|
|
11
|
+
footer: n,
|
|
12
|
+
closeOnOverlay: v = !0,
|
|
13
|
+
closeOnEscape: d = !0,
|
|
14
|
+
fullscreenable: y,
|
|
15
|
+
zIndex: c,
|
|
16
|
+
className: _,
|
|
17
|
+
style: b,
|
|
18
|
+
displayStyle: i
|
|
19
|
+
}) => {
|
|
20
|
+
const { t: N } = g(), k = M($), m = P(null), [r, p] = R(!1), w = E("modal", i), x = F("modal", i);
|
|
21
|
+
if (j(m, l), u(() => {
|
|
22
|
+
if (!l || !d)
|
|
23
|
+
return;
|
|
24
|
+
const a = (L) => {
|
|
25
|
+
L.key === "Escape" && o();
|
|
26
|
+
};
|
|
27
|
+
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
28
|
+
}, [l, d, o]), u(() => (l ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
29
|
+
document.body.style.overflow = "";
|
|
30
|
+
}), [l]), !l || typeof document > "u")
|
|
31
|
+
return null;
|
|
32
|
+
const C = /* @__PURE__ */ e(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: "nice-modal-overlay",
|
|
36
|
+
style: c ? { zIndex: c } : void 0,
|
|
37
|
+
onClick: v ? o : void 0,
|
|
38
|
+
children: /* @__PURE__ */ s(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref: m,
|
|
42
|
+
className: `nice-modal nice-modal--${r ? "full" : f} nice-modal--ds-${x} ${_ || ""}`,
|
|
43
|
+
style: { ...w, ...b },
|
|
44
|
+
role: "dialog",
|
|
45
|
+
"aria-modal": "true",
|
|
46
|
+
"aria-label": t,
|
|
47
|
+
onClick: (a) => a.stopPropagation(),
|
|
48
|
+
children: [
|
|
49
|
+
t && /* @__PURE__ */ s("div", { className: "nice-modal__header", children: [
|
|
50
|
+
/* @__PURE__ */ e("h2", { className: "nice-modal__title", children: t }),
|
|
51
|
+
/* @__PURE__ */ s("div", { className: "nice-modal__header-actions", children: [
|
|
52
|
+
y && /* @__PURE__ */ e(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
type: "button",
|
|
56
|
+
className: "nice-modal__fullscreen",
|
|
57
|
+
onClick: () => p((a) => !a),
|
|
58
|
+
"aria-label": r ? "Exit fullscreen" : "Fullscreen",
|
|
59
|
+
children: r ? "⇲" : "⇱"
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ e(
|
|
63
|
+
"button",
|
|
64
|
+
{
|
|
65
|
+
type: "button",
|
|
66
|
+
className: "nice-modal__close",
|
|
67
|
+
onClick: o,
|
|
68
|
+
"aria-label": N("controls.close", "Close"),
|
|
69
|
+
children: /* @__PURE__ */ e(
|
|
70
|
+
"svg",
|
|
71
|
+
{
|
|
72
|
+
width: "24",
|
|
73
|
+
height: "24",
|
|
74
|
+
viewBox: "0 0 20 20",
|
|
75
|
+
fill: "currentColor",
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
children: /* @__PURE__ */ e("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] })
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ e("div", { className: "nice-modal__body", children: h }),
|
|
85
|
+
n && /* @__PURE__ */ e("div", { className: "nice-modal__footer", children: n })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
return B(C, k?.portalTarget ?? document.body);
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
A as N
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),T=require("./core-CSfXTICE.cjs"),c=require("react"),W=require("./NiceTabs-C4H5un8J.cjs"),_n=({items:n,multiple:s=!1,defaultOpen:a=[],size:i="md",width:l,maxWidth:_,animationDuration:r=220,className:m,style:o,displayStyle:t})=>{T.is("card",t);const[u,j]=c.useState(new Set(a)),x=c.useId(),b=c.useCallback(w=>{j(k=>{const M=new Set(k);return M.has(w)?M.delete(w):(s||M.clear(),M.add(w)),M})},[s]),$={...o,...l!==void 0?{width:typeof l=="number"?`${l}px`:l}:{},..._!==void 0?{maxWidth:typeof _=="number"?`${_}px`:_}:{},"--nice-accordion-anim":`${Math.max(0,r)}ms`};return e.jsx("div",{className:`nice-accordion nice-accordion--${i} ${m||""}`,style:$,children:n.map((w,k)=>{const M=u.has(w.id),I=`${x}-trigger-${k}`,h=`${x}-panel-${k}`;return e.jsxs("div",{className:"nice-accordion__item",children:[e.jsxs("button",{id:I,className:"nice-accordion__trigger",onClick:()=>!w.disabled&&b(w.id),"aria-expanded":M,"aria-controls":h,"aria-disabled":w.disabled,disabled:w.disabled,children:[e.jsx("span",{children:w.title}),e.jsx("svg",{className:`nice-accordion__chevron ${M?"nice-accordion__chevron--open":""}`,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.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"})})]}),M&&e.jsx("div",{id:h,className:"nice-accordion__content",role:"region","aria-labelledby":I,children:w.content})]},w.id)})})},hn=({items:n,separator:s="/",size:a="md",className:i,style:l})=>e.jsx("nav",{className:`nice-breadcrumb nice-breadcrumb--${a} ${i||""}`,style:l,"aria-label":"Breadcrumb",children:n.map((_,r)=>e.jsxs(c.Fragment,{children:[r>0&&e.jsx("span",{className:"nice-breadcrumb__separator",children:s}),r===n.length-1?e.jsx("span",{className:"nice-breadcrumb__current","aria-current":"page",children:_.label}):e.jsx("span",{className:"nice-breadcrumb__item",children:e.jsx("a",{className:"nice-breadcrumb__link",href:_.href,onClick:m=>{_.onClick&&(m.preventDefault(),_.onClick())},children:_.label})})]},r))}),mn=({children:n,title:s,headerExtra:a,footer:i,hoverable:l,bordered:_=!0,onClick:r,size:m="md",className:o,style:t,displayStyle:u})=>{const j=T.os("card",u),x=T.is("card",u);return e.jsxs("div",{className:`nice-card nice-card--${m} nice-card--ds-${x} ${_?"nice-card--bordered":"nice-card--frameless"} ${l?"nice-card--hoverable":""} ${r?"nice-card--clickable":""} ${o||""}`,style:{...j,...t},onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,children:[(s||a)&&e.jsxs("div",{className:"nice-card__header",children:[s&&e.jsx("h3",{className:"nice-card__title",children:s}),a]}),e.jsx("div",{className:"nice-card__body",children:n}),i&&e.jsx("div",{className:"nice-card__footer",children:i})]})},$e=({items:n,orientation:s="horizontal",onItemClick:a,size:i="md",className:l,style:_,accessMode:r,id:m,displayStyle:o})=>{T.os("menu",o),T.is("menu",o);const u=T.Bs(r,m)==="hidden",[j,x]=c.useState(null),[b,$]=c.useState(-1),w=c.useRef(null),k=n.filter(h=>!h.disabled),M=c.useCallback(h=>{const p=s==="horizontal",v=p?"ArrowLeft":"ArrowUp",z=p?"ArrowRight":"ArrowDown";if(h.key===v)h.preventDefault(),$(g=>g<=0?k.length-1:g-1);else if(h.key===z)h.preventDefault(),$(g=>g>=k.length-1?0:g+1);else if(h.key==="Enter"||h.key===" "){h.preventDefault();const g=k[b];g&&(g.items?.length?x(j===g.key?null:g.key):(g.onClick?.(),a?.(g)))}else h.key==="Escape"&&x(null)},[s,k,b,j,a]),I=(h,p)=>{const v=h.items&&h.items.length>0,z=j===h.key,g=k[b]?.key===h.key;return e.jsxs("li",{className:`nice-menu__item ${h.disabled?"nice-menu__item--disabled":""} ${v?"nice-menu__item--has-children":""} ${g?"nice-menu__item--focused":""}`,onMouseEnter:()=>v&&x(h.key),onMouseLeave:()=>v&&x(null),role:"none",children:[e.jsxs("button",{type:"button",className:"nice-menu__link",disabled:h.disabled,tabIndex:g?0:-1,role:"menuitem","aria-haspopup":v||void 0,"aria-expanded":v?z:void 0,onClick:()=>{h.disabled||(h.onClick?.(),a?.(h))},children:[h.icon&&e.jsx("span",{className:"nice-menu__icon",children:h.icon}),e.jsx("span",{children:h.text}),v&&e.jsx("span",{className:"nice-menu__arrow",children:"▸"})]}),v&&z&&e.jsx("ul",{className:"nice-menu__submenu",role:"menu",children:h.items.map((L,C)=>I(L))})]},h.key)};return u?null:e.jsx("nav",{className:`nice-menu nice-menu--${s} nice-menu--${i} ${l||""}`,style:_,children:e.jsx("ul",{ref:w,className:"nice-menu__list",role:"menubar",tabIndex:0,onKeyDown:M,onFocus:()=>b<0&&$(0),children:n.map((h,p)=>I(h))})})};$e.displayName="NiceMenu";const bn=({items:n,target:s,onItemClick:a,size:i="md",className:l,style:_})=>{const[r,m]=c.useState(null),o=c.useRef(null);return T.ws(o,()=>m(null)),c.useEffect(()=>{const t=s.current;if(!t)return;const u=j=>{j.preventDefault(),m({x:j.clientX,y:j.clientY})};return t.addEventListener("contextmenu",u),()=>t.removeEventListener("contextmenu",u)},[s]),r?e.jsx("div",{ref:o,className:`nice-contextmenu nice-contextmenu--${i} ${l||""}`,style:{position:"fixed",left:r.x,top:r.y,zIndex:1e4,..._},children:e.jsx("ul",{className:"nice-contextmenu__list",role:"menu",children:n.map(t=>e.jsx("li",{className:`nice-contextmenu__item ${t.disabled?"nice-contextmenu__item--disabled":""}`,role:"none",children:e.jsxs("button",{type:"button",className:"nice-contextmenu__btn",disabled:t.disabled,"aria-disabled":t.disabled,role:"menuitem",onClick:()=>{t.onClick?.(),a?.(t),m(null)},children:[t.icon&&e.jsx("span",{className:"nice-contextmenu__icon","aria-hidden":"true",children:t.icon}),e.jsx("span",{children:t.text})]})},t.key))})}):null},pn=({items:n,selectedIndex:s,onSelectedIndexChange:a,animationEnabled:i=!0,nav:l="tabs",showArrows:_,autoPlay:r=0,size:m="md",className:o,style:t,accessMode:u,id:j})=>{const b=T.Bs(u,j)==="hidden",[$,w]=c.useState(0),k=s??$,[M,I]=c.useState("right"),h=c.useRef(null),p=c.useCallback(y=>{I(y>k?"right":"left"),a?a(y):w(y)},[k,a]),v=c.useCallback(()=>p((k+1)%n.length),[p,k,n.length]),z=c.useCallback(()=>p((k-1+n.length)%n.length),[p,k,n.length]);c.useEffect(()=>{if(r>0&&n.length>1)return h.current=setInterval(v,r),()=>{h.current&&clearInterval(h.current)}},[r,v,n.length]);const g=c.useCallback(y=>{y.key==="ArrowRight"||y.key==="ArrowDown"?(y.preventDefault(),v()):(y.key==="ArrowLeft"||y.key==="ArrowUp")&&(y.preventDefault(),z())},[v,z]),L=n[k];if(!L)return null;const C=_??(l==="dots"||l==="arrows"||l==="none"),f=l==="tabs",D=l==="dots";return b?null:e.jsxs("div",{className:["nice-multiview",`nice-multiview--${m}`,i?"nice-multiview--animated":"",o].filter(Boolean).join(" "),style:t,onKeyDown:g,tabIndex:0,role:"region","aria-roledescription":"carousel","aria-label":"Multi-view",children:[f&&e.jsx("div",{className:"nice-multiview__tabs",role:"tablist",children:n.map((y,d)=>e.jsxs("button",{role:"tab","aria-selected":d===k,className:["nice-multiview__tab",d===k?"nice-multiview__tab--active":""].filter(Boolean).join(" "),onClick:()=>p(d),children:[y.icon&&e.jsx("span",{className:"nice-multiview__tab-icon",children:y.icon}),y.label&&e.jsx("span",{className:"nice-multiview__tab-label",children:y.label}),!y.label&&!y.icon&&e.jsx("span",{className:"nice-multiview__tab-label",children:y.key})]},y.key))}),e.jsxs("div",{className:"nice-multiview__viewport",children:[C&&n.length>1&&e.jsx("button",{className:"nice-multiview__arrow nice-multiview__arrow--prev",onClick:z,"aria-label":"Previous",children:"‹"}),e.jsx("div",{className:["nice-multiview__content",i?`nice-multiview__content--slide-${M}`:""].filter(Boolean).join(" "),role:"tabpanel",children:L.render()},L.key),C&&n.length>1&&e.jsx("button",{className:"nice-multiview__arrow nice-multiview__arrow--next",onClick:v,"aria-label":"Next",children:"›"})]}),D&&n.length>1&&e.jsx("div",{className:"nice-multiview__dots",children:n.map((y,d)=>e.jsx("button",{className:["nice-multiview__dot",d===k?"nice-multiview__dot--active":""].filter(Boolean).join(" "),onClick:()=>p(d),"aria-label":`View ${d+1}`},y.key))}),l==="arrows"&&n.length>1&&e.jsxs("div",{className:"nice-multiview__counter",children:[k+1," / ",n.length]})]})},xn=({items:n,selectedKey:s,onSelectedKeyChange:a,tabPosition:i="top",size:l="md",className:_,style:r,displayStyle:m})=>{T.is("tab",m);const[o,t]=c.useState(n[0]?.key??""),u=s??o,j=w=>{a?a(w):t(w)},x=n.find(w=>w.key===u),b=i==="left"||i==="right",$=e.jsx("div",{className:"nice-tabpanel__tabs",role:"tablist",style:{display:"flex",flexDirection:b?"column":"row"},children:n.map(w=>e.jsxs("button",{type:"button",role:"tab",className:`nice-tabpanel__tab ${w.key===u?"nice-tabpanel__tab--active":""}`,disabled:w.disabled,onClick:()=>!w.disabled&&j(w.key),"aria-selected":w.key===u,children:[w.icon&&e.jsx("span",{className:"nice-tabpanel__tab-icon",children:w.icon}),e.jsx("span",{children:w.title}),w.badge&&e.jsx("span",{className:"nice-tabpanel__tab-badge",children:w.badge})]},w.key))});return e.jsxs("div",{className:`nice-tabpanel nice-tabpanel--${i} ${_||""}`,style:{display:"flex",flexDirection:b?"row":"column",...r},children:[(i==="top"||i==="left")&&$,e.jsx("div",{className:"nice-tabpanel__content",role:"tabpanel",children:x?.render()}),(i==="bottom"||i==="right")&&$]})},Nn=({panes:n,orientation:s="horizontal",gutterSize:a=6,onResize:i,className:l,style:_,accessMode:r,id:m})=>{const t=T.Bs(r,m)==="hidden",u=c.useRef(null),[j,x]=c.useState(()=>n.map(()=>100/n.length)),b=c.useCallback((w,k)=>{k.preventDefault();const M=u.current;if(!M)return;const I=s==="horizontal",h=I?M.offsetWidth:M.offsetHeight,p=I?k.clientX:k.clientY,v=[...j],z=L=>{const C=((I?L.clientX:L.clientY)-p)/h*100,f=[...v],D=n[w].minSize?n[w].minSize/h*100:5,y=n[w+1].minSize?n[w+1].minSize/h*100:5;let d=v[w]+C,E=v[w+1]-C;d<D&&(d=D,E=v[w]+v[w+1]-D),E<y&&(E=y,d=v[w]+v[w+1]-y),f[w]=d,f[w+1]=E,x(f),i?.(f)},g=()=>{document.removeEventListener("pointermove",z),document.removeEventListener("pointerup",g)};document.addEventListener("pointermove",z),document.addEventListener("pointerup",g)},[j,s,n,i]),$=s==="horizontal";return t?null:e.jsx("div",{ref:u,className:`nice-splitter nice-splitter--${s} ${l||""}`,style:{display:"flex",flexDirection:$?"row":"column",height:"100%",..._},children:n.map((w,k)=>e.jsxs(c.Fragment,{children:[e.jsx("div",{className:"nice-splitter__pane",style:{[$?"width":"height"]:`calc(${j[k]}% - ${a*(n.length-1)/n.length}px)`,overflow:"auto"},children:w.render()}),k<n.length-1&&e.jsx("div",{className:`nice-splitter__gutter nice-splitter__gutter--${s}`,style:{[$?"width":"height"]:a,cursor:$?"col-resize":"row-resize",flexShrink:0},onPointerDown:M=>b(k,M)})]},w.key))})},vn=({items:n,size:s="md",className:a,style:i,accessMode:l,id:_})=>{const m=T.Bs(l,_)==="hidden",o=n.filter(x=>!x.location||x.location==="before"),t=n.filter(x=>x.location==="center"),u=n.filter(x=>x.location==="after"),j=x=>x.widget==="separator"?e.jsx("div",{className:"nice-toolbar__separator"},x.key):x.widget==="spacer"?e.jsx("div",{className:"nice-toolbar__spacer",style:{flex:1}},x.key):x.render?e.jsx("div",{className:"nice-toolbar__custom",children:x.render()},x.key):e.jsxs("button",{type:"button",className:`nice-toolbar__btn nice-btn nice-btn--ghost nice-btn--${s}`,disabled:x.disabled,onClick:x.onClick,children:[x.icon&&e.jsx("span",{className:"nice-toolbar__icon",children:x.icon}),x.text&&e.jsx("span",{children:x.text})]},x.key);return m?null:e.jsxs("div",{className:`nice-toolbar ${a||""}`,style:{display:"flex",alignItems:"center",gap:4,...i},children:[e.jsx("div",{className:"nice-toolbar__section nice-toolbar__section--before",style:{display:"flex",alignItems:"center",gap:4},children:o.map(j)}),t.length>0&&e.jsx("div",{className:"nice-toolbar__section nice-toolbar__section--center",style:{display:"flex",alignItems:"center",gap:4,flex:1,justifyContent:"center"},children:t.map(j)}),e.jsx("div",{className:"nice-toolbar__section nice-toolbar__section--after",style:{display:"flex",alignItems:"center",gap:4,marginLeft:t.length===0?"auto":void 0},children:u.map(j)})]})},ze=c.forwardRef(({panels:n,columns:s=12,rowHeight:a=80,gap:i=8,draggable:l=!0,resizable:_=!0,onLayoutChange:r,className:m,style:o,id:t},u)=>{const j=T.Ss(t),[x,b]=c.useState(null),$=c.useRef(null),w=c.useCallback((v,z)=>{l&&(b(z),v.dataTransfer.effectAllowed="move")},[l]),k=c.useCallback((v,z)=>{if(v.preventDefault(),!x||x===z)return;const g=n.find(f=>f.key===x),L=n.find(f=>f.key===z);if(!g||!L)return;const C=n.map(f=>f.key===x?{...f,col:L.col,row:L.row}:f.key===z?{...f,col:g.col,row:g.row}:f);r?.(C),b(null)},[x,n,r]),M=c.useCallback(v=>{v.preventDefault()},[]),I=c.useRef(null);c.useEffect(()=>{if(!_)return;const v=g=>{if(!I.current||!$.current)return;const{key:L,startX:C,startY:f,cs:D,rs:y}=I.current,d=g.clientX-C,E=g.clientY-f,P=$.current.clientWidth/s,V=Math.max(1,D+Math.round(d/P)),Z=Math.max(1,y+Math.round(E/a)),Y=n.map(R=>R.key===L?{...R,colSpan:V,rowSpan:Z}:R);r?.(Y)},z=()=>{I.current=null};return document.addEventListener("mousemove",v),document.addEventListener("mouseup",z),()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",z)}},[_,n,s,a,r]);const h=c.useCallback((v,z,g,L)=>{v.stopPropagation(),I.current={key:z,startX:v.clientX,startY:v.clientY,cs:g,rs:L}},[]),p=Math.max(...n.map(v=>v.row+(v.rowSpan??1)),1);return e.jsx("div",{ref:u,id:j,className:`nice-dashboard ${m||""}`,style:o,children:e.jsx("div",{ref:$,className:"nice-dashboard__grid",style:{display:"grid",gridTemplateColumns:`repeat(${s}, 1fr)`,gridTemplateRows:`repeat(${p}, ${a}px)`,gap:i},children:n.map(v=>e.jsxs("div",{className:`nice-dashboard__panel${x===v.key?" nice-dashboard__panel--dragging":""}`,style:{gridColumn:`${v.col+1} / span ${v.colSpan??1}`,gridRow:`${v.row+1} / span ${v.rowSpan??1}`},draggable:l,onDragStart:z=>w(z,v.key),onDragOver:M,onDrop:z=>k(z,v.key),children:[e.jsx("div",{className:"nice-dashboard__panel-content",children:v.render()}),_&&e.jsx("div",{className:"nice-dashboard__resize-handle",onMouseDown:z=>h(z,v.key,v.colSpan??1,v.rowSpan??1)})]},v.key))})})});ze.displayName="NiceDashboardLayout";const Me=c.forwardRef(({header:n,sidebar:s,sidebarWidth:a=260,sidebarCollapsed:i,onToggleSidebar:l,children:_,footer:r,className:m,style:o,id:t},u)=>{const j=T.Ss(t),[x,b]=c.useState(!1),$=i??x,w=c.useCallback(()=>{const k=!$;b(k),l?.(k)},[$,l]);return e.jsxs("div",{ref:u,id:j,className:`nice-app-layout${$?" nice-app-layout--collapsed":""} ${m||""}`,style:o,children:[n&&e.jsx("header",{className:"nice-app-layout__header",children:n}),e.jsxs("div",{className:"nice-app-layout__body",children:[s&&e.jsx("aside",{className:"nice-app-layout__sidebar",style:{width:$?0:a,overflow:"hidden",transition:"width 0.2s"},children:!$&&s}),s&&e.jsx("button",{type:"button",className:"nice-app-layout__sidebar-toggle",onClick:w,"aria-label":$?"Open sidebar":"Close sidebar",children:$?"☰":"✕"}),e.jsx("main",{className:"nice-app-layout__content",children:_})]}),r&&e.jsx("footer",{className:"nice-app-layout__footer",children:r})]})});Me.displayName="NiceAppLayout";const De=c.forwardRef(({items:n,activeKey:s,onChange:a,size:i="md",showLabels:l=!0,className:_,style:r,id:m},o)=>{const t=T.Ss(m);return e.jsx("nav",{ref:o,id:t,className:`nice-bottom-nav nice-bottom-nav--${i} ${_||""}`,style:r,role:"navigation",children:n.map(u=>e.jsxs("button",{type:"button",className:`nice-bottom-nav__item${s===u.key?" nice-bottom-nav__item--active":""}${u.disabled?" nice-bottom-nav__item--disabled":""}`,onClick:()=>!u.disabled&&a?.(u.key),disabled:u.disabled,"aria-current":s===u.key?"page":void 0,children:[u.icon&&e.jsx("span",{className:"nice-bottom-nav__icon",children:u.icon}),l&&e.jsx("span",{className:"nice-bottom-nav__label",children:u.label})]},u.key))})});De.displayName="NiceBottomNavigation";const Te=c.forwardRef(({items:n,size:s="md",className:a,style:i,id:l},_)=>{const r=T.Ss(l),[m,o]=c.useState(null),t=c.useRef(null);c.useEffect(()=>{if(!m)return;const j=x=>{t.current&&!t.current.contains(x.target)&&o(null)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[m]);const u=n.find(j=>j.key===m);return e.jsxs("div",{ref:_,id:r,className:`nice-mega-menu nice-mega-menu--${s} ${a||""}`,style:i,children:[e.jsx("div",{ref:t,className:"nice-mega-menu__bar",role:"menubar",children:n.map(j=>e.jsx("button",{type:"button",className:`nice-mega-menu__trigger${m===j.key?" nice-mega-menu__trigger--active":""}`,onMouseEnter:()=>o(j.key),onClick:()=>o(m===j.key?null:j.key),"aria-haspopup":"true","aria-expanded":m===j.key,children:j.label},j.key))}),u&&e.jsx("div",{className:"nice-mega-menu__dropdown",onMouseLeave:()=>o(null),children:u.renderPanel?u.renderPanel():e.jsx("div",{className:"nice-mega-menu__columns",children:u.columns.map((j,x)=>e.jsxs("div",{className:"nice-mega-menu__column",children:[j.header&&e.jsx("div",{className:"nice-mega-menu__column-header",children:j.header}),e.jsx("ul",{className:"nice-mega-menu__list",role:"menu",children:j.items.map(b=>e.jsx("li",{className:`nice-mega-menu__item${b.disabled?" nice-mega-menu__item--disabled":""}`,role:"menuitem",children:b.href?e.jsxs("a",{href:b.href,className:"nice-mega-menu__link",children:[b.icon&&e.jsx("span",{className:"nice-mega-menu__icon",children:b.icon}),b.label]}):e.jsxs("button",{type:"button",className:"nice-mega-menu__link",disabled:b.disabled,onClick:()=>{b.onClick?.(),o(null)},children:[b.icon&&e.jsx("span",{className:"nice-mega-menu__icon",children:b.icon}),b.label]})},b.key))})]},x))})})]})});Te.displayName="NiceMegaMenu";const Ee=c.forwardRef(({items:n,position:s="bottom",size:a="md",magnify:i=!0,magnifyScale:l=1.5,activeKey:_,onItemClick:r,contained:m=!1,className:o,style:t,id:u,...j},x)=>{const b=T.Ss(u),{t:$}=T.$o(),[w,k]=c.useState(null),M=c.useCallback(h=>{if(!i||w===null)return 1;const p=Math.abs(h-w);return p===0?l:p===1?1+(l-1)*.5:p===2?1+(l-1)*.2:1},[i,w,l]),I=s==="left"||s==="right";return e.jsx("div",{ref:x,id:b,className:`nice-dock nice-dock--${s} nice-dock--${a}${m?" nice-dock--contained":""} ${o??""}`,style:t,role:"toolbar","aria-label":$("dock.label","Dock"),...j,children:e.jsx("div",{className:"nice-dock__bar",style:{flexDirection:I?"column":"row"},children:n.map((h,p)=>{const v=M(p);return e.jsxs("button",{type:"button",className:`nice-dock__item ${_===h.key?"nice-dock__item--active":""} ${h.disabled?"nice-dock__item--disabled":""}`,style:{transform:`scale(${v})`,transition:"transform 0.15s ease-out"},disabled:h.disabled,onClick:()=>r?.(h.key),onMouseEnter:()=>k(p),onMouseLeave:()=>k(null),"aria-label":h.label,title:h.label,children:[e.jsx("span",{className:"nice-dock__icon",children:h.icon}),h.badge!==void 0&&e.jsx("span",{className:"nice-dock__badge",children:h.badge})]},h.key)})})})});Ee.displayName="NiceDock";const Ie=({items:n,label:s,icon:a,position:i,onItemClick:l})=>{const{t:_}=T.$o(),[r,m]=c.useState(!1),[o,t]=c.useState(null),u=c.useRef(null);c.useEffect(()=>{if(!r)return;const b=$=>{u.current&&!u.current.contains($.target)&&(m(!1),t(null))};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[r]),c.useEffect(()=>{if(!r)return;const b=$=>{$.key==="Escape"&&(m(!1),t(null))};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]);const j=i==="bottom"?"bottom-start":i==="top"?"top-start":i==="left"?"left-start":"right-start",x=c.useCallback(b=>{if(b.children&&b.children.length>0){t(o===b.key?null:b.key);return}b.onClick?.(),l?.(b.key),m(!1),t(null)},[l,o]);return e.jsxs("div",{className:"nice-desktop__start",ref:u,children:[e.jsxs("button",{type:"button",className:`nice-desktop__start-btn ${r?"nice-desktop__start-btn--active":""}`,onClick:()=>m(!r),"aria-expanded":r,"aria-haspopup":"menu","aria-label":_("desktop.start","Start"),children:[a&&e.jsx("span",{className:"nice-desktop__start-icon",children:a}),s&&e.jsx("span",{className:"nice-desktop__start-label",children:s}),!a&&!s&&e.jsx("span",{className:"nice-desktop__start-label",children:_("desktop.start","Start")})]}),r&&e.jsx("div",{className:`nice-desktop__start-menu nice-desktop__start-menu--${j}`,role:"menu",children:n.map(b=>e.jsxs(c.Fragment,{children:[b.divider&&e.jsx("div",{className:"nice-desktop__start-divider"}),e.jsxs("div",{className:"nice-desktop__start-item-wrap",children:[e.jsxs("button",{type:"button",className:`nice-desktop__start-item ${o===b.key?"nice-desktop__start-item--open":""}`,disabled:b.disabled,onClick:()=>x(b),role:"menuitem",children:[b.icon&&e.jsx("span",{className:"nice-desktop__start-item-icon",children:b.icon}),e.jsx("span",{className:"nice-desktop__start-item-label",children:b.label}),b.children&&b.children.length>0&&e.jsx("span",{className:"nice-desktop__start-item-arrow",children:"▸"})]}),b.children&&o===b.key&&e.jsx("div",{className:"nice-desktop__start-submenu",role:"menu",children:b.children.map($=>e.jsxs("button",{type:"button",className:"nice-desktop__start-item",disabled:$.disabled,onClick:()=>x($),role:"menuitem",children:[$.icon&&e.jsx("span",{className:"nice-desktop__start-item-icon",children:$.icon}),e.jsx("span",{className:"nice-desktop__start-item-label",children:$.label})]},$.key))})]})]},b.key))})]})},fe=({items:n,position:s,size:a,startMenu:i,systemTray:l,onItemClick:_})=>{const m=s==="left"||s==="right"?{width:a,height:"100%"}:{height:a,width:"100%"};return e.jsxs("div",{className:`nice-desktop__taskbar nice-desktop__taskbar--${s}`,style:m,role:"toolbar","aria-label":"Taskbar",children:[i,e.jsx("div",{className:"nice-desktop__taskbar-items",children:n.map(o=>e.jsxs("button",{type:"button",className:`nice-desktop__taskbar-btn ${o.active?"nice-desktop__taskbar-btn--active":""} ${o.minimized?"nice-desktop__taskbar-btn--minimized":""}`,onClick:()=>_?.(o.key),title:o.label,children:[o.icon&&e.jsx("span",{className:"nice-desktop__taskbar-btn-icon",children:o.icon}),e.jsx("span",{className:"nice-desktop__taskbar-btn-label",children:o.label}),o.badge!==void 0&&e.jsx("span",{className:"nice-desktop__taskbar-btn-badge",children:o.badge})]},o.key))}),l]})},Re=({items:n,showClock:s=!0,onItemClick:a})=>{const[i,l]=c.useState(()=>new Date);return c.useEffect(()=>{if(!s)return;const _=setInterval(()=>l(new Date),3e4);return()=>clearInterval(_)},[s]),e.jsxs("div",{className:"nice-desktop__tray",children:[n.map(_=>e.jsx("button",{type:"button",className:"nice-desktop__tray-item",title:_.tooltip,onClick:()=>{_.onClick?.(),a?.(_.key)},children:_.icon},_.key)),s&&e.jsx("span",{className:"nice-desktop__tray-clock",children:i.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},Le=({icons:n,gridColumns:s,iconSize:a,onIconClick:i,onIconDoubleClick:l})=>{const[_,r]=c.useState(null),m=c.useCallback(t=>{r(t),i?.(t)},[i]),o=c.useCallback(t=>{l?.(t)},[l]);return e.jsx("div",{className:`nice-desktop__grid nice-desktop__grid--${a}`,style:{gridTemplateColumns:`repeat(${s}, 1fr)`},children:n.map(t=>e.jsxs("div",{className:`nice-desktop__icon ${_===t.key?"nice-desktop__icon--selected":""} ${t.disabled?"nice-desktop__icon--disabled":""}`,style:t.gridCol!=null||t.gridRow!=null?{gridColumn:t.gridCol,gridRow:t.gridRow}:void 0,onClick:()=>!t.disabled&&m(t.key),onDoubleClick:()=>!t.disabled&&o(t.key),role:"button",tabIndex:t.disabled?-1:0,"aria-label":t.label,onKeyDown:u=>{t.disabled||(u.key==="Enter"&&o(t.key),u.key===" "&&(u.preventDefault(),m(t.key)))},children:[e.jsx("div",{className:"nice-desktop__icon-img",children:t.icon}),e.jsx("span",{className:"nice-desktop__icon-label",children:t.label})]},t.key))})},Oe=({items:n,x:s,y:a,onItemClick:i,onClose:l})=>{const _=c.useRef(null);return c.useEffect(()=>{const r=m=>{_.current&&!_.current.contains(m.target)&&l()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[l]),c.useEffect(()=>{const r=m=>{m.key==="Escape"&&l()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[l]),e.jsx("div",{ref:_,className:"nice-desktop__context-menu",style:{position:"fixed",left:s,top:a},role:"menu",children:n.map(r=>e.jsxs(c.Fragment,{children:[r.divider&&e.jsx("div",{className:"nice-desktop__context-divider"}),e.jsxs("button",{type:"button",className:"nice-desktop__context-item",disabled:r.disabled,onClick:()=>{r.onClick?.(),i?.(r.key),l()},role:"menuitem",children:[r.icon&&e.jsx("span",{className:"nice-desktop__context-icon",children:r.icon}),e.jsx("span",{children:r.label})]})]},r.key))})},Ae=c.forwardRef(({icons:n=[],taskbarPosition:s="bottom",taskbarSize:a=40,startMenuItems:i=[],startMenuLabel:l,startMenuIcon:_,taskbarItems:r=[],systemTrayItems:m=[],showClock:o=!0,wallpaper:t,gridColumns:u=8,iconSize:j="md",onIconClick:x,onIconDoubleClick:b,onTaskbarItemClick:$,onStartMenuItemClick:w,onSystemTrayItemClick:k,contextMenuItems:M,onContextMenuItemClick:I,children:h,className:p,style:v,id:z,accessMode:g,...L},C)=>{const f=T.Ss(z),y=T.Bs(g,z)==="hidden",[d,E]=c.useState(null),P=c.useCallback(R=>{!M||M.length===0||(R.preventDefault(),E({x:R.clientX,y:R.clientY}))},[M]),V=i.length>0?e.jsx(Ie,{items:i,label:l,icon:_,position:s,onItemClick:w}):null,Z=e.jsx(Re,{items:m,showClock:o,onItemClick:k}),Y={...v,...t?{background:t}:{}};return y?null:e.jsxs("div",{ref:C,id:f,className:`nice-desktop nice-desktop--taskbar-${s} ${p??""}`,style:Y,...L,children:[(s==="top"||s==="left")&&e.jsx(fe,{items:r,position:s,size:a,startMenu:V,systemTray:Z,onItemClick:$}),e.jsxs("div",{className:"nice-desktop__area",onContextMenu:P,children:[n.length>0&&e.jsx(Le,{icons:n,gridColumns:u,iconSize:j,onIconClick:x,onIconDoubleClick:b}),h,d&&M&&e.jsx(Oe,{items:M,x:d.x,y:d.y,onItemClick:I,onClose:()=>E(null)})]}),(s==="bottom"||s==="right")&&e.jsx(fe,{items:r,position:s,size:a,startMenu:V,systemTray:Z,onItemClick:$})]})});Ae.displayName="NiceDesktop";const jn=({commands:n,onSelect:s,onClose:a})=>{const[i,l]=c.useState(""),_=c.useRef(null),{t:r}=T.$o();c.useEffect(()=>{_.current?.focus()},[]),c.useEffect(()=>{const o=t=>{t.key==="Escape"&&a()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[a]);const m=i?n.filter(o=>o.label.toLowerCase().includes(i.toLowerCase())):n;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-console__palette-overlay",onClick:a}),e.jsxs("div",{className:"nice-console__palette",role:"dialog","aria-label":r("console.commandPalette","Command Palette"),children:[e.jsx("input",{ref:_,className:"nice-console__palette-input",placeholder:r("console.searchCommands","Search commands..."),value:i,onChange:o=>l(o.target.value),onKeyDown:o=>{o.key==="Enter"&&m.length>0&&(s(m[0].key),a())}}),e.jsxs("div",{className:"nice-console__palette-list",children:[m.map(o=>e.jsxs("button",{type:"button",className:"nice-console__palette-item",disabled:o.disabled,onClick:()=>{s(o.key),a()},children:[o.icon&&e.jsx("span",{className:"nice-console__palette-icon",children:o.icon}),e.jsx("span",{className:"nice-console__palette-label",children:o.label}),o.description&&e.jsx("span",{className:"nice-console__palette-desc",children:o.description}),o.shortcut&&e.jsx("span",{className:"nice-console__palette-shortcut",children:o.shortcut})]},o.key)),m.length===0&&e.jsx("div",{className:"nice-console__palette-empty",children:r("console.noCommands","No matching commands")})]})]})]})},Be=c.forwardRef(({tabs:n=[],activeTabKey:s,onTabChange:a,onTabClose:i,commandPalette:l=[],onCommand:_,statusItems:r=[],toolbar:m,sidePanel:o,sidePanelWidth:t=220,sidePanelCollapsed:u,onToggleSidePanel:j,bottomPanel:x,bottomPanelHeight:b=200,bottomPanelCollapsed:$,onToggleBottomPanel:w,children:k,size:M="md",theme:I="dark",className:h,style:p,id:v,accessMode:z,...g},L)=>{const C=T.Ss(v),f=T.Bs(z,v),{t:D}=T.$o();if(f==="hidden")return null;const[y,d]=c.useState(n[0]?.key??""),[E,P]=c.useState(!1),[V,Z]=c.useState(!1),[Y,R]=c.useState(!1),q=s??y,B=u??E,F=$??V,X=c.useCallback(A=>{a?a(A):d(A)},[a]),K=c.useCallback(()=>{const A=!B;j?j(A):P(A)},[B,j]),ee=c.useCallback(()=>{const A=!F;w?w(A):Z(A)},[F,w]);c.useEffect(()=>{if(l.length===0)return;const A=te=>{te.ctrlKey&&te.shiftKey&&te.key==="P"&&(te.preventDefault(),R(J=>!J))};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[l.length]);const le=n.find(A=>A.key===q),_e=r.filter(A=>!A.position||A.position==="left"),ae=r.filter(A=>A.position==="right");return e.jsxs("div",{ref:L,id:C,className:`nice-console nice-console--${M} nice-console--${I} ${h??""}`,style:p,...g,children:[m&&e.jsx("div",{className:"nice-console__toolbar",children:m}),n.length>0&&e.jsx("div",{className:"nice-console__tabs",role:"tablist",children:n.map(A=>e.jsxs("div",{className:`nice-console__tab ${A.key===q?"nice-console__tab--active":""}`,role:"tab","aria-selected":A.key===q,children:[e.jsxs("button",{type:"button",className:"nice-console__tab-btn",onClick:()=>X(A.key),children:[A.icon&&e.jsx("span",{className:"nice-console__tab-icon",children:A.icon}),e.jsx("span",{children:A.label})]}),(A.closable??!0)&&i&&e.jsx("button",{type:"button",className:"nice-console__tab-close",onClick:()=>i(A.key),"aria-label":D("console.closeTab","Close tab"),children:"✕"})]},A.key))}),e.jsxs("div",{className:"nice-console__main",children:[o&&!B&&e.jsxs("aside",{className:"nice-console__side",style:{width:t,flexShrink:0},children:[e.jsx("div",{className:"nice-console__side-header",children:e.jsx("button",{type:"button",className:"nice-console__side-toggle",onClick:K,"aria-label":D("console.closeSidePanel","Close side panel"),children:"✕"})}),e.jsx("div",{className:"nice-console__side-content",children:o})]}),e.jsxs("div",{className:"nice-console__center",children:[e.jsx("div",{className:"nice-console__content",role:"tabpanel",children:le?le.render?le.render():le.content:k}),x&&!F&&e.jsxs("div",{className:"nice-console__bottom",style:{height:b,flexShrink:0},children:[e.jsx("div",{className:"nice-console__bottom-header",children:e.jsx("button",{type:"button",className:"nice-console__bottom-toggle",onClick:ee,"aria-label":D("console.closeBottomPanel","Close bottom panel"),children:"✕"})}),e.jsx("div",{className:"nice-console__bottom-content",children:x})]})]})]}),r.length>0&&e.jsxs("div",{className:"nice-console__statusbar",children:[e.jsxs("div",{className:"nice-console__statusbar-left",children:[o&&B&&e.jsx("button",{type:"button",className:"nice-console__statusbar-btn",onClick:K,title:D("console.openSidePanel","Open side panel"),children:"☰"}),x&&F&&e.jsx("button",{type:"button",className:"nice-console__statusbar-btn",onClick:ee,title:D("console.openBottomPanel","Open bottom panel"),children:"▁"}),_e.map(A=>e.jsx("span",{className:"nice-console__status-item",onClick:A.onClick,role:A.onClick?"button":void 0,tabIndex:A.onClick?0:void 0,children:A.content??A.label},A.key))]}),e.jsx("div",{className:"nice-console__statusbar-right",children:ae.map(A=>e.jsx("span",{className:"nice-console__status-item",onClick:A.onClick,role:A.onClick?"button":void 0,tabIndex:A.onClick?0:void 0,children:A.content??A.label},A.key))})]}),Y&&l.length>0&&e.jsx(jn,{commands:l,onSelect:A=>_?.(A),onClose:()=>R(!1)})]})});Be.displayName="NiceConsole";const Ye=c.forwardRef(({steps:n,activeStep:s,onStepChange:a,onComplete:i,onCancel:l,allowStepClick:_=!1,variant:r="horizontal",nextLabel:m,prevLabel:o,finishLabel:t,cancelLabel:u,showProgress:j=!0,className:x,style:b,size:$="md",accessMode:w,id:k},M)=>{const h=T.Bs(w,k)==="hidden",{t:p}=T.$o(),v=T.Ss(k),[z,g]=c.useState(0),[L,C]=c.useState({}),[f,D]=c.useState(new Set([0])),y=s??z,d=n[y],E=y===0,P=y===n.length-1,V=c.useCallback(X=>{const K=Math.max(0,Math.min(n.length-1,X));g(K),D(ee=>new Set(ee).add(K)),a?.(K)},[n.length,a]),Z=c.useCallback(()=>{if(!d?.validate)return!0;const X=d.validate();return X===!0||X===void 0?(C(K=>{const ee={...K};return delete ee[d.id],ee}),!0):(C(K=>({...K,[d.id]:X})),!1)},[d]),Y=c.useCallback(()=>{Z()&&(P?i?.():V(y+1))},[y,P,Z,V,i]),R=c.useCallback(()=>{E||V(y-1)},[y,E,V]),q=c.useCallback(X=>{const K=n.findIndex(ee=>ee.id===X);K>=0&&V(K)},[n,V]),B=c.useMemo(()=>({stepIndex:y,totalSteps:n.length,goNext:Y,goPrev:R,goTo:q,isFirst:E,isLast:P}),[y,n.length,Y,R,q,E,P]),F=(y+1)/n.length*100;return h?null:e.jsxs("div",{ref:M,id:v,className:`nice-wizard nice-wizard--${r} nice-size-${$}${x?` ${x}`:""}`,style:b,children:[e.jsx("div",{className:"nice-wizard__steps",role:"tablist",children:n.map((X,K)=>{const ee=K<y?"completed":K===y?"active":"pending",le=!!L[X.id];return e.jsxs("button",{role:"tab","aria-selected":K===y,className:`nice-wizard__step nice-wizard__step--${ee}${le?" nice-wizard__step--error":""}`,onClick:()=>_&&K<=y&&V(K),disabled:!_||K>y,type:"button",children:[e.jsx("span",{className:"nice-wizard__step-number",children:ee==="completed"?"✓":K+1}),e.jsx("span",{className:"nice-wizard__step-title",children:X.title}),X.optional&&e.jsxs("span",{className:"nice-wizard__step-optional",children:["(",p("optional","optional"),")"]})]},X.id)})}),j&&e.jsx("div",{className:"nice-wizard__progress",children:e.jsx("div",{className:"nice-wizard__progress-bar",style:{width:`${F}%`}})}),e.jsx("div",{className:"nice-wizard__content",role:"tabpanel",children:d&&e.jsxs(e.Fragment,{children:[typeof d.content=="function"?d.content(B):d.content,L[d.id]&&e.jsx("div",{className:"nice-wizard__error nice-error-text",children:L[d.id]})]})}),e.jsxs("div",{className:"nice-wizard__actions",children:[l&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--text",onClick:l,children:u??p("cancel","Cancel")}),e.jsxs("div",{className:"nice-wizard__actions-right",children:[!E&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outlined",onClick:R,children:o??p("previous","← Previous")}),e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:Y,children:P?t??p("finish","Finish ✓"):m??p("next","Next →")})]})]})]})});Ye.displayName="NiceWizard";const Fe=c.createContext(null);function fn(){const n=c.useContext(Fe);if(!n)throw new Error("useSetupWizard must be used within NiceSetupWizard");return n}const Ue=c.forwardRef(({steps:n,initialValues:s={},activeStep:a,layout:i="horizontal",size:l="md",defaultQuickMode:_=!1,allowQuickModeToggle:r=!0,showStepNumbers:m=!0,showProgress:o=!0,showEstimatedTime:t=!1,allowStepClick:u=!0,showReviewStep:j=!1,persistKey:x,animation:b="slide",branding:$,header:w,footer:k,onStepChange:M,onValuesChange:I,onComplete:h,onCancel:p,labels:v={},accessMode:z,id:g,className:L,style:C},f)=>{const D=T.Bs(z,g),y=D==="hidden",{t:d}=T.$o(),E=T.Ss(g),[P,V]=c.useState(_),Z=c.useMemo(()=>P?n.filter(N=>!N.quickModeSkip):n,[n,P]),Y=c.useMemo(()=>{if(!j)return Z;const N={id:"__review__",title:v.review??d("wizard.review","Review"),icon:"📋",content:H=>e.jsxs("div",{className:"nice-setup-wizard__review",children:[e.jsx("h3",{children:d("wizard.reviewTitle","Review Your Setup")}),Z.filter(U=>U.summary).map(U=>e.jsxs("div",{className:"nice-setup-wizard__review-section",children:[e.jsx("h4",{children:U.title}),U.summary?.(H.values)]},U.id))]})};return[...Z,N]},[Z,j,v.review,d]),[R,q]=c.useState(()=>{if(x)try{const N=localStorage.getItem(x);if(N)return{...s,...JSON.parse(N)}}catch{}return s}),[B,F]=c.useState(()=>{if(a)return a;if(x)try{const N=localStorage.getItem(`${x}_step`);if(N&&Y.some(H=>H.id===N))return N}catch{}return Y[0]?.id??""}),[X,K]=c.useState(()=>new Set([B])),[ee,le]=c.useState({}),[_e,ae]=c.useState(!1),[A,te]=c.useState("next"),J=Y.findIndex(N=>N.id===B),S=Y[J],O=J===0,G=J===Y.length-1,ne=(J+1)/Y.length*100;c.useEffect(()=>{x&&(localStorage.setItem(x,JSON.stringify(R)),localStorage.setItem(`${x}_step`,B))},[R,B,x]);const oe=c.useCallback((N,H)=>{q(U=>{const se={...U,[N]:H};return I?.(se),se})},[I]),ye=c.useCallback(N=>{q(H=>{const U={...H,...N};return I?.(U),U})},[I]),de=c.useCallback((N,H)=>{le(U=>({...U,[N]:H}))},[]),me=c.useCallback(N=>{le(H=>{const U={...H};return delete U[N],U})},[]),re=c.useCallback(N=>{const H=Y.findIndex(U=>U.id===N);H>=0&&(te(H>J?"next":"prev"),F(N),K(U=>new Set(U).add(N)),M?.(N,H))},[Y,J,M]),pe=c.useCallback(async()=>{if(S){if(S.validate){ae(!0);try{const N=await S.validate(R);if(N){de(S.id,N),ae(!1);return}me(S.id)}catch(N){de(S.id,String(N)),ae(!1);return}ae(!1)}if(S.fields){for(const N of S.fields){if(N.required&&!R[N.id]){de(S.id,`${N.label} ${d("wizard.isRequired","is required")}`);return}if(N.validation?.custom){const H=N.validation.custom(R[N.id]);if(H){de(S.id,H);return}}}me(S.id)}if(G)await h?.(R),x&&(localStorage.removeItem(x),localStorage.removeItem(`${x}_step`));else{let N;S.nextStep?N=typeof S.nextStep=="function"?S.nextStep(R):S.nextStep:N=Y[J+1]?.id??"",N&&re(N)}}},[S,R,G,J,Y,h,x,d,de,me,re]),xe=c.useCallback(()=>{if(O)return;const N=S?.prevStep??Y[J-1]?.id;N&&(te("prev"),re(N))},[O,S,J,Y,re]),Ne=c.useCallback(()=>{if(S?.optional&&!G){const N=Y[J+1]?.id;N&&re(N)}},[S,G,J,Y,re]),ke=c.useCallback(()=>{h?.(R)},[h,R]),ve=c.useCallback(()=>{p?.()},[p]),je=c.useCallback(()=>{V(N=>!N)},[]),he=c.useMemo(()=>({values:R,setValue:oe,setValues:ye,currentStep:S,currentIndex:J,totalSteps:Y.length,visitedSteps:X,errors:ee,setError:de,clearError:me,goNext:pe,goPrev:xe,goTo:re,skip:Ne,complete:ke,cancel:ve,isFirst:O,isLast:G,isQuickMode:P,toggleQuickMode:je,progress:ne,t:d}),[R,oe,ye,S,J,Y.length,X,ee,de,me,pe,xe,re,Ne,ke,ve,O,G,P,je,ne,d]),we=c.useMemo(()=>{if(!t)return null;const H=Y.map(U=>U.estimatedTime).filter(Boolean).map(U=>{const se=U.match(/(\d+)\s*(min|sec|s|m)/i);if(!se)return 0;const ie=parseInt(se[1],10);return se[2].toLowerCase().startsWith("m")?ie:ie/60}).reduce((U,se)=>U+se,0);return H>0?`~${Math.ceil(H)} min`:null},[Y,t]);if(!S)return null;const on=(N,H)=>{const U=N.id===B,se=X.has(N.id)&&!U&&H<J,ie=!U&&!se,ce=!!ee[N.id],Q=u&&(se||H<=J);return e.jsxs("button",{type:"button",role:"tab","aria-selected":U,"aria-current":U?"step":void 0,className:["nice-setup-wizard__step-indicator",U&&"nice-setup-wizard__step-indicator--active",se&&"nice-setup-wizard__step-indicator--completed",ie&&"nice-setup-wizard__step-indicator--pending",ce&&"nice-setup-wizard__step-indicator--error"].filter(Boolean).join(" "),onClick:()=>Q&&re(N.id),disabled:!Q,children:[e.jsx("span",{className:"nice-setup-wizard__step-marker",children:se?"✓":ce?"!":m?H+1:N.icon||"○"}),e.jsxs("span",{className:"nice-setup-wizard__step-info",children:[e.jsx("span",{className:"nice-setup-wizard__step-title",children:N.title}),N.subtitle&&e.jsx("span",{className:"nice-setup-wizard__step-subtitle",children:N.subtitle}),N.optional&&e.jsxs("span",{className:"nice-setup-wizard__step-optional",children:["(",v.optional??d("wizard.optional","optional"),")"]})]}),N.badge&&e.jsx("span",{className:"nice-setup-wizard__step-badge",children:N.badge})]},N.id)},dn=N=>{if(N.showWhen&&!N.showWhen(R))return null;const H=R[N.id]??N.defaultValue??"",U=Q=>oe(N.id,Q);if(N.render)return e.jsx("div",{className:`nice-setup-wizard__field${N.fullWidth?" nice-setup-wizard__field--full":""}`,children:N.render({value:H,onChange:U,field:N})},N.id);const se=`${E}-${N.id}`,ie={id:se,disabled:N.disabled||D==="disabled"||D==="readOnly",placeholder:N.placeholder,required:N.required};let ce;switch(N.type){case"textarea":ce=e.jsx("textarea",{...ie,className:"nice-setup-wizard__input nice-setup-wizard__textarea",value:String(H),onChange:Q=>U(Q.target.value),rows:4});break;case"select":ce=e.jsxs("select",{...ie,className:"nice-setup-wizard__input nice-setup-wizard__select",value:String(H),onChange:Q=>U(Q.target.value),children:[e.jsx("option",{value:"",children:N.placeholder||d("wizard.select","Select...")}),N.options?.map(Q=>e.jsx("option",{value:Q.value,children:Q.label},Q.value))]});break;case"radio":ce=e.jsx("div",{className:"nice-setup-wizard__radio-group",children:N.options?.map(Q=>e.jsxs("label",{className:"nice-setup-wizard__radio-label",children:[e.jsx("input",{type:"radio",name:se,value:Q.value,checked:H===Q.value,onChange:()=>U(Q.value),disabled:ie.disabled}),Q.icon&&e.jsx("span",{className:"nice-setup-wizard__radio-icon",children:Q.icon}),e.jsx("span",{children:Q.label})]},Q.value))});break;case"checkbox":ce=e.jsxs("label",{className:"nice-setup-wizard__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:!!H,onChange:Q=>U(Q.target.checked),disabled:ie.disabled}),e.jsx("span",{children:N.label})]});break;case"switch":ce=e.jsxs("label",{className:"nice-setup-wizard__switch-label",children:[e.jsx("span",{className:"nice-setup-wizard__switch-text",children:N.label}),e.jsxs("span",{className:`nice-setup-wizard__switch${H?" nice-setup-wizard__switch--on":""}`,children:[e.jsx("input",{type:"checkbox",checked:!!H,onChange:Q=>U(Q.target.checked),disabled:ie.disabled}),e.jsx("span",{className:"nice-setup-wizard__switch-track"}),e.jsx("span",{className:"nice-setup-wizard__switch-thumb"})]})]});break;case"slider":ce=e.jsxs("div",{className:"nice-setup-wizard__slider-wrapper",children:[e.jsx("input",{type:"range",...ie,className:"nice-setup-wizard__slider",value:Number(H)||N.validation?.min||0,min:N.validation?.min,max:N.validation?.max,onChange:Q=>U(Number(Q.target.value))}),e.jsx("span",{className:"nice-setup-wizard__slider-value",children:String(H??"")})]});break;default:ce=e.jsx("input",{type:N.type==="custom"?"text":N.type,...ie,className:"nice-setup-wizard__input",value:String(H),onChange:Q=>U(Q.target.value),minLength:N.validation?.minLength,maxLength:N.validation?.maxLength,min:N.validation?.min,max:N.validation?.max,pattern:N.validation?.pattern?.source})}return e.jsxs("div",{className:`nice-setup-wizard__field${N.fullWidth?" nice-setup-wizard__field--full":""}`,children:[N.type!=="checkbox"&&N.type!=="switch"&&e.jsxs("label",{htmlFor:se,className:"nice-setup-wizard__label",children:[N.label,N.required&&e.jsx("span",{className:"nice-setup-wizard__required",children:"*"})]}),ce,N.description&&e.jsx("span",{className:"nice-setup-wizard__field-desc",children:N.description})]},N.id)},un=()=>S.fields?e.jsx("div",{className:"nice-setup-wizard__fields",children:S.fields.map(dn)}):S.content?typeof S.content=="function"?S.content(he):S.content:null;return y?null:e.jsx(Fe.Provider,{value:he,children:e.jsxs("div",{ref:f,id:E,className:["nice-setup-wizard",`nice-setup-wizard--${i}`,`nice-size-${l}`,b!=="none"&&`nice-setup-wizard--anim-${b}`,L].filter(Boolean).join(" "),style:C,children:[($||w||r)&&e.jsxs("header",{className:"nice-setup-wizard__header",children:[$&&e.jsx("div",{className:"nice-setup-wizard__branding",children:$}),w,r&&e.jsxs("label",{className:"nice-setup-wizard__quick-toggle",children:[e.jsx("input",{type:"checkbox",checked:P,onChange:je}),e.jsx("span",{children:v.quickMode??d("wizard.quickMode","Quick Setup")})]}),we&&e.jsx("span",{className:"nice-setup-wizard__time",children:we})]}),i!=="minimal"&&e.jsx("nav",{className:"nice-setup-wizard__nav",role:"tablist",children:Y.map(on)}),o&&e.jsx("div",{className:"nice-setup-wizard__progress",children:e.jsx("div",{className:"nice-setup-wizard__progress-bar",style:{width:`${ne}%`},role:"progressbar","aria-valuenow":ne,"aria-valuemin":0,"aria-valuemax":100})}),e.jsxs("div",{className:["nice-setup-wizard__content",A==="next"&&"nice-setup-wizard__content--slide-next",A==="prev"&&"nice-setup-wizard__content--slide-prev"].filter(Boolean).join(" "),role:"tabpanel",children:[S.description&&e.jsx("p",{className:"nice-setup-wizard__step-description",children:S.description}),un(),ee[S.id]&&e.jsx("div",{className:"nice-setup-wizard__error",role:"alert",children:ee[S.id]})]},B),e.jsxs("footer",{className:"nice-setup-wizard__footer",children:[e.jsxs("div",{className:"nice-setup-wizard__actions-left",children:[p&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--text",onClick:ve,children:v.cancel??d("wizard.cancel","Cancel")}),S.optional&&!G&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--text",onClick:Ne,children:v.skip??d("wizard.skip","Skip")}),S.actions?.filter(N=>N.position==="left").map(N=>e.jsxs("button",{type:"button",className:`nice-btn nice-btn--${N.variant||"outlined"}`,onClick:()=>N.onClick(he),disabled:N.disabled?.(he),children:[N.icon," ",N.label]},N.id))]}),e.jsxs("div",{className:"nice-setup-wizard__actions-right",children:[S.actions?.filter(N=>N.position!=="left").map(N=>e.jsxs("button",{type:"button",className:`nice-btn nice-btn--${N.variant||"outlined"}`,onClick:()=>N.onClick(he),disabled:N.disabled?.(he),children:[N.icon," ",N.label]},N.id)),!O&&e.jsx(W.NiceButton,{variant:"outline",size:l,onClick:xe,children:v.prev??d("wizard.prev","← Back")}),e.jsx(W.NiceButton,{variant:"primary",size:l,onClick:pe,disabled:_e,loading:_e,children:G?v.finish??d("wizard.finish","Finish ✓"):v.next??d("wizard.next","Continue →")})]})]}),k&&e.jsx("div",{className:"nice-setup-wizard__custom-footer",children:k}),i==="minimal"&&e.jsx("div",{className:"nice-setup-wizard__minimal-indicator",children:v.stepOf?v.stepOf.replace("{current}",String(J+1)).replace("{total}",String(Y.length)):`${J+1} / ${Y.length}`})]})})});Ue.displayName="NiceSetupWizard";const We=c.forwardRef(({label:n,helperText:s,disabled:a,size:i="md",id:l,className:_,style:r,accessMode:m,logo:o,brandName:t,breadcrumbs:u,centerContent:j,rightContent:x,leftContent:b,sticky:$=!0,variant:w="light",height:k="md",onBrandClick:M,displayStyle:I},h)=>{const p=T.Bs(m,l),v=p==="hidden";p==="disabled"&&(a=!0);const{t:z}=T.$o(),g=T.Ss(l),L=T.os("menu",I),C=T.is("menu",I);return v?null:e.jsxs("nav",{ref:h,id:g,className:`nice-navbar nice-navbar--${w} nice-navbar--h-${k}${$?" nice-navbar--sticky":""} nice-navbar--ds-${C}${_?` ${_}`:""}${a?" nice-disabled":""}`,style:{...L,...r},role:"navigation","aria-label":n??z("mainNavigation","Main navigation"),children:[e.jsxs("div",{className:"nice-navbar__left",children:[b,(o||t)&&e.jsxs("div",{className:"nice-navbar__brand",onClick:M,role:M?"button":void 0,tabIndex:M?0:void 0,children:[o&&e.jsx("span",{className:"nice-navbar__logo",children:o}),t&&e.jsx("span",{className:"nice-navbar__brand-name",children:t})]}),u&&u.length>0&&e.jsx("ol",{className:"nice-navbar__breadcrumbs","aria-label":z("breadcrumbs","Breadcrumbs"),children:u.map((f,D)=>e.jsxs("li",{className:"nice-navbar__breadcrumb",children:[D>0&&e.jsx("span",{className:"nice-navbar__breadcrumb-sep",children:"/"}),f.href||f.onClick?e.jsx("a",{href:f.href??"#",onClick:y=>{f.onClick&&(y.preventDefault(),f.onClick())},children:f.label}):e.jsx("span",{"aria-current":D===u.length-1?"page":void 0,children:f.label})]},D))})]}),j&&e.jsx("div",{className:"nice-navbar__center",children:j}),x&&e.jsx("div",{className:"nice-navbar__right",children:x})]})});We.displayName="NiceNavbar";const Pe=c.forwardRef(({label:n,helperText:s,disabled:a,readOnly:i,size:l="md",id:_,className:r,style:m,accessMode:o,tenants:t,currentTenantId:u,onSwitch:j,onManage:x,onCreate:b,variant:$="dropdown",searchable:w=!1},k)=>{const M=T.Bs(o,_),I=M==="hidden";M==="disabled"&&(a=!0),M==="readOnly"&&(i=!0);const{t:h}=T.$o(),p=T.Ss(_),[v,z]=c.useState(!1),[g,L]=c.useState(""),C=c.useMemo(()=>t.find(y=>y.id===u),[t,u]),f=c.useMemo(()=>{if(!g)return t;const y=g.toLowerCase();return t.filter(d=>d.name.toLowerCase().includes(y))},[t,g]),D=c.useCallback(y=>{j?.(y),z(!1),L("")},[j]);return $==="inline"?e.jsxs("div",{ref:k,id:p,className:`nice-tenant-switcher nice-tenant-switcher--inline nice-size-${l}${r?` ${r}`:""}${a?" nice-disabled":""}`,style:m,children:[n&&e.jsx("span",{className:"nice-tenant-switcher__label",children:n}),e.jsx("div",{className:"nice-tenant-switcher__list",children:t.map(y=>e.jsxs("button",{type:"button",className:`nice-tenant-switcher__option${y.id===u?" nice-tenant-switcher__option--active":""}`,onClick:()=>D(y.id),disabled:a||i,children:[y.logoUrl&&e.jsx("img",{src:y.logoUrl,alt:"",className:"nice-tenant-switcher__option-logo"}),e.jsx("span",{children:y.name})]},y.id))})]}):I?null:e.jsxs("div",{ref:k,id:p,className:`nice-tenant-switcher nice-size-${l}${r?` ${r}`:""}${a?" nice-disabled":""}`,style:m,children:[e.jsxs("button",{type:"button",className:"nice-tenant-switcher__trigger",onClick:()=>!a&&!i&&z(!v),onBlur:()=>setTimeout(()=>z(!1),200),disabled:a,"aria-haspopup":"listbox","aria-expanded":v,children:[C?.logoUrl&&e.jsx("img",{src:C.logoUrl,alt:"",className:"nice-tenant-switcher__trigger-logo"}),e.jsx("span",{className:"nice-tenant-switcher__trigger-name",children:C?.name??h("selectTenant","Select organization")}),e.jsx("span",{className:"nice-tenant-switcher__trigger-arrow",children:v?"▲":"▼"})]}),v&&e.jsxs("div",{className:"nice-tenant-switcher__dropdown",role:"listbox",children:[w&&e.jsx("input",{type:"text",className:"nice-input nice-tenant-switcher__search",value:g,onChange:y=>L(y.target.value),placeholder:h("searchOrganizations","Search…"),autoFocus:!0}),e.jsxs("div",{className:"nice-tenant-switcher__options",children:[f.map(y=>e.jsxs("div",{className:`nice-tenant-switcher__option${y.id===u?" nice-tenant-switcher__option--active":""}`,role:"option","aria-selected":y.id===u,onClick:()=>D(y.id),children:[y.logoUrl&&e.jsx("img",{src:y.logoUrl,alt:"",className:"nice-tenant-switcher__option-logo"}),e.jsxs("div",{className:"nice-tenant-switcher__option-info",children:[e.jsx("span",{className:"nice-tenant-switcher__option-name",children:y.name}),y.subtitle&&e.jsx("span",{className:"nice-tenant-switcher__option-subtitle",children:y.subtitle})]}),y.id===u&&e.jsx("span",{className:"nice-tenant-switcher__check",children:"✓"})]},y.id)),f.length===0&&e.jsx("div",{className:"nice-tenant-switcher__empty",children:h("noResults","No results")})]}),(x||b)&&e.jsxs("div",{className:"nice-tenant-switcher__footer",children:[x&&e.jsx("button",{type:"button",onClick:x,children:h("manageTenants","Manage organizations")}),b&&e.jsx("button",{type:"button",onClick:b,children:h("createTenant","Create organization")})]})]})]})});Pe.displayName="NiceTenantSwitcher";const gn={online:"var(--nice-color-success, #5cb85c)",away:"var(--nice-color-warning, #f0ad4e)",busy:"var(--nice-color-error, #d9534f)",offline:"var(--nice-color-muted, #999)"},He=c.forwardRef(({label:n,disabled:s,size:a="md",id:i,className:l,style:_,accessMode:r,userName:m,userEmail:o,userRole:t,avatarUrl:u,items:j=[],open:x,onOpenChange:b,onProfile:$,onLogout:w,avatarSize:k=36,status:M},I)=>{const h=T.Bs(r,i),p=h==="hidden";h==="disabled"&&(s=!0);const{t:v}=T.$o(),z=T.Ss(i),[g,L]=c.useState(!1),C=x??g,f=c.useCallback(()=>{const E=!C;L(E),b?.(E)},[C,b]),D=m.split(" ").map(E=>E.charAt(0)).join("").toUpperCase().slice(0,2),y=[];$&&y.push({id:"__profile",label:v("profile","Profile"),onClick:$}),w&&y.push({id:"__divider",label:"",isDivider:!0},{id:"__logout",label:v("logout","Logout"),onClick:w,danger:!0});const d=j.length>0?j:y;return p?null:e.jsxs("div",{ref:I,id:z,className:`nice-user-menu nice-size-${a}${l?` ${l}`:""}${s?" nice-disabled":""}`,style:_,children:[e.jsx("button",{type:"button",className:"nice-user-menu__trigger",onClick:f,onBlur:()=>setTimeout(()=>{L(!1),b?.(!1)},200),disabled:s,"aria-haspopup":"menu","aria-expanded":C,"aria-label":n??m,children:e.jsxs("span",{className:"nice-user-menu__avatar",style:{width:k,height:k},children:[u?e.jsx("img",{src:u,alt:m}):e.jsx("span",{className:"nice-user-menu__initials",children:D}),M&&e.jsx("span",{className:"nice-user-menu__status",style:{backgroundColor:gn[M]},title:M})]})}),C&&e.jsxs("div",{className:"nice-user-menu__dropdown",role:"menu",children:[e.jsxs("div",{className:"nice-user-menu__info",children:[e.jsx("span",{className:"nice-user-menu__name",children:m}),o&&e.jsx("span",{className:"nice-user-menu__email",children:o}),t&&e.jsx("span",{className:"nice-user-menu__role",children:t})]}),d.length>0&&e.jsx("div",{className:"nice-user-menu__items",children:d.map(E=>E.isDivider?e.jsx("hr",{className:"nice-user-menu__divider"},E.id):e.jsxs("button",{type:"button",role:"menuitem",className:`nice-user-menu__item${E.danger?" nice-user-menu__item--danger":""}`,onClick:()=>{E.onClick?.(),L(!1),b?.(!1)},disabled:E.disabled||s,children:[E.icon&&e.jsx("span",{className:"nice-user-menu__item-icon",children:E.icon}),e.jsx("span",{children:E.label})]},E.id))})]})]})});He.displayName="NiceUserMenu";function yn(n,s){if(!s)return n;const a=s.toLowerCase();return n.map(i=>{const l=i.entities.filter(r=>r.label.toLowerCase().includes(a)||r.name.toLowerCase().includes(a));return i.label.toLowerCase().includes(a)||i.name.toLowerCase().includes(a)?i:l.length>0?{...i,entities:l}:null}).filter(Boolean)}const kn=({value:n,onChange:s,placeholder:a})=>e.jsxs("div",{className:"nice-dynamic-sidebar__search",children:[e.jsx("span",{className:"nice-dynamic-sidebar__search-icon","aria-hidden":!0,children:"🔍"}),e.jsx("input",{type:"text",className:"nice-dynamic-sidebar__search-input",value:n,onChange:i=>s(i.target.value),placeholder:a,"aria-label":a}),n&&e.jsx("button",{className:"nice-dynamic-sidebar__search-clear",onClick:()=>s(""),"aria-label":"Clear",type:"button",children:"×"})]}),wn=({module:n,activeRoute:s,collapsed:a,expandedModules:i,onToggleModule:l,onNavigate:_})=>{const r=i.has(n.id);return a?e.jsx("div",{className:"nice-dynamic-sidebar__module nice-dynamic-sidebar__module--collapsed",title:n.label,children:e.jsx("button",{className:`nice-dynamic-sidebar__module-icon ${n.isAvailable?"":"nice-dynamic-sidebar__module-icon--disabled"}`,onClick:()=>n.isAvailable&&n.entities.length>0&&_(n.entities[0].route,n.entities[0]),disabled:!n.isAvailable,type:"button",children:e.jsx("span",{children:n.icon||n.label[0]})})}):e.jsxs("div",{className:`nice-dynamic-sidebar__module ${n.isAvailable?"":"nice-dynamic-sidebar__module--disabled"}`,children:[e.jsxs("button",{className:`nice-dynamic-sidebar__module-header ${r?"nice-dynamic-sidebar__module-header--expanded":""}`,onClick:()=>n.isAvailable&&l(n.id),disabled:!n.isAvailable,type:"button","aria-expanded":r,children:[n.icon&&e.jsx("span",{className:"nice-dynamic-sidebar__module-icon",children:n.icon}),e.jsx("span",{className:"nice-dynamic-sidebar__module-label",children:n.label}),e.jsx("span",{className:`nice-dynamic-sidebar__module-chevron ${r?"nice-dynamic-sidebar__module-chevron--open":""}`,children:"▸"})]}),r&&e.jsx("ul",{className:"nice-dynamic-sidebar__entities",role:"list",children:n.entities.map(m=>e.jsx("li",{className:`nice-dynamic-sidebar__entity ${s===m.route?"nice-dynamic-sidebar__entity--active":""}`,children:e.jsxs("button",{className:"nice-dynamic-sidebar__entity-btn",onClick:()=>_(m.route,m),type:"button",children:[m.icon&&e.jsx("span",{className:"nice-dynamic-sidebar__entity-icon",children:m.icon}),e.jsx("span",{children:m.label})]})},m.id))})]})},Cn=({favorites:n,activeRoute:s,onNavigate:a,label:i})=>n.length===0?null:e.jsxs("div",{className:"nice-dynamic-sidebar__favorites",children:[e.jsx("div",{className:"nice-dynamic-sidebar__section-title",children:i}),e.jsx("ul",{role:"list",children:n.map(l=>e.jsx("li",{className:`nice-dynamic-sidebar__favorite ${s===l.route?"nice-dynamic-sidebar__favorite--active":""}`,children:e.jsxs("button",{className:"nice-dynamic-sidebar__favorite-btn",onClick:()=>a(l.route),type:"button",children:[l.icon&&e.jsx("span",{children:l.icon}),e.jsx("span",{children:l.label})]})},l.id))})]}),Ve=c.forwardRef(({menu:n,activeRoute:s,collapsed:a,width:i=260,collapsedWidth:l=56,searchable:_=!0,showFavorites:r=!0,showQuickActions:m=!0,collapsible:o=!0,onNavigate:t,onCollapseChange:u,onToggleFavorite:j,header:x,footer:b,className:$,style:w,id:k,accessMode:M,...I},h)=>{const p=T.Ss(k),v=T.Bs(M,k),{t:z}=T.$o(),[g,L]=c.useState(a??!1),C=a??g,[f,D]=c.useState(""),[y,d]=c.useState(()=>{if(s){const R=n.modules.find(q=>q.entities.some(B=>B.route===s));return R?new Set([R.id]):new Set}return new Set}),E=c.useCallback(()=>{const R=!C;L(R),u?.(R)},[C,u]),P=c.useCallback(R=>{d(q=>{const B=new Set(q);return B.has(R)?B.delete(R):B.add(R),B})},[]),V=c.useCallback((R,q)=>{t?.(R,q)},[t]),Z=c.useMemo(()=>yn(n.modules.filter(R=>R.isAvailable).sort((R,q)=>R.order-q.order),f),[n.modules,f]),Y=C?l:i;return v==="hidden"?null:e.jsxs("nav",{ref:h,id:p,className:`nice-dynamic-sidebar ${C?"nice-dynamic-sidebar--collapsed":""} ${$??""}`,style:{...w,width:Y,minWidth:Y},"aria-label":z("nav.sidebar","Sidebar"),...I,children:[x&&e.jsx("div",{className:"nice-dynamic-sidebar__header",children:x}),o&&e.jsx("button",{className:"nice-dynamic-sidebar__toggle",onClick:E,"aria-label":C?z("expand","Expand"):z("collapse","Collapse"),type:"button",children:C?"▸":"◂"}),_&&!C&&e.jsx(kn,{value:f,onChange:D,placeholder:z("nav.search","Search")}),r&&!C&&e.jsx(Cn,{favorites:n.favorites,activeRoute:s,onNavigate:V,label:z("nav.favorites","Favorites")}),m&&!C&&n.quickActions.length>0&&e.jsx("div",{className:"nice-dynamic-sidebar__quick-actions",children:n.quickActions.map(R=>e.jsxs("button",{className:"nice-dynamic-sidebar__quick-action",onClick:()=>V(R.route),title:R.shortcut?`${R.label} (${R.shortcut})`:R.label,type:"button",children:[R.icon&&e.jsx("span",{children:R.icon}),e.jsx("span",{children:R.label})]},R.id))}),e.jsxs("div",{className:"nice-dynamic-sidebar__modules",role:"navigation",children:[Z.map(R=>e.jsx(wn,{module:R,activeRoute:s,collapsed:C,expandedModules:y,onToggleModule:P,onNavigate:V},R.id)),Z.length===0&&!C&&e.jsx("div",{className:"nice-dynamic-sidebar__empty",children:z("noData","No data")})]}),b&&e.jsx("div",{className:"nice-dynamic-sidebar__footer",children:b})]})});Ve.displayName="NiceDynamicSidebar";const be={all:{icon:"☰",label:"Wszystko"},"by-role":{icon:"👤",label:"Według roli"},"by-unit":{icon:"🏢",label:"Według jednostki"},favorites:{icon:"⭐",label:"Ulubione"},preferences:{icon:"⚙️",label:"Preferencje"}},ge={enableModeIcons:!1,enabledModes:["all","by-role","by-unit","favorites","preferences"],activeMode:"all",pinnedSources:{},hiddenItems:[],favorites:[],maxDepth:{},collapsedIds:[],autoExpand:!0};function Ke(n){return`nice_sidebar_nav_${n??"_default"}`}function Sn(n,s){const a={...ge,userId:n??"_default"};if(s&&Object.assign(a,s),s&&typeof s.activeMode<"u")return a;try{const i=localStorage.getItem(Ke(n));if(i){const l=JSON.parse(i);return{...a,...l,userId:n??"_default"}}}catch{}return a}function $n(n,s,a,i){const[l,_]=c.useState(()=>{const o=Sn(n,a);return s!==void 0&&(o.enableModeIcons=s),o});c.useEffect(()=>{a&&_(o=>({...o,...a}))},[a]);const r=c.useCallback(o=>{_(t=>{const u=o(t);if(!a?.activeMode)try{localStorage.setItem(Ke(n),JSON.stringify(u))}catch{}return i?.(u),u})},[n,a,i]),m=c.useMemo(()=>({setMode:o=>r(t=>({...t,activeMode:o})),setEnableModeIcons:o=>r(t=>({...t,enableModeIcons:o})),toggleMode:o=>r(t=>{if(o==="preferences")return t;const u=t.enabledModes.includes(o);return{...t,enabledModes:u?t.enabledModes.filter(j=>j!==o):[...t.enabledModes,o],activeMode:!u||t.activeMode!==o?t.activeMode:"all"}}),pinSource:(o,t)=>r(u=>({...u,pinnedSources:{...u.pinnedSources,[o]:[...u.pinnedSources[o]??[],t]}})),unpinSource:(o,t)=>r(u=>({...u,pinnedSources:{...u.pinnedSources,[o]:(u.pinnedSources[o]??[]).filter(j=>j!==t)}})),hideItem:o=>r(t=>({...t,hiddenItems:t.hiddenItems.some(u=>u.id===o.id)?t.hiddenItems:[...t.hiddenItems,o]})),restoreItem:o=>r(t=>({...t,hiddenItems:t.hiddenItems.filter(u=>u.id!==o)})),addFavorite:o=>r(t=>({...t,favorites:t.favorites.some(u=>u.id===o.id)?t.favorites:[...t.favorites,{...o,addedAt:Date.now()}]})),removeFavorite:o=>r(t=>({...t,favorites:t.favorites.filter(u=>u.id!==o)})),setMaxDepth:(o,t)=>r(u=>({...u,maxDepth:{...u.maxDepth,[o]:Math.min(4,Math.max(1,t))}})),toggleCollapse:o=>r(t=>({...t,collapsedIds:t.collapsedIds.includes(o)?t.collapsedIds.filter(u=>u!==o):[...t.collapsedIds,o]})),setAutoExpand:o=>r(t=>({...t,autoExpand:o})),resetAll:()=>r(()=>({...ge,userId:n??"_default"}))}),[r,n]);return[l,m]}function zn({enabledModes:n,activeMode:s,onSelect:a}){const i=[...n.filter(l=>l!=="preferences"),"preferences"];return e.jsx("div",{className:"nice-sidebar-nav__mode-bar",role:"tablist","aria-label":"Tryb nawigacji",children:i.map(l=>{const _=be[l],r=s===l;return e.jsxs("button",{role:"tab","aria-selected":r,"aria-label":_.label,title:_.label,className:["nice-sidebar-nav__mode-pill",r?"nice-sidebar-nav__mode-pill--active":""].filter(Boolean).join(" "),onClick:()=>a(l),children:[e.jsx("span",{className:"nice-sidebar-nav__mode-pill-icon","aria-hidden":"true",children:_.icon}),e.jsx("span",{className:"nice-sidebar-nav__mode-pill-label",children:_.label})]},l)})})}function Qe({item:n,depth:s,maxDepth:a,activeRoute:i,collapsedIds:l,hiddenIds:_,autoExpand:r,onNavigate:m,onHide:o,onToggleCollapse:t,onAddFavorite:u,isFavorite:j}){if(_.has(n.id))return null;const x=(n.children?.length??0)>0&&s<a,b=l.includes(n.id),$=r?!b:b,w=!!(n.route&&i&&n.route===i),k=!!n.route;function M(){k&&n.route?m?.(n.route,n):x&&t(n.id)}return e.jsxs("li",{className:["nice-sidebar-nav__node",`nice-sidebar-nav__node--depth-${s}`,w?"nice-sidebar-nav__node--active":"",x?"nice-sidebar-nav__node--branch":"nice-sidebar-nav__node--leaf"].filter(Boolean).join(" "),children:[e.jsxs("div",{className:"nice-sidebar-nav__node-row",children:[x&&e.jsx("button",{className:"nice-sidebar-nav__collapse-btn","aria-label":$?"Zwiń":"Rozwiń","aria-expanded":$,onClick:()=>t(n.id),children:e.jsx("span",{"aria-hidden":"true",children:$?"▾":"▸"})}),!x&&e.jsx("span",{className:"nice-sidebar-nav__collapse-spacer"}),e.jsxs("span",{role:k?"link":void 0,tabIndex:k?0:void 0,className:["nice-sidebar-nav__node-content",k?"nice-sidebar-nav__node-content--link":""].filter(Boolean).join(" "),onClick:M,onKeyDown:I=>(I.key==="Enter"||I.key===" ")&&M(),children:[n.icon&&e.jsx("span",{className:"nice-sidebar-nav__node-icon","aria-hidden":"true",children:n.icon}),e.jsx("span",{className:"nice-sidebar-nav__node-label",children:n.label}),n.badge!==void 0&&e.jsx("span",{className:"nice-sidebar-nav__node-badge","aria-label":`${n.badge} powiadomień`,children:n.badge})]}),e.jsxs("div",{className:"nice-sidebar-nav__node-actions",children:[k&&!j(n.id)&&e.jsx("button",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--fav","aria-label":"Dodaj do ulubionych",title:"Dodaj do ulubionych",onClick:I=>{I.stopPropagation(),u({id:n.id,label:n.label,icon:n.icon,route:n.route,sourceId:n.sourceId,moduleId:n.moduleId,addedAt:Date.now()})},children:"☆"}),j(n.id)&&e.jsx("span",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--fav-active","aria-label":"W ulubionych",title:"W ulubionych",children:"⭐"}),e.jsx("button",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--hide","aria-label":"Ukryj element",title:"Ukryj",onClick:I=>{I.stopPropagation(),o({id:n.id,kind:n.kind,label:n.label})},children:"👁"})]})]}),x&&$&&e.jsx("ul",{className:"nice-sidebar-nav__children",children:n.children.map(I=>e.jsx(Qe,{item:I,depth:s+1,maxDepth:a,activeRoute:i,collapsedIds:l,hiddenIds:_,autoExpand:r,onNavigate:m,onHide:o,onToggleCollapse:t,onAddFavorite:u,isFavorite:j},I.id))})]})}function Mn(n,s){return n.map(a=>({id:a.id,label:a.label,icon:a.icon,kind:"module",sourceId:s,children:a.views.map(i=>({id:i.id,label:i.label,icon:i.icon,route:i.route,badge:i.badge,kind:"view",sourceId:s,moduleId:a.id,children:[]}))}))}function Dn(n,s){return n.map(a=>({id:a.id,label:a.label,icon:a.icon,kind:"role",sourceId:s,children:a.modules.map(i=>({id:`${a.id}:${i.id}`,label:i.label,icon:i.icon,kind:"module",sourceId:s,children:i.views.map(l=>({id:l.id,label:l.label,icon:l.icon,route:l.route,badge:l.badge,kind:"view",sourceId:s,moduleId:i.id,children:[]}))}))}))}function Tn(n,s){return n.map(a=>({id:a.id,label:a.label,icon:a.icon,kind:"unit",sourceId:s,children:a.modules.map(i=>({id:`${a.id}:${i.id}`,label:i.label,icon:i.icon,kind:"module",sourceId:s,children:i.views.map(l=>({id:l.id,label:l.label,icon:l.icon,route:l.route,badge:l.badge,kind:"view",sourceId:s,moduleId:i.id,children:[]}))}))}))}function En({node:n,mode:s,maxDepth:a,isPinned:i,prefs:l,helpers:_,activeRoute:r,onNavigate:m}){const o=c.useMemo(()=>new Set(l.hiddenItems.map(j=>j.id)),[l.hiddenItems]),t=c.useMemo(()=>s==="all"?Mn(n.modules,n.source.id):s==="by-role"?Dn(n.roles,n.source.id):Tn(n.units,n.source.id),[s,n]),u=c.useCallback(j=>l.favorites.some(x=>x.id===j),[l.favorites]);return o.has(n.source.id)?null:e.jsxs("section",{className:"nice-sidebar-nav__source-section",children:[e.jsxs("div",{className:"nice-sidebar-nav__source-header",children:[n.source.icon&&e.jsx("span",{className:"nice-sidebar-nav__source-icon","aria-hidden":"true",children:n.source.icon}),e.jsx("span",{className:"nice-sidebar-nav__source-label",children:n.source.label}),e.jsxs("div",{className:"nice-sidebar-nav__source-actions",children:[e.jsx("button",{className:["nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--pin",i?"nice-sidebar-nav__action-btn--pin-active":""].filter(Boolean).join(" "),"aria-label":i?"Odepnij źródło":"Przypnij źródło",title:i?"Odepnij":"Przypnij",onClick:()=>i?_.unpinSource(s,n.source.id):_.pinSource(s,n.source.id),children:i?"📌":"📍"}),e.jsx("button",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--hide","aria-label":"Ukryj źródło",title:"Ukryj",onClick:()=>_.hideItem({id:n.source.id,kind:"source",label:n.source.label}),children:"👁"})]})]}),a>1&&e.jsx("ul",{className:"nice-sidebar-nav__tree",children:t.map(j=>e.jsx(Qe,{item:j,depth:2,maxDepth:a,activeRoute:r,collapsedIds:l.collapsedIds,hiddenIds:o,autoExpand:l.autoExpand,onNavigate:m,onHide:_.hideItem,onToggleCollapse:_.toggleCollapse,onAddFavorite:_.addFavorite,isFavorite:u},j.id))})]})}function In({favorites:n,activeRoute:s,onNavigate:a,onRemove:i}){return n.length===0?e.jsx("p",{className:"nice-sidebar-nav__empty",children:"Brak ulubionych. Najedź na element i kliknij ☆, aby dodać."}):e.jsx("ul",{className:"nice-sidebar-nav__favorites-list",children:n.map(l=>{const _=!!(l.route&&l.route===s);return e.jsxs("li",{className:["nice-sidebar-nav__fav-item",_?"nice-sidebar-nav__fav-item--active":""].filter(Boolean).join(" "),children:[e.jsxs("span",{role:"link",tabIndex:0,className:"nice-sidebar-nav__fav-content",onClick:()=>{l.route&&a?.(l.route,l)},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&l.route&&a?.(l.route,l)},children:[l.icon&&e.jsx("span",{className:"nice-sidebar-nav__fav-icon","aria-hidden":"true",children:l.icon}),e.jsx("span",{className:"nice-sidebar-nav__fav-label",children:l.label})]}),e.jsx("button",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--remove","aria-label":"Usuń z ulubionych",title:"Usuń z ulubionych",onClick:()=>i(l.id),children:"✕"})]},l.id)})})}const Ce=["all","by-role","by-unit","favorites"];function Rn({prefs:n,helpers:s}){return e.jsxs("div",{className:"nice-sidebar-nav__prefs",children:[e.jsx("h3",{className:"nice-sidebar-nav__prefs-title",children:"Preferencje"}),e.jsxs("section",{className:"nice-sidebar-nav__prefs-section",children:[e.jsx("h4",{className:"nice-sidebar-nav__prefs-section-title",children:"Tryb wyświetlania"}),e.jsxs("label",{className:"nice-sidebar-nav__prefs-row",children:[e.jsx("span",{children:"Pokaż ikony trybów"}),e.jsx("input",{type:"checkbox",checked:n.enableModeIcons,onChange:a=>s.setEnableModeIcons(a.target.checked)})]}),Ce.map(a=>{const i=be[a],l=n.enabledModes.includes(a);return e.jsxs("label",{className:"nice-sidebar-nav__prefs-row",children:[e.jsxs("span",{children:[i.icon," ",i.label]}),e.jsx("input",{type:"checkbox",checked:l,onChange:()=>s.toggleMode(a)})]},a)})]}),e.jsxs("section",{className:"nice-sidebar-nav__prefs-section",children:[e.jsx("h4",{className:"nice-sidebar-nav__prefs-section-title",children:"Głębokość drzewa"}),Ce.map(a=>{const i=be[a],l=n.maxDepth[a]??4;return e.jsxs("div",{className:"nice-sidebar-nav__prefs-row",children:[e.jsxs("span",{children:[i.icon," ",i.label]}),e.jsxs("div",{className:"nice-sidebar-nav__depth-control",children:[e.jsx("input",{type:"range",min:1,max:4,value:l,onChange:_=>s.setMaxDepth(a,Number(_.target.value)),"aria-label":`Głębokość dla trybu ${i.label}`}),e.jsx("span",{className:"nice-sidebar-nav__depth-value",children:l})]})]},a)})]}),e.jsxs("section",{className:"nice-sidebar-nav__prefs-section",children:[e.jsx("h4",{className:"nice-sidebar-nav__prefs-section-title",children:"Zachowanie drzewa"}),e.jsxs("label",{className:"nice-sidebar-nav__prefs-row",children:[e.jsx("span",{children:"Domyślnie rozwiń wszystko"}),e.jsx("input",{type:"checkbox",checked:n.autoExpand,onChange:a=>s.setAutoExpand(a.target.checked)})]})]}),n.hiddenItems.length>0&&e.jsxs("section",{className:"nice-sidebar-nav__prefs-section",children:[e.jsx("h4",{className:"nice-sidebar-nav__prefs-section-title",children:"Ukryte elementy"}),e.jsx("ul",{className:"nice-sidebar-nav__hidden-list",children:n.hiddenItems.map(a=>e.jsxs("li",{className:"nice-sidebar-nav__hidden-item",children:[e.jsxs("span",{className:"nice-sidebar-nav__hidden-label",children:[e.jsxs("span",{className:"nice-sidebar-nav__hidden-kind",children:["[",a.kind,"]"]})," ",a.label]}),e.jsx("button",{className:"nice-sidebar-nav__action-btn",onClick:()=>s.restoreItem(a.id),"aria-label":`Przywróć ${a.label}`,title:"Przywróć",children:"↩"})]},a.id))})]}),e.jsx("section",{className:"nice-sidebar-nav__prefs-section",children:e.jsx("button",{className:"nice-sidebar-nav__btn-reset",onClick:s.resetAll,"aria-label":"Zresetuj wszystkie preferencje",children:"Resetuj wszystkie preferencje"})})]})}const Ln=c.forwardRef(function({data:s,userId:a,activeRoute:i,onNavigate:l,enableModeIcons:_,preferences:r,onPreferencesChange:m,width:o=264,collapsed:t,onCollapsedChange:u,size:j="md",className:x,"data-testid":b},$){const[w,k]=c.useState(!1),M=t??w,I=c.useCallback(()=>{const C=!M;u?u(C):k(C)},[M,u]),[h,p]=$n(a,_,r,m),v=c.useMemo(()=>{const C=h.activeMode;if(C==="favorites"||C==="preferences")return s;const f=h.pinnedSources[C];return!f||f.length===0?s:s.filter(D=>f.includes(D.source.id))},[s,h.activeMode,h.pinnedSources]),z=h.maxDepth[h.activeMode]??4;function g(){const C=h.activeMode;return C==="favorites"?e.jsx(In,{favorites:h.favorites,activeRoute:i,onNavigate:l,onRemove:p.removeFavorite}):C==="preferences"?e.jsx(Rn,{prefs:h,helpers:p}):v.length===0?e.jsx("p",{className:"nice-sidebar-nav__empty",children:"Brak widocznych źródeł danych dla tego trybu."}):v.map(f=>{const D=(h.pinnedSources[C]??[]).includes(f.source.id);return e.jsx(En,{node:f,mode:C,maxDepth:z,isPinned:D,prefs:h,helpers:p,activeRoute:i,onNavigate:l},f.source.id)})}const L=["nice-sidebar-nav",`nice-sidebar-nav--${j}`,h.enableModeIcons?"nice-sidebar-nav--with-strip":"",M?"nice-sidebar-nav--collapsed":"",x].filter(Boolean).join(" ");return e.jsxs("div",{ref:$,className:L,style:{width:M?void 0:o},"data-testid":b,"data-mode":h.activeMode,children:[h.enableModeIcons&&!M&&e.jsx(zn,{enabledModes:h.enabledModes,activeMode:h.activeMode,onSelect:p.setMode}),e.jsx("div",{className:"nice-sidebar-nav__content",children:e.jsx("div",{className:"nice-sidebar-nav__body",children:g()})}),e.jsx("div",{className:"nice-sidebar-nav__footer",children:e.jsxs("button",{type:"button",className:"nice-sidebar-nav__footer-toggle",onClick:I,"aria-label":M?"Rozwiń sidebar":"Zwiń do ikon",title:M?"Rozwiń sidebar":"Zwiń do ikon",children:[e.jsx("span",{className:"nice-sidebar-nav__footer-toggle-icon","aria-hidden":"true",children:M?"»":"«"}),e.jsx("span",{className:"nice-sidebar-nav__footer-toggle-label",children:M?"Rozwiń":"Zwiń do ikon"})]})})]})}),Xe=c.forwardRef(({tabs:n,activeIndex:s,renderTab:a,onActiveChange:i,onCloseTab:l,onReorderTabs:_,onSaveState:r,enableShortcuts:m=!0,maxTabs:o=0,showDirtyIndicator:t=!0,tabBarPosition:u="top",draggable:j=!0,showAddButton:x=!1,onAddTab:b,keepAlive:$=!0,warnOnUnsavedClose:w=!0,maxClosedTabs:k=10,onUndoCloseTab:M,getTabState:I,unsavedWarningMessage:h,className:p,style:v,id:z,accessMode:g,...L},C)=>{const f=T.Ss(z),D=T.Bs(g,z),{t:y}=T.$o(),d=c.useRef(null),[E,P]=c.useState(null),[V,Z]=c.useState(null),[Y,R]=c.useState([]),[q,B]=c.useState(null),F=c.useCallback((S,O,G=!1)=>{if(!G&&w&&S.isDirty){B({tab:S,index:O});return}const ne={tab:{...S},originalIndex:O,closedAt:Date.now(),state:I?.(S)};R(oe=>[ne,...oe].slice(0,k)),l?.(S,O)},[w,k,I,l]),X=c.useCallback(()=>{if(Y.length===0)return;const[S,...O]=Y;R(O),M?.(S)},[Y,M]);c.useEffect(()=>{if(!m)return;const S=O=>{const G=O.ctrlKey||O.metaKey;if(G&&O.key==="w"){O.preventDefault();const ne=n[s];ne&&ne.closable!==!1&&F(ne,s)}else if(G&&O.key==="Tab"){O.preventDefault();const ne=O.shiftKey?-1:1,oe=(s+ne+n.length)%n.length;i?.(oe)}else G&&O.shiftKey&&(O.key==="t"||O.key==="T")&&(O.preventDefault(),X())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[m,n,s,F,X,i]),c.useEffect(()=>{if(!r)return;const S=setTimeout(()=>{r({tabs:n,activeTabIndex:s})},500);return()=>clearTimeout(S)},[n,s,r]);const K=c.useCallback(S=>{j&&Z(S)},[j]),ee=c.useCallback((S,O)=>{S.preventDefault()},[V]),le=c.useCallback(S=>{if(V===null||V===S)return;const O=[...n],[G]=O.splice(V,1);O.splice(S,0,G),_?.(O),Z(null);let ne=s;s===V?ne=S:V<s&&S>=s?ne--:V>s&&S<=s&&ne++,ne!==s&&i?.(ne)},[V,n,s,_,i]),_e=c.useCallback((S,O)=>{S.preventDefault(),P({tabIndex:O,x:S.clientX,y:S.clientY})},[]),ae=c.useCallback(()=>P(null),[]),A=c.useMemo(()=>{if(!E)return[];const S=n[E.tabIndex];return[{label:y("wm.close","Close"),action:()=>{F(S,E.tabIndex),ae()},disabled:S.closable===!1},{label:y("wm.closeAll","Close all"),action:()=>{n.forEach((O,G)=>O.closable!==!1&&F(O,G)),ae()}},{label:y("wm.closeOthers","Close others"),action:()=>{n.forEach((O,G)=>G!==E.tabIndex&&O.closable!==!1&&F(O,G)),ae()}},{label:y("controls.pin","Pin"),action:()=>ae()},{type:"divider"},{label:y("wm.reopenClosed","Reopen closed tab"),action:()=>{X(),ae()},disabled:Y.length===0,shortcut:"Ctrl+Shift+T"}]},[E,n,y,F,X,Y.length,ae]);if(c.useEffect(()=>{if(!E)return;const S=()=>ae();return window.addEventListener("click",S),()=>window.removeEventListener("click",S)},[E,ae]),D==="hidden")return null;const te=e.jsxs("div",{className:`nice-mdi__tab-bar nice-mdi__tab-bar--${u}`,role:"tablist",children:[n.map((S,O)=>e.jsxs("div",{className:`nice-mdi__tab ${O===s?"nice-mdi__tab--active":""} ${S.isPinned?"nice-mdi__tab--pinned":""}`,role:"tab","aria-selected":O===s,onClick:()=>i?.(O),onContextMenu:G=>_e(G,O),draggable:j,onDragStart:()=>K(O),onDragOver:G=>ee(G,O),onDrop:()=>le(O),children:[S.icon&&e.jsx("span",{className:"nice-mdi__tab-icon",children:S.icon}),e.jsx("span",{className:"nice-mdi__tab-title",children:S.title}),t&&S.isDirty&&e.jsx("span",{className:"nice-mdi__tab-dirty",title:"Unsaved changes",children:"●"}),S.closable!==!1&&!S.isPinned&&e.jsx("button",{className:"nice-mdi__tab-close",onClick:G=>{G.stopPropagation(),F(S,O)},"aria-label":y("wm.close","Close"),type:"button",children:"×"})]},S.id)),x&&e.jsx("button",{className:"nice-mdi__tab-add",onClick:b,"aria-label":y("controls.new","New"),type:"button",children:"+"})]}),J=$?e.jsx("div",{className:"nice-mdi__content",children:n.map((S,O)=>e.jsx("div",{className:"nice-mdi__panel",role:"tabpanel",style:{display:O===s?"block":"none"},children:a(S,O)},S.id))}):e.jsx("div",{className:"nice-mdi__content",children:n[s]&&e.jsx("div",{className:"nice-mdi__panel",role:"tabpanel",children:a(n[s],s)})});return e.jsxs("div",{ref:S=>{d.current=S,typeof C=="function"?C(S):C&&(C.current=S)},id:f,className:`nice-mdi ${p??""}`,style:v,...L,children:[u==="top"&&te,J,u==="bottom"&&te,E&&e.jsx("div",{className:"nice-mdi__ctx-menu",style:{position:"fixed",left:E.x,top:E.y,zIndex:9999},children:A.map((S,O)=>"type"in S&&S.type==="divider"?e.jsx("div",{className:"nice-mdi__ctx-divider"},O):e.jsxs("button",{className:"nice-mdi__ctx-item",onClick:S.action,disabled:S.disabled,type:"button",children:[e.jsx("span",{className:"nice-mdi__ctx-label",children:S.label}),"shortcut"in S&&S.shortcut&&e.jsx("span",{className:"nice-mdi__ctx-shortcut",children:S.shortcut})]},O))}),q&&e.jsx("div",{className:"nice-mdi__modal-backdrop",onClick:()=>B(null),children:e.jsxs("div",{className:"nice-mdi__modal",onClick:S=>S.stopPropagation(),children:[e.jsx("div",{className:"nice-mdi__modal-icon",children:"⚠️"}),e.jsx("h3",{className:"nice-mdi__modal-title",children:y("wm.unsavedTitle","Unsaved Changes")}),e.jsx("p",{className:"nice-mdi__modal-message",children:h??y("wm.unsavedMessage",`"${q.tab.title}" has unsaved changes. Do you want to close it anyway?`)}),e.jsxs("div",{className:"nice-mdi__modal-actions",children:[e.jsx("button",{type:"button",className:"nice-mdi__modal-btn nice-mdi__modal-btn--secondary",onClick:()=>B(null),children:y("controls.cancel","Cancel")}),e.jsx("button",{type:"button",className:"nice-mdi__modal-btn nice-mdi__modal-btn--danger",onClick:()=>{F(q.tab,q.index,!0),B(null)},children:y("wm.closeAnyway","Close Anyway")})]})]})})]})});Xe.displayName="NiceMdiWorkspace";const Ge=c.forwardRef(({menu:n,activeRoute:s,toolbar:a,statusBar:i,sidebarHeader:l,sidebarFooter:_,onNavigate:r,children:m,className:o,style:t,id:u,accessMode:j,...x},b)=>{const $=T.Ss(u),w=T.Bs(j,u),{t:k}=T.$o(),[M,I]=c.useState(!1);return w==="hidden"?null:e.jsxs("div",{ref:b,id:$,className:`nice-shell nice-shell--classic ${M?"nice-shell--sidebar-collapsed":""} ${o??""}`,style:t,...x,children:[e.jsxs("aside",{className:"nice-shell__sidebar",children:[l&&e.jsx("div",{className:"nice-shell__sidebar-header",children:l}),e.jsx("button",{className:"nice-shell__sidebar-toggle",onClick:()=>I(h=>!h),type:"button","aria-label":M?k("expand","Expand"):k("collapse","Collapse"),children:M?"▸":"◂"}),n&&!M&&e.jsx("nav",{className:"nice-shell__nav",role:"navigation",children:n.modules.filter(h=>h.isAvailable).sort((h,p)=>h.order-p.order).map(h=>e.jsxs("div",{className:"nice-shell__nav-group",children:[e.jsxs("div",{className:"nice-shell__nav-group-label",children:[h.icon&&e.jsx("span",{children:h.icon}),e.jsx("span",{children:h.label})]}),e.jsx("ul",{children:h.entities.map(p=>e.jsx("li",{children:e.jsx("button",{className:`nice-shell__nav-item ${s===p.route?"nice-shell__nav-item--active":""}`,onClick:()=>r?.(p.route),type:"button",children:p.label})},p.id))})]},h.id))}),_&&e.jsx("div",{className:"nice-shell__sidebar-footer",children:_})]}),e.jsxs("div",{className:"nice-shell__main",children:[a&&e.jsx("header",{className:"nice-shell__toolbar",children:a}),e.jsx("main",{className:"nice-shell__content",children:m}),i&&e.jsx("footer",{className:"nice-shell__status-bar",children:i})]})]})});Ge.displayName="NiceClassicShell";const Ze=c.forwardRef(({topBar:n,sidePanel:s,sidePanelPosition:a="left",sidePanelWidth:i=280,children:l,className:_,style:r,id:m,accessMode:o,...t},u)=>{const j=T.Ss(m);return T.Bs(o,m)==="hidden"?null:e.jsxs("div",{ref:u,id:j,className:`nice-shell nice-shell--dashboard ${_??""}`,style:r,...t,children:[n&&e.jsx("header",{className:"nice-shell__top-bar",children:n}),e.jsxs("div",{className:`nice-shell__dashboard-body nice-shell__dashboard-body--panel-${a}`,children:[s&&e.jsx("aside",{className:"nice-shell__side-panel",style:{width:i},children:s}),e.jsx("main",{className:"nice-shell__dashboard-content",children:l})]})]})});Ze.displayName="NiceDashboardShell";const qe=c.forwardRef(({topBar:n,bottomNav:s,children:a,className:i,style:l,id:_,accessMode:r,...m},o)=>{const t=T.Ss(_);return T.Bs(r,_)==="hidden"?null:e.jsxs("div",{ref:o,id:t,className:`nice-shell nice-shell--compact ${i??""}`,style:l,...m,children:[n&&e.jsx("header",{className:"nice-shell__compact-top",children:n}),e.jsx("main",{className:"nice-shell__compact-content",children:a}),s&&e.jsx("footer",{className:"nice-shell__compact-bottom",children:s})]})});qe.displayName="NiceCompactShell";const Je=c.forwardRef(({overlay:n,lockScreen:s,locked:a=!1,children:i,className:l,style:_,id:r,accessMode:m,...o},t)=>{const u=T.Ss(r);return T.Bs(m,r)==="hidden"?null:e.jsx("div",{ref:t,id:u,className:`nice-shell nice-shell--kiosk ${l??""}`,style:{..._,position:"fixed",inset:0},...o,children:a&&s?e.jsx("div",{className:"nice-shell__kiosk-lock",children:s}):e.jsxs(e.Fragment,{children:[e.jsx("main",{className:"nice-shell__kiosk-content",children:i}),n&&e.jsx("div",{className:"nice-shell__kiosk-overlay",children:n})]})})});Je.displayName="NiceKioskShell";const en=c.forwardRef(({menu:n,activeRoute:s,tenant:a,topBarActions:i,globalSearch:l,footer:_,onNavigate:r,children:m,className:o,style:t,id:u,accessMode:j,...x},b)=>{const $=T.Ss(u);return T.Bs(j,u)==="hidden"?null:e.jsxs("div",{ref:b,id:$,className:`nice-shell nice-shell--modern ${o??""}`,style:t,...x,children:[e.jsx("aside",{className:"nice-shell__modern-rail",role:"navigation",children:n?.modules.filter(k=>k.isAvailable).sort((k,M)=>k.order-M.order).map(k=>e.jsx("button",{type:"button",title:k.label,className:"nice-shell__modern-rail-item",onClick:()=>k.entities[0]&&r?.(k.entities[0].route),children:e.jsx("span",{"aria-hidden":!0,children:k.icon??"◦"})},k.id))}),e.jsxs("div",{className:"nice-shell__modern-main",children:[e.jsxs("header",{className:"nice-shell__modern-topbar",children:[a&&e.jsxs("div",{className:"nice-shell__modern-tenant",style:a.primaryColor?{borderColor:a.primaryColor}:void 0,children:[a.logoUrl&&e.jsx("img",{src:a.logoUrl,alt:""}),e.jsx("span",{children:a.shortName??a.name}),a.plan&&e.jsx("small",{children:a.plan})]}),l&&e.jsx("div",{className:"nice-shell__modern-search",children:l}),i&&e.jsx("div",{className:"nice-shell__modern-actions",children:i})]}),e.jsx("main",{className:"nice-shell__modern-content","data-active-route":s,children:m}),_&&e.jsx("footer",{className:"nice-shell__modern-footer",children:_})]})]})});en.displayName="NiceModernShell";const nn=c.forwardRef(({header:n,tenant:s,maxWidth:a=960,centered:i=!0,children:l,className:_,style:r,id:m,accessMode:o,...t},u)=>{const j=T.Ss(m);return T.Bs(o,m)==="hidden"?null:e.jsxs("div",{ref:u,id:j,className:`nice-shell nice-shell--minimal ${i?"nice-shell--minimal-centered":""} ${_??""}`,style:r,...t,children:[(n||s)&&e.jsxs("header",{className:"nice-shell__minimal-header",children:[s&&e.jsxs("div",{className:"nice-shell__minimal-tenant",children:[s.logoUrl&&e.jsx("img",{src:s.logoUrl,alt:""}),e.jsx("span",{children:s.name})]}),n]}),e.jsx("main",{className:"nice-shell__minimal-content",style:{maxWidth:a,marginInline:i?"auto":void 0},children:l})]})});nn.displayName="NiceMinimalShell";const sn=c.forwardRef(({menu:n,activeRoute:s,tenant:a,toolbar:i,inspector:l,inspectorOpen:_=!0,statusBar:r,onNavigate:m,children:o,className:t,style:u,id:j,accessMode:x,...b},$)=>{const w=T.Ss(j),k=T.Bs(x,j),[M,I]=c.useState(_);return k==="hidden"?null:e.jsxs("div",{ref:$,id:w,className:`nice-shell nice-shell--hybrid ${t??""}`,style:u,...b,children:[e.jsxs("header",{className:"nice-shell__hybrid-topbar",children:[a&&e.jsxs("div",{className:"nice-shell__hybrid-tenant",children:[a.logoUrl&&e.jsx("img",{src:a.logoUrl,alt:""}),e.jsx("span",{children:a.name})]}),i,l&&e.jsx("button",{type:"button",className:"nice-shell__hybrid-inspector-toggle",onClick:()=>I(h=>!h),"aria-pressed":M,children:"⚙"})]}),e.jsxs("div",{className:"nice-shell__hybrid-body",children:[e.jsx("aside",{className:"nice-shell__hybrid-sidebar",role:"navigation",children:n?.modules.filter(h=>h.isAvailable).sort((h,p)=>h.order-p.order).map(h=>e.jsxs("div",{className:"nice-shell__hybrid-nav-group",children:[e.jsx("div",{className:"nice-shell__hybrid-nav-group-label",children:h.label}),e.jsx("ul",{children:h.entities.map(p=>e.jsx("li",{children:e.jsx("button",{type:"button",className:`nice-shell__hybrid-nav-item ${s===p.route?"nice-shell__hybrid-nav-item--active":""}`,onClick:()=>m?.(p.route),children:p.label})},p.id))})]},h.id))}),e.jsx("main",{className:"nice-shell__hybrid-content",children:o}),l&&M&&e.jsx("aside",{className:"nice-shell__hybrid-inspector",children:l})]}),r&&e.jsx("footer",{className:"nice-shell__hybrid-status",children:r})]})});sn.displayName="NiceHybridShell";const an=c.forwardRef(({appTitle:n,tenant:s,topBarActions:a,tabs:i=[],activeTabId:l,onTabChange:_,fab:r,children:m,className:o,style:t,id:u,accessMode:j,...x},b)=>{const $=T.Ss(u);return T.Bs(j,u)==="hidden"?null:e.jsxs("div",{ref:b,id:$,className:`nice-shell nice-shell--pwa ${o??""}`,style:t,...x,children:[e.jsxs("header",{className:"nice-shell__pwa-topbar",children:[e.jsxs("div",{className:"nice-shell__pwa-title",children:[s?.logoUrl&&e.jsx("img",{src:s.logoUrl,alt:""}),e.jsx("span",{children:s?.name??n??""})]}),a&&e.jsx("div",{className:"nice-shell__pwa-actions",children:a})]}),e.jsx("main",{className:"nice-shell__pwa-content",children:m}),r&&e.jsx("div",{className:"nice-shell__pwa-fab",children:r}),i.length>0&&e.jsx("nav",{className:"nice-shell__pwa-tabs",role:"tablist",children:i.map(k=>e.jsxs("button",{type:"button",role:"tab","aria-selected":l===k.id,className:`nice-shell__pwa-tab ${l===k.id?"nice-shell__pwa-tab--active":""}`,onClick:()=>_?.(k.id,k.route),children:[k.icon&&e.jsx("span",{"aria-hidden":!0,children:k.icon}),e.jsx("span",{children:k.label})]},k.id))})]})});an.displayName="NicePwaShell";const ln=c.forwardRef(({modes:n,activeMode:s,onModeChange:a,variant:i="dropdown",gridColumns:l=3,showDescription:_=!0,showColorIndicator:r=!0,compact:m=!1,size:o="md",className:t,style:u,id:j,accessMode:x,...b},$)=>{const w=T.Ss(j),k=T.Bs(x,j),{t:M}=T.$o(),[I,h]=c.useState(!1),p=c.useRef(null),v=n.find(g=>g.key===s);c.useEffect(()=>{if(!I)return;const g=L=>{p.current&&!p.current.contains(L.target)&&h(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[I]);const z=c.useCallback(g=>{a?.(g),h(!1)},[a]);return k==="hidden"?null:i==="dropdown"?e.jsxs("div",{ref:g=>{p.current=g,typeof $=="function"?$(g):$&&($.current=g)},id:w,className:`nice-mode-selector nice-mode-selector--dropdown nice-mode-selector--${o} ${t??""}`,style:u,...b,children:[e.jsxs("button",{className:"nice-mode-selector__trigger",onClick:()=>h(g=>!g),"aria-expanded":I,"aria-haspopup":"listbox",type:"button",children:[r&&v?.color&&e.jsx("span",{className:"nice-mode-selector__color",style:{backgroundColor:v.color}}),v?.icon&&e.jsx("span",{className:"nice-mode-selector__icon",children:v.icon}),e.jsx("span",{className:"nice-mode-selector__label",children:v?.displayName??s}),e.jsx("span",{className:"nice-mode-selector__chevron",children:I?"▴":"▾"})]}),I&&e.jsx("ul",{className:"nice-mode-selector__menu",role:"listbox",children:n.map(g=>e.jsxs("li",{className:`nice-mode-selector__option ${g.key===s?"nice-mode-selector__option--active":""}`,role:"option","aria-selected":g.key===s,onClick:()=>z(g),children:[r&&g.color&&e.jsx("span",{className:"nice-mode-selector__color",style:{backgroundColor:g.color}}),g.icon&&e.jsx("span",{className:"nice-mode-selector__icon",children:g.icon}),e.jsxs("div",{children:[e.jsx("div",{className:"nice-mode-selector__name",children:g.displayName}),_&&g.description&&e.jsx("div",{className:"nice-mode-selector__desc",children:g.description})]})]},g.key))})]}):i==="pills"?e.jsx("div",{ref:$,id:w,className:`nice-mode-selector nice-mode-selector--pills ${t??""}`,style:u,role:"radiogroup",...b,children:n.map(g=>e.jsxs("button",{className:`nice-mode-selector__pill ${g.key===s?"nice-mode-selector__pill--active":""}`,style:r&&g.color?{borderColor:g.color}:void 0,onClick:()=>z(g),role:"radio","aria-checked":g.key===s,type:"button",children:[g.icon&&e.jsx("span",{children:g.icon}),e.jsx("span",{children:g.displayName})]},g.key))}):e.jsx("div",{ref:$,id:w,className:`nice-mode-selector nice-mode-selector--card-grid ${t??""}`,style:{...u,gridTemplateColumns:`repeat(${l}, 1fr)`},role:"radiogroup",...b,children:n.map(g=>e.jsxs("button",{className:`nice-mode-selector__card ${g.key===s?"nice-mode-selector__card--active":""} ${m?"nice-mode-selector__card--compact":""}`,onClick:()=>z(g),role:"radio","aria-checked":g.key===s,type:"button",children:[r&&g.color&&e.jsx("div",{className:"nice-mode-selector__card-stripe",style:{backgroundColor:g.color}}),g.icon&&e.jsx("div",{className:"nice-mode-selector__card-icon",children:g.icon}),e.jsx("div",{className:"nice-mode-selector__card-name",children:g.displayName}),_&&g.description&&!m&&e.jsx("div",{className:"nice-mode-selector__card-desc",children:g.description}),g.sourcePackage&&!m&&e.jsx("div",{className:"nice-mode-selector__card-pkg",children:g.sourcePackage})]},g.key))})});ln.displayName="NiceModeSelector";function On(n){const s=new Map;for(const a of n.sort((i,l)=>i.orderIndex-l.orderIndex))s.has(a.category)||s.set(a.category,[]),s.get(a.category).push(a);return Array.from(s,([a,i])=>({category:a,items:i}))}const An=({question:n,value:s,onChange:a})=>{switch(n.questionType){case"boolean":return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--boolean",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsxs("div",{className:"nice-onboarding__boolean-group",children:[e.jsx("button",{className:`nice-onboarding__bool-btn ${s==="true"?"nice-onboarding__bool-btn--active":""}`,onClick:()=>a("true"),type:"button",children:"✓"}),e.jsx("button",{className:`nice-onboarding__bool-btn ${s==="false"?"nice-onboarding__bool-btn--active":""}`,onClick:()=>a("false"),type:"button",children:"✗"})]})]});case"select":return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--select",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsx("div",{className:"nice-onboarding__options",children:n.options?.map(i=>e.jsx("button",{className:`nice-onboarding__option ${s===i?"nice-onboarding__option--selected":""}`,onClick:()=>a(i),type:"button",children:i},i))})]});case"multiSelect":return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--multi",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsx("div",{className:"nice-onboarding__options",children:n.options?.map(i=>{const l=s.split(",").filter(Boolean),_=l.includes(i);return e.jsx("button",{className:`nice-onboarding__option ${_?"nice-onboarding__option--selected":""}`,onClick:()=>{const r=_?l.filter(m=>m!==i):[...l,i];a(r.join(","))},type:"button",children:i},i)})})]});case"number":return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--number",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsx("input",{type:"number",className:"nice-onboarding__input",value:s,onChange:i=>a(i.target.value)})]});case"date":return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--date",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsx("input",{type:"date",className:"nice-onboarding__input",value:s,onChange:i=>a(i.target.value)})]});default:return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--text",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsx("input",{type:"text",className:"nice-onboarding__input",value:s,onChange:i=>a(i.target.value),placeholder:n.defaultValue})]})}},cn=c.forwardRef(({questions:n,initialAnswers:s=[],stepLabels:a,onComplete:i,onCancel:l,onStepChange:_,welcomeContent:r,completionContent:m,showProgress:o=!0,allowBack:t=!0,logo:u,size:j="md",className:x,style:b,id:$,accessMode:w,...k},M)=>{const I=T.Ss($),h=T.Bs(w,$),{t:p}=T.$o(),v=c.useMemo(()=>On(n),[n]),z=!!r,g=!!m,L=z?-1:0,C=g?v.length:v.length-1,[f,D]=c.useState(L),[y,d]=c.useState(()=>{const B=new Map;for(const F of s)B.set(F.questionId,F.answer);for(const F of n)!B.has(F.id)&&F.defaultValue&&B.set(F.id,F.defaultValue);return B}),E=c.useCallback((B,F)=>{d(X=>{const K=new Map(X);return K.set(B,F),K})},[]),P=c.useMemo(()=>f<0||f>=v.length?!0:v[f].items.every(F=>!F.isRequired||(y.get(F.id)??"").trim().length>0),[f,v,y]),V=c.useCallback(()=>{if(f>=C){const F=[];y.forEach((X,K)=>F.push({questionId:K,answer:X})),i?.(F);return}const B=f+1;D(B),_?.(B)},[f,C,y,i,_]),Z=c.useCallback(()=>{if(f<=L)return;const B=f-1;D(B),_?.(B)},[f,L,_]),Y=v.length+(z?1:0)+(g?1:0),R=f-L,q=Math.round(R/Math.max(Y-1,1)*100);return h==="hidden"?null:e.jsxs("div",{ref:M,id:I,className:`nice-onboarding nice-onboarding--${j} ${x??""}`,style:b,...k,children:[e.jsxs("div",{className:"nice-onboarding__header",children:[u&&e.jsx("div",{className:"nice-onboarding__logo",children:u}),o&&e.jsx("div",{className:"nice-onboarding__progress",children:e.jsx("div",{className:"nice-onboarding__progress-bar",style:{width:`${q}%`}})}),e.jsx("div",{className:"nice-onboarding__steps",children:v.map((B,F)=>e.jsxs("div",{className:`nice-onboarding__step-dot ${F===f?"nice-onboarding__step-dot--active":""} ${F<f?"nice-onboarding__step-dot--done":""}`,children:[e.jsx("span",{children:F+1}),e.jsx("span",{className:"nice-onboarding__step-label",children:a?.[F]??B.category})]},F))})]}),e.jsxs("div",{className:"nice-onboarding__body",children:[f===-1&&r,f>=0&&f<v.length&&e.jsxs("div",{className:"nice-onboarding__questions",children:[e.jsx("h2",{className:"nice-onboarding__category",children:v[f].category}),v[f].items.map(B=>e.jsx(An,{question:B,value:y.get(B.id)??"",onChange:F=>E(B.id,F)},B.id))]}),f===v.length&&m]}),e.jsxs("div",{className:"nice-onboarding__footer",children:[l&&e.jsx("button",{className:"nice-onboarding__btn nice-onboarding__btn--cancel",onClick:l,type:"button",children:p("cancel","Cancel")}),e.jsxs("div",{className:"nice-onboarding__footer-right",children:[t&&f>L&&e.jsx("button",{className:"nice-onboarding__btn nice-onboarding__btn--back",onClick:Z,type:"button",children:p("back","Back")}),e.jsx("button",{className:"nice-onboarding__btn nice-onboarding__btn--next",onClick:V,disabled:!P,type:"button",children:f>=C?p("finish","Finish"):p("next","Next")})]})]})]})});cn.displayName="NiceOnboardingWizard";const Bn=[{key:"Mon",label:"Monday"},{key:"Tue",label:"Tuesday"},{key:"Wed",label:"Wednesday"},{key:"Thu",label:"Thursday"},{key:"Fri",label:"Friday"},{key:"Sat",label:"Saturday"},{key:"Sun",label:"Sunday"}],Yn=[{value:"YYYY-MM-DD",label:"YYYY-MM-DD"},{value:"DD/MM/YYYY",label:"DD/MM/YYYY"},{value:"MM/DD/YYYY",label:"MM/DD/YYYY"},{value:"DD.MM.YYYY",label:"DD.MM.YYYY"}],Se=["basic","contact","address","branding","localization","fiscal","preferences"],ue=({title:n,expanded:s,onToggle:a})=>e.jsxs("button",{className:`nice-org-form__section-header ${s?"nice-org-form__section-header--expanded":""}`,onClick:a,type:"button","aria-expanded":s,children:[e.jsx("span",{className:"nice-org-form__section-title",children:n}),e.jsx("span",{className:"nice-org-form__section-chevron",children:s?"▾":"▸"})]}),tn=c.forwardRef(({profile:n,onChange:s,onSave:a,onCancel:i,sections:l,expandedSections:_,showActions:r=!0,countryOptions:m,languageOptions:o,currencyOptions:t,timezoneOptions:u,saving:j=!1,className:x,style:b,id:$,accessMode:w,...k},M)=>{const I=T.Ss($),h=T.Bs(w,$),{t:p}=T.$o(),v=c.useMemo(()=>l&&l.length>0?l:Se,[l]),[z,g]=c.useState(()=>new Set(_??Se)),L=c.useCallback(d=>{g(E=>{const P=new Set(E);return P.has(d)?P.delete(d):P.add(d),P})},[]),C=h==="readOnly",f=h==="disabled",D=c.useCallback((d,E)=>{s?.({...n,[d]:E})},[n,s]),y=c.useCallback(()=>{a?.(n)},[n,a]);return h==="hidden"?null:e.jsxs("div",{ref:M,id:I,className:`nice-org-form ${x??""}`,style:b,...k,children:[v.includes("basic")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(ue,{title:p("org.basic","Company Information"),expanded:z.has("basic"),onToggle:()=>L("basic")}),z.has("basic")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(W.NiceTextInput,{label:p("org.name","Company Name"),value:n.name,onChange:d=>D("name",d),required:!0,disabled:f,readOnly:C}),e.jsx(W.NiceTextInput,{label:p("org.legalName","Legal Name"),value:n.legalName??"",onChange:d=>D("legalName",d),disabled:f,readOnly:C}),e.jsx(W.NiceTextInput,{label:p("org.taxId","Tax ID"),value:n.taxId??"",onChange:d=>D("taxId",d),disabled:f,readOnly:C}),e.jsx(W.NiceTextInput,{label:p("org.regNumber","Registration Number"),value:n.registrationNumber??"",onChange:d=>D("registrationNumber",d),disabled:f,readOnly:C}),e.jsx(W.NiceTextInput,{label:p("org.industry","Industry"),value:n.industry??"",onChange:d=>D("industry",d),disabled:f,readOnly:C}),e.jsx(W.NiceNumberInput,{label:p("org.employees","Number of Employees"),value:n.employeeCount??null,onChange:d=>D("employeeCount",d??void 0),min:1,disabled:f,readOnly:C})]})]}),v.includes("contact")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(ue,{title:p("org.contact","Contact Details"),expanded:z.has("contact"),onToggle:()=>L("contact")}),z.has("contact")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(W.NiceTextInput,{label:p("org.email","Email"),value:n.email??"",onChange:d=>D("email",d),type:"email",disabled:f,readOnly:C}),e.jsx(W.NiceTextInput,{label:p("org.phone","Phone"),value:n.phone??"",onChange:d=>D("phone",d),type:"tel",disabled:f,readOnly:C}),e.jsx(W.NiceTextInput,{label:p("org.website","Website"),value:n.website??"",onChange:d=>D("website",d),type:"url",disabled:f,readOnly:C}),e.jsx(W.NiceTextInput,{label:p("org.fax","Fax"),value:n.fax??"",onChange:d=>D("fax",d),type:"tel",disabled:f,readOnly:C})]})]}),v.includes("address")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(ue,{title:p("org.address","Address"),expanded:z.has("address"),onToggle:()=>L("address")}),z.has("address")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(W.NiceTextInput,{label:p("org.street","Street"),value:n.street??"",onChange:d=>D("street",d),disabled:f,readOnly:C}),e.jsx(W.NiceTextInput,{label:p("org.city","City"),value:n.city??"",onChange:d=>D("city",d),disabled:f,readOnly:C}),e.jsx(W.NiceTextInput,{label:p("org.state","State / Province"),value:n.state??"",onChange:d=>D("state",d),disabled:f,readOnly:C}),e.jsx(W.NiceTextInput,{label:p("org.postalCode","Postal Code"),value:n.postalCode??"",onChange:d=>D("postalCode",d),disabled:f,readOnly:C}),m?e.jsx(W.NiceSelect,{label:p("org.country","Country"),value:n.country??"",onChange:d=>D("country",d),options:m,searchable:!0,disabled:f,readOnly:C}):e.jsx(W.NiceTextInput,{label:p("org.country","Country"),value:n.country??"",onChange:d=>D("country",d),disabled:f,readOnly:C})]})]}),v.includes("branding")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(ue,{title:p("org.branding","Branding"),expanded:z.has("branding"),onToggle:()=>L("branding")}),z.has("branding")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(W.NiceTextInput,{label:p("org.logoUrl","Logo URL"),value:n.logoUrl??"",onChange:d=>D("logoUrl",d),type:"url",disabled:f,readOnly:C}),e.jsx(W.NiceColorPicker,{label:p("org.primaryColor","Primary Color"),value:n.primaryColor??"var(--color-primary, #3b82f6)",onChange:d=>D("primaryColor",d),disabled:f,readOnly:C}),e.jsx(W.NiceColorPicker,{label:p("org.secondaryColor","Secondary Color"),value:n.secondaryColor??"var(--color-accent, #8b5cf6)",onChange:d=>D("secondaryColor",d),disabled:f,readOnly:C})]})]}),v.includes("localization")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(ue,{title:p("org.localization","Localization"),expanded:z.has("localization"),onToggle:()=>L("localization")}),z.has("localization")&&e.jsxs("div",{className:"nice-org-form__fields",children:[o?e.jsx(W.NiceSelect,{label:p("org.language","Default Language"),value:n.defaultLanguage??"",onChange:d=>D("defaultLanguage",d),options:o,searchable:!0,disabled:f,readOnly:C}):e.jsx(W.NiceTextInput,{label:p("org.language","Default Language"),value:n.defaultLanguage??"",onChange:d=>D("defaultLanguage",d),disabled:f,readOnly:C}),t?e.jsx(W.NiceSelect,{label:p("org.currency","Default Currency"),value:n.defaultCurrency??"",onChange:d=>D("defaultCurrency",d),options:t,searchable:!0,disabled:f,readOnly:C}):e.jsx(W.NiceTextInput,{label:p("org.currency","Default Currency"),value:n.defaultCurrency??"",onChange:d=>D("defaultCurrency",d),disabled:f,readOnly:C}),u?e.jsx(W.NiceSelect,{label:p("org.timezone","Default Timezone"),value:n.defaultTimezone??"",onChange:d=>D("defaultTimezone",d),options:u,searchable:!0,disabled:f,readOnly:C}):e.jsx(W.NiceTextInput,{label:p("org.timezone","Default Timezone"),value:n.defaultTimezone??"",onChange:d=>D("defaultTimezone",d),disabled:f,readOnly:C}),e.jsx(W.NiceSelect,{label:p("org.dateFormat","Date Format"),value:n.dateFormat??"YYYY-MM-DD",onChange:d=>D("dateFormat",d),options:Yn,disabled:f,readOnly:C})]})]}),v.includes("fiscal")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(ue,{title:p("org.fiscal","Fiscal Settings"),expanded:z.has("fiscal"),onToggle:()=>L("fiscal")}),z.has("fiscal")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(W.NiceTextInput,{label:p("org.fiscalYearStart","Fiscal Year Start"),value:n.fiscalYearStart??"",onChange:d=>D("fiscalYearStart",d),placeholder:"MM-DD",disabled:f,readOnly:C}),e.jsx(W.NiceToggle,{label:p("org.vatEnabled","VAT Enabled"),checked:n.vatEnabled??!1,onChange:d=>D("vatEnabled",d),disabled:f||C}),n.vatEnabled&&e.jsx(W.NiceNumberInput,{label:p("org.defaultVatRate","Default VAT Rate (%)"),value:n.defaultVatRate??null,onChange:d=>D("defaultVatRate",d??void 0),min:0,max:100,step:.5,disabled:f,readOnly:C})]})]}),v.includes("preferences")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(ue,{title:p("org.preferences","Work Preferences"),expanded:z.has("preferences"),onToggle:()=>L("preferences")}),z.has("preferences")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsxs("div",{className:"nice-org-form__field-group",children:[e.jsx("label",{className:"nice-org-form__group-label",children:p("org.workingDays","Working Days")}),e.jsx("div",{className:"nice-org-form__checkboxes",children:Bn.map(d=>e.jsx(W.NiceCheckbox,{label:d.label,checked:(n.workingDays??["Mon","Tue","Wed","Thu","Fri"]).includes(d.key),onChange:E=>{const P=n.workingDays??["Mon","Tue","Wed","Thu","Fri"],V=E?[...P,d.key]:P.filter(Z=>Z!==d.key);D("workingDays",V)},disabled:f||C},d.key))})]}),e.jsx(W.NiceTextInput,{label:p("org.workStart","Working Hours Start"),value:n.workingHoursStart??"09:00",onChange:d=>D("workingHoursStart",d),placeholder:"HH:MM",disabled:f,readOnly:C}),e.jsx(W.NiceTextInput,{label:p("org.workEnd","Working Hours End"),value:n.workingHoursEnd??"17:00",onChange:d=>D("workingHoursEnd",d),placeholder:"HH:MM",disabled:f,readOnly:C})]})]}),r&&e.jsxs("div",{className:"nice-org-form__actions",children:[i&&e.jsx(W.NiceButton,{variant:"secondary",onClick:i,disabled:j,children:p("cancel","Cancel")}),a&&e.jsx(W.NiceButton,{variant:"primary",onClick:y,loading:j,disabled:C||f,children:p("save","Save")})]})]})});tn.displayName="NiceOrganizationProfileForm";const Fn={available:{color:"var(--text-muted, #6b7280)",icon:"○"},installed:{color:"var(--color-primary, #3b82f6)",icon:"◉"},active:{color:"var(--color-success, #10b981)",icon:"●"},disabled:{color:"var(--color-warning, #f59e0b)",icon:"◌"},error:{color:"var(--color-error, #ef4444)",icon:"⊘"},updating:{color:"var(--color-accent, #8b5cf6)",icon:"↻"}};function Un(n,s){switch(n){case"available":return["install"];case"installed":return["activate",...s?[]:["uninstall"]];case"active":return["deactivate"];case"disabled":return["activate",...s?[]:["uninstall"]];case"error":return["activate",...s?[]:["uninstall"]];case"updating":return[];default:return[]}}const Wn=({module:n,onAction:s,onClick:a,showDependencies:i,showAuthor:l,showVersion:_,processing:r,disabled:m,readOnly:o,t,layout:u})=>{const j=Fn[n.status],x=Un(n.status,n.isCore);return e.jsxs("div",{className:`nice-module-card nice-module-card--${u} nice-module-card--${n.status}`,onClick:a,role:a?"button":void 0,tabIndex:a?0:void 0,onKeyDown:a?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),a())}:void 0,children:[e.jsxs("div",{className:"nice-module-card__header",children:[e.jsx("span",{className:"nice-module-card__icon",children:n.icon??"📦"}),e.jsxs("div",{className:"nice-module-card__info",children:[e.jsx("div",{className:"nice-module-card__name",children:n.label}),_&&e.jsxs("span",{className:"nice-module-card__version",children:["v",n.version]})]}),e.jsxs("span",{className:"nice-module-card__status",style:{color:j.color},title:n.status,children:[r?"⟳":j.icon," ",n.status]})]}),e.jsx("div",{className:"nice-module-card__desc",children:n.description}),e.jsxs("div",{className:"nice-module-card__meta",children:[l&&n.author&&e.jsx("span",{className:"nice-module-card__author",children:n.author}),n.isCore&&e.jsx("span",{className:"nice-module-card__badge nice-module-card__badge--core",children:t("module.core","Core")})]}),i&&n.dependencies&&n.dependencies.length>0&&e.jsxs("div",{className:"nice-module-card__deps",children:[e.jsxs("span",{className:"nice-module-card__deps-label",children:[t("module.deps","Dependencies"),":"]}),n.dependencies.map(b=>e.jsx("span",{className:"nice-module-card__dep-tag",children:b},b))]}),!o&&x.length>0&&e.jsx("div",{className:"nice-module-card__actions",children:x.map(b=>e.jsx(W.NiceButton,{size:"sm",variant:b==="uninstall"?"error":b==="activate"?"primary":"secondary",onClick:$=>{$.stopPropagation(),s(b)},disabled:m||r,loading:r,children:t(`module.${b}`,b.charAt(0).toUpperCase()+b.slice(1))},b))})]})},rn=c.forwardRef(({modules:n,onAction:s,statusFilter:a,searchable:i=!0,showDependencies:l=!0,showAuthor:_=!0,showVersion:r=!0,processingModules:m,layout:o="list",gridColumns:t=3,onModuleClick:u,className:j,style:x,id:b,accessMode:$,...w},k)=>{const M=T.Ss(b),I=T.Bs($,b),{t:h}=T.$o(),[p,v]=c.useState(""),[z,g]=c.useState("all"),L=I==="readOnly",C=I==="disabled",f=c.useMemo(()=>{let d=n;if(a&&a.length>0&&(d=d.filter(E=>a.includes(E.status))),z!=="all"&&(d=d.filter(E=>E.status===z)),p){const E=p.toLowerCase();d=d.filter(P=>P.label.toLowerCase().includes(E)||P.name.toLowerCase().includes(E)||P.description.toLowerCase().includes(E))}return d},[n,a,z,p]),D=c.useMemo(()=>{const d={all:n.length};for(const E of n)d[E.status]=(d[E.status]??0)+1;return d},[n]),y=c.useCallback((d,E)=>{s?.(d,E)},[s]);return I==="hidden"?null:e.jsxs("div",{ref:k,id:M,className:`nice-module-panel ${j??""}`,style:x,...w,children:[e.jsxs("div",{className:"nice-module-panel__toolbar",children:[i&&e.jsx(W.NiceTextInput,{value:p,onChange:v,placeholder:h("module.search","Search modules…"),type:"search",clearable:!0,className:"nice-module-panel__search"}),e.jsx("div",{className:"nice-module-panel__filters",role:"tablist",children:["all","active","installed","disabled","available","error"].map(d=>e.jsxs("button",{className:`nice-module-panel__filter ${z===d?"nice-module-panel__filter--active":""}`,onClick:()=>g(d),role:"tab","aria-selected":z===d,type:"button",children:[h(`module.status.${d}`,d==="all"?"All":d.charAt(0).toUpperCase()+d.slice(1)),e.jsx("span",{className:"nice-module-panel__filter-count",children:D[d]??0})]},d))})]}),e.jsx("div",{className:`nice-module-panel__grid nice-module-panel__grid--${o}`,style:o==="grid"?{gridTemplateColumns:`repeat(${t}, 1fr)`}:void 0,children:f.length===0?e.jsx("div",{className:"nice-module-panel__empty",children:h("module.empty","No modules found")}):f.map(d=>e.jsx(Wn,{module:d,onAction:E=>y(d.id,E),onClick:u?()=>u(d):void 0,showDependencies:l,showAuthor:_,showVersion:r,processing:m?.has(d.id)??!1,disabled:C,readOnly:L,t:h,layout:o},d.id))}),e.jsxs("div",{className:"nice-module-panel__summary",children:[h("module.total","Total"),": ",n.length," ·",h("module.status.active","Active"),":"," ",D.active??0," ·",h("module.status.disabled","Disabled"),":"," ",D.disabled??0," ·",h("module.status.error","Error"),":"," ",D.error??0]})]})});rn.displayName="NiceModuleLifecyclePanel";exports.DEFAULT_SIDEBAR_PREFS=ge;exports.DesktopContextMenu=Oe;exports.DesktopGrid=Le;exports.DesktopStartMenu=Ie;exports.DesktopSystemTray=Re;exports.DesktopTaskbar=fe;exports.NiceAccordion=_n;exports.NiceAppLayout=Me;exports.NiceBottomNavigation=De;exports.NiceBreadcrumb=hn;exports.NiceCard=mn;exports.NiceClassicShell=Ge;exports.NiceCompactShell=qe;exports.NiceConsole=Be;exports.NiceContextMenu=bn;exports.NiceDashboardLayout=ze;exports.NiceDashboardShell=Ze;exports.NiceDesktop=Ae;exports.NiceDock=Ee;exports.NiceDynamicSidebar=Ve;exports.NiceHybridShell=sn;exports.NiceKioskShell=Je;exports.NiceMdiWorkspace=Xe;exports.NiceMegaMenu=Te;exports.NiceMenu=$e;exports.NiceMinimalShell=nn;exports.NiceModeSelector=ln;exports.NiceModernShell=en;exports.NiceModuleLifecyclePanel=rn;exports.NiceMultiView=pn;exports.NiceNavbar=We;exports.NiceOnboardingWizard=cn;exports.NiceOrganizationProfileForm=tn;exports.NicePwaShell=an;exports.NiceSetupWizard=Ue;exports.NiceSidebarNav=Ln;exports.NiceSplitter=Nn;exports.NiceTabPanel=xn;exports.NiceTenantSwitcher=Pe;exports.NiceToolbar=vn;exports.NiceUserMenu=He;exports.NiceWizard=Ye;exports.SIDEBAR_MODE_META=be;exports.useSetupWizard=fn;
|