@nice2dev/ui 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- .nice-html-editor-ai{--ai-primary: var(--color-info, #3b82f6);--ai-primary-light: var(--nice-accent, #818cf8);--ai-bg: var(--bg-secondary, #f8fafc);--ai-border: var(--border-color, #e5e7eb);--ai-text: var(--text-primary, #0f172a);--ai-text-muted: var(--text-secondary, #475569);--ai-success: var(--color-success, #10b981);--ai-panel-bg: var(--bg-primary, #ffffff);--ai-translate: var(--color-info, #3b82f6);--ai-improve: var(--color-warning, #f59e0b);position:relative;display:flex;flex-direction:column;border-radius:var(--nice-radius-lg, 8px);overflow:hidden;border:1px solid var(--ai-border)}[data-theme=dark] .nice-html-editor-ai,.nice-html-editor-ai.dark{--ai-primary: var(--nice-accent, #818cf8);--ai-primary-light: var(--nice-accent, #a5b4fc);--ai-bg: var(--text-primary, #0f172a);--ai-border: var(--text-primary, #0f172a);--ai-text: var(--border-color, #e5e7eb);--ai-text-muted: var(--text-muted, #94a3b8);--ai-success: var(--color-success, #10b981);--ai-panel-bg: var(--text-primary, #0f172a)}.nice-html-editor-ai__toolbar{display:flex;align-items:center;justify-content:space-between;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);background:linear-gradient(135deg,var(--color-info, #3b82f6) 0%,var(--nice-accent, #8b5cf6) 100%);gap:var(--nice-space-2, 8px)}.nice-html-editor-ai__toolbar-left{display:flex;align-items:center;gap:var(--nice-space-3, 12px)}.nice-html-editor-ai__badge{display:inline-flex;align-items:center;justify-content:center;padding:var(--nice-space-0-5, 2px) var(--nice-space-2, 8px);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--ai-primary);background:#fff;border-radius:var(--nice-radius-sm, 4px)}.nice-html-editor-ai__loading{font-size:12px;color:#fff;opacity:.9;animation:pulse-opacity 1.5s ease-in-out infinite}.nice-html-editor-ai__toolbar-right{display:flex;align-items:center;gap:var(--nice-space-1, 4px)}.nice-html-editor-ai__btn{display:inline-flex;align-items:center;gap:var(--nice-space-1, 4px);padding:var(--nice-space-1-5, 6px) var(--nice-space-3, 12px);font-size:12px;font-weight:500;color:#fff;background:var(--nice-overlay-light-15, color-mix(in srgb, var(--text-on-primary, #fff) 15%, transparent));border:1px solid var(--nice-overlay-light-20, color-mix(in srgb, var(--text-on-primary, #fff) 20%, transparent));border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__btn:hover:not(:disabled){background:var(--nice-overlay-light-25, color-mix(in srgb, var(--text-on-primary, #fff) 25%, transparent));border-color:var(--nice-overlay-light-40, color-mix(in srgb, var(--text-on-primary, #fff) 40%, transparent))}.nice-html-editor-ai__btn:disabled{opacity:.5;cursor:not-allowed}.nice-html-editor-ai__dropdown{position:relative}.nice-html-editor-ai__dropdown-menu{position:absolute;top:100%;left:0;min-width:140px;margin-top:var(--nice-space-1, 4px);padding:var(--nice-space-1, 4px) 0;background:var(--ai-panel-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);box-shadow:0 10px 25px var(--nice-overlay-15, color-mix(in srgb, var(--text-primary, #000) 15%, transparent));opacity:0;visibility:hidden;transform:translateY(-8px);transition:all .15s ease;z-index:100}.nice-html-editor-ai__dropdown:hover .nice-html-editor-ai__dropdown-menu{opacity:1;visibility:visible;transform:translateY(0)}.nice-html-editor-ai__dropdown-menu--languages{max-height:240px;overflow-y:auto}.nice-html-editor-ai__dropdown-item{display:block;width:100%;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);font-size:13px;color:var(--ai-text);background:transparent;border:none;text-align:left;cursor:pointer;transition:background .1s ease}.nice-html-editor-ai__dropdown-item:hover{background:var(--ai-bg)}.nice-html-editor-ai__editor-wrapper{flex:1;min-height:200px}.nice-html-editor-ai__panel{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:90%;max-width:700px;max-height:80vh;background:var(--ai-panel-bg);border-radius:var(--nice-radius-xl, 12px);box-shadow:0 25px 50px var(--nice-overlay-25, color-mix(in srgb, var(--text-primary, #000) 25%, transparent));display:flex;flex-direction:column;z-index:1000;animation:fadeIn .2s ease-out}@keyframes fadeIn{0%{opacity:0;transform:translate(-50%,-50%) scale(.95)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}.nice-html-editor-ai__panel-header{display:flex;align-items:center;justify-content:space-between;padding:var(--nice-space-4, 16px) var(--nice-space-5, 20px);background:var(--ai-bg);border-bottom:1px solid var(--ai-border);border-radius:var(--nice-radius-xl, 12px) var(--nice-radius-xl, 12px) 0 0;gap:var(--nice-space-3, 12px);flex-wrap:wrap}.nice-html-editor-ai__panel-header h4{margin:0;font-size:16px;font-weight:600;color:var(--ai-text)}.nice-html-editor-ai__close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;font-size:16px;color:var(--ai-text-muted);background:transparent;border:none;border-radius:var(--nice-radius-md, 6px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__close:hover{color:var(--ai-text);background:var(--ai-border)}.nice-html-editor-ai__panel-body{flex:1;overflow-y:auto;padding:var(--nice-space-5, 20px)}.nice-html-editor-ai__panel-footer{display:flex;justify-content:flex-end;gap:var(--nice-space-2, 8px);padding:var(--nice-space-4, 16px) var(--nice-space-5, 20px);border-top:1px solid var(--ai-border)}.nice-html-editor-ai__style-selector{display:flex;gap:var(--nice-space-1, 4px)}.nice-html-editor-ai__style-btn{padding:var(--nice-space-1, 4px) var(--nice-space-2-5, 10px);font-size:12px;font-weight:500;color:var(--ai-text-muted);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__style-btn:hover{color:var(--ai-text);border-color:var(--ai-text-muted)}.nice-html-editor-ai__style-btn--active{color:#fff;background:var(--ai-primary);border-color:var(--ai-primary)}.nice-html-editor-ai__language-select{padding:var(--nice-space-1-5, 6px) var(--nice-space-2-5, 10px);font-size:13px;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);outline:none;cursor:pointer}.nice-html-editor-ai__language-select:focus{border-color:var(--ai-primary)}.nice-html-editor-ai__comparison{display:grid;grid-template-columns:1fr 1fr;gap:var(--nice-space-4, 16px)}.nice-html-editor-ai__text-block{display:flex;flex-direction:column;gap:var(--nice-space-2, 8px)}.nice-html-editor-ai__text-block h5{margin:0;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--ai-text-muted)}.nice-html-editor-ai__text-content{padding:var(--nice-space-3, 12px);font-size:14px;line-height:1.6;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);min-height:100px;white-space:pre-wrap}.nice-html-editor-ai__text-block--improved h5{color:var(--ai-improve)}.nice-html-editor-ai__text-block--improved .nice-html-editor-ai__text-content{border-color:var(--ai-improve);background:#f59e0b0d}.nice-html-editor-ai__text-block--translated h5{color:var(--ai-translate)}.nice-html-editor-ai__text-block--translated .nice-html-editor-ai__text-content{border-color:var(--ai-translate);background:#0ea5e90d}.nice-html-editor-ai__loading-panel{display:flex;align-items:center;justify-content:center;padding:var(--nice-space-10, 40px);color:var(--ai-primary);font-size:14px}.nice-html-editor-ai__loading-panel:before{content:"";display:inline-block;width:18px;height:18px;margin-right:var(--nice-space-2-5, 10px);border:2px solid var(--ai-border);border-top-color:var(--ai-primary);border-radius:var(--nice-radius-full, 50%);animation:spin .8s linear infinite}.nice-html-editor-ai__generate-input{display:flex;flex-direction:column;gap:var(--nice-space-3, 12px);margin-bottom:var(--nice-space-4, 16px)}.nice-html-editor-ai__generate-textarea{width:100%;padding:var(--nice-space-3, 12px);font-size:14px;font-family:inherit;line-height:1.5;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);resize:vertical;outline:none;transition:border-color .15s ease}.nice-html-editor-ai__generate-textarea:focus{border-color:var(--ai-primary)}.nice-html-editor-ai__generate-textarea::placeholder{color:var(--ai-text-muted)}.nice-html-editor-ai__generate-btn{align-self:flex-end;padding:var(--nice-space-2-5, 10px) var(--nice-space-6, 24px);font-size:14px;font-weight:500;color:#fff;background:var(--ai-primary);border:none;border-radius:var(--nice-radius-md, 6px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__generate-btn:hover:not(:disabled){background:var(--ai-primary-light)}.nice-html-editor-ai__generate-btn:disabled{opacity:.6;cursor:not-allowed}.nice-html-editor-ai__generate-result{margin-top:var(--nice-space-4, 16px)}.nice-html-editor-ai__generate-result h5{margin:0 0 var(--nice-space-2, 8px);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--ai-text-muted)}.nice-html-editor-ai__preview{padding:var(--nice-space-4, 16px);margin-bottom:var(--nice-space-4, 16px);background:#fff;border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);line-height:1.6}.nice-html-editor-ai__code{margin:0;padding:var(--nice-space-3, 12px);font-family:Fira Code,Consolas,monospace;font-size:12px;line-height:1.5;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);overflow-x:auto;max-height:200px;white-space:pre-wrap}.nice-html-editor-ai__apply{padding:var(--nice-space-2, 8px) var(--nice-space-5, 20px);font-size:14px;font-weight:500;color:#fff;background:var(--ai-success);border:none;border-radius:var(--nice-radius-md, 6px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__apply:hover:not(:disabled){background:var(--color-success, #10b981)}.nice-html-editor-ai__apply:disabled{opacity:.6;cursor:not-allowed}.nice-html-editor-ai__cancel{padding:var(--nice-space-2, 8px) var(--nice-space-5, 20px);font-size:14px;font-weight:500;color:var(--ai-text-muted);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__cancel:hover{color:var(--ai-text);background:var(--ai-bg)}@media(max-width:640px){.nice-html-editor-ai__toolbar{flex-wrap:wrap}.nice-html-editor-ai__toolbar-right{width:100%;justify-content:flex-start;margin-top:var(--nice-space-2, 8px);flex-wrap:wrap}.nice-html-editor-ai__panel{width:95%;max-height:90vh}.nice-html-editor-ai__comparison{grid-template-columns:1fr}.nice-html-editor-ai__panel-header{flex-direction:column;align-items:flex-start}.nice-html-editor-ai__style-selector{flex-wrap:wrap;margin-top:var(--nice-space-2, 8px)}}.nice-html-editor-ai__panel:before{content:"";position:fixed;inset:0;background:var(--nice-overlay-40, color-mix(in srgb, var(--text-primary, #000) 40%, transparent));z-index:-1}.nice-code-editor-ai{--ai-primary: var(--color-info, #3b82f6);--ai-primary-light: var(--nice-accent, #818cf8);--ai-bg: var(--bg-secondary, #f8fafc);--ai-border: var(--border-color, #e5e7eb);--ai-text: var(--text-primary, #0f172a);--ai-text-muted: var(--text-secondary, #475569);--ai-ghost: var(--nice-accent-tint-40, rgba(99, 102, 241, .4));--ai-success: var(--color-success, #10b981);--ai-panel-bg: var(--bg-primary, #ffffff);position:relative;display:flex;flex-direction:column;border-radius:var(--nice-radius-lg, 8px);overflow:hidden;border:1px solid var(--ai-border)}[data-theme=dark] .nice-code-editor-ai,.nice-code-editor-ai.dark{--ai-primary: var(--nice-accent, #818cf8);--ai-primary-light: var(--nice-accent, #a5b4fc);--ai-bg: var(--text-primary, #0f172a);--ai-border: var(--text-primary, #0f172a);--ai-text: var(--border-color, #e5e7eb);--ai-text-muted: var(--text-muted, #94a3b8);--ai-ghost: rgba(129, 140, 248, .5);--ai-success: var(--color-success, #10b981);--ai-panel-bg: var(--text-primary, #0f172a)}.nice-code-editor-ai__toolbar{display:flex;align-items:center;justify-content:space-between;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);background:var(--ai-bg);border-bottom:1px solid var(--ai-border);gap:var(--nice-space-2, 8px)}.nice-code-editor-ai__toolbar-left{display:flex;align-items:center;gap:var(--nice-space-3, 12px)}.nice-code-editor-ai__toolbar-badge{display:inline-flex;align-items:center;justify-content:center;padding:var(--nice-space-0-5, 2px) var(--nice-space-2, 8px);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:#fff;background:linear-gradient(135deg,var(--ai-primary) 0%,var(--ai-primary-light) 100%);border-radius:var(--nice-radius-sm, 4px)}.nice-code-editor-ai__loading{font-size:12px;color:var(--ai-primary);animation:pulse-opacity 1.5s ease-in-out infinite}@keyframes pulse-opacity{0%,to{opacity:.5}50%{opacity:1}}.nice-code-editor-ai__toolbar-right{display:flex;align-items:center;gap:var(--nice-space-1, 4px)}.nice-code-editor-ai__toolbar-btn{display:inline-flex;align-items:center;gap:var(--nice-space-1, 4px);padding:var(--nice-space-1, 4px) var(--nice-space-2-5, 10px);font-size:12px;font-weight:500;color:var(--ai-text);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-code-editor-ai__toolbar-btn:hover:not(:disabled){background:var(--ai-primary);color:#fff;border-color:var(--ai-primary)}.nice-code-editor-ai__toolbar-btn:disabled{opacity:.5;cursor:not-allowed}.nice-code-editor-ai__editor-wrapper{position:relative;flex:1;min-height:200px}.nice-code-editor-ai__ghost-text{position:absolute;pointer-events:none;z-index:10;display:flex;align-items:flex-start;gap:var(--nice-space-2, 8px)}.nice-code-editor-ai__ghost-text-content{font-family:Fira Code,Consolas,Monaco,monospace;font-size:14px;line-height:19px;color:var(--ai-ghost);white-space:pre}.nice-code-editor-ai__ghost-text-hint{display:inline-flex;align-items:center;padding:var(--nice-space-0-5, 2px) var(--nice-space-1-5, 6px);font-size:10px;font-weight:500;color:var(--ai-text-muted);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 3px);margin-left:var(--nice-space-2, 8px);opacity:.8}.nice-code-editor-ai__panel{position:absolute;bottom:0;left:0;right:0;max-height:50%;background:var(--ai-panel-bg);border-top:2px solid var(--ai-primary);display:flex;flex-direction:column;z-index:100;animation:slideUp .2s ease-out}@keyframes slideUp{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}.nice-code-editor-ai__panel-header{display:flex;align-items:center;justify-content:space-between;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);background:var(--ai-bg);border-bottom:1px solid var(--ai-border)}.nice-code-editor-ai__panel-header h4{margin:0;font-size:14px;font-weight:600;color:var(--ai-text)}.nice-code-editor-ai__panel-close{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;font-size:14px;color:var(--ai-text-muted);background:transparent;border:none;border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-code-editor-ai__panel-close:hover{color:var(--ai-text);background:var(--ai-border)}.nice-code-editor-ai__panel-body{flex:1;overflow-y:auto;padding:var(--nice-space-3, 12px)}.nice-code-editor-ai__panel-loading{display:flex;align-items:center;justify-content:center;padding:var(--nice-space-6, 24px);color:var(--ai-primary);font-size:14px}.nice-code-editor-ai__panel-loading:before{content:"";display:inline-block;width:16px;height:16px;margin-right:var(--nice-space-2, 8px);border:2px solid var(--ai-border);border-top-color:var(--ai-primary);border-radius:var(--nice-radius-full, 50%);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.nice-code-editor-ai__code-preview{margin:0 0 var(--nice-space-3, 12px);padding:var(--nice-space-3, 12px);font-family:Fira Code,Consolas,Monaco,monospace;font-size:12px;line-height:1.5;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);overflow-x:auto;max-height:120px;white-space:pre-wrap}.nice-code-editor-ai__code-preview--result{border-color:var(--ai-success);background:#22c55e0d}.nice-code-editor-ai__explanation{display:flex;flex-direction:column;gap:var(--nice-space-3, 12px)}.nice-code-editor-ai__explanation-text{font-size:14px;line-height:1.6;color:var(--ai-text);white-space:pre-wrap}.nice-code-editor-ai__refactor-input{display:flex;gap:var(--nice-space-2, 8px);margin-bottom:var(--nice-space-3, 12px)}.nice-code-editor-ai__refactor-input input{flex:1;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);font-size:13px;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);outline:none;transition:border-color .15s ease}.nice-code-editor-ai__refactor-input input:focus{border-color:var(--ai-primary)}.nice-code-editor-ai__refactor-input input::placeholder{color:var(--ai-text-muted)}.nice-code-editor-ai__refactor-btn{padding:var(--nice-space-2, 8px) var(--nice-space-4, 16px);font-size:13px;font-weight:500;color:#fff;background:var(--ai-primary);border:none;border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease;white-space:nowrap}.nice-code-editor-ai__refactor-btn:hover:not(:disabled){background:var(--ai-primary-light)}.nice-code-editor-ai__refactor-btn:disabled{opacity:.6;cursor:not-allowed}.nice-code-editor-ai__refactor-result{margin-top:var(--nice-space-3, 12px)}.nice-code-editor-ai__refactor-result h5{margin:0 0 var(--nice-space-2, 8px);font-size:13px;font-weight:600;color:var(--ai-success)}.nice-code-editor-ai__refactor-actions{display:flex;gap:var(--nice-space-2, 8px);margin-top:var(--nice-space-3, 12px)}.nice-code-editor-ai__refactor-apply{padding:var(--nice-space-1-5, 6px) var(--nice-space-4, 16px);font-size:13px;font-weight:500;color:#fff;background:var(--ai-success);border:none;border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-code-editor-ai__refactor-apply:hover{background:var(--color-success, #10b981)}.nice-code-editor-ai__refactor-discard{padding:var(--nice-space-1-5, 6px) var(--nice-space-4, 16px);font-size:13px;font-weight:500;color:var(--ai-text-muted);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-code-editor-ai__refactor-discard:hover{color:var(--ai-text);background:var(--ai-bg)}.nice-code-editor-ai--sm .nice-code-editor-ai__toolbar{padding:var(--nice-space-1-5, 6px) var(--nice-space-2, 8px)}.nice-code-editor-ai--sm .nice-code-editor-ai__toolbar-btn{padding:var(--nice-space-0-5, 2px) var(--nice-space-1-5, 6px);font-size:11px}.nice-code-editor-ai--lg .nice-code-editor-ai__toolbar{padding:var(--nice-space-2-5, 10px) var(--nice-space-4, 16px)}.nice-code-editor-ai--lg .nice-code-editor-ai__toolbar-btn{padding:var(--nice-space-1-5, 6px) var(--nice-space-3-5, 14px);font-size:14px}@media(max-width:640px){.nice-code-editor-ai__toolbar{flex-wrap:wrap}.nice-code-editor-ai__toolbar-right{width:100%;justify-content:flex-start;margin-top:var(--nice-space-2, 8px);flex-wrap:wrap}.nice-code-editor-ai__panel{max-height:70%}.nice-code-editor-ai__refactor-input{flex-direction:column}}.nice-emoji-picker{display:flex;flex-direction:column;width:320px;max-height:400px;background:var(--bg-primary, #fff);border:1px solid var(--border-color, #e5e7eb);border-radius:var(--nice-radius-lg, 8px);box-shadow:0 4px 12px var(--nice-overlay-10, color-mix(in srgb, var(--text-primary, #000) 10%, transparent));font-family:inherit;overflow:hidden}.nice-emoji-picker--sm{width:280px;max-height:340px}.nice-emoji-picker--sm .nice-emoji-picker__emoji{width:28px;height:28px;font-size:16px}.nice-emoji-picker--lg{width:400px;max-height:500px}.nice-emoji-picker--lg .nice-emoji-picker__emoji{width:40px;height:40px;font-size:26px}.nice-emoji-picker__search{display:flex;align-items:center;gap:var(--nice-space-2, 8px);padding:var(--nice-space-2-5, 10px);border-bottom:1px solid var(--border-color, #e5e7eb);flex-shrink:0}.nice-emoji-picker__search-input{flex:1;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);border:1px solid var(--border-color, #d1d5db);border-radius:var(--nice-radius-md, 6px);font-size:14px;background:var(--bg-primary, #fff);color:var(--text-primary, #1f2937)}.nice-emoji-picker__search-input:focus{outline:none;border-color:var(--color-primary, #3b82f6);box-shadow:0 0 0 2px var(--color-primary, #6366f1) )}.nice-emoji-picker__search-input::placeholder{color:var(--text-secondary, #9ca3af)}.nice-emoji-picker__skin-tone-wrapper{position:relative;flex-shrink:0}.nice-emoji-picker__skin-tone-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid var(--border-color, #d1d5db);border-radius:var(--nice-radius-md, 6px);background:var(--bg-primary, #fff);cursor:pointer;font-size:18px;transition:border-color .15s,background .15s}.nice-emoji-picker__skin-tone-btn:hover{background:var(--hover-bg, #f3f4f6)}.nice-emoji-picker__skin-tone-menu{position:absolute;top:100%;right:0;margin-top:var(--nice-space-1, 4px);display:flex;gap:var(--nice-space-1, 4px);padding:var(--nice-space-1-5, 6px);background:var(--bg-primary, #fff);border:1px solid var(--border-color, #e5e7eb);border-radius:var(--nice-radius-lg, 8px);box-shadow:0 4px 12px var(--nice-overlay-15, color-mix(in srgb, var(--text-primary, #000) 15%, transparent));z-index:10}.nice-emoji-picker__skin-tone-option{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:2px solid transparent;border-radius:var(--nice-radius-md, 6px);background:transparent;cursor:pointer;font-size:18px;transition:background .15s,border-color .15s}.nice-emoji-picker__skin-tone-option:hover{background:var(--hover-bg, #f3f4f6)}.nice-emoji-picker__skin-tone-option--selected{border-color:var(--color-primary, #3b82f6);background:var(--color-primary-light, #dbeafe)}.nice-emoji-picker__categories{display:flex;border-bottom:1px solid var(--border-color, #e5e7eb);padding:var(--nice-space-1, 4px) var(--nice-space-2, 8px);gap:var(--nice-space-0-5, 2px);flex-shrink:0;overflow-x:auto}.nice-emoji-picker__category-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:var(--nice-radius-md, 6px);background:transparent;cursor:pointer;font-size:18px;flex-shrink:0;transition:background .15s}.nice-emoji-picker__category-btn:hover{background:var(--hover-bg, #f3f4f6)}.nice-emoji-picker__category-btn--selected{background:var(--color-primary-light, #dbeafe)}.nice-emoji-picker__grid-container{flex:1;overflow-y:auto;padding:var(--nice-space-2, 8px)}.nice-emoji-picker__section{margin-bottom:var(--nice-space-3, 12px)}.nice-emoji-picker__section:last-child{margin-bottom:0}.nice-emoji-picker__section-title{font-size:12px;font-weight:600;color:var(--text-secondary, #6b7280);text-transform:uppercase;letter-spacing:.05em;margin-bottom:var(--nice-space-2, 8px);padding-left:var(--nice-space-1, 4px)}.nice-emoji-picker__grid{display:grid;gap:var(--nice-space-0-5, 2px)}.nice-emoji-picker__emoji{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border:none;border-radius:var(--nice-radius-md, 6px);background:transparent;cursor:pointer;font-size:22px;transition:background .15s,transform .1s}.nice-emoji-picker__emoji:hover{background:var(--hover-bg, #f3f4f6);transform:scale(1.15)}.nice-emoji-picker__emoji:active{transform:scale(1.05)}.nice-emoji-picker__emoji--custom img{width:24px;height:24px;object-fit:contain}.nice-emoji-picker__empty{grid-column:1 / -1;padding:var(--nice-space-6, 24px);text-align:center;color:var(--text-secondary, #6b7280);font-size:13px}.nice-emoji-picker__grid-container::-webkit-scrollbar{width:8px}.nice-emoji-picker__grid-container::-webkit-scrollbar-track{background:transparent}.nice-emoji-picker__grid-container::-webkit-scrollbar-thumb{background:var(--border-color, #d1d5db);border-radius:var(--nice-radius-sm, 4px)}.nice-emoji-picker__grid-container::-webkit-scrollbar-thumb:hover{background:var(--text-secondary, #9ca3af)}.nice-crop-editor{display:flex;flex-direction:column;gap:var(--nice-space-4, 16px);width:100%;max-width:600px;font-family:inherit}.nice-crop-editor__container{position:relative;width:100%;height:0;padding-bottom:75%;background:var(--bg-primary, #ffffff);border-radius:var(--nice-radius-lg, 8px);overflow:hidden;user-select:none}.nice-crop-editor__image{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain;pointer-events:none}.nice-crop-editor__overlay{position:absolute;inset:0;pointer-events:none}.nice-crop-editor__overlay-piece{position:absolute;background:var(--nice-overlay-50, color-mix(in srgb, var(--text-primary, #000) 50%, transparent))}.nice-crop-editor__crop-area{position:absolute;border:2px solid var(--bg-primary, #ffffff);box-shadow:0 0 0 9999px var(--nice-overlay-50, color-mix(in srgb, var(--text-primary, #000) 50%, transparent));cursor:move;box-sizing:border-box}.nice-crop-editor__grid{position:absolute;inset:0;pointer-events:none}.nice-crop-editor__grid-line{position:absolute;background:var(--nice-overlay-light-40, color-mix(in srgb, var(--text-on-primary, #fff) 40%, transparent))}.nice-crop-editor__grid-line--h1{left:0;right:0;top:33.33%;height:1px}.nice-crop-editor__grid-line--h2{left:0;right:0;top:66.66%;height:1px}.nice-crop-editor__grid-line--v1{top:0;bottom:0;left:33.33%;width:1px}.nice-crop-editor__grid-line--v2{top:0;bottom:0;left:66.66%;width:1px}.nice-crop-editor__handle{position:absolute;width:12px;height:12px;background:var(--bg-primary, #FFF);border:2px solid var(--color-primary, #3b82f6);border-radius:var(--nice-radius-sm, 2px);z-index:1}.nice-crop-editor__handle:hover{background:var(--color-primary, #3b82f6)}.nice-crop-editor__handle--nw{top:-6px;left:-6px;cursor:nw-resize}.nice-crop-editor__handle--ne{top:-6px;right:-6px;cursor:ne-resize}.nice-crop-editor__handle--sw{bottom:-6px;left:-6px;cursor:sw-resize}.nice-crop-editor__handle--se{bottom:-6px;right:-6px;cursor:se-resize}.nice-crop-editor__handle--n{top:-6px;left:50%;transform:translate(-50%);cursor:n-resize}.nice-crop-editor__handle--s{bottom:-6px;left:50%;transform:translate(-50%);cursor:s-resize}.nice-crop-editor__handle--e{right:-6px;top:50%;transform:translateY(-50%);cursor:e-resize}.nice-crop-editor__handle--w{left:-6px;top:50%;transform:translateY(-50%);cursor:w-resize}.nice-crop-editor__controls{display:flex;flex-direction:column;gap:var(--nice-space-3, 12px);padding:var(--nice-space-3, 12px);background:var(--bg-primary, #fff);color:var(--text-primary, inherit);border:1px solid var(--border-color, #e5e7eb);border-radius:var(--nice-radius-lg, 8px)}.nice-crop-editor__control-group{display:flex;flex-direction:column;gap:var(--nice-space-1-5, 6px)}.nice-crop-editor__control-group--row{flex-direction:row;align-items:center;gap:var(--nice-space-2, 8px)}.nice-crop-editor__label{font-size:12px;font-weight:600;color:var(--text-secondary, #6b7280);text-transform:uppercase;letter-spacing:.05em}.nice-crop-editor__aspect-buttons{display:flex;flex-wrap:wrap;gap:var(--nice-space-1-5, 6px)}.nice-crop-editor__aspect-btn{padding:var(--nice-space-1-5, 6px) var(--nice-space-3, 12px);border:1px solid var(--border-color, #d1d5db);border-radius:var(--nice-radius-md, 6px);background:var(--bg-primary, #fff);color:var(--text-primary, #1f2937);font-size:13px;cursor:pointer;transition:background .15s,border-color .15s,color .15s}.nice-crop-editor__aspect-btn:hover{background:var(--hover-bg, color-mix(in srgb, var(--color-primary, #3b82f6) 8%, transparent))}.nice-crop-editor__aspect-btn--selected{background:var(--color-primary, #3b82f6);border-color:var(--color-primary, #3b82f6);color:var(--text-on-primary, #FFF)}.nice-crop-editor__aspect-btn--selected:hover{background:var(--color-primary-hover, var(--color-primary, #2563eb));filter:brightness(.95)}.nice-crop-editor__slider{width:100%;height:6px;appearance:none;background:var(--border-color, #d1d5db);border-radius:var(--nice-radius-sm, 3px);cursor:pointer}.nice-crop-editor__slider::-webkit-slider-thumb{appearance:none;width:18px;height:18px;background:var(--color-primary, #3b82f6);border-radius:var(--nice-radius-full, 50%);cursor:pointer;transition:background .15s}.nice-crop-editor__slider::-webkit-slider-thumb:hover{filter:brightness(.95)}.nice-crop-editor__slider::-moz-range-thumb{width:18px;height:18px;background:var(--color-primary, #3b82f6);border:none;border-radius:var(--nice-radius-full, 50%);cursor:pointer}.nice-crop-editor__btn{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid var(--border-color, #d1d5db);border-radius:var(--nice-radius-md, 6px);background:var(--bg-primary, #fff);color:var(--text-primary, #1f2937);font-size:18px;cursor:pointer;transition:background .15s,border-color .15s,color .15s}.nice-crop-editor__btn:hover{background:var(--hover-bg, color-mix(in srgb, var(--color-primary, #3b82f6) 8%, transparent))}.nice-crop-editor__btn--active{background:var(--color-primary, #3b82f6);border-color:var(--color-primary, #3b82f6);color:var(--text-on-primary, #FFF)}.nice-crop-editor__btn--reset{margin-left:auto;color:var(--color-danger, #ef4444)}.nice-crop-editor__btn--reset:hover{background:color-mix(in srgb,var(--color-danger, #ef4444) 14%,transparent)}
1
+ .nice-html-editor-ai{--ai-primary: var(--color-info, #3b82f6);--ai-primary-light: var(--nice-accent, #818cf8);--ai-bg: var(--bg-secondary, #f8fafc);--ai-border: var(--border-color, #e5e7eb);--ai-text: var(--text-primary, #0f172a);--ai-text-muted: var(--text-secondary, #475569);--ai-success: var(--color-success, #10b981);--ai-panel-bg: var(--bg-primary, #ffffff);--ai-translate: var(--color-info, #3b82f6);--ai-improve: var(--color-warning, #f59e0b);position:relative;display:flex;flex-direction:column;border-radius:var(--nice-radius-lg, 8px);overflow:hidden;border:1px solid var(--ai-border)}[data-theme=dark] .nice-html-editor-ai,.nice-html-editor-ai.dark{--ai-primary: var(--nice-accent, #818cf8);--ai-primary-light: var(--nice-accent, #a5b4fc);--ai-bg: var(--text-primary, #0f172a);--ai-border: var(--text-primary, #0f172a);--ai-text: var(--border-color, #e5e7eb);--ai-text-muted: var(--text-muted, #94a3b8);--ai-success: var(--color-success, #10b981);--ai-panel-bg: var(--text-primary, #0f172a)}.nice-html-editor-ai__toolbar{display:flex;align-items:center;justify-content:space-between;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);background:linear-gradient(135deg,var(--color-info, #3b82f6) 0%,var(--nice-accent, #8b5cf6) 100%);gap:var(--nice-space-2, 8px)}.nice-html-editor-ai__toolbar-left{display:flex;align-items:center;gap:var(--nice-space-3, 12px)}.nice-html-editor-ai__badge{display:inline-flex;align-items:center;justify-content:center;padding:var(--nice-space-0-5, 2px) var(--nice-space-2, 8px);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--ai-primary);background:#fff;border-radius:var(--nice-radius-sm, 4px)}.nice-html-editor-ai__loading{font-size:12px;color:#fff;opacity:.9;animation:pulse-opacity 1.5s ease-in-out infinite}.nice-html-editor-ai__toolbar-right{display:flex;align-items:center;gap:var(--nice-space-1, 4px)}.nice-html-editor-ai__btn{display:inline-flex;align-items:center;gap:var(--nice-space-1, 4px);padding:var(--nice-space-1-5, 6px) var(--nice-space-3, 12px);font-size:12px;font-weight:500;color:#fff;background:var(--nice-overlay-light-15, color-mix(in srgb, var(--text-on-primary, #fff) 15%, transparent));border:1px solid var(--nice-overlay-light-20, color-mix(in srgb, var(--text-on-primary, #fff) 20%, transparent));border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__btn:hover:not(:disabled){background:var(--nice-overlay-light-25, color-mix(in srgb, var(--text-on-primary, #fff) 25%, transparent));border-color:var(--nice-overlay-light-40, color-mix(in srgb, var(--text-on-primary, #fff) 40%, transparent))}.nice-html-editor-ai__btn:disabled{opacity:.5;cursor:not-allowed}.nice-html-editor-ai__dropdown{position:relative}.nice-html-editor-ai__dropdown-menu{position:absolute;top:100%;left:0;min-width:140px;margin-top:var(--nice-space-1, 4px);padding:var(--nice-space-1, 4px) 0;background:var(--ai-panel-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);box-shadow:0 10px 25px var(--nice-overlay-15, color-mix(in srgb, var(--text-primary, #000) 15%, transparent));opacity:0;visibility:hidden;transform:translateY(-8px);transition:all .15s ease;z-index:100}.nice-html-editor-ai__dropdown:hover .nice-html-editor-ai__dropdown-menu{opacity:1;visibility:visible;transform:translateY(0)}.nice-html-editor-ai__dropdown-menu--languages{max-height:240px;overflow-y:auto}.nice-html-editor-ai__dropdown-item{display:block;width:100%;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);font-size:13px;color:var(--ai-text);background:transparent;border:none;text-align:left;cursor:pointer;transition:background .1s ease}.nice-html-editor-ai__dropdown-item:hover{background:var(--ai-bg)}.nice-html-editor-ai__editor-wrapper{flex:1;min-height:200px}.nice-html-editor-ai__panel{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:90%;max-width:700px;max-height:80vh;background:var(--ai-panel-bg);border-radius:var(--nice-radius-xl, 12px);box-shadow:0 25px 50px var(--nice-overlay-25, color-mix(in srgb, var(--text-primary, #000) 25%, transparent));display:flex;flex-direction:column;z-index:1000;animation:fadeIn .2s ease-out}@keyframes fadeIn{0%{opacity:0;transform:translate(-50%,-50%) scale(.95)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}.nice-html-editor-ai__panel-header{display:flex;align-items:center;justify-content:space-between;padding:var(--nice-space-4, 16px) var(--nice-space-5, 20px);background:var(--ai-bg);border-bottom:1px solid var(--ai-border);border-radius:var(--nice-radius-xl, 12px) var(--nice-radius-xl, 12px) 0 0;gap:var(--nice-space-3, 12px);flex-wrap:wrap}.nice-html-editor-ai__panel-header h4{margin:0;font-size:16px;font-weight:600;color:var(--ai-text)}.nice-html-editor-ai__close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;font-size:16px;color:var(--ai-text-muted);background:transparent;border:none;border-radius:var(--nice-radius-md, 6px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__close:hover{color:var(--ai-text);background:var(--ai-border)}.nice-html-editor-ai__panel-body{flex:1;overflow-y:auto;padding:var(--nice-space-5, 20px)}.nice-html-editor-ai__panel-footer{display:flex;justify-content:flex-end;gap:var(--nice-space-2, 8px);padding:var(--nice-space-4, 16px) var(--nice-space-5, 20px);border-top:1px solid var(--ai-border)}.nice-html-editor-ai__style-selector{display:flex;gap:var(--nice-space-1, 4px)}.nice-html-editor-ai__style-btn{padding:var(--nice-space-1, 4px) var(--nice-space-2-5, 10px);font-size:12px;font-weight:500;color:var(--ai-text-muted);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__style-btn:hover{color:var(--ai-text);border-color:var(--ai-text-muted)}.nice-html-editor-ai__style-btn--active{color:#fff;background:var(--ai-primary);border-color:var(--ai-primary)}.nice-html-editor-ai__language-select{padding:var(--nice-space-1-5, 6px) var(--nice-space-2-5, 10px);font-size:13px;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);outline:none;cursor:pointer}.nice-html-editor-ai__language-select:focus{border-color:var(--ai-primary)}.nice-html-editor-ai__comparison{display:grid;grid-template-columns:1fr 1fr;gap:var(--nice-space-4, 16px)}.nice-html-editor-ai__text-block{display:flex;flex-direction:column;gap:var(--nice-space-2, 8px)}.nice-html-editor-ai__text-block h5{margin:0;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--ai-text-muted)}.nice-html-editor-ai__text-content{padding:var(--nice-space-3, 12px);font-size:14px;line-height:1.6;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);min-height:100px;white-space:pre-wrap}.nice-html-editor-ai__text-block--improved h5{color:var(--ai-improve)}.nice-html-editor-ai__text-block--improved .nice-html-editor-ai__text-content{border-color:var(--ai-improve);background:#f59e0b0d}.nice-html-editor-ai__text-block--translated h5{color:var(--ai-translate)}.nice-html-editor-ai__text-block--translated .nice-html-editor-ai__text-content{border-color:var(--ai-translate);background:#0ea5e90d}.nice-html-editor-ai__loading-panel{display:flex;align-items:center;justify-content:center;padding:var(--nice-space-10, 40px);color:var(--ai-primary);font-size:14px}.nice-html-editor-ai__loading-panel:before{content:"";display:inline-block;width:18px;height:18px;margin-right:var(--nice-space-2-5, 10px);border:2px solid var(--ai-border);border-top-color:var(--ai-primary);border-radius:var(--nice-radius-full, 50%);animation:spin .8s linear infinite}.nice-html-editor-ai__generate-input{display:flex;flex-direction:column;gap:var(--nice-space-3, 12px);margin-bottom:var(--nice-space-4, 16px)}.nice-html-editor-ai__generate-textarea{width:100%;padding:var(--nice-space-3, 12px);font-size:14px;font-family:inherit;line-height:1.5;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);resize:vertical;outline:none;transition:border-color .15s ease}.nice-html-editor-ai__generate-textarea:focus{border-color:var(--ai-primary)}.nice-html-editor-ai__generate-textarea::placeholder{color:var(--ai-text-muted)}.nice-html-editor-ai__generate-btn{align-self:flex-end;padding:var(--nice-space-2-5, 10px) var(--nice-space-6, 24px);font-size:14px;font-weight:500;color:#fff;background:var(--ai-primary);border:none;border-radius:var(--nice-radius-md, 6px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__generate-btn:hover:not(:disabled){background:var(--ai-primary-light)}.nice-html-editor-ai__generate-btn:disabled{opacity:.6;cursor:not-allowed}.nice-html-editor-ai__generate-result{margin-top:var(--nice-space-4, 16px)}.nice-html-editor-ai__generate-result h5{margin:0 0 var(--nice-space-2, 8px);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--ai-text-muted)}.nice-html-editor-ai__preview{padding:var(--nice-space-4, 16px);margin-bottom:var(--nice-space-4, 16px);background:#fff;border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);line-height:1.6}.nice-html-editor-ai__code{margin:0;padding:var(--nice-space-3, 12px);font-family:Fira Code,Consolas,monospace;font-size:12px;line-height:1.5;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);overflow-x:auto;max-height:200px;white-space:pre-wrap}.nice-html-editor-ai__apply{padding:var(--nice-space-2, 8px) var(--nice-space-5, 20px);font-size:14px;font-weight:500;color:#fff;background:var(--ai-success);border:none;border-radius:var(--nice-radius-md, 6px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__apply:hover:not(:disabled){background:var(--color-success, #10b981)}.nice-html-editor-ai__apply:disabled{opacity:.6;cursor:not-allowed}.nice-html-editor-ai__cancel{padding:var(--nice-space-2, 8px) var(--nice-space-5, 20px);font-size:14px;font-weight:500;color:var(--ai-text-muted);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px);cursor:pointer;transition:all .15s ease}.nice-html-editor-ai__cancel:hover{color:var(--ai-text);background:var(--ai-bg)}@media(max-width:640px){.nice-html-editor-ai__toolbar{flex-wrap:wrap}.nice-html-editor-ai__toolbar-right{width:100%;justify-content:flex-start;margin-top:var(--nice-space-2, 8px);flex-wrap:wrap}.nice-html-editor-ai__panel{width:95%;max-height:90vh}.nice-html-editor-ai__comparison{grid-template-columns:1fr}.nice-html-editor-ai__panel-header{flex-direction:column;align-items:flex-start}.nice-html-editor-ai__style-selector{flex-wrap:wrap;margin-top:var(--nice-space-2, 8px)}}.nice-html-editor-ai__panel:before{content:"";position:fixed;inset:0;background:var(--nice-overlay-40, color-mix(in srgb, var(--text-primary, #000) 40%, transparent));z-index:-1}.nice-code-editor-ai{--ai-primary: var(--color-info, #3b82f6);--ai-primary-light: var(--nice-accent, #818cf8);--ai-bg: var(--bg-secondary, #f8fafc);--ai-border: var(--border-color, #e5e7eb);--ai-text: var(--text-primary, #0f172a);--ai-text-muted: var(--text-secondary, #475569);--ai-ghost: var(--nice-accent-tint-40, rgba(99, 102, 241, .4));--ai-success: var(--color-success, #10b981);--ai-panel-bg: var(--bg-primary, #ffffff);position:relative;display:flex;flex-direction:column;border-radius:var(--nice-radius-lg, 8px);overflow:hidden;border:1px solid var(--ai-border)}[data-theme=dark] .nice-code-editor-ai,.nice-code-editor-ai.dark{--ai-primary: var(--nice-accent, #818cf8);--ai-primary-light: var(--nice-accent, #a5b4fc);--ai-bg: var(--text-primary, #0f172a);--ai-border: var(--text-primary, #0f172a);--ai-text: var(--border-color, #e5e7eb);--ai-text-muted: var(--text-muted, #94a3b8);--ai-ghost: rgba(129, 140, 248, .5);--ai-success: var(--color-success, #10b981);--ai-panel-bg: var(--text-primary, #0f172a)}.nice-code-editor-ai__toolbar{display:flex;align-items:center;justify-content:space-between;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);background:var(--ai-bg);border-bottom:1px solid var(--ai-border);gap:var(--nice-space-2, 8px)}.nice-code-editor-ai__toolbar-left{display:flex;align-items:center;gap:var(--nice-space-3, 12px)}.nice-code-editor-ai__toolbar-badge{display:inline-flex;align-items:center;justify-content:center;padding:var(--nice-space-0-5, 2px) var(--nice-space-2, 8px);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:#fff;background:linear-gradient(135deg,var(--ai-primary) 0%,var(--ai-primary-light) 100%);border-radius:var(--nice-radius-sm, 4px)}.nice-code-editor-ai__loading{font-size:12px;color:var(--ai-primary);animation:pulse-opacity 1.5s ease-in-out infinite}@keyframes pulse-opacity{0%,to{opacity:.5}50%{opacity:1}}.nice-code-editor-ai__toolbar-right{display:flex;align-items:center;gap:var(--nice-space-1, 4px)}.nice-code-editor-ai__toolbar-btn{display:inline-flex;align-items:center;gap:var(--nice-space-1, 4px);padding:var(--nice-space-1, 4px) var(--nice-space-2-5, 10px);font-size:12px;font-weight:500;color:var(--ai-text);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-code-editor-ai__toolbar-btn:hover:not(:disabled){background:var(--ai-primary);color:#fff;border-color:var(--ai-primary)}.nice-code-editor-ai__toolbar-btn:disabled{opacity:.5;cursor:not-allowed}.nice-code-editor-ai__editor-wrapper{position:relative;flex:1;min-height:200px}.nice-code-editor-ai__ghost-text{position:absolute;pointer-events:none;z-index:10;display:flex;align-items:flex-start;gap:var(--nice-space-2, 8px)}.nice-code-editor-ai__ghost-text-content{font-family:Fira Code,Consolas,Monaco,monospace;font-size:14px;line-height:19px;color:var(--ai-ghost);white-space:pre}.nice-code-editor-ai__ghost-text-hint{display:inline-flex;align-items:center;padding:var(--nice-space-0-5, 2px) var(--nice-space-1-5, 6px);font-size:10px;font-weight:500;color:var(--ai-text-muted);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 3px);margin-left:var(--nice-space-2, 8px);opacity:.8}.nice-code-editor-ai__panel{position:absolute;bottom:0;left:0;right:0;max-height:50%;background:var(--ai-panel-bg);border-top:2px solid var(--ai-primary);display:flex;flex-direction:column;z-index:100;animation:slideUp .2s ease-out}@keyframes slideUp{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}.nice-code-editor-ai__panel-header{display:flex;align-items:center;justify-content:space-between;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);background:var(--ai-bg);border-bottom:1px solid var(--ai-border)}.nice-code-editor-ai__panel-header h4{margin:0;font-size:14px;font-weight:600;color:var(--ai-text)}.nice-code-editor-ai__panel-close{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;font-size:14px;color:var(--ai-text-muted);background:transparent;border:none;border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-code-editor-ai__panel-close:hover{color:var(--ai-text);background:var(--ai-border)}.nice-code-editor-ai__panel-body{flex:1;overflow-y:auto;padding:var(--nice-space-3, 12px)}.nice-code-editor-ai__panel-loading{display:flex;align-items:center;justify-content:center;padding:var(--nice-space-6, 24px);color:var(--ai-primary);font-size:14px}.nice-code-editor-ai__panel-loading:before{content:"";display:inline-block;width:16px;height:16px;margin-right:var(--nice-space-2, 8px);border:2px solid var(--ai-border);border-top-color:var(--ai-primary);border-radius:var(--nice-radius-full, 50%);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.nice-code-editor-ai__code-preview{margin:0 0 var(--nice-space-3, 12px);padding:var(--nice-space-3, 12px);font-family:Fira Code,Consolas,Monaco,monospace;font-size:12px;line-height:1.5;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);overflow-x:auto;max-height:120px;white-space:pre-wrap}.nice-code-editor-ai__code-preview--result{border-color:var(--ai-success);background:#22c55e0d}.nice-code-editor-ai__explanation{display:flex;flex-direction:column;gap:var(--nice-space-3, 12px)}.nice-code-editor-ai__explanation-text{font-size:14px;line-height:1.6;color:var(--ai-text);white-space:pre-wrap}.nice-code-editor-ai__refactor-input{display:flex;gap:var(--nice-space-2, 8px);margin-bottom:var(--nice-space-3, 12px)}.nice-code-editor-ai__refactor-input input{flex:1;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);font-size:13px;color:var(--ai-text);background:var(--ai-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);outline:none;transition:border-color .15s ease}.nice-code-editor-ai__refactor-input input:focus{border-color:var(--ai-primary)}.nice-code-editor-ai__refactor-input input::placeholder{color:var(--ai-text-muted)}.nice-code-editor-ai__refactor-btn{padding:var(--nice-space-2, 8px) var(--nice-space-4, 16px);font-size:13px;font-weight:500;color:#fff;background:var(--ai-primary);border:none;border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease;white-space:nowrap}.nice-code-editor-ai__refactor-btn:hover:not(:disabled){background:var(--ai-primary-light)}.nice-code-editor-ai__refactor-btn:disabled{opacity:.6;cursor:not-allowed}.nice-code-editor-ai__refactor-result{margin-top:var(--nice-space-3, 12px)}.nice-code-editor-ai__refactor-result h5{margin:0 0 var(--nice-space-2, 8px);font-size:13px;font-weight:600;color:var(--ai-success)}.nice-code-editor-ai__refactor-actions{display:flex;gap:var(--nice-space-2, 8px);margin-top:var(--nice-space-3, 12px)}.nice-code-editor-ai__refactor-apply{padding:var(--nice-space-1-5, 6px) var(--nice-space-4, 16px);font-size:13px;font-weight:500;color:#fff;background:var(--ai-success);border:none;border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-code-editor-ai__refactor-apply:hover{background:var(--color-success, #10b981)}.nice-code-editor-ai__refactor-discard{padding:var(--nice-space-1-5, 6px) var(--nice-space-4, 16px);font-size:13px;font-weight:500;color:var(--ai-text-muted);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-code-editor-ai__refactor-discard:hover{color:var(--ai-text);background:var(--ai-bg)}.nice-code-editor-ai--sm .nice-code-editor-ai__toolbar{padding:var(--nice-space-1-5, 6px) var(--nice-space-2, 8px)}.nice-code-editor-ai--sm .nice-code-editor-ai__toolbar-btn{padding:var(--nice-space-0-5, 2px) var(--nice-space-1-5, 6px);font-size:11px}.nice-code-editor-ai--lg .nice-code-editor-ai__toolbar{padding:var(--nice-space-2-5, 10px) var(--nice-space-4, 16px)}.nice-code-editor-ai--lg .nice-code-editor-ai__toolbar-btn{padding:var(--nice-space-1-5, 6px) var(--nice-space-3-5, 14px);font-size:14px}@media(max-width:640px){.nice-code-editor-ai__toolbar{flex-wrap:wrap}.nice-code-editor-ai__toolbar-right{width:100%;justify-content:flex-start;margin-top:var(--nice-space-2, 8px);flex-wrap:wrap}.nice-code-editor-ai__panel{max-height:70%}.nice-code-editor-ai__refactor-input{flex-direction:column}}.nice-emoji-picker{display:flex;flex-direction:column;width:320px;max-height:400px;background:var(--bg-primary, #fff);border:1px solid var(--border-color, #e5e7eb);border-radius:var(--nice-radius-lg, 8px);box-shadow:0 4px 12px var(--nice-overlay-10, color-mix(in srgb, var(--text-primary, #000) 10%, transparent));font-family:inherit;overflow:hidden}.nice-emoji-picker--sm{width:280px;max-height:340px}.nice-emoji-picker--sm .nice-emoji-picker__emoji{width:28px;height:28px;font-size:16px}.nice-emoji-picker--lg{width:400px;max-height:500px}.nice-emoji-picker--lg .nice-emoji-picker__emoji{width:40px;height:40px;font-size:26px}.nice-emoji-picker__search{display:flex;align-items:center;gap:var(--nice-space-2, 8px);padding:var(--nice-space-2-5, 10px);border-bottom:1px solid var(--border-color, #e5e7eb);flex-shrink:0}.nice-emoji-picker__search-input{flex:1;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);border:1px solid var(--border-color, #d1d5db);border-radius:var(--nice-radius-md, 6px);font-size:14px;background:var(--bg-primary, #fff);color:var(--text-primary, #1f2937)}.nice-emoji-picker__search-input:focus{outline:none;border-color:var(--color-primary, #3b82f6);box-shadow:0 0 0 2px var(--color-primary, #6366f1)}.nice-emoji-picker__search-input::placeholder{color:var(--text-secondary, #9ca3af)}.nice-emoji-picker__skin-tone-wrapper{position:relative;flex-shrink:0}.nice-emoji-picker__skin-tone-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid var(--border-color, #d1d5db);border-radius:var(--nice-radius-md, 6px);background:var(--bg-primary, #fff);cursor:pointer;font-size:18px;transition:border-color .15s,background .15s}.nice-emoji-picker__skin-tone-btn:hover{background:var(--hover-bg, #f3f4f6)}.nice-emoji-picker__skin-tone-menu{position:absolute;top:100%;right:0;margin-top:var(--nice-space-1, 4px);display:flex;gap:var(--nice-space-1, 4px);padding:var(--nice-space-1-5, 6px);background:var(--bg-primary, #fff);border:1px solid var(--border-color, #e5e7eb);border-radius:var(--nice-radius-lg, 8px);box-shadow:0 4px 12px var(--nice-overlay-15, color-mix(in srgb, var(--text-primary, #000) 15%, transparent));z-index:10}.nice-emoji-picker__skin-tone-option{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:2px solid transparent;border-radius:var(--nice-radius-md, 6px);background:transparent;cursor:pointer;font-size:18px;transition:background .15s,border-color .15s}.nice-emoji-picker__skin-tone-option:hover{background:var(--hover-bg, #f3f4f6)}.nice-emoji-picker__skin-tone-option--selected{border-color:var(--color-primary, #3b82f6);background:var(--color-primary-light, #dbeafe)}.nice-emoji-picker__categories{display:flex;border-bottom:1px solid var(--border-color, #e5e7eb);padding:var(--nice-space-1, 4px) var(--nice-space-2, 8px);gap:var(--nice-space-0-5, 2px);flex-shrink:0;overflow-x:auto}.nice-emoji-picker__category-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:var(--nice-radius-md, 6px);background:transparent;cursor:pointer;font-size:18px;flex-shrink:0;transition:background .15s}.nice-emoji-picker__category-btn:hover{background:var(--hover-bg, #f3f4f6)}.nice-emoji-picker__category-btn--selected{background:var(--color-primary-light, #dbeafe)}.nice-emoji-picker__grid-container{flex:1;overflow-y:auto;padding:var(--nice-space-2, 8px)}.nice-emoji-picker__section{margin-bottom:var(--nice-space-3, 12px)}.nice-emoji-picker__section:last-child{margin-bottom:0}.nice-emoji-picker__section-title{font-size:12px;font-weight:600;color:var(--text-secondary, #6b7280);text-transform:uppercase;letter-spacing:.05em;margin-bottom:var(--nice-space-2, 8px);padding-left:var(--nice-space-1, 4px)}.nice-emoji-picker__grid{display:grid;gap:var(--nice-space-0-5, 2px)}.nice-emoji-picker__emoji{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border:none;border-radius:var(--nice-radius-md, 6px);background:transparent;cursor:pointer;font-size:22px;transition:background .15s,transform .1s}.nice-emoji-picker__emoji:hover{background:var(--hover-bg, #f3f4f6);transform:scale(1.15)}.nice-emoji-picker__emoji:active{transform:scale(1.05)}.nice-emoji-picker__emoji--custom img{width:24px;height:24px;object-fit:contain}.nice-emoji-picker__empty{grid-column:1 / -1;padding:var(--nice-space-6, 24px);text-align:center;color:var(--text-secondary, #6b7280);font-size:13px}.nice-emoji-picker__grid-container::-webkit-scrollbar{width:8px}.nice-emoji-picker__grid-container::-webkit-scrollbar-track{background:transparent}.nice-emoji-picker__grid-container::-webkit-scrollbar-thumb{background:var(--border-color, #d1d5db);border-radius:var(--nice-radius-sm, 4px)}.nice-emoji-picker__grid-container::-webkit-scrollbar-thumb:hover{background:var(--text-secondary, #9ca3af)}.nice-crop-editor{display:flex;flex-direction:column;gap:var(--nice-space-4, 16px);width:100%;max-width:600px;font-family:inherit}.nice-crop-editor__container{position:relative;width:100%;height:0;padding-bottom:75%;background:var(--bg-primary, #ffffff);border-radius:var(--nice-radius-lg, 8px);overflow:hidden;user-select:none}.nice-crop-editor__image{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain;pointer-events:none}.nice-crop-editor__overlay{position:absolute;inset:0;pointer-events:none}.nice-crop-editor__overlay-piece{position:absolute;background:var(--nice-overlay-50, color-mix(in srgb, var(--text-primary, #000) 50%, transparent))}.nice-crop-editor__crop-area{position:absolute;border:2px solid var(--bg-primary, #ffffff);box-shadow:0 0 0 9999px var(--nice-overlay-50, color-mix(in srgb, var(--text-primary, #000) 50%, transparent));cursor:move;box-sizing:border-box}.nice-crop-editor__grid{position:absolute;inset:0;pointer-events:none}.nice-crop-editor__grid-line{position:absolute;background:var(--nice-overlay-light-40, color-mix(in srgb, var(--text-on-primary, #fff) 40%, transparent))}.nice-crop-editor__grid-line--h1{left:0;right:0;top:33.33%;height:1px}.nice-crop-editor__grid-line--h2{left:0;right:0;top:66.66%;height:1px}.nice-crop-editor__grid-line--v1{top:0;bottom:0;left:33.33%;width:1px}.nice-crop-editor__grid-line--v2{top:0;bottom:0;left:66.66%;width:1px}.nice-crop-editor__handle{position:absolute;width:12px;height:12px;background:var(--bg-primary, #FFF);border:2px solid var(--color-primary, #3b82f6);border-radius:var(--nice-radius-sm, 2px);z-index:1}.nice-crop-editor__handle:hover{background:var(--color-primary, #3b82f6)}.nice-crop-editor__handle--nw{top:-6px;left:-6px;cursor:nw-resize}.nice-crop-editor__handle--ne{top:-6px;right:-6px;cursor:ne-resize}.nice-crop-editor__handle--sw{bottom:-6px;left:-6px;cursor:sw-resize}.nice-crop-editor__handle--se{bottom:-6px;right:-6px;cursor:se-resize}.nice-crop-editor__handle--n{top:-6px;left:50%;transform:translate(-50%);cursor:n-resize}.nice-crop-editor__handle--s{bottom:-6px;left:50%;transform:translate(-50%);cursor:s-resize}.nice-crop-editor__handle--e{right:-6px;top:50%;transform:translateY(-50%);cursor:e-resize}.nice-crop-editor__handle--w{left:-6px;top:50%;transform:translateY(-50%);cursor:w-resize}.nice-crop-editor__controls{display:flex;flex-direction:column;gap:var(--nice-space-3, 12px);padding:var(--nice-space-3, 12px);background:var(--bg-primary, #fff);color:var(--text-primary, inherit);border:1px solid var(--border-color, #e5e7eb);border-radius:var(--nice-radius-lg, 8px)}.nice-crop-editor__control-group{display:flex;flex-direction:column;gap:var(--nice-space-1-5, 6px)}.nice-crop-editor__control-group--row{flex-direction:row;align-items:center;gap:var(--nice-space-2, 8px)}.nice-crop-editor__label{font-size:12px;font-weight:600;color:var(--text-secondary, #6b7280);text-transform:uppercase;letter-spacing:.05em}.nice-crop-editor__aspect-buttons{display:flex;flex-wrap:wrap;gap:var(--nice-space-1-5, 6px)}.nice-crop-editor__aspect-btn{padding:var(--nice-space-1-5, 6px) var(--nice-space-3, 12px);border:1px solid var(--border-color, #d1d5db);border-radius:var(--nice-radius-md, 6px);background:var(--bg-primary, #fff);color:var(--text-primary, #1f2937);font-size:13px;cursor:pointer;transition:background .15s,border-color .15s,color .15s}.nice-crop-editor__aspect-btn:hover{background:var(--hover-bg, color-mix(in srgb, var(--color-primary, #3b82f6) 8%, transparent))}.nice-crop-editor__aspect-btn--selected{background:var(--color-primary, #3b82f6);border-color:var(--color-primary, #3b82f6);color:var(--text-on-primary, #FFF)}.nice-crop-editor__aspect-btn--selected:hover{background:var(--color-primary-hover, var(--color-primary, #2563eb));filter:brightness(.95)}.nice-crop-editor__slider{width:100%;height:6px;appearance:none;background:var(--border-color, #d1d5db);border-radius:var(--nice-radius-sm, 3px);cursor:pointer}.nice-crop-editor__slider::-webkit-slider-thumb{appearance:none;width:18px;height:18px;background:var(--color-primary, #3b82f6);border-radius:var(--nice-radius-full, 50%);cursor:pointer;transition:background .15s}.nice-crop-editor__slider::-webkit-slider-thumb:hover{filter:brightness(.95)}.nice-crop-editor__slider::-moz-range-thumb{width:18px;height:18px;background:var(--color-primary, #3b82f6);border:none;border-radius:var(--nice-radius-full, 50%);cursor:pointer}.nice-crop-editor__btn{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid var(--border-color, #d1d5db);border-radius:var(--nice-radius-md, 6px);background:var(--bg-primary, #fff);color:var(--text-primary, #1f2937);font-size:18px;cursor:pointer;transition:background .15s,border-color .15s,color .15s}.nice-crop-editor__btn:hover{background:var(--hover-bg, color-mix(in srgb, var(--color-primary, #3b82f6) 8%, transparent))}.nice-crop-editor__btn--active{background:var(--color-primary, #3b82f6);border-color:var(--color-primary, #3b82f6);color:var(--text-on-primary, #FFF)}.nice-crop-editor__btn--reset{margin-left:auto;color:var(--color-danger, #ef4444)}.nice-crop-editor__btn--reset:hover{background:color-mix(in srgb,var(--color-danger, #ef4444) 14%,transparent)}
package/dist/editors.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./pickerCommons-B-wOzHFh.cjs"),i=require("./NiceForm-C6F0HvrX.cjs"),e=require("./NiceMention-J1lUDLhg.cjs"),o=require("./NiceSelect-BVoqtfYN.cjs"),N=require("./NiceColorPicker-CKVbjicN.cjs"),t=require("./NiceHtmlEditor-D8RQcBNp.cjs"),r=require("./NiceCodeEditor-cIqUSk3j.cjs");exports.NiceCheckbox=c.NiceCheckbox;exports.NiceNumberInput=c.NiceNumberInput;exports.NiceTextInput=c.NiceTextInput;exports.NiceToggle=c.NiceToggle;exports.MASK_PRESETS=i.MASK_PRESETS;exports.NiceAutocomplete=i.NiceAutocomplete;exports.NiceCalendar=i.NiceCalendar;exports.NiceCountryPicker=i.NiceCountryPicker;exports.NiceDateTimePicker=i.NiceDateTimePicker;exports.NiceForm=i.NiceForm;exports.NiceMaskedInput=i.NiceMaskedInput;exports.NicePasswordInput=i.NicePasswordInput;exports.NiceRadioGroup=i.NiceRadioGroup;exports.NiceRating=i.NiceRating;exports.NiceSlider=i.NiceSlider;exports.NiceTagBox=i.NiceTagBox;exports.NiceTextArea=i.NiceTextArea;exports.NiceUpload=i.NiceUpload;exports.NICE_COLOR_PRESET_KEYS=e.NICE_COLOR_PRESET_KEYS;exports.NiceAccountPicker=e.NiceAccountPicker;exports.NiceAddressInput=e.NiceAddressInput;exports.NiceCodeEditorAI=e.NiceCodeEditorAI;exports.NiceColorPalette=e.NiceColorPalette;exports.NiceContactPicker=e.NiceContactPicker;exports.NiceCropEditor=e.NiceCropEditor;exports.NiceDateRangeBox=e.NiceDateRangeBox;exports.NiceDocumentEditor=e.NiceDocumentEditor;exports.NiceDropDownBox=e.NiceDropDownBox;exports.NiceEmojiPicker=e.NiceEmojiPicker;exports.NiceGradientPicker=e.NiceGradientPicker;exports.NiceHtmlEditorAI=e.NiceHtmlEditorAI;exports.NiceImageAnnotator=e.NiceImageAnnotator;exports.NiceImageEditor=e.NiceImageEditor;exports.NiceInputOtp=e.NiceInputOtp;exports.NiceInvoiceLineEditor=e.NiceInvoiceLineEditor;exports.NiceKeyValueEditor=e.NiceKeyValueEditor;exports.NiceKnob=e.NiceKnob;exports.NiceLogConsole=e.NiceLogConsole;exports.NiceLookup=e.NiceLookup;exports.NiceMarkdownEditor=e.NiceMarkdownEditor;exports.NiceMention=e.NiceMention;exports.NicePDFAnnotationEditor=e.NicePDFAnnotationEditor;exports.NicePickList=e.NicePickList;exports.NiceRangeSlider=e.NiceRangeSlider;exports.NiceScannerControl=e.NiceScannerControl;exports.NiceScriptRunner=e.NiceScriptRunner;exports.NiceSignature=e.NiceSignature;exports.NiceTreeSelect=e.NiceTreeSelect;exports.NiceWiki=e.NiceWiki;exports.NiceSelect=o.NiceSelect;exports.NiceColorPicker=N.NiceColorPicker;exports.NiceHtmlEditor=t.NiceHtmlEditor;exports.NiceCodeEditor=r.NiceCodeEditor;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./pickerCommons-B-wOzHFh.cjs"),i=require("./NiceForm-C6F0HvrX.cjs"),e=require("./NiceMention-BjeLN4Jx.cjs"),o=require("./NiceSelect-BVoqtfYN.cjs"),N=require("./NiceColorPicker-CKVbjicN.cjs"),t=require("./NiceHtmlEditor-D8RQcBNp.cjs"),r=require("./NiceCodeEditor-cIqUSk3j.cjs");exports.NiceCheckbox=c.NiceCheckbox;exports.NiceNumberInput=c.NiceNumberInput;exports.NiceTextInput=c.NiceTextInput;exports.NiceToggle=c.NiceToggle;exports.MASK_PRESETS=i.MASK_PRESETS;exports.NiceAutocomplete=i.NiceAutocomplete;exports.NiceCalendar=i.NiceCalendar;exports.NiceCountryPicker=i.NiceCountryPicker;exports.NiceDateTimePicker=i.NiceDateTimePicker;exports.NiceForm=i.NiceForm;exports.NiceMaskedInput=i.NiceMaskedInput;exports.NicePasswordInput=i.NicePasswordInput;exports.NiceRadioGroup=i.NiceRadioGroup;exports.NiceRating=i.NiceRating;exports.NiceSlider=i.NiceSlider;exports.NiceTagBox=i.NiceTagBox;exports.NiceTextArea=i.NiceTextArea;exports.NiceUpload=i.NiceUpload;exports.NICE_COLOR_PRESET_KEYS=e.NICE_COLOR_PRESET_KEYS;exports.NiceAccountPicker=e.NiceAccountPicker;exports.NiceAddressInput=e.NiceAddressInput;exports.NiceCodeEditorAI=e.NiceCodeEditorAI;exports.NiceColorPalette=e.NiceColorPalette;exports.NiceContactPicker=e.NiceContactPicker;exports.NiceCropEditor=e.NiceCropEditor;exports.NiceDateRangeBox=e.NiceDateRangeBox;exports.NiceDocumentEditor=e.NiceDocumentEditor;exports.NiceDropDownBox=e.NiceDropDownBox;exports.NiceEmojiPicker=e.NiceEmojiPicker;exports.NiceGradientPicker=e.NiceGradientPicker;exports.NiceHtmlEditorAI=e.NiceHtmlEditorAI;exports.NiceImageAnnotator=e.NiceImageAnnotator;exports.NiceImageEditor=e.NiceImageEditor;exports.NiceInputOtp=e.NiceInputOtp;exports.NiceInvoiceLineEditor=e.NiceInvoiceLineEditor;exports.NiceKeyValueEditor=e.NiceKeyValueEditor;exports.NiceKnob=e.NiceKnob;exports.NiceLogConsole=e.NiceLogConsole;exports.NiceLookup=e.NiceLookup;exports.NiceMarkdownEditor=e.NiceMarkdownEditor;exports.NiceMention=e.NiceMention;exports.NicePDFAnnotationEditor=e.NicePDFAnnotationEditor;exports.NicePickList=e.NicePickList;exports.NiceRangeSlider=e.NiceRangeSlider;exports.NiceScannerControl=e.NiceScannerControl;exports.NiceScriptRunner=e.NiceScriptRunner;exports.NiceSignature=e.NiceSignature;exports.NiceTreeSelect=e.NiceTreeSelect;exports.NiceWiki=e.NiceWiki;exports.NiceSelect=o.NiceSelect;exports.NiceColorPicker=N.NiceColorPicker;exports.NiceHtmlEditor=t.NiceHtmlEditor;exports.NiceCodeEditor=r.NiceCodeEditor;
package/dist/editors.d.ts CHANGED
@@ -944,14 +944,30 @@ export declare const NiceDateRangeBox: default_2.FC<NiceDateRangeBoxProps>;
944
944
 
945
945
  /** Props for the {@link NiceDateRangeBox} component — a pair of date pickers for selecting a date range. */
946
946
  export declare interface NiceDateRangeBoxProps extends NiceFormFieldProps {
947
- /** Start date (ISO string). */
948
- startDate: string;
949
- /** End date (ISO string). */
950
- endDate: string;
951
- /** Called when the start date changes. */
952
- onStartChange: (date: string) => void;
953
- /** Called when the end date changes. */
954
- onEndChange: (date: string) => void;
947
+ /**
948
+ * Start date (ISO string) — **controlled**. Omit it (and pass
949
+ * `defaultStartDate`, or nothing at all) to let the control keep its own copy.
950
+ */
951
+ startDate?: string;
952
+ /**
953
+ * End date (ISO string) — **controlled**. Omit it (and pass `defaultEndDate`,
954
+ * or nothing at all) to let the control keep its own copy.
955
+ */
956
+ endDate?: string;
957
+ /**
958
+ * Initial start date for the **uncontrolled** mode. Ignored when `startDate`
959
+ * is supplied.
960
+ */
961
+ defaultStartDate?: string;
962
+ /**
963
+ * Initial end date for the **uncontrolled** mode. Ignored when `endDate` is
964
+ * supplied.
965
+ */
966
+ defaultEndDate?: string;
967
+ /** Called when the start date changes — in both controlled and uncontrolled mode. */
968
+ onStartChange?: (date: string) => void;
969
+ /** Called when the end date changes — in both controlled and uncontrolled mode. */
970
+ onEndChange?: (date: string) => void;
955
971
  /** Earliest selectable date. */
956
972
  min?: string;
957
973
  /** Latest selectable date. */
package/dist/editors.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { N as a, a as c, b as o, c as s } from "./pickerCommons-COiSUiP2.js";
2
2
  import { M as r, N as t, a as n, b as d, c as p, d as l, e as m, f as E, g as u, h as k, i as x, j as C, k as P, l as g } from "./NiceForm-CCyfWgIs.js";
3
- import { N as S, a as A, b as f, c as R, d as T, e as D, f as b, g as L, h as M, i as w, j as B, k as K, l as _, m as h, n as j, o as y, p as O, q as v, r as F, s as G, t as H, u as q, v as z, w as U, x as V, y as W, z as Y, A as J, B as Q, C as X, D as Z } from "./NiceMention-CWoLD0SE.js";
3
+ import { N as S, a as A, b as f, c as R, d as T, e as D, f as b, g as L, h as M, i as w, j as B, k as K, l as _, m as h, n as j, o as y, p as O, q as v, r as F, s as G, t as H, u as q, v as z, w as U, x as V, y as W, z as Y, A as J, B as Q, C as X, D as Z } from "./NiceMention-OaCi-GNO.js";
4
4
  import { N as ee } from "./NiceSelect-DHowflmX.js";
5
5
  import { N as ae } from "./NiceColorPicker-C8NZZcXE.js";
6
6
  import { NiceHtmlEditor as oe } from "./NiceHtmlEditor-B8B8AcSC.js";
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./charts-B-sl1V9y.cjs"),it=require("./core-C2KhqEaU.cjs"),s=require("react"),Me=require("./pickerCommons-B-wOzHFh.cjs"),qe=require("./NiceForm-C6F0HvrX.cjs"),Pt=require("./NiceSelect-BVoqtfYN.cjs"),De=require("./NiceColorPicker-CKVbjicN.cjs"),ze=require("./NiceMention-J1lUDLhg.cjs"),Bo=require("./NiceHtmlEditor-D8RQcBNp.cjs"),$i=require("./NiceCodeEditor-cIqUSk3j.cjs"),Ie=require("./NiceModuleLifecyclePanel-Df_1k5qW.cjs"),mt=require("./NiceScheduler-nW7fMzKL.cjs"),gt=require("./NicePivotGrid-Cmiolup9.cjs"),e=require("react/jsx-runtime"),Dp=require("react-dom"),ot=require("./NiceSavedQueryPanel-BhjFJBvn.cjs"),nt=require("./NiceLoginForm-BrvIc-wq.cjs"),Ii=require("./NiceModal-0UxviEYE.cjs"),Fo=require("./NiceConfirmDialog-oSxVpsCs.cjs"),Fa=require("./NicePagination-EEQ6o1dF.cjs"),sn=require("./NiceDataGrid-3AIf2D3t.cjs"),Xe=require("./NiceWindow-DdD9k4nc.cjs"),Oo=require("./NiceGantt-_ysNSVYR.cjs"),Nt=require("./devops-CU0sOVEA.cjs"),Ap=require("./NiceDocumentViewer-BE0gKBlw.cjs"),Bt=require("./no-code-C58g8_fb.cjs"),Tn=require("./data-branching-DC6hcBQN.cjs");function Vo({className:t="",size:n="md",showTooltip:i=!0,showLabel:a=!0,onClick:r,label:o,tooltipPosition:c="bottom"}){const{badgeInfo:l,isLoading:m}=it.useTracelessPolicySafe(),[p,u]=s.useState(!1),f={sm:"nice-traceless-badge--sm",md:"nice-traceless-badge--md",lg:"nice-traceless-badge--lg"},b=o||l.label;return s.createElement("div",{className:`nice-traceless-badge ${l.cssClass} ${f[n]} ${t}`.trim(),onClick:r,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),role:r?"button":"status",tabIndex:r?0:void 0,onKeyDown:r?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),r())}:void 0,"aria-label":`Privacy mode: ${b}`,style:{display:"inline-flex",alignItems:"center",gap:"0.375rem",padding:n==="sm"?"0.25rem 0.5rem":n==="lg"?"0.5rem 1rem":"0.375rem 0.75rem",borderRadius:"9999px",fontSize:n==="sm"?"0.75rem":n==="lg"?"1rem":"0.875rem",fontWeight:500,backgroundColor:`${l.color}20`,color:l.color,border:`1px solid ${l.color}40`,cursor:r?"pointer":"default",transition:"all 0.2s ease",position:"relative",userSelect:"none"}},s.createElement("span",{"aria-hidden":!0},m?s.createElement(d.oa,{name:"clock",size:14}):l.icon),a&&s.createElement("span",null,b),i&&p&&s.createElement("div",{role:"tooltip",style:{position:"absolute",[c==="top"?"bottom":c==="bottom"?"top":c==="left"?"right":"left"]:"100%",[c==="top"||c==="bottom"?"left":"top"]:"50%",transform:c==="top"||c==="bottom"?"translateX(-50%)":"translateY(-50%)",marginTop:c==="bottom"?"0.5rem":void 0,marginBottom:c==="top"?"0.5rem":void 0,marginLeft:c==="right"?"0.5rem":void 0,marginRight:c==="left"?"0.5rem":void 0,padding:"0.5rem 0.75rem",backgroundColor:"var(--text-primary, #1f2937)",color:"var(--bg-primary, #fff)",borderRadius:"0.375rem",fontSize:"0.75rem",whiteSpace:"nowrap",zIndex:50,boxShadow:"0 4px 6px -1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",maxWidth:"280px",textAlign:"left"}},l.tooltip))}function Pp({className:t="",showReport:n=!0,showAudit:i=!0,showModeSelector:a=!0,availableModes:r=["traceless","ephemeral","private"],onModeChange:o}){const{policy:c,badgeInfo:l,setUserPreference:m,generateReport:p}=it.useTracelessPolicySafe(),{result:u,run:f}=it.useStorageAudit(),[b,h]=s.useState(null),y=s.useCallback(_=>{m({preferredMode:_}),o?.(_)},[m,o]),g=s.useCallback(()=>{h(p())},[p]),v={traceless:"Zero storage. Maximum privacy. Data resets on every page load.",ephemeral:"Session-only. Data clears when you close the tab.",private:"Minimal storage with secure authentication.",balanced:"Local preferences saved. No tracking cookies.",full:"All storage enabled with consent controls.",custom:"Custom configuration."};return s.createElement("div",{className:`nice-traceless-panel ${t}`.trim(),style:{padding:"1.5rem",backgroundColor:"var(--bg-secondary, #f9fafb)",borderRadius:"0.75rem",border:"1px solid var(--border-color, #e5e7eb)"}},s.createElement("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1.5rem"}},s.createElement(Vo,{size:"lg",showTooltip:!1}),s.createElement("div",null,s.createElement("h3",{style:{margin:0,fontSize:"1.125rem",fontWeight:600}},"Privacy Settings"),s.createElement("p",{style:{margin:0,fontSize:"0.875rem",color:"var(--text-muted, #6b7280)"}},v[c.effectiveMode]))),a&&s.createElement("div",{style:{marginBottom:"1.5rem"}},s.createElement("label",{style:{display:"block",marginBottom:"0.5rem",fontWeight:500}},"Privacy Level"),s.createElement("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap"}},r.map(_=>s.createElement("button",{key:_,onClick:()=>y(_),style:{padding:"0.5rem 1rem",borderRadius:"0.5rem",border:c.effectiveMode===_?"2px solid var(--nice-primary, #3b82f6)":"1px solid var(--border-color, #d1d5db)",backgroundColor:c.effectiveMode===_?"var(--info-bg, #eff6ff)":"var(--bg-primary, #fff)",cursor:"pointer",fontWeight:c.effectiveMode===_?600:400,textTransform:"capitalize"}},_)))),s.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"1rem",marginBottom:"1.5rem"}},s.createElement(Ki,{title:"Cookies",allowed:c.cookiesAllowed,icon:s.createElement(d.oa,{name:"file",size:24})}),s.createElement(Ki,{title:"localStorage",allowed:c.localStorageAllowed,icon:s.createElement(d.oa,{name:"save",size:24})}),s.createElement(Ki,{title:"sessionStorage",allowed:c.sessionStorageAllowed,icon:s.createElement(d.oa,{name:"clipboard",size:24})})),s.createElement("div",{style:{display:"flex",gap:"0.75rem",flexWrap:"wrap"}},i&&s.createElement("button",{onClick:f,style:{padding:"0.5rem 1rem",borderRadius:"0.5rem",border:"1px solid var(--border-color, #d1d5db)",backgroundColor:"var(--bg-primary, #fff)",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"0.375rem"}},s.createElement(d.oa,{name:"search",size:16}),"Run Audit"),n&&s.createElement("button",{onClick:g,style:{padding:"0.5rem 1rem",borderRadius:"0.5rem",border:"1px solid var(--border-color, #d1d5db)",backgroundColor:"var(--bg-primary, #fff)",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"0.375rem"}},s.createElement(d.oa,{name:"file",size:16}),"Generate Report")),u&&s.createElement("div",{style:{marginTop:"1rem",padding:"1rem",backgroundColor:u.compliant?"var(--nice-success-bg, #ecfdf5)":"var(--danger-bg, #fef2f2)",borderRadius:"0.5rem",border:`1px solid ${u.compliant?"var(--color-success, #10b981)":"var(--color-error, #ef4444)"}`}},s.createElement("p",{style:{margin:0,fontWeight:500,color:u.compliant?"var(--nice-success, #059669)":"var(--color-error, #dc2626)",display:"inline-flex",alignItems:"center",gap:"0.375rem"}},s.createElement(d.oa,{name:u.compliant?"check":"close",size:16}),u.compliant?"Compliant":"Violations Found"),!u.compliant&&u.violations.map((_,x)=>s.createElement("p",{key:x,style:{margin:"0.5rem 0 0",fontSize:"0.875rem"}},`• ${_.message}`))),b&&s.createElement("div",{style:{marginTop:"1rem",padding:"1rem",backgroundColor:"var(--bg-primary, #fff)",borderRadius:"0.5rem",border:"1px solid var(--border-color, #d1d5db)"}},s.createElement("h4",{style:{margin:"0 0 0.5rem",fontSize:"0.875rem",fontWeight:600}},"Compliance Statement"),s.createElement("p",{style:{margin:0,fontSize:"0.875rem",color:"var(--text-secondary, #4b5563)"}},b.statement)))}function Ki({title:t,allowed:n,icon:i}){return s.createElement("div",{style:{padding:"0.75rem",backgroundColor:"var(--bg-primary, #fff)",borderRadius:"0.5rem",border:"1px solid var(--border-color, #e5e7eb)",textAlign:"center"}},s.createElement("div",{style:{fontSize:"1.5rem",marginBottom:"0.25rem"}},i),s.createElement("div",{style:{fontSize:"0.75rem",fontWeight:500,marginBottom:"0.25rem"}},t),s.createElement("div",{style:{fontSize:"0.75rem",color:n?"var(--color-success, #10b981)":"var(--text-muted, #6b7280)",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"0.25rem"}},s.createElement(d.oa,{name:n?"check":"close",size:12}),n?"Enabled":"Disabled"))}function $p({className:t="",position:n="bottom",variant:i="minimal",onAccept:a,onDecline:r,onCustomize:o,privacyPolicyUrl:c,acceptText:l="Accept",declineText:m="Decline"}){const{shouldShow:p,mode:u,dismiss:f}=it.useCookieBannerVisibility(),b=s.useCallback(()=>{a?.(),f()},[a,f]),h=s.useCallback(()=>{r?.(),f()},[r,f]);if(!p)return null;const y=n==="top"?{top:0,borderBottom:"1px solid var(--border-color, #e5e7eb)"}:{bottom:0,borderTop:"1px solid var(--border-color, #e5e7eb)"};return s.createElement("div",{className:`nice-consent-banner nice-consent-banner--${i} ${t}`.trim(),role:"dialog","aria-label":"Cookie consent",style:{position:"fixed",left:0,right:0,padding:"1rem 1.5rem",backgroundColor:"var(--bg-primary, #fff)",boxShadow:"0 -4px 6px -1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1rem",flexWrap:"wrap",...y}},s.createElement("div",{style:{flex:1,minWidth:"200px"}},s.createElement("p",{style:{margin:0,fontSize:"0.875rem"}},"We use cookies and similar technologies to improve your experience. ",c&&s.createElement("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-primary, #3b82f6)"}},"Learn more"))),s.createElement("div",{style:{display:"flex",gap:"0.5rem",flexShrink:0}},o&&s.createElement("button",{onClick:o,style:{padding:"0.5rem 1rem",borderRadius:"0.375rem",border:"1px solid var(--border-color, #d1d5db)",backgroundColor:"var(--bg-primary, #fff)",cursor:"pointer"}},"Customize"),s.createElement("button",{onClick:h,style:{padding:"0.5rem 1rem",borderRadius:"0.375rem",border:"1px solid var(--border-color, #d1d5db)",backgroundColor:"var(--bg-primary, #fff)",cursor:"pointer"}},m),s.createElement("button",{onClick:b,style:{padding:"0.5rem 1rem",borderRadius:"0.375rem",border:"none",backgroundColor:"var(--color-primary, #3b82f6)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontWeight:500}},l)))}function Ip({useCase:t,className:n="",message:i,variant:a="inline",dismissible:r=!1,onDismiss:o}){const{warningMessage:c}=it.useTracelessPolicySafe().policy.effectiveMode==="traceless"?{warningMessage:i||"This feature has limited functionality in Traceless mode."}:{warningMessage:void 0},[l,m]=s.useState(!1),p=s.useCallback(()=>{m(!0),o?.()},[o]);if(!c||l)return null;const u={inline:{padding:"0.5rem 0.75rem",backgroundColor:"var(--warning-bg, #fef3c7)",border:"1px solid var(--nice-warning-light, #fbbf24)",borderRadius:"0.375rem",fontSize:"0.875rem"},banner:{padding:"0.75rem 1rem",backgroundColor:"var(--warning-bg, #fef3c7)",borderBottom:"1px solid var(--nice-warning-light, #fbbf24)",fontSize:"0.875rem"},toast:{padding:"0.75rem 1rem",backgroundColor:"var(--text-primary, #1f2937)",color:"var(--bg-primary, #fff)",borderRadius:"0.5rem",boxShadow:"0 4px 6px -1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",fontSize:"0.875rem"}};return s.createElement("div",{className:`nice-traceless-warning nice-traceless-warning--${a} ${n}`.trim(),role:"alert",style:{display:"flex",alignItems:"center",gap:"0.5rem",...u[a]}},s.createElement("span",{"aria-hidden":!0},s.createElement(d.oa,{name:"warning",size:16})),s.createElement("span",{style:{flex:1}},c),r&&s.createElement("button",{onClick:p,"aria-label":"Dismiss warning",style:{background:"none",border:"none",cursor:"pointer",padding:"0.25rem",opacity:.7}},s.createElement(d.oa,{name:"close",size:14})))}const qo=s.createContext(null);function Rp(){const t=s.useContext(qo);return t||{isActive:!1,trackEvent:()=>{},trackPageView:()=>{},setUserProperties:()=>{},mode:"traceless",provider:"custom"}}function Mp({children:t,provider:n,trackingId:i,endpoint:a,customHandler:r,cookies:o=!0,localStorage:c=!1,minMode:l="balanced",autoTrackPageViews:m=!0,respectDoNotTrack:p=!0,debug:u=!1,domain:f,scriptUrl:b,anonymizeIp:h=!0,cookieless:y=!1}){const{policy:g,mode:v}=it.useTracelessPolicySafe(),_=s.useMemo(()=>{if(p&&typeof navigator<"u"){const T=navigator.doNotTrack||window.doNotTrack;if(T==="1"||T==="yes")return u&&console.log("[NiceAnalyticsTracker] Disabled: Do Not Track is set"),!1}const N=["traceless","ephemeral","private","balanced","full"],k=N.indexOf(v),E=N.indexOf(l);return k<E?(u&&console.log(`[NiceAnalyticsTracker] Disabled: mode ${v} < minMode ${l}`),!1):o&&!g.cookiesAllowed&&!y?(u&&console.log("[NiceAnalyticsTracker] Disabled: cookies required but not allowed"),!1):c&&!g.localStorageAllowed?(u&&console.log("[NiceAnalyticsTracker] Disabled: localStorage required but not allowed"),!1):!0},[v,l,g,o,c,y,p,u]);s.useEffect(()=>{if(_){if(n==="custom"&&r){r.init();return}switch(n){case"plausible":Pn(b||"https://plausible.io/js/script.js",{"data-domain":i||f});break;case"simple-analytics":Pn(b||"https://scripts.simpleanalyticscdn.com/latest.js");break;case"umami":Pn(b||a||"",{"data-website-id":i});break;case"fathom":Pn(b||"https://cdn.usefathom.com/script.js",{"data-site":i});break;case"matomo":Bp(a||"",i||"",h);break;case"google-analytics":y||(Pn(`https://www.googletagmanager.com/gtag/js?id=${i}`),zp(i||"",h));break;case"google-tag-manager":y||Lp(i||"");break;default:u&&console.warn(`[NiceAnalyticsTracker] Unknown provider: ${n}`)}u&&console.log(`[NiceAnalyticsTracker] Initialized: ${n}`)}},[_,n,i,a,b,f,h,y,r,u]);const x=s.useCallback(N=>{if(_){if(u&&console.log("[NiceAnalyticsTracker] trackPageView:",N),n==="custom"&&r){r.trackPageView(N);return}switch(n){case"plausible":window.plausible?.("pageview");break;case"umami":window.umami?.track();break;case"fathom":window.fathom?.trackPageview();break;case"matomo":window._paq?.push(["trackPageView"]);break;case"google-analytics":window.gtag?.("event","page_view",{page_path:N.path,page_title:N.title});break}}},[_,n,r,u]);s.useEffect(()=>{if(!_||!m)return;x({path:typeof window<"u"?window.location.pathname:"/",title:typeof document<"u"?document.title:""});const N=()=>{x({path:window.location.pathname,title:document.title})};return window.addEventListener("popstate",N),()=>window.removeEventListener("popstate",N)},[_,m,x]);const w=s.useCallback(N=>{if(_){if(u&&console.log("[NiceAnalyticsTracker] trackEvent:",N),n==="custom"&&r){r.trackEvent(N);return}switch(n){case"plausible":window.plausible?.(N.name,{props:N.properties});break;case"umami":window.umami?.track(N.name,N.properties);break;case"fathom":window.fathom?.trackGoal(N.name,N.value??0);break;case"matomo":window._paq?.push(["trackEvent",N.category,N.name,N.label,N.value]);break;case"google-analytics":window.gtag?.("event",N.name,{event_category:N.category,event_label:N.label,value:N.value,...N.properties});break}}},[_,n,r,u]),j=s.useCallback(N=>{if(_){if(u&&console.log("[NiceAnalyticsTracker] setUserProperties:",N),n==="custom"&&r?.setUserProperties){r.setUserProperties(N);return}switch(n){case"google-analytics":window.gtag?.("set","user_properties",N);break;case"matomo":Object.entries(N).forEach(([k,E])=>{window._paq?.push(["setCustomVariable",k,String(E)])});break}}},[_,n,r,u]),C=s.useMemo(()=>({isActive:_,trackEvent:w,trackPageView:x,setUserProperties:j,mode:v,provider:n}),[_,w,x,j,v,n]);return s.createElement(qo.Provider,{value:C},t)}function Pn(t,n){if(typeof document>"u"||!t||document.querySelector(`script[src="${t}"]`))return;const a=document.createElement("script");a.src=t,a.async=!0,a.defer=!0,n&&Object.entries(n).forEach(([r,o])=>{o!==void 0&&a.setAttribute(r,o)}),document.head.appendChild(a)}function zp(t,n){if(typeof window>"u")return;window.dataLayer=window.dataLayer||[];function i(...a){window.dataLayer.push(arguments)}window.gtag=i,i("js",new Date),i("config",t,{anonymize_ip:n})}function Lp(t){if(typeof window>"u")return;window.dataLayer=window.dataLayer||[],window.dataLayer.push({"gtm.start":new Date().getTime(),event:"gtm.js"});const n=document.createElement("script");n.async=!0,n.src=`https://www.googletagmanager.com/gtm.js?id=${t}`,document.head.appendChild(n)}function Bp(t,n,i){if(typeof window>"u"||!t)return;window._paq=window._paq||[];const a=window._paq;i&&a.push(["setAnonymizeIp",!0]),a.push(["trackPageView"]),a.push(["enableLinkTracking"]),a.push(["setTrackerUrl",`${t}/matomo.php`]),a.push(["setSiteId",n]);const r=document.createElement("script");r.async=!0,r.src=`${t}/matomo.js`,document.head.appendChild(r)}function Vt(t,n=2){return String(t).padStart(n,"0")}function Ji(t){return Vt(t.getUTCFullYear(),4)+Vt(t.getUTCMonth()+1)+Vt(t.getUTCDate())+"T"+Vt(t.getUTCHours())+Vt(t.getUTCMinutes())+Vt(t.getUTCSeconds())+"Z"}function dr(t){return Vt(t.getFullYear(),4)+Vt(t.getMonth()+1)+Vt(t.getDate())}function $n(t){return t.replace(/\\/g,"\\\\").replace(/;/g,"\\;").replace(/,/g,"\\,").replace(/\r?\n/g,"\\n")}function Fp(t){if(t.length<=75)return t;const n=[];let i=0;for(;i<t.length;)n.push(t.slice(i,i+75)),i+=75;return n.join(`\r
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./charts-B-sl1V9y.cjs"),it=require("./core-C2KhqEaU.cjs"),s=require("react"),Me=require("./pickerCommons-B-wOzHFh.cjs"),qe=require("./NiceForm-C6F0HvrX.cjs"),Pt=require("./NiceSelect-BVoqtfYN.cjs"),De=require("./NiceColorPicker-CKVbjicN.cjs"),ze=require("./NiceMention-BjeLN4Jx.cjs"),Bo=require("./NiceHtmlEditor-D8RQcBNp.cjs"),$i=require("./NiceCodeEditor-cIqUSk3j.cjs"),Ie=require("./NiceModuleLifecyclePanel-Df_1k5qW.cjs"),mt=require("./NiceScheduler-nW7fMzKL.cjs"),gt=require("./NicePivotGrid-Cmiolup9.cjs"),e=require("react/jsx-runtime"),Dp=require("react-dom"),ot=require("./NiceSavedQueryPanel-BhjFJBvn.cjs"),nt=require("./NiceLoginForm-BrvIc-wq.cjs"),Ii=require("./NiceModal-0UxviEYE.cjs"),Fo=require("./NiceConfirmDialog-oSxVpsCs.cjs"),Fa=require("./NicePagination-EEQ6o1dF.cjs"),sn=require("./NiceDataGrid-3AIf2D3t.cjs"),Xe=require("./NiceWindow-DdD9k4nc.cjs"),Oo=require("./NiceGantt-_ysNSVYR.cjs"),Nt=require("./devops-CU0sOVEA.cjs"),Ap=require("./NiceDocumentViewer-BE0gKBlw.cjs"),Bt=require("./no-code-C58g8_fb.cjs"),Tn=require("./data-branching-DC6hcBQN.cjs");function Vo({className:t="",size:n="md",showTooltip:i=!0,showLabel:a=!0,onClick:r,label:o,tooltipPosition:c="bottom"}){const{badgeInfo:l,isLoading:m}=it.useTracelessPolicySafe(),[p,u]=s.useState(!1),f={sm:"nice-traceless-badge--sm",md:"nice-traceless-badge--md",lg:"nice-traceless-badge--lg"},b=o||l.label;return s.createElement("div",{className:`nice-traceless-badge ${l.cssClass} ${f[n]} ${t}`.trim(),onClick:r,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),role:r?"button":"status",tabIndex:r?0:void 0,onKeyDown:r?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),r())}:void 0,"aria-label":`Privacy mode: ${b}`,style:{display:"inline-flex",alignItems:"center",gap:"0.375rem",padding:n==="sm"?"0.25rem 0.5rem":n==="lg"?"0.5rem 1rem":"0.375rem 0.75rem",borderRadius:"9999px",fontSize:n==="sm"?"0.75rem":n==="lg"?"1rem":"0.875rem",fontWeight:500,backgroundColor:`${l.color}20`,color:l.color,border:`1px solid ${l.color}40`,cursor:r?"pointer":"default",transition:"all 0.2s ease",position:"relative",userSelect:"none"}},s.createElement("span",{"aria-hidden":!0},m?s.createElement(d.oa,{name:"clock",size:14}):l.icon),a&&s.createElement("span",null,b),i&&p&&s.createElement("div",{role:"tooltip",style:{position:"absolute",[c==="top"?"bottom":c==="bottom"?"top":c==="left"?"right":"left"]:"100%",[c==="top"||c==="bottom"?"left":"top"]:"50%",transform:c==="top"||c==="bottom"?"translateX(-50%)":"translateY(-50%)",marginTop:c==="bottom"?"0.5rem":void 0,marginBottom:c==="top"?"0.5rem":void 0,marginLeft:c==="right"?"0.5rem":void 0,marginRight:c==="left"?"0.5rem":void 0,padding:"0.5rem 0.75rem",backgroundColor:"var(--text-primary, #1f2937)",color:"var(--bg-primary, #fff)",borderRadius:"0.375rem",fontSize:"0.75rem",whiteSpace:"nowrap",zIndex:50,boxShadow:"0 4px 6px -1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",maxWidth:"280px",textAlign:"left"}},l.tooltip))}function Pp({className:t="",showReport:n=!0,showAudit:i=!0,showModeSelector:a=!0,availableModes:r=["traceless","ephemeral","private"],onModeChange:o}){const{policy:c,badgeInfo:l,setUserPreference:m,generateReport:p}=it.useTracelessPolicySafe(),{result:u,run:f}=it.useStorageAudit(),[b,h]=s.useState(null),y=s.useCallback(_=>{m({preferredMode:_}),o?.(_)},[m,o]),g=s.useCallback(()=>{h(p())},[p]),v={traceless:"Zero storage. Maximum privacy. Data resets on every page load.",ephemeral:"Session-only. Data clears when you close the tab.",private:"Minimal storage with secure authentication.",balanced:"Local preferences saved. No tracking cookies.",full:"All storage enabled with consent controls.",custom:"Custom configuration."};return s.createElement("div",{className:`nice-traceless-panel ${t}`.trim(),style:{padding:"1.5rem",backgroundColor:"var(--bg-secondary, #f9fafb)",borderRadius:"0.75rem",border:"1px solid var(--border-color, #e5e7eb)"}},s.createElement("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1.5rem"}},s.createElement(Vo,{size:"lg",showTooltip:!1}),s.createElement("div",null,s.createElement("h3",{style:{margin:0,fontSize:"1.125rem",fontWeight:600}},"Privacy Settings"),s.createElement("p",{style:{margin:0,fontSize:"0.875rem",color:"var(--text-muted, #6b7280)"}},v[c.effectiveMode]))),a&&s.createElement("div",{style:{marginBottom:"1.5rem"}},s.createElement("label",{style:{display:"block",marginBottom:"0.5rem",fontWeight:500}},"Privacy Level"),s.createElement("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap"}},r.map(_=>s.createElement("button",{key:_,onClick:()=>y(_),style:{padding:"0.5rem 1rem",borderRadius:"0.5rem",border:c.effectiveMode===_?"2px solid var(--nice-primary, #3b82f6)":"1px solid var(--border-color, #d1d5db)",backgroundColor:c.effectiveMode===_?"var(--info-bg, #eff6ff)":"var(--bg-primary, #fff)",cursor:"pointer",fontWeight:c.effectiveMode===_?600:400,textTransform:"capitalize"}},_)))),s.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"1rem",marginBottom:"1.5rem"}},s.createElement(Ki,{title:"Cookies",allowed:c.cookiesAllowed,icon:s.createElement(d.oa,{name:"file",size:24})}),s.createElement(Ki,{title:"localStorage",allowed:c.localStorageAllowed,icon:s.createElement(d.oa,{name:"save",size:24})}),s.createElement(Ki,{title:"sessionStorage",allowed:c.sessionStorageAllowed,icon:s.createElement(d.oa,{name:"clipboard",size:24})})),s.createElement("div",{style:{display:"flex",gap:"0.75rem",flexWrap:"wrap"}},i&&s.createElement("button",{onClick:f,style:{padding:"0.5rem 1rem",borderRadius:"0.5rem",border:"1px solid var(--border-color, #d1d5db)",backgroundColor:"var(--bg-primary, #fff)",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"0.375rem"}},s.createElement(d.oa,{name:"search",size:16}),"Run Audit"),n&&s.createElement("button",{onClick:g,style:{padding:"0.5rem 1rem",borderRadius:"0.5rem",border:"1px solid var(--border-color, #d1d5db)",backgroundColor:"var(--bg-primary, #fff)",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"0.375rem"}},s.createElement(d.oa,{name:"file",size:16}),"Generate Report")),u&&s.createElement("div",{style:{marginTop:"1rem",padding:"1rem",backgroundColor:u.compliant?"var(--nice-success-bg, #ecfdf5)":"var(--danger-bg, #fef2f2)",borderRadius:"0.5rem",border:`1px solid ${u.compliant?"var(--color-success, #10b981)":"var(--color-error, #ef4444)"}`}},s.createElement("p",{style:{margin:0,fontWeight:500,color:u.compliant?"var(--nice-success, #059669)":"var(--color-error, #dc2626)",display:"inline-flex",alignItems:"center",gap:"0.375rem"}},s.createElement(d.oa,{name:u.compliant?"check":"close",size:16}),u.compliant?"Compliant":"Violations Found"),!u.compliant&&u.violations.map((_,x)=>s.createElement("p",{key:x,style:{margin:"0.5rem 0 0",fontSize:"0.875rem"}},`• ${_.message}`))),b&&s.createElement("div",{style:{marginTop:"1rem",padding:"1rem",backgroundColor:"var(--bg-primary, #fff)",borderRadius:"0.5rem",border:"1px solid var(--border-color, #d1d5db)"}},s.createElement("h4",{style:{margin:"0 0 0.5rem",fontSize:"0.875rem",fontWeight:600}},"Compliance Statement"),s.createElement("p",{style:{margin:0,fontSize:"0.875rem",color:"var(--text-secondary, #4b5563)"}},b.statement)))}function Ki({title:t,allowed:n,icon:i}){return s.createElement("div",{style:{padding:"0.75rem",backgroundColor:"var(--bg-primary, #fff)",borderRadius:"0.5rem",border:"1px solid var(--border-color, #e5e7eb)",textAlign:"center"}},s.createElement("div",{style:{fontSize:"1.5rem",marginBottom:"0.25rem"}},i),s.createElement("div",{style:{fontSize:"0.75rem",fontWeight:500,marginBottom:"0.25rem"}},t),s.createElement("div",{style:{fontSize:"0.75rem",color:n?"var(--color-success, #10b981)":"var(--text-muted, #6b7280)",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"0.25rem"}},s.createElement(d.oa,{name:n?"check":"close",size:12}),n?"Enabled":"Disabled"))}function $p({className:t="",position:n="bottom",variant:i="minimal",onAccept:a,onDecline:r,onCustomize:o,privacyPolicyUrl:c,acceptText:l="Accept",declineText:m="Decline"}){const{shouldShow:p,mode:u,dismiss:f}=it.useCookieBannerVisibility(),b=s.useCallback(()=>{a?.(),f()},[a,f]),h=s.useCallback(()=>{r?.(),f()},[r,f]);if(!p)return null;const y=n==="top"?{top:0,borderBottom:"1px solid var(--border-color, #e5e7eb)"}:{bottom:0,borderTop:"1px solid var(--border-color, #e5e7eb)"};return s.createElement("div",{className:`nice-consent-banner nice-consent-banner--${i} ${t}`.trim(),role:"dialog","aria-label":"Cookie consent",style:{position:"fixed",left:0,right:0,padding:"1rem 1.5rem",backgroundColor:"var(--bg-primary, #fff)",boxShadow:"0 -4px 6px -1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1rem",flexWrap:"wrap",...y}},s.createElement("div",{style:{flex:1,minWidth:"200px"}},s.createElement("p",{style:{margin:0,fontSize:"0.875rem"}},"We use cookies and similar technologies to improve your experience. ",c&&s.createElement("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-primary, #3b82f6)"}},"Learn more"))),s.createElement("div",{style:{display:"flex",gap:"0.5rem",flexShrink:0}},o&&s.createElement("button",{onClick:o,style:{padding:"0.5rem 1rem",borderRadius:"0.375rem",border:"1px solid var(--border-color, #d1d5db)",backgroundColor:"var(--bg-primary, #fff)",cursor:"pointer"}},"Customize"),s.createElement("button",{onClick:h,style:{padding:"0.5rem 1rem",borderRadius:"0.375rem",border:"1px solid var(--border-color, #d1d5db)",backgroundColor:"var(--bg-primary, #fff)",cursor:"pointer"}},m),s.createElement("button",{onClick:b,style:{padding:"0.5rem 1rem",borderRadius:"0.375rem",border:"none",backgroundColor:"var(--color-primary, #3b82f6)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontWeight:500}},l)))}function Ip({useCase:t,className:n="",message:i,variant:a="inline",dismissible:r=!1,onDismiss:o}){const{warningMessage:c}=it.useTracelessPolicySafe().policy.effectiveMode==="traceless"?{warningMessage:i||"This feature has limited functionality in Traceless mode."}:{warningMessage:void 0},[l,m]=s.useState(!1),p=s.useCallback(()=>{m(!0),o?.()},[o]);if(!c||l)return null;const u={inline:{padding:"0.5rem 0.75rem",backgroundColor:"var(--warning-bg, #fef3c7)",border:"1px solid var(--nice-warning-light, #fbbf24)",borderRadius:"0.375rem",fontSize:"0.875rem"},banner:{padding:"0.75rem 1rem",backgroundColor:"var(--warning-bg, #fef3c7)",borderBottom:"1px solid var(--nice-warning-light, #fbbf24)",fontSize:"0.875rem"},toast:{padding:"0.75rem 1rem",backgroundColor:"var(--text-primary, #1f2937)",color:"var(--bg-primary, #fff)",borderRadius:"0.5rem",boxShadow:"0 4px 6px -1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",fontSize:"0.875rem"}};return s.createElement("div",{className:`nice-traceless-warning nice-traceless-warning--${a} ${n}`.trim(),role:"alert",style:{display:"flex",alignItems:"center",gap:"0.5rem",...u[a]}},s.createElement("span",{"aria-hidden":!0},s.createElement(d.oa,{name:"warning",size:16})),s.createElement("span",{style:{flex:1}},c),r&&s.createElement("button",{onClick:p,"aria-label":"Dismiss warning",style:{background:"none",border:"none",cursor:"pointer",padding:"0.25rem",opacity:.7}},s.createElement(d.oa,{name:"close",size:14})))}const qo=s.createContext(null);function Rp(){const t=s.useContext(qo);return t||{isActive:!1,trackEvent:()=>{},trackPageView:()=>{},setUserProperties:()=>{},mode:"traceless",provider:"custom"}}function Mp({children:t,provider:n,trackingId:i,endpoint:a,customHandler:r,cookies:o=!0,localStorage:c=!1,minMode:l="balanced",autoTrackPageViews:m=!0,respectDoNotTrack:p=!0,debug:u=!1,domain:f,scriptUrl:b,anonymizeIp:h=!0,cookieless:y=!1}){const{policy:g,mode:v}=it.useTracelessPolicySafe(),_=s.useMemo(()=>{if(p&&typeof navigator<"u"){const T=navigator.doNotTrack||window.doNotTrack;if(T==="1"||T==="yes")return u&&console.log("[NiceAnalyticsTracker] Disabled: Do Not Track is set"),!1}const N=["traceless","ephemeral","private","balanced","full"],k=N.indexOf(v),E=N.indexOf(l);return k<E?(u&&console.log(`[NiceAnalyticsTracker] Disabled: mode ${v} < minMode ${l}`),!1):o&&!g.cookiesAllowed&&!y?(u&&console.log("[NiceAnalyticsTracker] Disabled: cookies required but not allowed"),!1):c&&!g.localStorageAllowed?(u&&console.log("[NiceAnalyticsTracker] Disabled: localStorage required but not allowed"),!1):!0},[v,l,g,o,c,y,p,u]);s.useEffect(()=>{if(_){if(n==="custom"&&r){r.init();return}switch(n){case"plausible":Pn(b||"https://plausible.io/js/script.js",{"data-domain":i||f});break;case"simple-analytics":Pn(b||"https://scripts.simpleanalyticscdn.com/latest.js");break;case"umami":Pn(b||a||"",{"data-website-id":i});break;case"fathom":Pn(b||"https://cdn.usefathom.com/script.js",{"data-site":i});break;case"matomo":Bp(a||"",i||"",h);break;case"google-analytics":y||(Pn(`https://www.googletagmanager.com/gtag/js?id=${i}`),zp(i||"",h));break;case"google-tag-manager":y||Lp(i||"");break;default:u&&console.warn(`[NiceAnalyticsTracker] Unknown provider: ${n}`)}u&&console.log(`[NiceAnalyticsTracker] Initialized: ${n}`)}},[_,n,i,a,b,f,h,y,r,u]);const x=s.useCallback(N=>{if(_){if(u&&console.log("[NiceAnalyticsTracker] trackPageView:",N),n==="custom"&&r){r.trackPageView(N);return}switch(n){case"plausible":window.plausible?.("pageview");break;case"umami":window.umami?.track();break;case"fathom":window.fathom?.trackPageview();break;case"matomo":window._paq?.push(["trackPageView"]);break;case"google-analytics":window.gtag?.("event","page_view",{page_path:N.path,page_title:N.title});break}}},[_,n,r,u]);s.useEffect(()=>{if(!_||!m)return;x({path:typeof window<"u"?window.location.pathname:"/",title:typeof document<"u"?document.title:""});const N=()=>{x({path:window.location.pathname,title:document.title})};return window.addEventListener("popstate",N),()=>window.removeEventListener("popstate",N)},[_,m,x]);const w=s.useCallback(N=>{if(_){if(u&&console.log("[NiceAnalyticsTracker] trackEvent:",N),n==="custom"&&r){r.trackEvent(N);return}switch(n){case"plausible":window.plausible?.(N.name,{props:N.properties});break;case"umami":window.umami?.track(N.name,N.properties);break;case"fathom":window.fathom?.trackGoal(N.name,N.value??0);break;case"matomo":window._paq?.push(["trackEvent",N.category,N.name,N.label,N.value]);break;case"google-analytics":window.gtag?.("event",N.name,{event_category:N.category,event_label:N.label,value:N.value,...N.properties});break}}},[_,n,r,u]),j=s.useCallback(N=>{if(_){if(u&&console.log("[NiceAnalyticsTracker] setUserProperties:",N),n==="custom"&&r?.setUserProperties){r.setUserProperties(N);return}switch(n){case"google-analytics":window.gtag?.("set","user_properties",N);break;case"matomo":Object.entries(N).forEach(([k,E])=>{window._paq?.push(["setCustomVariable",k,String(E)])});break}}},[_,n,r,u]),C=s.useMemo(()=>({isActive:_,trackEvent:w,trackPageView:x,setUserProperties:j,mode:v,provider:n}),[_,w,x,j,v,n]);return s.createElement(qo.Provider,{value:C},t)}function Pn(t,n){if(typeof document>"u"||!t||document.querySelector(`script[src="${t}"]`))return;const a=document.createElement("script");a.src=t,a.async=!0,a.defer=!0,n&&Object.entries(n).forEach(([r,o])=>{o!==void 0&&a.setAttribute(r,o)}),document.head.appendChild(a)}function zp(t,n){if(typeof window>"u")return;window.dataLayer=window.dataLayer||[];function i(...a){window.dataLayer.push(arguments)}window.gtag=i,i("js",new Date),i("config",t,{anonymize_ip:n})}function Lp(t){if(typeof window>"u")return;window.dataLayer=window.dataLayer||[],window.dataLayer.push({"gtm.start":new Date().getTime(),event:"gtm.js"});const n=document.createElement("script");n.async=!0,n.src=`https://www.googletagmanager.com/gtm.js?id=${t}`,document.head.appendChild(n)}function Bp(t,n,i){if(typeof window>"u"||!t)return;window._paq=window._paq||[];const a=window._paq;i&&a.push(["setAnonymizeIp",!0]),a.push(["trackPageView"]),a.push(["enableLinkTracking"]),a.push(["setTrackerUrl",`${t}/matomo.php`]),a.push(["setSiteId",n]);const r=document.createElement("script");r.async=!0,r.src=`${t}/matomo.js`,document.head.appendChild(r)}function Vt(t,n=2){return String(t).padStart(n,"0")}function Ji(t){return Vt(t.getUTCFullYear(),4)+Vt(t.getUTCMonth()+1)+Vt(t.getUTCDate())+"T"+Vt(t.getUTCHours())+Vt(t.getUTCMinutes())+Vt(t.getUTCSeconds())+"Z"}function dr(t){return Vt(t.getFullYear(),4)+Vt(t.getMonth()+1)+Vt(t.getDate())}function $n(t){return t.replace(/\\/g,"\\\\").replace(/;/g,"\\;").replace(/,/g,"\\,").replace(/\r?\n/g,"\\n")}function Fp(t){if(t.length<=75)return t;const n=[];let i=0;for(;i<t.length;)n.push(t.slice(i,i+75)),i+=75;return n.join(`\r
2
2
  `)}function Uo(t,n={}){const{prodId:i="-//nice2dev//NiceToDev.UI//EN",calendarName:a,method:r}=n,o=["BEGIN:VCALENDAR","VERSION:2.0",`PRODID:${i}`,"CALSCALE:GREGORIAN"];r&&o.push(`METHOD:${r}`),a&&o.push(`X-WR-CALNAME:${$n(a)}`);const c=Ji(new Date);for(const l of t)o.push("BEGIN:VEVENT"),o.push(`UID:${l.uid}`),o.push(`DTSTAMP:${c}`),l.allDay?(o.push(`DTSTART;VALUE=DATE:${dr(l.start)}`),l.end&&o.push(`DTEND;VALUE=DATE:${dr(l.end)}`)):(o.push(`DTSTART:${Ji(l.start)}`),l.end&&o.push(`DTEND:${Ji(l.end)}`)),o.push(`SUMMARY:${$n(l.summary)}`),l.description&&o.push(`DESCRIPTION:${$n(l.description)}`),l.location&&o.push(`LOCATION:${$n(l.location)}`),l.url&&o.push(`URL:${l.url}`),l.status&&o.push(`STATUS:${l.status}`),l.rrule&&o.push(`RRULE:${l.rrule}`),l.categories&&l.categories.length>0&&o.push(`CATEGORIES:${l.categories.map($n).join(",")}`),o.push("END:VEVENT");return o.push("END:VCALENDAR"),o.map(Fp).join(`\r
3
3
  `)}function Go(t,n={}){const i=Uo(t,n);return new Blob([i],{type:"text/calendar;charset=utf-8"})}function Op(t,n="calendar.ics",i={}){if(typeof window>"u"||typeof URL.createObjectURL!="function")return;const a=Go(t,i),r=URL.createObjectURL(a),o=document.createElement("a");o.href=r,o.download=n,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(r)}function Vp(t){const n=t?.closest?.("[data-theme], .nice-dark, .nice-light, .dark");if(!n)return"";const i=n.getAttribute("data-theme");return i==="dark"||n.classList.contains("nice-dark")||n.classList.contains("dark")?"nice-dark":i==="light"||n.classList.contains("nice-light")?"nice-light":""}const Wo=({icon:t,items:n,direction:i="right",position:a={bottom:24,right:24},disabled:r=!1,className:o,style:c,id:l})=>{const[m,p]=s.useState(!1),u=m&&!r,f=s.useRef(null),b=s.useRef(null),[h,y]=s.useState(null),[g,v]=s.useState("");s.useLayoutEffect(()=>{if(!u||!b.current)return;const x=b.current,w=()=>y(x.getBoundingClientRect());return w(),v(Vp(f.current)),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[u]);const _=e.jsx("div",{className:"nice-speed-dial__items",role:"menu",children:n.map(x=>e.jsx("button",{type:"button",role:"menuitem",className:"nice-speed-dial__item nice-btn nice-btn--secondary",onClick:()=>{x.onClick?.(),p(!1)},title:x.label,"aria-label":x.label,children:x.icon},x.key))});return e.jsxs("div",{ref:f,id:l,className:["nice-speed-dial",`nice-speed-dial--${i}`,u?"nice-speed-dial--open":"",r?"nice-speed-dial--disabled":"",o||""].filter(Boolean).join(" "),style:{...a,...c},children:[e.jsx("button",{ref:b,type:"button",className:"nice-speed-dial__trigger nice-btn nice-btn--primary",onClick:()=>p(x=>!x),"aria-expanded":u,"aria-haspopup":"menu",disabled:r,children:e.jsx("span",{className:"nice-speed-dial__trigger-icon",children:t??e.jsx(d.oa,{name:"plus",size:24})})}),u&&h&&typeof document<"u"&&Dp.createPortal(e.jsx("div",{className:["nice-speed-dial","nice-speed-dial--portal",`nice-speed-dial--${i}`,"nice-speed-dial--open",g].filter(Boolean).join(" "),"data-theme":g==="nice-dark"?"dark":g==="nice-light"?"light":void 0,style:{position:"fixed",left:h.left,top:h.top,width:h.width,height:h.height,right:"auto",bottom:"auto",margin:0},children:_}),document.body)]})},St=({children:t,variant:n="primary",size:i="md",dot:a,outline:r,subtle:o,pulse:c,icon:l,removable:m,onRemove:p,className:u,style:f,displayStyle:b})=>{const h=d.rc("badge",b),y=d.ac("badge",b),g={...h};for(const v of["fontSize","padding","paddingLeft","paddingRight","paddingTop","paddingBottom","paddingInline","paddingBlock"])delete g[v];if(n!=="primary"||r||o)for(const v of["background","backgroundColor","color"])delete g[v];if(r||o)for(const v of["border","borderColor","borderWidth","borderStyle","boxShadow"])delete g[v];return e.jsxs("span",{className:`nice-badge nice-badge--${n} nice-badge--${i} nice-badge--ds-${y} ${a?"nice-badge--dot":""} ${r?"nice-badge--outline":""} ${o?"nice-badge--subtle":""} ${c?"nice-badge--pulse":""} ${m?"nice-badge--removable":""} ${u||""}`,style:{...g,...f},children:[l&&e.jsx("span",{className:"nice-badge__icon",children:l}),t,m&&e.jsx("button",{type:"button",className:"nice-badge__remove",onClick:p,"aria-label":"Remove",children:e.jsx(d.oa,{name:"close",size:14})})]})},_i=({children:t,selected:n,removable:i,onClick:a,onRemove:r,color:o,size:c="md",className:l,style:m})=>e.jsxs("span",{className:`nice-tag nice-tag--${c} ${a?"nice-tag--clickable":""} ${n?"nice-tag--selected":""} ${l||""}`,style:{...m,...o&&!n?{borderColor:o,color:o}:{}},onClick:a,role:a?"button":void 0,tabIndex:a?0:void 0,children:[t,i&&e.jsx("button",{type:"button",className:"nice-tag__remove",onClick:p=>{p.stopPropagation(),r?.()},"aria-label":"Remove",children:e.jsx(d.oa,{name:"close",size:14})})]});function qp(t){return t.split(" ").map(n=>n[0]).filter(Boolean).slice(0,2).join("").toUpperCase()}const jt=({src:t,alt:n,name:i,size:a="md",square:r,color:o,className:c,style:l})=>e.jsx("div",{className:`nice-avatar nice-avatar--${a} ${r?"nice-avatar--square":""} ${c||""}`,style:{...l,...o?{background:o}:{}},"aria-label":n||i,children:t?e.jsx("img",{src:t,alt:n||i||""}):i?qp(i):e.jsx(d.oa,{name:"user",size:"md",className:"nice-avatar__fallback-icon"})});function Up(t){return t?t.trim().split(/\s+/).map(n=>n[0]).join("").slice(0,2).toUpperCase():""}const Oa=({children:t,items:n,max:i,size:a="md",className:r,style:o})=>{const c=`nice-avatar nice-avatar--${a}`;let l,m;if(n&&n.length>0)m=n.length,l=(i?n.slice(0,i):n).map((f,b)=>{const h=f.src?e.jsx("img",{src:f.src,alt:f.name??""}):e.jsx("span",{children:Up(f.name)});return f.href?e.jsx("a",{className:c,href:f.href,title:f.name,onClick:f.onClick,children:h},b):f.onClick?e.jsx("button",{type:"button",className:c,title:f.name,onClick:f.onClick,children:h},b):e.jsx("span",{className:c,title:f.name,children:h},b)});else{const u=s.Children.toArray(t);m=u.length,l=(i?u.slice(0,i):u).map(b=>s.isValidElement(b)&&b.props.size==null?s.cloneElement(b,{size:a}):b)}const p=i?Math.max(0,m-i):0;return e.jsxs("div",{className:`nice-avatar-group nice-avatar-group--${a} ${r||""}`,style:o,children:[l,p>0&&e.jsxs("div",{className:c,style:{background:"var(--text-muted)"},children:["+",p]})]})},Gp={xxs:4,xs:6,sm:8,md:12,lg:16,xl:20,xxl:28},Va=s.forwardRef(({children:t,items:n,renderCard:i,searchable:a,searchField:r="text",searchPlaceholder:o,emptyText:c,onCardClick:l,size:m="md",minColumnWidth:p=240,columns:u,gap:f,align:b="stretch",value:h,onChange:y,name:g,disabled:v,readOnly:_,loading:x,error:w,errorText:j,className:C,style:N},k)=>{const{t:E}=d.Gt(),[T,$]=s.useState(""),A=u?`repeat(${u}, minmax(0, 1fr))`:`repeat(auto-fill, minmax(${p}px, 1fr))`,S=f??Gp[m]??12,D=typeof w=="string"?w.length>0:!!w,P=typeof w=="string"?w:w?j??"":"",se=n!=null&&i!=null,Y=s.useMemo(()=>{if(!se||!T)return n??[];const K=T.toLowerCase();return(n??[]).filter(U=>String(U[r]??"").toLowerCase().includes(K))},[se,n,T,r]),H=y!=null||h!=null,W=s.useMemo(()=>({value:h,onChange:K=>{!v&&!_&&y?.(K)},name:g}),[h,y,g,v,_]),F=`nice-card-group nice-card-group--${m}${v?" nice-card-group--disabled":""}${_?" nice-card-group--readonly":""}${x?" nice-card-group--loading":""}${D?" nice-card-group--error":""}${C?` ${C}`:""}`;if(se)return e.jsx(Ie.NiceCardGroupSizeContext.Provider,{value:m,children:e.jsxs("div",{ref:k,className:F,style:{position:"relative",...N},"aria-disabled":v||void 0,"aria-busy":x||void 0,children:[a&&e.jsx("div",{className:"nice-card-group__search",children:e.jsx("input",{type:"text",value:T,onChange:K=>$(K.target.value),placeholder:o||E("controls.search","Search...")})}),x?e.jsx("div",{className:"nice-card-group__empty",children:e.jsx("span",{className:"nice-spinner nice-spinner--md"})}):Y.length===0?e.jsx("div",{className:"nice-card-group__empty",children:c||E("controls.noData","No data available")}):e.jsx("div",{className:"nice-card-group__grid",style:{display:"grid",gridTemplateColumns:A,gap:S,alignItems:b},children:Y.map(K=>e.jsx("div",{className:"nice-card-group__data-card",onClick:l?()=>l(K):void 0,style:l?{cursor:"pointer"}:void 0,children:i(K)},K.key))}),P&&e.jsx("div",{className:"nice-card-group__error",role:"alert",children:P})]})});const z=e.jsxs("div",{ref:k,className:F,style:{display:"grid",gridTemplateColumns:A,gap:S,alignItems:b,position:x?"relative":void 0,...N},role:H?"radiogroup":void 0,"aria-label":H?g:void 0,"aria-disabled":v||void 0,"aria-busy":x||void 0,children:[t,x&&e.jsx("span",{className:"nice-card-group__spinner","aria-hidden":"true",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),P&&e.jsx("div",{className:"nice-card-group__error",role:"alert",style:{gridColumn:"1 / -1"},children:P})]});return e.jsx(Ie.NiceCardGroupSizeContext.Provider,{value:m,children:H?e.jsx(Ie.NiceCardRadioContext.Provider,{value:W,children:z}):z})});Va.displayName="NiceCardGroup";const Wp={color:!0,description:!0,volume:!0,gain:!0},qa=s.forwardRef(function(n,i){const{children:a,name:r,description:o,defaultDescription:c="",onDescriptionChange:l,labelPlacement:m="bottom",number:p,color:u="transparent",onColorChange:f,volume:b,defaultVolume:h=80,onVolumeChange:y,gain:g,defaultGain:v=50,onGainChange:_,contextMenu:x=!0,quickControls:w,onOpenConfig:j,fullConfigLabel:C="Full configuration",selected:N,onClick:k,focusId:E,className:T,style:$,title:A,"data-testid":S}=n,D={...Wp,...w},P=s.useRef(null),se=fe=>{P.current=fe,typeof i=="function"?i(fe):i&&(i.current=fe)},Y=P;d.Xs(Y,{id:E??"",onActivate:k,disabled:!E});const[H,W]=d.Vu({value:o,defaultValue:c,onChange:l,componentName:"NiceDeviceTile"}),[F,z]=d.Vu({value:b,defaultValue:h,onChange:y,componentName:"NiceDeviceTile"}),[K,U]=d.Vu({value:g,defaultValue:v,onChange:_,componentName:"NiceDeviceTile"}),O=d.Gu(),[G,B]=s.useState(null),ne=s.useRef(null);d.Sc(ne,()=>B(null)),s.useEffect(()=>{if(!G)return;O?.pauseNavigation();const fe=_e=>{_e.key==="Escape"&&B(null)};return window.addEventListener("keydown",fe),()=>{window.removeEventListener("keydown",fe),O?.resumeNavigation()}},[G,O]);const le=fe=>{if(!x)return;fe.preventDefault();const _e=Math.min(fe.clientX,window.innerWidth-256),L=Math.min(fe.clientY,window.innerHeight-320);B({x:Math.max(8,_e),y:Math.max(8,L)})},Q=u!=="transparent"&&u!=="";return e.jsxs("div",{ref:se,className:["nice-device-tile",`nice-device-tile--label-${m}`,N?"nice-device-tile--selected":"",Q?"nice-device-tile--colored":"",T??""].filter(Boolean).join(" "),style:{...$,"--device-color":u},title:A,"data-testid":S,onClick:k,onContextMenu:le,role:k?"button":void 0,tabIndex:E?0:void 0,children:[e.jsxs("div",{className:"nice-device-tile__device",children:[p!=null&&e.jsx("span",{className:"nice-device-tile__badge",children:p}),a]}),(r||H)&&e.jsxs("div",{className:"nice-device-tile__caption",children:[r&&e.jsx("span",{className:"nice-device-tile__name",children:r}),H&&e.jsx("span",{className:"nice-device-tile__description",children:H})]}),G&&e.jsxs("div",{ref:ne,className:"nice-device-tile__menu",style:{position:"fixed",left:G.x,top:G.y},onClick:fe=>fe.stopPropagation(),role:"menu",children:[r&&e.jsx("div",{className:"nice-device-tile__menu-title",children:r}),D.color&&e.jsxs("div",{className:"nice-device-tile__menu-row",children:[e.jsx("span",{className:"nice-device-tile__menu-label",children:"Color"}),e.jsx(De.NiceColorPicker,{compact:!0,value:Q?u:"#3b82f6",onChange:fe=>f?.(fe)})]}),D.description&&e.jsxs("div",{className:"nice-device-tile__menu-row nice-device-tile__menu-row--stack",children:[e.jsx("span",{className:"nice-device-tile__menu-label",children:"Description"}),e.jsx(Me.NiceTextInput,{value:H,onChange:fe=>W(fe),size:"sm"})]}),D.volume&&e.jsxs("div",{className:"nice-device-tile__menu-row",children:[e.jsx("span",{className:"nice-device-tile__menu-label",children:"Volume"}),e.jsx(qe.NiceSlider,{value:F,onChange:fe=>z(fe),min:0,max:100})]}),D.gain&&e.jsxs("div",{className:"nice-device-tile__menu-row",children:[e.jsx("span",{className:"nice-device-tile__menu-label",children:"Gain"}),e.jsx(qe.NiceSlider,{value:K,onChange:fe=>U(fe),min:0,max:100})]}),j&&e.jsx(De.NiceButton,{size:"sm",variant:"outline",className:"nice-device-tile__menu-config",onClick:()=>{B(null),j()},children:C})]})]})}),Hp={xxs:20,xs:24,sm:32,md:40,lg:56,xl:72,xxl:96},ai=15,vn=18,si=6,In=30,Ho=({level:t=0,size:n="md",muted:i=!1,...a})=>{const o=`nice-mic-clip-${d.bc()}`,c=typeof n=="number"?n:Hp[n]??40,l=Math.max(0,Math.min(1,t)),m=si+(1-l)*In,p=l*In;return e.jsx(qa,{...a,children:e.jsxs("svg",{className:`nice-microphone${i?" nice-microphone--muted":""}`,width:c,height:c*(64/48),viewBox:"0 0 48 64",role:"img","aria-label":a.name?`Microphone: ${a.name}`:"Microphone",children:[e.jsx("defs",{children:e.jsx("clipPath",{id:o,children:e.jsx("rect",{x:ai,y:si,width:vn,height:In,rx:vn/2})})}),e.jsxs("g",{clipPath:`url(#${o})`,children:[e.jsx("rect",{x:ai,y:si,width:vn,height:In,className:"nice-microphone__body"}),p>0&&e.jsx("rect",{x:ai,y:m,width:vn,height:p,className:"nice-microphone__level"})]}),e.jsx("rect",{x:ai,y:si,width:vn,height:In,rx:vn/2,className:"nice-microphone__outline"}),e.jsx("path",{d:"M10 30 a14 14 0 0 0 28 0",className:"nice-microphone__stand"}),e.jsx("line",{x1:"24",y1:"44",x2:"24",y2:"56",className:"nice-microphone__stand"}),e.jsx("line",{x1:"16",y1:"56",x2:"32",y2:"56",className:"nice-microphone__stand"}),i&&e.jsx("line",{x1:"9",y1:"9",x2:"39",y2:"49",className:"nice-microphone__slash"})]})})},Kp={xxs:22,xs:28,sm:36,md:48,lg:64,xl:84,xxl:110},Jp=[{id:"LT",shape:{kind:"rect",x:18,y:3,w:16,h:5,rx:2},label:[26,1]},{id:"RT",shape:{kind:"rect",x:66,y:3,w:16,h:5,rx:2},label:[74,1]},{id:"LB",shape:{kind:"rect",x:18,y:10,w:16,h:5,rx:2},label:[26,9]},{id:"RB",shape:{kind:"rect",x:66,y:10,w:16,h:5,rx:2},label:[74,9]},{id:"DpadUp",shape:{kind:"rect",x:25,y:26,w:5,h:6,rx:1},label:[27,24]},{id:"DpadDown",shape:{kind:"rect",x:25,y:38,w:5,h:6,rx:1},label:[27,50]},{id:"DpadLeft",shape:{kind:"rect",x:18,y:32,w:6,h:5,rx:1},label:[16,35]},{id:"DpadRight",shape:{kind:"rect",x:31,y:32,w:6,h:5,rx:1},label:[40,35]},{id:"Y",shape:{kind:"circle",cx:74,cy:25,r:4},label:[74,19]},{id:"A",shape:{kind:"circle",cx:74,cy:41,r:4},label:[74,51]},{id:"X",shape:{kind:"circle",cx:66,cy:33,r:4},label:[58,35]},{id:"B",shape:{kind:"circle",cx:82,cy:33,r:4},label:[90,35]},{id:"Back",shape:{kind:"circle",cx:44,cy:26,r:2.6},label:[44,20]},{id:"Start",shape:{kind:"circle",cx:56,cy:26,r:2.6},label:[56,20]},{id:"LS",shape:{kind:"circle",cx:42,cy:42,r:6},label:[42,54]},{id:"RS",shape:{kind:"circle",cx:60,cy:44,r:6},label:[60,56]}],Yp="M50 18 C66 18 72 20 76 26 L90 48 C94 58 86 64 80 58 L66 46 L34 46 L20 58 C14 64 6 58 10 48 L24 26 C28 20 34 18 50 18 Z";function Qp({shape:t}){return t.kind==="circle"?e.jsx("circle",{cx:t.cx,cy:t.cy,r:t.r}):e.jsx("rect",{x:t.x,y:t.y,width:t.w,height:t.h,rx:t.rx??1})}const Ko=({view:t="compact",size:n="md",onButtonPress:i,pressedButtons:a,highlightedButtons:r,live:o=!1,gamepadIndex:c=0,buttonLabels:l,actionTree:m,assignments:p,onAssign:u,...f})=>{const b=typeof n=="number"?n:Kp[n]??48,[h,y]=s.useState(()=>new Set),[g,v]=s.useState(null);d.Vs({index:c,enabled:o,onButtonDown:k=>{y(E=>{const T=new Set(E);return T.add(k),T}),i?.(k)},onButtonUp:k=>{y(E=>{const T=new Set(E);return T.delete(k),T})}});const _=k=>!!r?.includes(k)||!!a?.includes(k)||h.has(k),x=b*1.5,w=x*(68/100),j=(k,E)=>{k.stopPropagation(),i?.(E),m&&v(T=>T===E?null:E)},C=t==="compact",N=e.jsxs("svg",{className:`nice-gamepad nice-gamepad--${t}`,width:x,height:w,viewBox:"0 0 100 68",role:"img","aria-label":f.name?`Gamepad: ${f.name}`:"Gamepad",children:[e.jsx("path",{d:Yp,className:"nice-gamepad__body"}),!C&&Jp.map(({id:k,shape:E,label:T})=>{const $=l?.[k],A=p?.[k];return e.jsxs("g",{"data-button":k,"data-pressed":_(k)?"true":void 0,className:`nice-gamepad__btn${g===k?" nice-gamepad__btn--armed":""}`,onClick:S=>j(S,k),children:[e.jsx(Qp,{shape:E}),($||A)&&e.jsx("text",{x:T[0],y:T[1],className:"nice-gamepad__label",children:$??A})]},k)})]});return e.jsx(qa,{...f,children:m&&!C?e.jsxs("div",{className:"nice-gamepad__assign",children:[N,e.jsxs("div",{className:"nice-gamepad__tree",children:[e.jsx("div",{className:"nice-gamepad__tree-hint",children:g?`Assign to "${g}"…`:"Click a button, then a node"}),e.jsx(ot.NiceTreeView,{nodes:m,selectionMode:"single",onNodeClick:k=>{g&&(u?.(g,k),v(null))}})]})]}):N})},Xp=({devices:t,defaultDevices:n,onDevicesChange:i,autoDetect:a=!0,kinds:r=["microphone","gamepad"],slots:o,onAssign:c,onOpenConfig:l,columns:m,minColumnWidth:p=160,className:u,style:f,id:b,"data-testid":h})=>{const[y,g]=d.Vu({value:t,defaultValue:n??[],onChange:i,componentName:"NiceDeviceManager"}),v=s.useCallback(w=>{w.length!==0&&g(j=>{const C=new Set(j.map(k=>k.id)),N=w.filter(k=>!C.has(k.id));return N.length?[...j,...N]:j})},[g]);s.useEffect(()=>{if(!a||!r.includes("microphone")||!navigator.mediaDevices?.enumerateDevices)return;let w=!1;const j=()=>{navigator.mediaDevices.enumerateDevices().then(C=>{if(w)return;const N=C.filter(k=>k.kind==="audioinput").map((k,E)=>({id:`mic:${k.deviceId||E}`,kind:"microphone",name:k.label||`Microphone ${E+1}`,deviceId:k.deviceId}));v(N)}).catch(()=>{})};return j(),navigator.mediaDevices.addEventListener?.("devicechange",j),()=>{w=!0,navigator.mediaDevices.removeEventListener?.("devicechange",j)}},[a,r,v]),s.useEffect(()=>{if(!a||!r.includes("gamepad")||!navigator.getGamepads)return;const w=()=>{const j=Array.from(navigator.getGamepads?.()??[]).filter(C=>!!C).map(C=>({id:`pad:${C.index}`,kind:"gamepad",name:C.id?.split("(")[0]?.trim()||`Controller ${C.index+1}`,deviceId:String(C.index)}));v(j)};return w(),window.addEventListener("gamepadconnected",w),window.addEventListener("gamepaddisconnected",w),()=>{window.removeEventListener("gamepadconnected",w),window.removeEventListener("gamepaddisconnected",w)}},[a,r,v]);const _=s.useCallback((w,j)=>{g(C=>C.map(N=>N.id===w?{...N,...j}:N))},[g]),x=s.useCallback((w,j)=>{_(w,{assignedTo:j}),c?.(w,j)},[_,c]);return e.jsx("div",{id:b,"data-testid":h,className:`nice-device-manager ${u??""}`.trim(),style:f,children:y.length===0?e.jsx("p",{className:"nice-device-manager__empty",children:"No devices detected."}):e.jsx(Va,{columns:m,minColumnWidth:p,gap:12,children:y.map((w,j)=>{const C={name:w.name,description:w.description,number:w.number??j+1,color:w.color??"transparent",volume:w.volume,gain:w.gain,onColorChange:N=>_(w.id,{color:N}),onDescriptionChange:N=>_(w.id,{description:N}),onVolumeChange:N=>_(w.id,{volume:N}),onGainChange:N=>_(w.id,{gain:N}),onOpenConfig:()=>l?.(w)};return e.jsxs("div",{className:"nice-device-manager__cell",children:[w.kind==="microphone"?e.jsx(Ho,{...C,level:w.level}):e.jsx(Ko,{...C,view:"compact",live:!0}),o&&o.length>0&&e.jsx("div",{className:"nice-device-manager__slots",children:o.map(N=>e.jsx(De.NiceButton,{size:"sm",variant:w.assignedTo===N.id?"primary":"ghost",onClick:()=>x(w.id,w.assignedTo===N.id?null:N.id),children:N.label},N.id))})]},w.id)})})})},vi=({value:t,max:n=100,label:i,helperText:a,error:r,required:o,disabled:c,loading:l,showValue:m,showLabel:p,text:u,variant:f="primary",size:b="md",striped:h,animated:y,formatValue:g,labelPlacement:v="top",errorPlacement:_="bottom",labelWidth:x,controlWidth:w,className:j,style:C,id:N})=>{const k=d.bc(N),E=Math.min(100,Math.max(0,t/n*100)),T=u??(g?g(t,n):`${Math.round(E)}%`),$=m??p??!0,A=i?e.jsxs("label",{className:"nice-field__label",htmlFor:k,children:[i,o&&e.jsx("span",{className:"nice-field__required",children:"*"})]}):null,S=r?e.jsx("div",{id:`${k}-error`,className:"nice-field__error",role:"alert",children:r}):null,D=!r&&a?e.jsx("div",{id:`${k}-helper`,className:"nice-field__helper",children:a}):null,P=e.jsxs("div",{className:`nice-progress ${c?"nice-progress--disabled":""} ${l?"nice-progress--loading":""}`,role:"progressbar",id:k,"aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":n,"aria-busy":l||void 0,"aria-disabled":c||void 0,children:[e.jsx("div",{className:`nice-progress__track ${b!=="md"?`nice-progress__track--${b}`:""}`,children:e.jsx("div",{className:`nice-progress__fill nice-progress__fill--${f} ${h||l?"nice-progress__fill--striped":""} ${y||l?"nice-progress__fill--animated":""}`,style:{width:l?"100%":`${E}%`}})}),$&&(v==="left"||v==="right")&&e.jsx("span",{className:"nice-progress__value",children:T})]}),se=e.jsxs("div",{className:"nice-progress__header",children:[A,$&&e.jsx("span",{className:"nice-progress__value",children:T})]});return e.jsxs("div",{className:`nice-field nice-field--${b} ${v==="left"?"nice-field--label-left":""} ${j||""}`,style:{...C,...x!=null&&{"--nice-field-label-width":typeof x=="number"?`${x}px`:x},...w!=null&&{"--nice-field-control-width":typeof w=="number"?`${w}px`:w}},children:[v==="top"&&($?se:A),v==="left"||v==="right"?e.jsxs("div",{className:"nice-field__control",style:{display:"flex",alignItems:"center",gap:"var(--nice-space-2, 8px)",flex:"1 1 auto"},children:[v==="right"?e.jsxs(e.Fragment,{children:[P,A]}):e.jsxs(e.Fragment,{children:[A,P]}),_==="right"&&S,_==="right"&&!r&&D]}):e.jsx("div",{className:"nice-field__control",children:P}),v==="bottom"&&($?se:A),_!=="right"&&S,_!=="right"&&D]})},wi=({vertical:t,text:n,size:i="md",className:a,style:r})=>t?e.jsx("hr",{className:`nice-divider nice-divider--vertical nice-divider--${i} ${a||""}`,style:r}):n?e.jsx("div",{className:`nice-divider--with-text nice-divider--${i} ${a||""}`,style:r,children:n}):e.jsx("hr",{className:`nice-divider nice-divider--${i} ${a||""}`,style:r}),pr=t=>typeof t=="number"?t:/^\d+(\.\d+)?$/.test(t.trim())?`${t}px`:t,Zp={text:14,rect:80,circle:40},eu={xxs:{text:6,rect:28,circle:16},xs:{text:8,rect:40,circle:24},sm:{text:11,rect:60,circle:32},small:{text:11,rect:60,circle:32},md:{text:14,rect:80,circle:40},medium:{text:14,rect:80,circle:40},lg:{text:20,rect:120,circle:56},large:{text:20,rect:120,circle:56},xl:{text:28,rect:160,circle:72},xxl:{text:36,rect:220,circle:96}},Un=({variant:t="text",width:n,height:i,count:a=1,size:r="md",orientation:o="vertical",animationSpeed:c,className:l,style:m})=>{const p=eu[r]??Zp,u=pr(n??(t==="circle"?p.circle:"100%")),f=pr(i??(t==="text"?p.text:t==="circle"?p.circle:p.rect)),b=c!=null&&c>0?{"--nice-skeleton-speed":`${c}s`}:null;if(a<=1)return e.jsx("div",{className:`nice-skeleton nice-skeleton--${t} nice-skeleton--${r} ${l||""}`,style:{width:u,height:f,...b,...m}});const h=o==="horizontal";return e.jsx("div",{className:`nice-skeleton-group ${l||""}`,style:{display:"flex",flexDirection:h?"row":"column",gap:"var(--nice-space-2, 8px)",width:"100%",...b,...m},children:Array.from({length:a}).map((y,g)=>e.jsx("div",{className:`nice-skeleton nice-skeleton--${t} nice-skeleton--${r}`,style:h?{flex:"1 1 0",minWidth:0,height:f}:{width:u,height:f}},g))})},Gn=({size:t="md",className:n,style:i})=>e.jsx("div",{className:`nice-spinner nice-spinner--${t} ${n||""}`,style:i,role:"status","aria-label":"Loading"}),Ua=({icon:t,title:n,description:i,action:a,size:r="md",className:o,style:c})=>e.jsxs("div",{className:`nice-empty nice-empty--${r} ${o||""}`,style:c,role:"status","aria-label":n,children:[t&&e.jsx("div",{className:"nice-empty__icon","aria-hidden":"true",children:t}),e.jsx("div",{className:"nice-empty__title",children:n}),i&&e.jsx("div",{className:"nice-empty__desc",children:i}),a]}),ur={xxs:9,xs:11,sm:13,small:13,md:16,medium:16,lg:20,large:20,xl:24,xxl:28},Ga=s.forwardRef(({items:t,mode:n="left",size:i="md",isFragment:a=!1,renderItem:r,className:o,style:c,id:l,...m},p)=>{const{renderIcon:u}=d.fc(),f=ur[i]??ur.md;return e.jsx("div",{ref:p,id:l,className:`nice-timeline nice-timeline--${n} nice-timeline--${i} ${a?"nice-timeline--fragment":""} ${o||""}`,style:c,...m,children:t.map((b,h)=>{const y=n==="alternate"?h%2===0?"left":"right":n;return e.jsxs("div",{className:`nice-timeline__item nice-timeline__item--${y}`,children:[e.jsx("div",{className:"nice-timeline__dot",style:b.color?{borderColor:b.color,color:b.color}:void 0,children:u(b.icon,f)??e.jsx("span",{className:"nice-timeline__dot-inner",style:b.color?{background:b.color}:void 0})}),a&&h===0&&e.jsx("div",{className:"nice-timeline__connector nice-timeline__connector--leading"}),(h<t.length-1||a)&&e.jsx("div",{className:"nice-timeline__connector"}),e.jsx("div",{className:"nice-timeline__content",children:r?r(b,h):e.jsxs(e.Fragment,{children:[b.title&&e.jsx("div",{className:"nice-timeline__title",children:b.title}),b.subtitle&&e.jsx("div",{className:"nice-timeline__subtitle",children:b.subtitle}),b.content&&e.jsx("div",{className:"nice-timeline__body",children:b.content})]})})]},b.key)})})});Ga.displayName="NiceTimeline";const Wa=s.forwardRef(({items:t,visibleCount:n=1,showArrows:i=!0,showDots:a=!0,autoPlay:r=7e3,circular:o=!0,activeIndex:c,onChange:l,size:m="md",fullWidth:p=!0,className:u,style:f,id:b,...h},y)=>{const{t:g}=d.Gt(),[v,_]=s.useState(0),x=s.useRef(void 0),j=c!=null&&typeof l=="function"?c:v,C=Math.max(1,Math.floor(n||1)),N=Math.max(0,t.length-C),k=s.useCallback(D=>{let P=D;o?P=(D%t.length+t.length)%t.length:P=Math.max(0,Math.min(N,D)),_(P),l?.(P)},[t.length,N,o,l]),E=s.useCallback(()=>k(j+1),[k,j]),T=s.useCallback(()=>k(j-1),[k,j]);s.useEffect(()=>{if(r>0)return x.current=setInterval(E,r),()=>clearInterval(x.current)},[r,E]);const $=s.useCallback(D=>{D.key==="ArrowLeft"&&(D.preventDefault(),T()),D.key==="ArrowRight"&&(D.preventDefault(),E())},[T,E]),A=o||j>0,S=o||j<N;return e.jsxs("div",{ref:y,id:b,className:`nice-carousel nice-carousel--${m} ${p?"nice-carousel--full-width":""} ${u||""}`,style:f,role:"region","aria-roledescription":"carousel","aria-label":g("carousel.label","Carousel"),tabIndex:0,onKeyDown:$,...h,children:[e.jsx("div",{className:"nice-carousel__viewport",children:e.jsx("div",{className:"nice-carousel__track",style:{transform:`translateX(-${j*(100/C)}%)`,"--nice-carousel-slide-basis":`${100/C}%`},children:t.map((D,P)=>e.jsx("div",{className:"nice-carousel__slide",role:"group","aria-roledescription":"slide","aria-label":`${P+1} / ${t.length}`,children:D},P))})}),i&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"nice-carousel__arrow nice-carousel__arrow--prev",onClick:T,disabled:!A,"aria-label":g("carousel.prev","Previous"),children:e.jsx(d.oa,{name:"chevron-left",size:20})}),e.jsx("button",{type:"button",className:"nice-carousel__arrow nice-carousel__arrow--next",onClick:E,disabled:!S,"aria-label":g("carousel.next","Next"),children:e.jsx(d.oa,{name:"chevron-right",size:20})})]}),a&&t.length>C&&e.jsx("div",{className:"nice-carousel__dots",role:"tablist",children:Array.from({length:N+1},(D,P)=>e.jsx("button",{type:"button",className:`nice-carousel__dot ${P===j?"nice-carousel__dot--active":""}`,onClick:()=>k(P),role:"tab","aria-selected":P===j,"aria-label":`${g("carousel.goTo","Go to slide")} ${P+1}`},P))})]})});Wa.displayName="NiceCarousel";function tu({items:t,itemHeight:n,height:i=400,overscan:a=3,renderItem:r,itemKey:o,className:c,style:l,size:m="md",disabled:p,readOnly:u,loading:f,error:b,...h},y){const g=s.useRef(null),[v,_]=s.useState(0),x=typeof i=="number"?i:parseFloat(String(i)),w=Number.isFinite(x)?x:400,j=Number.isFinite(n)&&n>0?n:1,C=Number.isFinite(a)&&a>=0?Math.floor(a):0,N=t.length*j,{startIndex:k,endIndex:E}=s.useMemo(()=>{const A=Math.max(1,Math.ceil(w/j)),S=Math.floor(v/j),D=Math.max(0,S-C),P=Math.min(t.length-1,S+A+C);return{startIndex:D,endIndex:P}},[v,w,j,t.length,C]),T=s.useCallback(A=>{_(A.currentTarget.scrollTop)},[]);s.useEffect(()=>{y&&(typeof y=="function"?y(g.current):y.current=g.current)},[y]);const $=s.useMemo(()=>{const A=[];for(let S=k;S<=E;S++){const D=o?o(t[S],S):S;A.push(e.jsx("div",{className:"nice-virtual-scroller__item",style:{position:"absolute",top:S*j,left:0,right:0,height:j},children:r(t[S],S)},D))}return A},[k,E,t,j,r,o]);return e.jsxs("div",{ref:g,className:`nice-virtual-scroller nice-virtual-scroller--${m} ${p?"nice-virtual-scroller--disabled":""} ${b?"nice-virtual-scroller--error":""} ${c||""}`,style:{width:"100%",...l,height:typeof i=="string"&&!/^\d+(\.\d+)?$/.test(i)?i:w,overflow:"auto",position:"relative"},onScroll:T,role:"list","aria-disabled":p||void 0,"aria-busy":f||void 0,...h,children:[b?e.jsx("div",{className:"nice-virtual-scroller__error",role:"alert",children:b}):e.jsx("div",{style:{height:N,position:"relative",width:"100%"},children:$}),f&&e.jsx("div",{className:"nice-virtual-scroller__loading","aria-hidden":"true",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})})]})}const Ha=s.forwardRef(tu);Ha.displayName="NiceVirtualScroller";function mr(t,n){const i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),r=getComputedStyle(t),o=parseFloat(r.borderLeftWidth)||0,c=parseFloat(r.borderTopWidth)||0;return{width:a.width,height:a.height,left:0,top:0,transform:`translate(${a.left-i.left-o}px, ${a.top-i.top-c}px)`,opacity:1}}function Jo({options:t,value:n,defaultValue:i,onChange:a,size:r="md",block:o=!1,disabled:c=!1,readOnly:l=!1,loading:m=!1,error:p,highlightFill:u=!0,errorPlacement:f="bottom",className:b="",style:h,"data-testid":y="nice-segmented-control"}){const{t:g}=d.Gt(),v=s.useRef(null),[_,x]=s.useState(i),[w,j]=s.useState({}),C=n!==void 0?n:_,N=t.findIndex(T=>T.value===C);s.useEffect(()=>{if(!v.current||N<0){j({opacity:0});return}const T=v.current,A=T.querySelectorAll(".nice-segmented-control__option")[N];if(!A){j({opacity:0});return}j(mr(T,A))},[N,t.length,u,r,o]),s.useEffect(()=>{const T=()=>{if(!v.current||N<0)return;const $=v.current,S=$.querySelectorAll(".nice-segmented-control__option")[N];S&&j(mr($,S))};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[N]);const k=s.useCallback(T=>{c||l||m||t.find(A=>A.value===T)?.disabled||(n===void 0&&x(T),a?.(T))},[c,l,m,t,n,a]),E=e.jsxs("div",{ref:v,className:`nice-segmented-control nice-segmented-control--${r} ${o?"nice-segmented-control--block":""} ${c?"nice-segmented-control--disabled":""} ${l?"nice-segmented-control--readonly":""} ${m?"nice-segmented-control--loading":""} ${p?"nice-segmented-control--error":""} ${u?"nice-segmented-control--fill":""} ${b}`,style:h,role:"group","aria-label":g("controls.select","Select option"),"aria-busy":m||void 0,"aria-invalid":!!p||void 0,"data-testid":y,children:[e.jsx("div",{className:"nice-segmented-control__thumb",style:w}),t.map((T,$)=>{const A=T.value===C,S=c||T.disabled;return e.jsxs("button",{type:"button",className:`nice-segmented-control__option ${A?"nice-segmented-control__option--selected":""} ${S?"nice-segmented-control__option--disabled":""}`,onClick:()=>k(T.value),disabled:S||m,"aria-pressed":A,"data-testid":`${y}-option-${$}`,children:[T.icon&&e.jsx("span",{className:"nice-segmented-control__icon",children:T.icon}),e.jsx("span",{className:"nice-segmented-control__label",children:T.label})]},String(T.value))}),m&&e.jsx("div",{className:"nice-segmented-control__spinner","aria-hidden":"true",children:e.jsx("div",{className:"nice-spinner nice-spinner--sm"})})]});return p?e.jsxs("div",{className:`nice-segmented-control-field${f==="right"?" nice-segmented-control-field--err-right":""}`,children:[E,e.jsx("div",{className:"nice-segmented-control__error",role:"alert",children:p})]}):E}Jo.displayName="NiceSegmentedControl";const Yo=s.createContext(null);function Ri(){const t=s.useContext(Yo);if(!t)throw new Error("useFAQ must be used within NiceFAQ");return t}function ri(t,n){if(!n)return{score:1,indices:[]};const i=t.toLowerCase(),r=n.toLowerCase().split(/\s+/).filter(Boolean);let o=0;const c=[];for(const m of r){let p=!1,u=0;for(;(u=i.indexOf(m,u))!==-1;){p=!0,c.push([u,u+m.length]);const f=u===0||/\s/.test(t[u-1]),b=u+m.length===t.length||/\s/.test(t[u+m.length]);f&&b?o+=2:f?o+=1.5:o+=1,u+=1}if(!p){let f=0,b=-1;for(let h=0;h<i.length&&f<m.length;h++)if(i[h]===m[f]){if(b===-1||h===b+1)if(b===-1)c.push([h,h+1]);else{const y=c[c.length-1];y[1]=h+1}else c.push([h,h+1]);b=h,f++}if(f===m.length)o+=.5;else return null}}const l=nu(c);return{score:o/r.length,indices:l}}function nu(t){if(t.length===0)return[];const n=[...t].sort((a,r)=>a[0]-r[0]),i=[n[0]];for(let a=1;a<n.length;a++){const r=i[i.length-1],o=n[a];o[0]<=r[1]?r[1]=Math.max(r[1],o[1]):i.push(o)}return i}function iu(t,n){if(!n.trim())return t.map(a=>({item:a,score:1,matches:[]}));const i=[];for(const a of t){const r=[];let o=0;const c=ri(a.question,n);if(c&&c.score>0&&(r.push({field:"question",indices:c.indices}),o+=c.score*3),typeof a.answer=="string"){const l=ri(a.answer,n);l&&l.score>0&&(r.push({field:"answer",indices:l.indices}),o+=l.score*1)}if(a.tags)for(const l of a.tags){const m=ri(l,n);if(m&&m.score>0){r.push({field:"tags",indices:m.indices}),o+=m.score*2;break}}if(a.keywords)for(const l of a.keywords){const m=ri(l,n);if(m&&m.score>0){r.push({field:"keywords",indices:m.indices}),o+=m.score*2.5;break}}r.length>0&&(a.featured&&(o*=1.2),i.push({item:a,score:o,matches:r}))}return i.sort((a,r)=>r.score-a.score)}const au=({text:t,indices:n})=>{if(n.length===0)return e.jsx(e.Fragment,{children:t});const i=[];let a=0;for(const[r,o]of n)r>a&&i.push(e.jsx("span",{children:t.slice(a,r)},`text-${a}`)),i.push(e.jsx("mark",{className:"nice-faq-highlight",children:t.slice(r,o)},`mark-${r}`)),a=o;return a<t.length&&i.push(e.jsx("span",{children:t.slice(a)},`text-${a}`)),e.jsx(e.Fragment,{children:i})},Qo=({placeholder:t="Search FAQ...",autoFocus:n=!1,showIcon:i=!0,debounceMs:a=200})=>{const{searchQuery:r,setSearchQuery:o}=Ri(),[c,l]=s.useState(r),m=s.useRef(null),p=s.useRef(null);s.useEffect(()=>(p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{o(c)},a),()=>{p.current&&clearTimeout(p.current)}),[c,a,o]);const u=s.useCallback(()=>{l(""),o(""),m.current?.focus()},[o]);return e.jsxs("div",{className:"nice-faq-search",children:[i&&e.jsx("span",{className:"nice-faq-search-icon",children:e.jsx(d.oa,{name:"search",size:16})}),e.jsx("input",{ref:m,type:"text",className:"nice-faq-search-input",placeholder:t,value:c,onChange:f=>l(f.target.value),autoFocus:n,"aria-label":"Search FAQ"}),c&&e.jsx("button",{className:"nice-faq-search-clear",onClick:u,"aria-label":"Clear search",children:e.jsx(d.oa,{name:"close",size:14})})]})},Xo=({showCounts:t=!0,layout:n="horizontal"})=>{const{categories:i,items:a,selectedCategory:r,setSelectedCategory:o}=Ri(),c=s.useMemo(()=>{const l={all:a.length};for(const m of a)m.category&&(l[m.category]=(l[m.category]||0)+1);return l},[a]);return i.length===0?null:n==="dropdown"?e.jsx("div",{className:"nice-faq-category-dropdown",children:e.jsxs("select",{value:r||"all",onChange:l=>o(l.target.value==="all"?null:l.target.value),className:"nice-faq-category-select",children:[e.jsxs("option",{value:"all",children:["All Categories ",t&&`(${c.all})`]}),i.map(l=>e.jsxs("option",{value:l.id,children:[l.name," ",t&&`(${c[l.id]||0})`]},l.id))]})}):e.jsxs("div",{className:`nice-faq-categories nice-faq-categories--${n}`,children:[e.jsxs("button",{className:`nice-faq-category-btn ${r?"":"nice-faq-category-btn--active"}`,onClick:()=>o(null),children:[e.jsx("span",{children:"All"}),t&&e.jsx("span",{className:"nice-faq-category-count",children:c.all})]}),i.map(l=>e.jsxs("button",{className:`nice-faq-category-btn ${r===l.id?"nice-faq-category-btn--active":""}`,onClick:()=>o(l.id),style:l.color?{"--cat-color":l.color}:void 0,children:[l.icon&&e.jsx("span",{className:"nice-faq-category-icon",children:l.icon}),e.jsx("span",{children:l.name}),t&&e.jsx("span",{className:"nice-faq-category-count",children:c[l.id]||0})]},l.id))]})},Ka=({result:t,showFeedback:n=!0,showRelated:i=!0,animateExpand:a=!0})=>{const{item:r,matches:o}=t,{expandedIds:c,toggleExpanded:l,items:m,submitFeedback:p}=Ri(),[u,f]=s.useState(null),[b,h]=s.useState(!1),[y,g]=s.useState(""),v=s.useRef(null),_=c.has(r.id),x=o.find(N=>N.field==="question")?.indices||[],w=s.useMemo(()=>!i||!r.relatedIds||r.relatedIds.length===0?[]:m.filter(N=>r.relatedIds?.includes(N.id)),[i,r.relatedIds,m]),j=N=>{f(N),N?p(r.id,N):h(!0)},C=()=>{p(r.id,!1,y),h(!1),g("")};return e.jsxs("div",{className:`nice-faq-item ${_?"nice-faq-item--expanded":""} ${r.featured?"nice-faq-item--featured":""}`,"data-question-id":r.id,children:[e.jsxs("button",{className:"nice-faq-question",onClick:()=>l(r.id),"aria-expanded":_,"aria-controls":`faq-answer-${r.id}`,children:[r.icon&&e.jsx("span",{className:"nice-faq-question-icon",children:r.icon}),e.jsx("span",{className:"nice-faq-question-text",children:e.jsx(au,{text:r.question,indices:x})}),e.jsx("span",{className:`nice-faq-chevron ${_?"nice-faq-chevron--open":""}`,children:e.jsx(d.oa,{name:"chevron-down",size:16})})]}),e.jsx("div",{id:`faq-answer-${r.id}`,className:`nice-faq-answer ${a?"nice-faq-answer--animated":""}`,ref:v,style:{maxHeight:_?a?v.current?.scrollHeight??1e3:void 0:0},"aria-hidden":!_,children:e.jsxs("div",{className:"nice-faq-answer-content",children:[typeof r.answer=="string"?e.jsx("p",{children:r.answer}):r.answer,r.tags&&r.tags.length>0&&e.jsx("div",{className:"nice-faq-tags",children:r.tags.map(N=>e.jsx("span",{className:"nice-faq-tag",children:N},N))}),w.length>0&&e.jsxs("div",{className:"nice-faq-related",children:[e.jsx("span",{className:"nice-faq-related-label",children:"Related:"}),w.map(N=>e.jsx("button",{className:"nice-faq-related-link",onClick:k=>{k.stopPropagation(),l(N.id),document.querySelector(`[data-question-id="${N.id}"]`)?.scrollIntoView({behavior:"smooth",block:"center"})},children:N.question},N.id))]}),n&&e.jsxs("div",{className:"nice-faq-feedback",children:[u===null?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"nice-faq-feedback-label",children:"Was this helpful?"}),e.jsxs("button",{className:"nice-faq-feedback-btn nice-faq-feedback-btn--yes",onClick:()=>j(!0),"aria-label":"Yes, this was helpful",children:[e.jsx(d.oa,{name:"check",size:14})," Yes"]}),e.jsxs("button",{className:"nice-faq-feedback-btn nice-faq-feedback-btn--no",onClick:()=>j(!1),"aria-label":"No, this was not helpful",children:[e.jsx(d.oa,{name:"close",size:14})," No"]})]}):e.jsx("span",{className:"nice-faq-feedback-thanks",children:u?"Thanks for your feedback!":""}),b&&e.jsxs("div",{className:"nice-faq-feedback-form",children:[e.jsx("textarea",{placeholder:"How can we improve this answer?",value:y,onChange:N=>g(N.target.value),className:"nice-faq-feedback-textarea",rows:3}),e.jsxs("div",{className:"nice-faq-feedback-actions",children:[e.jsx("button",{className:"nice-faq-feedback-submit",onClick:C,children:"Submit"}),e.jsx("button",{className:"nice-faq-feedback-cancel",onClick:()=>{h(!1),f(null)},children:"Cancel"})]})]})]})]})})]})},Sa=({category:t,results:n,showFeedback:i,showRelated:a,collapsible:r=!0})=>{const[o,c]=s.useState(!1);return n.length===0?null:e.jsxs("div",{className:"nice-faq-group",children:[e.jsxs("div",{className:`nice-faq-group-header ${r?"nice-faq-group-header--collapsible":""}`,onClick:r?()=>c(!o):void 0,style:t.color?{borderColor:t.color}:void 0,children:[t.icon&&e.jsx("span",{className:"nice-faq-group-icon",children:t.icon}),e.jsx("h3",{className:"nice-faq-group-title",children:t.name}),t.description&&e.jsx("p",{className:"nice-faq-group-desc",children:t.description}),e.jsx("span",{className:"nice-faq-group-count",children:n.length}),r&&e.jsx("span",{className:`nice-faq-group-chevron ${o?"":"nice-faq-group-chevron--open"}`,children:e.jsx(d.oa,{name:"chevron-down",size:16})})]}),!o&&e.jsx("div",{className:"nice-faq-group-items",children:n.map(l=>e.jsx(Ka,{result:l,showFeedback:i,showRelated:a},l.item.id))})]})},su=({items:t,categories:n=[],showSearch:i=!0,searchPlaceholder:a="Search frequently asked questions...",autoFocusSearch:r=!1,showCategories:o=!0,categoryLayout:c="horizontal",groupByCategory:l=!0,allowMultiple:m=!0,defaultExpanded:p=[],showFeedback:u=!0,showRelated:f=!0,onFeedback:b,onAnalytics:h,showExpandControls:y=!0,animateExpand:g=!0,emptyMessage:v="No questions found matching your search.",generateSchema:_=!0,header:x,footer:w,size:j="md",className:C,style:N})=>{const[k,E]=s.useState(new Set(p)),[T,$]=s.useState(""),[A,S]=s.useState(null),D=s.useMemo(()=>[...t].sort((G,B)=>G.featured&&!B.featured?-1:!G.featured&&B.featured?1:(G.order??999)-(B.order??999)),[t]),P=s.useMemo(()=>A?D.filter(G=>G.category===A):D,[D,A]),se=s.useMemo(()=>iu(P,T),[P,T]),Y=s.useMemo(()=>{if(!l||n.length===0)return null;const G={},B=[];for(const ne of se){const le=ne.item.category;le?(G[le]||(G[le]=[]),G[le].push(ne)):B.push(ne)}return{groups:G,uncategorized:B}},[l,n,se]),H=s.useCallback(G=>{E(B=>{const ne=new Set(B);return ne.has(G)?(ne.delete(G),h?.({type:"collapse",questionId:G,timestamp:new Date().toISOString()})):(m||ne.clear(),ne.add(G),h?.({type:"expand",questionId:G,timestamp:new Date().toISOString()})),ne})},[m,h]),W=s.useCallback(()=>{E(new Set(t.map(G=>G.id)))},[t]),F=s.useCallback(()=>{E(new Set)},[]),z=s.useCallback(G=>{$(G),G.trim()&&h?.({type:"search",searchQuery:G,timestamp:new Date().toISOString()})},[h]),K=s.useCallback((G,B,ne)=>{const le={questionId:G,helpful:B,comment:ne,timestamp:new Date().toISOString()};b?.(le),h?.({type:"feedback",questionId:G,timestamp:le.timestamp,metadata:{helpful:B,comment:ne}})},[b,h]),U=s.useMemo(()=>{if(!_)return null;const G={"@context":"https://schema.org","@type":"FAQPage",mainEntity:t.map(B=>({"@type":"Question",name:B.question,acceptedAnswer:{"@type":"Answer",text:typeof B.answer=="string"?B.answer:""}}))};return e.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(G)}})},[_,t]),O={items:D,categories:n,expandedIds:k,searchQuery:T,selectedCategory:A,toggleExpanded:H,expandAll:W,collapseAll:F,setSearchQuery:z,setSelectedCategory:S,submitFeedback:K};return e.jsx(Yo.Provider,{value:O,children:e.jsxs("div",{className:`nice-faq nice-faq--${j} ${C||""}`,style:N,children:[U,x&&e.jsx("div",{className:"nice-faq-header",children:x}),e.jsxs("div",{className:"nice-faq-controls",children:[i&&e.jsx(Qo,{placeholder:a,autoFocus:r}),o&&n.length>0&&e.jsx(Xo,{layout:c,showCounts:!0}),y&&e.jsxs("div",{className:"nice-faq-expand-controls",children:[e.jsx("button",{className:"nice-faq-expand-btn",onClick:W,children:"Expand All"}),e.jsx("button",{className:"nice-faq-expand-btn",onClick:F,children:"Collapse All"})]})]}),T&&e.jsxs("div",{className:"nice-faq-results-info",children:["Found ",se.length," result",se.length!==1?"s":"",' for "',T,'"']}),e.jsx("div",{className:"nice-faq-list",children:se.length===0?e.jsx("div",{className:"nice-faq-empty",children:typeof v=="string"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"nice-faq-empty-icon",children:e.jsx(d.oa,{name:"search",size:32})}),e.jsx("p",{children:v})]}):v}):Y?e.jsxs(e.Fragment,{children:[n.sort((G,B)=>(G.order??999)-(B.order??999)).map(G=>e.jsx(Sa,{category:G,results:Y.groups[G.id]||[],showFeedback:u,showRelated:f},G.id)),Y.uncategorized.length>0&&e.jsx(Sa,{category:{id:"other",name:"Other Questions"},results:Y.uncategorized,showFeedback:u,showRelated:f})]}):se.map(G=>e.jsx(Ka,{result:G,showFeedback:u,showRelated:f,animateExpand:g},G.item.id))}),w&&e.jsx("div",{className:"nice-faq-footer",children:w})]})})};function Yi(t,n){return n.split(".").reduce((i,a)=>{if(i&&typeof i=="object")return i[a]},t)}const ru=({status:t})=>{const i={connecting:{color:"var(--color-warning, #f59e0b)",label:"Connecting..."},connected:{color:"var(--color-success, #22c55e)",label:"Live"},disconnected:{color:"var(--text-muted, #6b7280)",label:"Disconnected"},error:{color:"var(--color-error, #ef4444)",label:"Error"}}[t];return e.jsxs("div",{className:"nice-live-grid-status",children:[e.jsx("span",{className:"nice-live-grid-status-dot",style:{backgroundColor:i.color}}),e.jsx("span",{className:"nice-live-grid-status-label",children:i.label})]})};function ou({columns:t,data:n=[],dataSource:i,rowKey:a="id",showConnectionStatus:r=!0,highlightDuration:o=2e3,updateAnimation:c="flash",maxRows:l,selectable:m=!1,selectedIds:p,onSelectionChange:u,onRowClick:f,onUpdate:b,onConnectionStatusChange:h,emptyContent:y="No data",loadingContent:g="Loading...",sortable:v=!1,sortField:_,sortDirection:x,onSortChange:w,virtualized:j=!1,rowHeight:C=40,height:N=400,className:k="",style:E},T){const[$,A]=s.useState(n),[S,D]=s.useState(!1),[P,se]=s.useState("disconnected"),[Y,H]=s.useState(new Map),[W,F]=s.useState(p||new Set),z=s.useRef(null),K=s.useRef(null),U=s.useRef(new Map),O=p??W,G=u??F,B=s.useCallback(R=>R[a],[a]),ne=s.useCallback((R,ue,re=[])=>{H(be=>{const we=new Map(be);return we.set(R,{operation:ue,changedFields:new Set(re),timestamp:Date.now()}),we});const he=U.current.get(R);he&&clearTimeout(he);const ce=setTimeout(()=>{H(be=>{const we=new Map(be);return we.delete(R),we}),U.current.delete(R)},o);U.current.set(R,ce)},[o]),le=s.useCallback(R=>{const ue=B(R.row);if(A(re=>{switch(R.operation){case"insert":{if(re.some(be=>B(be)===ue))return re;const ce=[R.row,...re];return l&&ce.length>l?ce.slice(0,l):ce}case"update":return re.map(he=>B(he)===ue?{...he,...R.row,...R.changes||{}}:he);case"upsert":{if(re.some(be=>B(be)===ue))return re.map(be=>B(be)===ue?{...be,...R.row,...R.changes||{}}:be);const ce=[R.row,...re];return l&&ce.length>l?ce.slice(0,l):ce}case"delete":return re.filter(he=>B(he)!==ue);default:return re}}),c!=="none"){const re=R.changes?Object.keys(R.changes):[];ne(ue,R.operation,re)}b?.(R)},[B,l,c,ne,b]),Q=s.useCallback(R=>{"updates"in R?R.fullRefresh?A(R.updates.map(ue=>ue.row)):R.updates.forEach(le):le(R)},[le]);s.useEffect(()=>{if(!i)return;i.fetchInitial&&(D(!0),i.fetchInitial().then(ue=>{A(ue),D(!1)})),K.current=i.subscribe(Q);let R;return i.onStatusChange&&(R=i.onStatusChange(ue=>{se(ue),h?.(ue)})),()=>{K.current?.(),R?.()}},[i,Q,h]),s.useEffect(()=>{const R=U.current;return()=>{R.forEach(ue=>clearTimeout(ue))}},[]),s.useImperativeHandle(T,()=>({getData:()=>$,addRow:R=>le({operation:"insert",row:R}),updateRow:(R,ue)=>{const re=$.find(he=>B(he)===R);re&&le({operation:"update",row:re,changes:ue})},deleteRow:R=>{const ue=$.find(re=>B(re)===R);ue&&le({operation:"delete",row:ue})},refresh:()=>{i?.fetchInitial&&(D(!0),i.fetchInitial().then(R=>{A(R),D(!1)}))},getConnectionStatus:()=>P}));const fe=s.useMemo(()=>!_||!x?$:[...$].sort((R,ue)=>{const re=Yi(R,_),he=Yi(ue,_);if(re===he)return 0;if(re==null)return 1;if(he==null)return-1;const ce=re<he?-1:1;return x==="asc"?ce:-ce}),[$,_,x]),_e=s.useCallback((R,ue)=>{if(m){const re=B(R),he=new Set(O);he.has(re)?he.delete(re):he.add(re),G(he)}f?.(R,ue)},[m,B,O,G,f]),L=s.useCallback(R=>{if(!v)return;let ue="asc";_===R&&(ue=x==="asc"?"desc":"asc"),w?.(R,ue)},[v,_,x,w]),ie=s.useCallback(R=>{const ue=B(R),re=Y.get(ue),he=O.has(ue),ce=["nice-live-grid-row"];return he&&ce.push("nice-live-grid-row--selected"),re&&(ce.push(`nice-live-grid-row--${re.operation}`),ce.push(`nice-live-grid-row--${c}`)),ce.join(" ")},[B,Y,O,c]),Z=s.useCallback((R,ue)=>{const re=B(R);return Y.get(re)?.changedFields.has(ue)?"nice-live-grid-cell--changed":""},[B,Y]);return S&&$.length===0?e.jsx("div",{className:`nice-live-grid nice-live-grid--loading ${k}`,style:E,children:g}):e.jsxs("div",{ref:z,className:`nice-live-grid ${k}`,style:{...E,height:N},children:[r&&e.jsxs("div",{className:"nice-live-grid-header",children:[e.jsx(ru,{status:P}),e.jsxs("span",{className:"nice-live-grid-count",children:[$.length," rows"]})]}),e.jsx("div",{className:"nice-live-grid-table-wrapper",children:e.jsxs("table",{className:"nice-live-grid-table",children:[e.jsx("thead",{children:e.jsx("tr",{children:t.map(R=>e.jsxs("th",{className:`nice-live-grid-th ${v&&R.sortable!==!1?"nice-live-grid-th--sortable":""}`,style:{width:R.width,minWidth:R.minWidth,maxWidth:R.maxWidth,textAlign:R.align||"left"},onClick:()=>R.sortable!==!1&&L(String(R.field)),children:[R.headerRender?R.headerRender(R):R.header,_===String(R.field)&&e.jsx("span",{className:"nice-live-grid-sort-icon",children:e.jsx(d.oa,{name:x==="asc"?"sort-asc":"sort-desc",size:12})})]},String(R.field)))})}),e.jsx("tbody",{children:fe.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:t.length,className:"nice-live-grid-empty",children:y})}):fe.map(R=>e.jsx("tr",{className:ie(R),onClick:ue=>_e(R,ue),style:{height:C},children:t.map(ue=>{const re=Yi(R,String(ue.field));return e.jsx("td",{className:`nice-live-grid-td ${Z(R,String(ue.field))}`,style:{textAlign:ue.align||"left"},children:ue.render?ue.render(re,R,ue):String(re??"")},String(ue.field))})},String(B(R))))})]})})]})}const Zo=s.forwardRef(ou);Zo.displayName="NiceLiveDataGrid";function cu(t,n=1){let i;if(typeof t.quantity=="number"){const r=t.quantity*n;i=Number.isInteger(r)?String(r):String(Math.round(r*100)/100)}else i=t.quantity!=null?String(t.quantity):"";const a=t.unit??"";return[i,a].filter(Boolean).join(" ").trim()}const lu=({photos:t})=>{const n=[...t].sort((o,c)=>+!!c.primary-+!!o.primary),[i,a]=s.useState(n[0]?.id),r=n.find(o=>o.id===i)??n[0];return e.jsxs("div",{className:"nice-recipe__gallery",children:[r&&e.jsxs("div",{className:"nice-recipe__photo-main",children:[e.jsx("img",{src:r.url,alt:r.caption??""}),r.caption&&e.jsx("div",{className:"nice-recipe__photo-caption",children:r.caption})]}),n.length>1&&e.jsx("div",{className:"nice-recipe__photo-thumbs",children:n.map(o=>e.jsx("button",{type:"button",className:`nice-recipe__thumb${o.id===r?.id?" nice-recipe__thumb--active":""}`,onClick:()=>a(o.id),"aria-label":o.caption??"Photo",children:e.jsx("img",{src:o.url,alt:o.caption??""})},o.id))})]})},du=({recipe:t,compact:n=!1,hidePhotos:i=!1,hideIngredients:a=!1,hideSteps:r=!1,onIngredientToggle:o,onStepToggle:c,className:l,style:m,accessMode:p,id:u})=>{const{t:f}=d.Gt(),b=d.Dc(p,u),h=t.servings,[y,g]=s.useState(h);if(s.useEffect(()=>{g(h)},[h]),b==="hidden")return null;const v=b==="readOnly"||b==="disabled",_=mt.recipeTotalMinutes(t),x=t.photos??[],w=[...t.steps].sort((k,E)=>k.order-E.order),j=!v&&typeof h=="number"&&h>0&&typeof y=="number"&&y>0?y/h:1,C=!n&&typeof h=="number"&&h>0&&!v,N=()=>{typeof window<"u"&&window.print()};return e.jsxs("div",{className:`nice-recipe${n?" nice-recipe--compact":""} ${l??""}`,style:m,children:[e.jsxs("header",{className:"nice-recipe__header",children:[e.jsx("h3",{className:"nice-recipe__title",children:t.title||f("recipe.untitled","Untitled recipe")}),!n&&t.description&&e.jsx("p",{className:"nice-recipe__description",children:t.description}),e.jsxs("div",{className:"nice-recipe__meta",children:[t.servings!=null&&e.jsxs("span",{className:"nice-recipe__meta-item",children:[e.jsx(d.oa,{name:"box",size:14})," ",y??t.servings," ",f("recipe.servings","servings")]}),_!=null&&e.jsxs("span",{className:"nice-recipe__meta-item",children:[e.jsx(d.oa,{name:"clock",size:14})," ",_," ",f("recipe.minutes","min")]}),t.difficulty&&e.jsx("span",{className:`nice-recipe__badge nice-recipe__badge--${t.difficulty}`,children:f(`recipe.difficulty.${t.difficulty}`,t.difficulty)}),t.cuisine&&e.jsxs("span",{className:"nice-recipe__meta-item",children:[e.jsx(d.oa,{name:"globe",size:14})," ",t.cuisine]}),t.sourceUrl&&e.jsxs("a",{className:"nice-recipe__meta-item nice-recipe__source",href:t.sourceUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(d.oa,{name:"link",size:14})," ",f("recipe.source","Source")]})]}),(C||!n)&&e.jsxs("div",{className:"nice-recipe__actions",children:[C&&e.jsxs("span",{className:"nice-recipe__servings-stepper",children:[e.jsx("button",{type:"button",className:"nice-recipe__servings-btn","aria-label":f("recipe.servingsDecrease","Decrease servings"),onClick:()=>g(k=>Math.max(1,(k??h??1)-1)),disabled:(y??h??1)<=1,children:"−"}),e.jsxs("span",{"aria-live":"polite",className:"nice-recipe__servings-value",children:[y??h," ×"]}),e.jsx("button",{type:"button",className:"nice-recipe__servings-btn","aria-label":f("recipe.servingsIncrease","Increase servings"),onClick:()=>g(k=>Math.min(99,(k??h??1)+1)),disabled:(y??h??1)>=99,children:"+"}),j!==1&&e.jsx("button",{type:"button",className:"nice-recipe__servings-reset",onClick:()=>g(h),children:f("recipe.reset","Reset")})]}),!n&&e.jsxs("button",{type:"button",className:"nice-recipe__print",onClick:N,"aria-label":f("recipe.print","Print recipe"),children:[e.jsx(d.oa,{name:"printer",size:14})," ",f("recipe.print","Print")]})]}),t.tags&&t.tags.length>0&&e.jsx("div",{className:"nice-recipe__tags",children:t.tags.map(k=>e.jsxs("span",{className:"nice-recipe__tag",children:["#",k]},k))})]}),!i&&x.length>0&&e.jsx(lu,{photos:x}),e.jsxs("div",{className:"nice-recipe__body",children:[!a&&t.ingredients.length>0&&e.jsxs("section",{className:"nice-recipe__section nice-recipe__section--ingredients",children:[e.jsx("h4",{className:"nice-recipe__section-title",children:f("recipe.ingredients","Ingredients")}),e.jsx("ul",{className:"nice-recipe__ingredients",children:t.ingredients.map(k=>e.jsx("li",{className:"nice-recipe__ingredient",children:e.jsxs("label",{className:`nice-recipe__ingredient-row${k.checked?" nice-recipe__ingredient-row--checked":""}`,children:[e.jsx("input",{type:"checkbox",checked:!!k.checked,disabled:v||!o,onChange:()=>o?.(k)}),e.jsx("span",{className:"nice-recipe__ingredient-qty",children:cu(k,j)}),e.jsx("span",{className:"nice-recipe__ingredient-name",children:k.name}),k.notes&&e.jsxs("span",{className:"nice-recipe__ingredient-notes",children:["— ",k.notes]})]})},k.id))})]}),!r&&w.length>0&&e.jsxs("section",{className:"nice-recipe__section nice-recipe__section--steps",children:[e.jsx("h4",{className:"nice-recipe__section-title",children:f("recipe.steps","Steps")}),e.jsx("ol",{className:"nice-recipe__steps",children:w.map(k=>e.jsx("li",{className:`nice-recipe__step${k.done?" nice-recipe__step--done":""}`,children:e.jsxs("label",{className:"nice-recipe__step-row",children:[e.jsx("input",{type:"checkbox",checked:!!k.done,disabled:v||!c,onChange:()=>c?.(k)}),e.jsxs("div",{className:"nice-recipe__step-body",children:[e.jsx("div",{className:"nice-recipe__step-instruction",children:k.instruction}),k.durationMinutes!=null&&e.jsxs("div",{className:"nice-recipe__step-duration",children:[e.jsx(d.oa,{name:"clock",size:14})," ",k.durationMinutes," ",f("recipe.minutes","min")]}),k.image&&e.jsx("img",{className:"nice-recipe__step-image",src:k.image,alt:""})]})]})},k.id))})]})]}),!n&&t.nutrition&&e.jsxs("footer",{className:"nice-recipe__nutrition",children:[t.nutrition.calories!=null&&e.jsxs("span",{children:[f("recipe.nutrition.calories","Calories"),": ",t.nutrition.calories," kcal"]}),t.nutrition.protein!=null&&e.jsxs("span",{children:[f("recipe.nutrition.protein","Protein"),": ",t.nutrition.protein," g"]}),t.nutrition.fat!=null&&e.jsxs("span",{children:[f("recipe.nutrition.fat","Fat"),": ",t.nutrition.fat," g"]}),t.nutrition.carbs!=null&&e.jsxs("span",{children:[f("recipe.nutrition.carbs","Carbs"),": ",t.nutrition.carbs," g"]}),t.nutrition.fiber!=null&&e.jsxs("span",{children:[f("recipe.nutrition.fiber","Fiber"),": ",t.nutrition.fiber," g"]}),t.nutrition.sugar!=null&&e.jsxs("span",{children:[f("recipe.nutrition.sugar","Sugar"),": ",t.nutrition.sugar," g"]}),t.nutrition.sodium!=null&&e.jsxs("span",{children:[f("recipe.nutrition.sodium","Sodium"),": ",t.nutrition.sodium," mg"]})]})]})},pu=[{value:"",label:"All"},{value:"easy",label:"Easy"},{value:"medium",label:"Medium"},{value:"hard",label:"Hard"}],ec=({recipes:t,onSelect:n,initialQuery:i="",hideFilters:a,emptyMessage:r,className:o,style:c})=>{const{t:l}=d.Gt(),[m,p]=s.useState(i),[u,f]=s.useState(""),[b,h]=s.useState(""),y=s.useMemo(()=>{const v=new Set;for(const _ of t)for(const x of _.tags??[])v.add(x);return Array.from(v).sort()},[t]),g=s.useMemo(()=>{const v=m.trim().toLowerCase();return t.filter(_=>u&&_.difficulty!==u||b&&!(_.tags??[]).includes(b)?!1:v?[_.title,_.description??"",_.cuisine??"",..._.tags??[]].join(" ").toLowerCase().includes(v):!0)},[t,m,u,b]);return e.jsxs("div",{className:`nice-recipe-list ${o??""}`,style:c,children:[e.jsxs("div",{className:"nice-recipe-list__toolbar",children:[e.jsx("input",{type:"search",className:"nice-recipe-list__search",value:m,placeholder:l("recipe.list.search","Search recipes…"),onChange:v=>p(v.target.value),"aria-label":l("recipe.list.search","Search recipes")}),!a&&e.jsxs(e.Fragment,{children:[e.jsx("select",{className:"nice-recipe-list__filter",value:u,onChange:v=>f(v.target.value),"aria-label":l("recipe.difficulty","Difficulty"),children:pu.map(v=>e.jsx("option",{value:v.value,children:v.label},v.value||"all"))}),y.length>0&&e.jsxs("select",{className:"nice-recipe-list__filter",value:b,onChange:v=>h(v.target.value),"aria-label":l("recipe.tags","Tags"),children:[e.jsx("option",{value:"",children:l("recipe.list.allTags","All tags")}),y.map(v=>e.jsxs("option",{value:v,children:["#",v]},v))]})]}),e.jsxs("span",{className:"nice-recipe-list__count","aria-live":"polite",children:[g.length," / ",t.length]})]}),g.length===0?e.jsx("div",{className:"nice-recipe-list__empty",children:r??l("recipe.list.empty","No recipes match the current filters.")}):e.jsx("ul",{className:"nice-recipe-list__grid",children:g.map(v=>{const _=v.photos?.find(w=>w.primary)??v.photos?.[0],x=mt.recipeTotalMinutes(v);return e.jsx("li",{className:"nice-recipe-list__item",children:e.jsxs("button",{type:"button",className:"nice-recipe-list__card",onClick:()=>n?.(v),children:[_&&e.jsx("span",{className:"nice-recipe-list__thumb",children:e.jsx("img",{src:_.url,alt:_.caption??v.title,loading:"lazy"})}),e.jsxs("span",{className:"nice-recipe-list__body",children:[e.jsx("span",{className:"nice-recipe-list__title",children:v.title}),v.description&&e.jsx("span",{className:"nice-recipe-list__desc",children:v.description}),e.jsxs("span",{className:"nice-recipe-list__meta",children:[typeof v.servings=="number"&&e.jsxs("span",{children:["🍽 ",v.servings]}),x!=null&&x>0&&e.jsxs("span",{children:["⏱ ",x," min"]}),v.difficulty&&e.jsx("span",{className:`nice-recipe__badge nice-recipe__badge--${v.difficulty}`,children:v.difficulty})]}),v.tags&&v.tags.length>0&&e.jsx("span",{className:"nice-recipe-list__tags",children:v.tags.slice(0,4).map(w=>e.jsxs("span",{className:"nice-recipe__tag",children:["#",w]},w))})]})]})},v.id)})})]})},uu=["breakfast","lunch","dinner"],mu=1440*60*1e3;function hu(t){const n=new Date(t);n.setHours(0,0,0,0);const i=n.getDay(),a=i===0?-6:1-i;return n.setDate(n.getDate()+a),n}function hr(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}const gu=({recipes:t,meals:n,onChange:i,weekStart:a,rows:r=uu,readOnly:o,className:c,style:l})=>{const{t:m}=d.Gt(),p=s.useMemo(()=>hu(a??new Date),[a]),u=s.useMemo(()=>Array.from({length:7},(x,w)=>new Date(p.getTime()+w*mu)),[p]),f=s.useMemo(()=>{const x=new Map;for(const w of t)x.set(w.id,w);return x},[t]),b=s.useCallback((x,w)=>n.filter(j=>j.kind===w&&j.servedAt instanceof Date&&hr(j.servedAt,x)),[n]),h=s.useCallback((x,w,j)=>{if(!j||o)return;const C=f.get(j),N=new Date(x);N.setHours(w==="breakfast"?8:w==="lunch"?13:w==="dinner"?19:16,0,0,0);const k={id:mt.newRecipeId("meal"),name:C?.title??m("mealplan.untitled","Meal"),kind:w,servedAt:N,recipeIds:[j],servings:C?.servings};i?.([...n,k])},[n,i,o,f,m]),y=s.useCallback(x=>{o||i?.(n.filter(w=>w.id!==x))},[n,i,o]),g=x=>x.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"}),v=x=>m(`mealplan.kind.${x}`,x.charAt(0).toUpperCase()+x.slice(1)),_=new Date;return e.jsx("div",{className:`nice-mealplan ${c??""}`,style:l,children:e.jsxs("div",{className:"nice-mealplan__grid",style:{gridTemplateColumns:"auto repeat(7, minmax(8rem, 1fr))"},children:[e.jsx("div",{className:"nice-mealplan__corner"}),u.map(x=>e.jsx("div",{className:`nice-mealplan__day-head${hr(x,_)?" nice-mealplan__day-head--today":""}`,children:g(x)},x.toISOString())),r.map(x=>e.jsxs(s.Fragment,{children:[e.jsx("div",{className:"nice-mealplan__row-head",children:v(x)}),u.map(w=>{const j=b(w,x);return e.jsxs("div",{className:"nice-mealplan__cell",children:[j.map(C=>{const N=C.recipeIds[0]?f.get(C.recipeIds[0]):void 0;return e.jsxs("div",{className:"nice-mealplan__chip",title:C.name,children:[e.jsx("span",{className:"nice-mealplan__chip-title",children:N?.title??C.name}),!o&&e.jsx("button",{type:"button",className:"nice-mealplan__chip-remove","aria-label":m("mealplan.remove","Remove meal"),onClick:()=>y(C.id),children:"×"})]},C.id)}),!o&&t.length>0&&e.jsxs("select",{className:"nice-mealplan__add",value:"","aria-label":m("mealplan.addRecipe","Add recipe"),onChange:C=>{const N=C.target.value;N&&h(w,x,N),C.target.value=""},children:[e.jsxs("option",{value:"",children:["+ ",m("mealplan.add","Add")]}),t.map(C=>e.jsx("option",{value:C.id,children:C.title},C.id))]})]},`${x}-${w.toISOString()}`)})]},x))]})})},fu=({recipes:t,collections:n,onChange:i,readOnly:a,onSelectRecipe:r,className:o,style:c})=>{const{t:l}=d.Gt(),[m,p]=s.useState(n[0]?.id??null),[u,f]=s.useState(null),b=s.useMemo(()=>{const N=new Map;for(const k of t)N.set(k.id,k);return N},[t]),h=s.useMemo(()=>n.find(N=>N.id===m)??n[0]??null,[n,m]),y=s.useMemo(()=>h?h.recipeIds.map(N=>b.get(N)).filter(N=>!!N):[],[h,b]),g=s.useCallback(N=>{i?.(N)},[i]),v=s.useCallback(()=>{if(a||typeof window>"u")return;const N=window.prompt(l("collections.namePrompt","Collection name"),"");if(!N)return;const k={id:mt.newRecipeId("coll"),name:N.trim(),recipeIds:[]};g([...n,k]),p(k.id)},[n,a,l,g]),_=s.useCallback(N=>{if(a)return;const k=n.filter(E=>E.id!==N);g(k),m===N&&p(k[0]?.id??null)},[m,n,a,g]),x=s.useCallback(()=>{if(!u)return;const N=u.value.trim();N&&g(n.map(k=>k.id===u.id?{...k,name:N}:k)),f(null)},[n,u,g]),w=s.useCallback(N=>{!h||!N||a||h.recipeIds.includes(N)||g(n.map(k=>k.id===h.id?{...k,recipeIds:[...k.recipeIds,N]}:k))},[h,n,a,g]),j=s.useCallback(N=>{!h||a||g(n.map(k=>k.id===h.id?{...k,recipeIds:k.recipeIds.filter(E=>E!==N)}:k))},[h,n,a,g]),C=s.useMemo(()=>h?t.filter(N=>!h.recipeIds.includes(N.id)):[],[h,t]);return e.jsxs("div",{className:`nice-recipe-collections ${o??""}`,style:c,children:[e.jsxs("aside",{className:"nice-recipe-collections__sidebar",children:[e.jsxs("div",{className:"nice-recipe-collections__sidebar-head",children:[e.jsx("span",{className:"nice-recipe-collections__sidebar-title",children:l("collections.title","Collections")}),!a&&e.jsx("button",{type:"button",className:"nice-recipe-collections__sidebar-add",onClick:v,"aria-label":l("collections.create","Create collection"),children:"+"})]}),e.jsx("ul",{className:"nice-recipe-collections__list",children:n.map(N=>{const k=h?.id===N.id,E=u?.id===N.id;return e.jsxs("li",{className:`nice-recipe-collections__item${k?" nice-recipe-collections__item--active":""}`,children:[E?e.jsx("input",{autoFocus:!0,className:"nice-recipe-collections__rename",value:u.value,onChange:T=>f({id:N.id,value:T.target.value}),onBlur:x,onKeyDown:T=>{T.key==="Enter"?x():T.key==="Escape"&&f(null)}}):e.jsxs("button",{type:"button",className:"nice-recipe-collections__item-btn",onClick:()=>p(N.id),onDoubleClick:()=>!a&&f({id:N.id,value:N.name}),children:[e.jsx("span",{className:"nice-recipe-collections__item-name",children:N.name}),e.jsx("span",{className:"nice-recipe-collections__item-count",children:N.recipeIds.length})]}),!a&&!E&&e.jsx("button",{type:"button",className:"nice-recipe-collections__item-remove",onClick:()=>_(N.id),"aria-label":l("collections.delete","Delete collection"),title:l("collections.delete","Delete collection"),children:"×"})]},N.id)})})]}),e.jsx("section",{className:"nice-recipe-collections__main",children:h?e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"nice-recipe-collections__header",children:[e.jsx("h3",{className:"nice-recipe-collections__name",children:h.name}),!a&&C.length>0&&e.jsxs("select",{className:"nice-recipe-collections__add-recipe",value:"","aria-label":l("collections.addRecipe","Add recipe"),onChange:N=>{const k=N.target.value;k&&w(k),N.target.value=""},children:[e.jsxs("option",{value:"",children:["+ ",l("collections.addRecipe","Add recipe")]}),C.map(N=>e.jsx("option",{value:N.id,children:N.title},N.id))]})]}),y.length===0?e.jsx("div",{className:"nice-recipe-collections__empty",children:l("collections.empty","No recipes in this collection yet.")}):e.jsx(ec,{recipes:y,hideFilters:!0,onSelect:N=>r?.(N)}),!a&&y.length>0&&e.jsxs("details",{className:"nice-recipe-collections__manage",children:[e.jsx("summary",{children:l("collections.manage","Manage recipes")}),e.jsx("ul",{className:"nice-recipe-collections__manage-list",children:y.map(N=>e.jsxs("li",{children:[e.jsx("span",{children:N.title}),e.jsx("button",{type:"button",onClick:()=>j(N.id),"aria-label":l("collections.removeRecipe","Remove recipe from collection"),children:l("collections.removeShort","Remove")})]},N.id))})]})]}):e.jsx("div",{className:"nice-recipe-collections__empty",children:l("collections.emptyState","No collection selected.")})})]})},yn=["hour","day","week","month","quarter","year"],bu=t=>{switch(t){case"hour":return{msPerPixel:6e4,unitMs:36e5,unitLabel:"HH:mm",headerFormat:"MMM d, yyyy"};case"day":return{msPerPixel:36e5,unitMs:864e5,unitLabel:"d",headerFormat:"MMM yyyy"};case"week":return{msPerPixel:864e5/2,unitMs:6048e5,unitLabel:"W",headerFormat:"MMM yyyy"};case"month":return{msPerPixel:864e5*2,unitMs:2592e6,unitLabel:"MMM",headerFormat:"yyyy"};case"quarter":return{msPerPixel:864e5*7,unitMs:7776e6,unitLabel:"Q",headerFormat:"yyyy"};case"year":return{msPerPixel:864e5*30,unitMs:31536e6,unitLabel:"yyyy",headerFormat:""};default:return{msPerPixel:864e5,unitMs:864e5,unitLabel:"d",headerFormat:"MMM yyyy"}}},Nn=(t,n,i="pl-PL")=>{const a={};if(n.includes("yyyy")&&(a.year="numeric"),n.includes("MMM")&&(a.month="short"),n.includes("MM")&&!n.includes("MMM")&&(a.month="2-digit"),(n.includes("dd")||n.includes("d"))&&(a.day="2-digit"),n.includes("EEE")&&(a.weekday="short"),n.includes("HH")&&(a.hour="2-digit",a.hour12=!1),n.includes("mm")&&!n.includes("MMM")&&(a.minute="2-digit"),n==="W")return`T${xu(t)}`;if(n==="Q")return`Q${Math.ceil((t.getMonth()+1)/3)}`;const r=a.year||a.month||a.day||a.weekday;return(a.hour||a.minute)&&!r?t.toLocaleTimeString(i,a):t.toLocaleDateString(i,a)},xu=t=>{const n=new Date(t);n.setHours(0,0,0,0),n.setDate(n.getDate()+4-(n.getDay()||7));const i=new Date(n.getFullYear(),0,1);return Math.ceil(((n.getTime()-i.getTime())/864e5+1)/7)},gr=(t,n)=>new Date(t.getTime()+n),vu=["var(--color-primary, #3b82f6)","var(--color-error, #ef4444)","var(--color-success, #22c55e)","var(--color-warning, #f59e0b)","var(--color-accent, #8b5cf6)","var(--color-accent-pink, #ec4899)","var(--color-info, #06b6d4)","var(--nice-success, #84cc16)","var(--nice-warning, #f97316)","var(--color-accent, #6366f1)"],tc=s.forwardRef((t,n)=>{const{events:i,groups:a=[],markers:r=[],initialZoom:o="week",initialDate:c,width:l=800,height:m=400,showToday:p=!0,showZoomControls:u=!0,showNavControls:f=!0,showMinimap:b=!1,onEventClick:h,onEventHover:y,onDateChange:g,onZoomChange:v,renderEvent:_,colors:x=vu,locale:w="pl-PL",className:j,style:C,...N}=t,[k,E]=s.useState(o),[T,$]=s.useState(c||new Date),[A,S]=s.useState(!1),[D,P]=s.useState({x:0,date:new Date}),[se,Y]=s.useState(null),[H,W]=s.useState(new Set),F=s.useRef(null),z=bu(k),K=l*z.msPerPixel,U=new Date(T.getTime()-K/2),O=new Date(T.getTime()+K/2),G=s.useCallback(J=>(J.getTime()-U.getTime())/z.msPerPixel,[U,z.msPerPixel]);s.useCallback(J=>{const M=J*z.msPerPixel;return new Date(U.getTime()+M)},[U,z.msPerPixel]);const B=s.useMemo(()=>{const J=[];let M=new Date(U);switch(k){case"hour":M.setMinutes(0,0,0);break;case"day":M.setHours(0,0,0,0);break;case"week":{const te=M.getDay();M.setDate(M.getDate()-te+1),M.setHours(0,0,0,0);break}case"month":M.setDate(1),M.setHours(0,0,0,0);break;case"quarter":M.setMonth(Math.floor(M.getMonth()/3)*3),M.setDate(1),M.setHours(0,0,0,0);break;case"year":M.setMonth(0,1),M.setHours(0,0,0,0);break}for(;M<=O;){const te=G(M),ve=k==="day"?M.getDay()===1:k==="week"?M.getDate()===1:k==="month"?M.getMonth()%3===0:k==="quarter"?M.getMonth()===0:!0;J.push({date:new Date(M),x:te,isMain:ve,isWeekend:k==="day"&&(M.getDay()===0||M.getDay()===6)}),M=gr(M,z.unitMs)}return J},[U,O,k,z,G]),ne=s.useMemo(()=>{const J=z.unitMs/z.msPerPixel;return J<=0?1:Math.max(1,Math.ceil(40/J))},[z]),le=s.useMemo(()=>{const J=new Map;return J.set("__default",[]),a.forEach(M=>J.set(M.id,[])),i.forEach(M=>{const te=M.group&&J.has(M.group)?M.group:"__default",ve=J.get(te)||[];ve.push(M),J.set(te,ve)}),J},[i,a]),Q=s.useMemo(()=>{const J=[];return le.get("__default")?.length&&J.push({id:"__default",title:"",events:le.get("__default")||[],isGroup:!1}),a.forEach(M=>{H.has(M.id)||J.push({id:M.id,title:M.title,events:le.get(M.id)||[],isGroup:!0})}),J},[le,a,H]),fe=s.useCallback(J=>{$(J),g?.(J)},[g]),_e=s.useCallback(()=>{const J=yn.indexOf(k);if(J>0){const M=yn[J-1];E(M),v?.(M)}},[k,v]),L=s.useCallback(()=>{const J=yn.indexOf(k);if(J<yn.length-1){const M=yn[J+1];E(M),v?.(M)}},[k,v]),ie=s.useCallback(J=>{E(J),v?.(J)},[v]),Z=s.useCallback(J=>{const M=gr(T,J*K*.5);fe(M)},[T,K,fe]),R=s.useCallback(J=>{J.button===0&&(S(!0),P({x:J.clientX,date:T}))},[T]),ue=s.useCallback(J=>{if(!A)return;const te=(D.x-J.clientX)*z.msPerPixel,ve=new Date(D.date.getTime()+te);$(ve)},[A,D,z.msPerPixel]),re=s.useCallback(()=>{A&&(S(!1),g?.(T))},[A,T,g]),he=s.useCallback(J=>{J.preventDefault(),J.deltaY<0?_e():L()},[_e,L]),ce=s.useCallback(J=>{Y(J),y?.(J)},[y]),be=s.useCallback(()=>{Y(null),y?.(null)},[y]);s.useImperativeHandle(n,()=>({goToDate:fe,zoomIn:_e,zoomOut:L,setZoom:ie,getCurrentDate:()=>T,getCurrentZoom:()=>k}),[fe,_e,L,ie,T,k]);const we=40,de=60,pe=Math.max(Q.length*we,m-de-40),ee=G(new Date);return e.jsxs("div",{className:`nice-timeline ${j||""}`,style:{width:l,...C},...N,children:[e.jsxs("div",{className:"nice-timeline-toolbar",children:[f&&e.jsx("div",{className:"nice-timeline-nav",children:e.jsxs(mt.NiceButtonGroup,{size:"sm",children:[e.jsx(De.NiceButton,{onClick:()=>Z(-1),"aria-label":"Previous",children:"←"}),e.jsx(De.NiceButton,{onClick:()=>fe(new Date),children:"Dziś"}),e.jsx(De.NiceButton,{onClick:()=>Z(1),"aria-label":"Next",children:"→"})]})}),e.jsx("div",{className:"nice-timeline-center",children:e.jsxs("span",{className:"nice-timeline-range",children:[Nn(U,"MMM d, yyyy",w)," —"," ",Nn(O,"MMM d, yyyy",w)]})}),u&&e.jsx("div",{className:"nice-timeline-zoom",children:e.jsx(mt.NiceButtonGroup,{size:"sm",children:yn.map(J=>e.jsx(De.NiceButton,{variant:k===J?"primary":"secondary",onClick:()=>ie(J),children:J==="hour"?"godz.":J==="day"?"dzień":J==="week"?"tydz.":J==="month"?"mies.":J==="quarter"?"kw.":"rok"},J))})})]}),e.jsxs("div",{ref:F,className:"nice-timeline-container",onMouseDown:R,onMouseMove:ue,onMouseUp:re,onMouseLeave:re,onWheel:he,style:{cursor:A?"grabbing":"grab"},children:[e.jsxs("div",{className:"nice-timeline-header",style:{height:de},children:[e.jsx("div",{className:"nice-timeline-header-main",children:z.headerFormat&&e.jsx("span",{children:Nn(T,z.headerFormat,w)})}),e.jsx("div",{className:"nice-timeline-header-units",children:B.map((J,M)=>{const te=M%ne===0||J.isMain,ve=k==="hour"&&J.date.getHours()===0,I=ve?"d MMM":z.unitLabel;return e.jsx("div",{className:`nice-timeline-unit ${J.isMain?"main":""} ${J.isWeekend?"nice-timeline-unit--weekend":""} ${ve?"nice-timeline-unit--midnight":""} ${te?"":"nice-timeline-unit--no-label"}`,style:{left:J.x},children:te&&e.jsx("span",{children:Nn(J.date,I,w)})},M)})})]}),e.jsxs("div",{className:"nice-timeline-chart",style:{height:pe},children:[e.jsxs("svg",{className:"nice-timeline-grid",width:l,height:pe,children:[B.map((J,M)=>{if(!J.isWeekend)return null;const te=B[M+1],ve=(te?te.x:J.x+z.unitMs/z.msPerPixel)-J.x;return e.jsx("rect",{x:J.x,y:0,width:ve,height:pe,className:"nice-timeline-weekend-band"},`wk-${M}`)}),B.map((J,M)=>e.jsx("line",{x1:J.x,y1:0,x2:J.x,y2:pe,className:J.isMain?"main":"minor"},M)),p&&ee>=0&&ee<=l&&e.jsx("line",{x1:ee,y1:0,x2:ee,y2:pe,className:"today"}),Q.map((J,M)=>e.jsx("line",{x1:0,y1:(M+1)*we,x2:l,y2:(M+1)*we,className:"row-sep"},M))]}),r.map((J,M)=>{const te=G(J.date);return te<0||te>l?null:e.jsx("div",{className:`nice-timeline-marker ${J.type||"line"}`,style:{left:te,borderColor:J.color},children:e.jsx("span",{className:"nice-timeline-marker-label",children:J.label})},M)}),Q.map((J,M)=>e.jsx("div",{className:"nice-timeline-row",style:{top:M*we,height:we},children:J.events.map((te,ve)=>{const I=G(te.start),me=te.end?G(te.end):I+10,q=Math.max(me-I,20),Ne=te.color||x[ve%x.length];return I>l||me<0?null:te.type==="milestone"?e.jsx("div",{className:`nice-timeline-milestone ${se?.id===te.id?"hovered":""}`,style:{left:I,borderColor:Ne},onClick:()=>h?.(te),onMouseEnter:()=>ce(te),onMouseLeave:be,title:te.title,children:te.icon||"◆"},te.id):e.jsx("div",{className:`nice-timeline-event ${te.type||"event"} ${se?.id===te.id?"hovered":""}`,style:{left:Math.max(I,0),width:q,backgroundColor:Ne},onClick:()=>h?.(te),onMouseEnter:()=>ce(te),onMouseLeave:be,title:te.description||te.title,children:_?_(te):e.jsx("span",{className:"nice-timeline-event-title",children:te.title})},te.id)})},J.id)),p&&ee>=0&&ee<=l&&e.jsx("div",{className:"nice-timeline-today-marker",style:{left:ee},children:e.jsx("span",{children:"Dziś"})})]}),se&&e.jsxs("div",{className:"nice-timeline-tooltip",style:{left:G(se.start)+10},children:[e.jsx("strong",{children:se.title}),se.description&&e.jsx("p",{children:se.description}),e.jsxs("small",{children:[Nn(se.start,"MMM d, yyyy HH:mm",w),se.end&&` — ${Nn(se.end,"MMM d, yyyy HH:mm",w)}`]})]})]}),b&&e.jsx("div",{className:"nice-timeline-minimap"}),e.jsx("style",{children:`
4
4
  .nice-timeline {