@nice2dev/ui 1.0.29 → 1.0.31

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.
Files changed (108) hide show
  1. package/CHANGELOG.md +512 -0
  2. package/README.md +30 -31
  3. package/dist/NiceBackupStatusBadge.doc-Bx2bFmBQ.cjs +1 -0
  4. package/dist/NiceBackupStatusBadge.doc-CdDxIQ-M.js +25 -0
  5. package/dist/NiceCalendarScheduler.doc-BEtQkZjV.cjs +9 -0
  6. package/dist/NiceCalendarScheduler.doc-D__LRgOx.js +33 -0
  7. package/dist/NiceConfirmDialog-B57cl_F7.cjs +1 -0
  8. package/dist/NiceConfirmDialog-BiTJVR4-.js +81 -0
  9. package/dist/NiceConfirmDialog-Bjw_rN4o.cjs +1 -0
  10. package/dist/NiceConfirmDialog-N9fBTLYm.js +81 -0
  11. package/dist/NiceDrawingCanvas.doc-Dv5vB4gY.js +32 -0
  12. package/dist/NiceDrawingCanvas.doc-Ww9zz17x.cjs +8 -0
  13. package/dist/NiceErrorBoundary-1H751jK7.cjs +1 -0
  14. package/dist/NiceErrorBoundary-B-txoU3Y.js +709 -0
  15. package/dist/NiceErrorBoundary-BD-uqk_q.js +709 -0
  16. package/dist/NiceErrorBoundary-CIPXaYik.cjs +1 -0
  17. package/dist/NiceFileManagerViews.doc-CKlnm6cX.cjs +1 -0
  18. package/dist/NiceFileManagerViews.doc-Cg21DArG.js +25 -0
  19. package/dist/NiceForm-BNZB31Pg.js +4499 -0
  20. package/dist/NiceForm-CPyAXxBO.cjs +1 -0
  21. package/dist/NiceForm-DGUTmaZT.js +5014 -0
  22. package/dist/NiceForm-DmU-gmyv.cjs +382 -0
  23. package/dist/NiceMegaMenu.doc-7UyOCd3l.cjs +7 -0
  24. package/dist/NiceMegaMenu.doc-zeIyVa65.js +31 -0
  25. package/dist/NiceModal-BClAtR5T.js +95 -0
  26. package/dist/NiceModal-Bj53SKLI.js +95 -0
  27. package/dist/NiceModal-DC0UlQhc.cjs +1 -0
  28. package/dist/NiceModal-iKwtagFB.cjs +1 -0
  29. package/dist/NiceModuleLifecyclePanel-BBOg9g0b.cjs +1 -0
  30. package/dist/NiceModuleLifecyclePanel-BO8Hw_W9.js +7619 -0
  31. package/dist/NiceModuleLifecyclePanel-Ch7HRRoy.cjs +1 -0
  32. package/dist/NiceModuleLifecyclePanel-DtuXRiLR.js +6991 -0
  33. package/dist/NiceModuleLifecyclePanel.css +1 -1
  34. package/dist/NicePagination-BVo-4KAD.js +172 -0
  35. package/dist/NicePagination-Bjxy9aEc.js +172 -0
  36. package/dist/NicePagination-CaohvQsY.cjs +1 -0
  37. package/dist/NicePagination-CfFfNwrg.cjs +1 -0
  38. package/dist/NicePinCodeInput-DsyLuc0b.cjs +696 -0
  39. package/dist/NicePinCodeInput-nuRCN-9R.js +13223 -0
  40. package/dist/NiceSavedQueryPanel-BBFV4qiF.js +6969 -0
  41. package/dist/NiceSavedQueryPanel-CH5c3rUG.js +6988 -0
  42. package/dist/NiceSavedQueryPanel-CsiVNkCT.cjs +596 -0
  43. package/dist/NiceSavedQueryPanel-aQrEmmcC.cjs +596 -0
  44. package/dist/NiceScannerControl-Cd5KXJA9.js +12769 -0
  45. package/dist/NiceScannerControl-DZsERSw_.cjs +698 -0
  46. package/dist/NiceScannerControl.css +1 -0
  47. package/dist/NiceWindow-BoDzlGk-.js +1621 -0
  48. package/dist/NiceWindow-Cm9E6EAi.cjs +1 -0
  49. package/dist/NiceWindow-DgONWxBm.cjs +1 -0
  50. package/dist/NiceWindow-FMrVS7zo.js +1603 -0
  51. package/dist/charts-B90sSFeJ.cjs +761 -0
  52. package/dist/charts-Bs0aDM0X.js +4671 -0
  53. package/dist/charts-DaLf19vS.js +4671 -0
  54. package/dist/charts-DjjKkw0q.cjs +761 -0
  55. package/dist/charts.cjs +1 -1
  56. package/dist/charts.mjs +1 -1
  57. package/dist/core-BUTtIHg0.js +27766 -0
  58. package/dist/core-BUsZ7_vI.js +27914 -0
  59. package/dist/core-CESNSRyS.cjs +122 -0
  60. package/dist/core-CLfcCDKc.cjs +122 -0
  61. package/dist/data-branching-ByQdcjKO.cjs +1 -0
  62. package/dist/data-branching-D7l_kILW.cjs +1 -0
  63. package/dist/data-branching-lJ07lDN-.js +6255 -0
  64. package/dist/data-branching-psTzlcrT.js +6255 -0
  65. package/dist/data-branching.cjs +1 -1
  66. package/dist/data-branching.mjs +1 -1
  67. package/dist/data.cjs +1 -1
  68. package/dist/data.d.ts +41 -37
  69. package/dist/data.mjs +18 -19
  70. package/dist/devops-Bi8MXtko.js +8165 -0
  71. package/dist/devops-D7bQ3rE4.cjs +17 -0
  72. package/dist/devops-On_1wRf9.cjs +17 -0
  73. package/dist/devops-jCmpD6O-.js +8165 -0
  74. package/dist/devops.cjs +1 -1
  75. package/dist/devops.mjs +3 -3
  76. package/dist/editors.cjs +1 -1
  77. package/dist/editors.d.ts +219 -431
  78. package/dist/editors.mjs +48 -56
  79. package/dist/feedback.cjs +1 -1
  80. package/dist/feedback.mjs +3 -3
  81. package/dist/index-BDH1yDSg.js +69235 -0
  82. package/dist/index-BpixglWg.js +69337 -0
  83. package/dist/index-C9njkNOD.cjs +5470 -0
  84. package/dist/index-DLR-aWZR.cjs +5506 -0
  85. package/dist/index.cjs +1 -1
  86. package/dist/index.css +1 -1
  87. package/dist/index.d.ts +798 -1059
  88. package/dist/index.mjs +741 -756
  89. package/dist/lazy.cjs +1 -1
  90. package/dist/lazy.mjs +24 -24
  91. package/dist/navigation.cjs +1 -1
  92. package/dist/navigation.d.ts +25 -213
  93. package/dist/navigation.mjs +143 -151
  94. package/dist/no-code-8lO7o6xi.js +7425 -0
  95. package/dist/no-code-BHo5WrXr.js +7425 -0
  96. package/dist/no-code-DyA_1_Th.cjs +332 -0
  97. package/dist/no-code-K8tOLNew.cjs +332 -0
  98. package/dist/no-code.cjs +1 -1
  99. package/dist/no-code.mjs +1 -1
  100. package/dist/overlays.cjs +1 -1
  101. package/dist/overlays.d.ts +12 -0
  102. package/dist/overlays.mjs +82 -82
  103. package/dist/pickerCommons-BEc3pZ_s.js +2044 -0
  104. package/dist/pickerCommons-CORo9j2a.js +2119 -0
  105. package/dist/pickerCommons-CrITwM88.cjs +1 -0
  106. package/dist/pickerCommons-D3WShRrR.cjs +1 -0
  107. package/dist/style.css +5 -5
  108. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),o=require("./core-CESNSRyS.cjs"),r=require("react"),Ie=require("react-dom"),Ge=require("./vendor-DHEorsoy.cjs"),Se=r.forwardRef(({label:i,helperText:a,error:t,required:l,disabled:c,readOnly:n,size:s="md",name:x,id:p,className:h,style:m,accessMode:j,displayStyle:K,variant:_,value:$,defaultValue:E,onChange:b,onBlur:Y,onKeyDown:L,placeholder:w,type:D="text",maxLength:g,prefix:S,suffix:z,clearable:C,autoFocus:T,submitOnEnter:G,onSubmit:k,showKeyboardHints:A,labelPlacement:H,errorPlacement:Q,loading:O,labelWidth:ce,controlWidth:X,displayMode:W,...re},ee)=>{const v=o.$c(j,p),y=v==="hidden";v==="disabled"&&(c=!0),v==="readOnly"&&(n=!0);const{t:F}=o.Gt(),M=o.hc(p),q=o.rc("input",K),Z=o.ac("input",K),ue=_==="filled"?"filled":_==="underlined"?"underlined":"",ne=r.useCallback(()=>b?.(""),[b]),J=o.sc({enabled:W,readOnly:n,disabled:c}),de=o.Qc({enabled:G,onSubmit:k}),te=r.useCallback(f=>{de(f),L?.(f)},[de,L]),se=r.useMemo(()=>{const f=[];return G&&f.push({key:"Enter",description:F("shortcuts.submit","Submit")}),C&&f.push({key:"Escape",description:F("shortcuts.clear","Clear")}),f},[G,C,F]);return y?null:e.jsxs("div",{className:`nice-field nice-field--${s} ${H==="left"?"nice-field--label-left":""} ${H==="inside"?"nice-field--label-inside":""} ${O?"nice-field--loading":""} ${h||""}`,style:{...m,...ce!=null&&{"--nice-field-label-width":typeof ce=="number"?`${ce}px`:ce},...X!=null&&{"--nice-field-control-width":typeof X=="number"?`${X}px`:X}},"aria-busy":O||void 0,"data-floating":H==="inside"&&$?"true":void 0,children:[i&&H!=="inside"&&e.jsxs("label",{htmlFor:M,className:`nice-field__label ${l?"nice-field__label--required":""}`,children:[i,A&&se.length>0&&e.jsx(o.ha,{shortcuts:se,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[J.isDisplay?e.jsx(o.cc,{value:$??E??"",placeholder:w,disabled:c,readOnly:n,onActivate:J.enterEdit,ariaLabel:i}):e.jsxs("div",{className:`nice-input nice-input--${s} nice-input--ds-${ue||Z} ${t?"nice-input--error":""} ${c?"nice-input--disabled":""} ${n?"nice-input--readonly":""}`,style:_?void 0:q,children:[S&&e.jsx("span",{className:"nice-input__icon",children:S}),e.jsx("input",{ref:f=>{typeof ee=="function"?ee(f):ee&&(ee.current=f),J.autoFocusRef(f)},id:M,className:"nice-input__native",type:D,name:x,value:$,defaultValue:E,placeholder:w,disabled:c||O,readOnly:n,maxLength:g,autoFocus:T,"aria-invalid":!!t,"aria-describedby":t?`${M}-error`:a?`${M}-helper`:void 0,onChange:f=>b?.(f.target.value),onBlur:f=>{W&&J.exitEdit(),Y?.(f)},onKeyDown:te,...re}),C&&$&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:ne,"aria-label":F("controls.clear","Clear"),children:e.jsx(o.oa,{name:"close",size:14})}),z&&e.jsx("span",{className:"nice-input__icon",children:z}),i&&H==="inside"&&e.jsx("label",{htmlFor:M,className:`nice-input__floating-label ${l?"nice-input__floating-label--required":""}`,children:i})]}),O&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),Q==="right"&&t&&e.jsx("div",{id:`${M}-error`,className:"nice-field__error",role:"alert",children:t}),Q==="right"&&!t&&a&&e.jsx("div",{id:`${M}-helper`,className:"nice-field__helper",children:a})]}),Q!=="right"&&t&&e.jsx("div",{id:`${M}-error`,className:"nice-field__error",role:"alert",children:t}),Q!=="right"&&!t&&a&&e.jsx("div",{id:`${M}-helper`,className:"nice-field__helper",children:a})]})});Se.displayName="NiceTextInput";const He=Object.freeze(Object.defineProperty({__proto__:null,NiceTextInput:Se},Symbol.toStringTag,{value:"Module"})),Ce=r.forwardRef(({label:i,helperText:a,error:t,required:l,disabled:c,readOnly:n,size:s="md",name:x,id:p,className:h,style:m,accessMode:j,displayStyle:K,value:_,onChange:$,onBlur:E,onKeyDown:b,placeholder:Y,min:L,max:w,step:D=1,precision:g,prefix:S,prefixType:z="label",prefixOptions:C,prefixValue:T,onPrefixChange:G,suffix:k,showStepper:A=!0,submitOnEnter:H,onSubmit:Q,showKeyboardHints:O,labelPlacement:ce,errorPlacement:X,loading:W,labelWidth:re,controlWidth:ee,formatPreset:v,format:y,suffixType:F="label",suffixOptions:M,suffixValue:q,onSuffixChange:Z,displayMode:ue},ne)=>{const J=o.$c(j,p),de=J==="hidden";J==="disabled"&&(c=!0),J==="readOnly"&&(n=!0);const{t:te}=o.Gt(),se=o.hc(p),f=o.rc("input",K),B=o.ac("input",K),[I,R]=r.useState(!1),[V,oe]=r.useState(null),xe=o.sc({enabled:ue,readOnly:n,disabled:c}),pe=r.useMemo(()=>{let d=3;return w!=null&&(d=String(Math.abs(Math.floor(w))).length),L!=null&&L<0&&(d+=1),g&&(d+=g+1),Math.max(3,d)+1},[w,L,g]),ye=r.useCallback(d=>{if(y)return y(d);if(!v)return g!=null?d.toFixed(g):String(d);switch(v){case"integer":return Math.round(d).toLocaleString();case"decimal":return d.toLocaleString(void 0,{minimumFractionDigits:g??2,maximumFractionDigits:g??2});case"money":return d.toLocaleString(void 0,{minimumFractionDigits:g??2,maximumFractionDigits:g??2,useGrouping:!0});case"percent":return(d*100).toLocaleString(void 0,{minimumFractionDigits:g??0,maximumFractionDigits:g??2})+"%";default:return String(d)}},[y,v,g]),ge=r.useMemo(()=>I&&V!==null?V:_==null?"":I?g!=null?_.toFixed(g):String(_):ye(_),[_,I,V,ye,g]),he=_!=null&&_<0,fe=!!(S||z==="select"&&C&&C.length>0),ie=he&&fe&&!I,we=ie?ge.replace(/^[-−]/,""):ge,me=r.useCallback(d=>{let N=d;return L!==void 0&&(N=Math.max(L,N)),w!==void 0&&(N=Math.min(w,N)),g!==void 0&&(N=parseFloat(N.toFixed(g))),N},[L,w,g]),Me=r.useCallback(d=>{const N=d.target.value;if(oe(N),N===""||N==="-"||N==="."||N==="-."){N===""&&$?.(null);return}const ae=parseFloat(N);if(!isNaN(ae)){let _e=ae;L!==void 0&&(_e=Math.max(L,_e)),w!==void 0&&(_e=Math.min(w,_e)),$?.(_e)}},[$,L,w]),ve=r.useCallback(()=>{const d=Ne.current,N=me((d??0)+D);Ne.current=N,$?.(N)},[D,$,me]),$e=r.useCallback(()=>{const d=Ne.current,N=me((d??0)-D);Ne.current=N,$?.(N)},[D,$,me]),Ne=r.useRef(_);Ne.current=_;const u=r.useRef(null),U=r.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),P=r.useCallback(d=>{U();let N=300;const ae=()=>{d(),N=Math.max(30,N*.82),u.current=setTimeout(ae,N)};u.current=setTimeout(ae,400)},[U]),be=o.Qc({enabled:H,onSubmit:Q}),ke=r.useCallback(d=>{be(d),d.key==="ArrowUp"?(d.preventDefault(),ve()):d.key==="ArrowDown"&&(d.preventDefault(),$e()),b?.(d)},[be,b,ve,$e]),le=r.useMemo(()=>{const d=[];return H&&d.push(o.Jc.submit),A&&(d.push({key:"ArrowUp",description:te("shortcuts.increment","Increase value")}),d.push({key:"ArrowDown",description:te("shortcuts.decrement","Decrease value")})),d},[H,A,te]);return de?null:e.jsxs("div",{className:`nice-field nice-field--${s} ${ce==="left"?"nice-field--label-left":""} ${W?"nice-field--loading":""} ${h||""}`,style:{...m,...re!=null&&{"--nice-field-label-width":typeof re=="number"?`${re}px`:re},...ee!=null&&{"--nice-field-control-width":typeof ee=="number"?`${ee}px`:ee}},"aria-busy":W||void 0,children:[i&&e.jsxs("label",{htmlFor:se,className:`nice-field__label ${l?"nice-field__label--required":""}`,children:[i,O&&le.length>0&&e.jsx(o.ha,{shortcuts:le,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[xe.isDisplay?e.jsx(o.cc,{value:_==null?"":S?e.jsxs(e.Fragment,{children:[S,ge]}):ge,placeholder:Y,disabled:c,readOnly:n,onActivate:xe.enterEdit,ariaLabel:i}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:`nice-input nice-input--number nice-input--${s} nice-input--ds-${B} ${t?"nice-input--error":""} ${c?"nice-input--disabled":""} ${n?"nice-input--readonly":""}`,style:f,children:[A&&!n&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__minus",onClick:$e,onMouseDown:()=>P($e),onMouseUp:U,onMouseLeave:U,disabled:c,"aria-label":te("controls.decrement","Decrement"),children:e.jsx(o.oa,{name:"minus",size:16})}),z==="select"&&C&&C.length>0?e.jsxs(e.Fragment,{children:[ie&&e.jsx("span",{className:"nice-input__sign",children:"−"}),e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--prefix",value:T??C[0]?.value,disabled:c,onChange:d=>{const N=d.target.value,ae=C.find(je=>je.value===(T??C[0]?.value)),_e=C.find(je=>je.value===N);G?.(N,ae?.weight,_e?.weight)},children:C.map(d=>e.jsx("option",{value:d.value,children:d.label},d.value))})]}):S?e.jsxs("span",{className:"nice-input__icon nice-input__icon--prefix",children:[ie&&e.jsx("span",{className:"nice-input__sign",children:"−"}),S]}):null,e.jsx("input",{ref:d=>{typeof ne=="function"?ne(d):ne&&(ne.current=d),xe.autoFocusRef(d)},id:se,className:"nice-input__native",type:!I&&(y||v)?"text":"number",name:x,value:we,placeholder:Y,min:L,max:w,step:D,disabled:c||W,readOnly:n,"aria-invalid":!!t,onChange:Me,onFocus:d=>{R(!0),oe(null),d.target.select()},onBlur:d=>{if(R(!1),oe(null),_!=null&&g!==void 0){const N=parseFloat(_.toFixed(g));N!==_&&$?.(N)}ue&&xe.exitEdit(),E?.(d)},onKeyDown:ke,style:{width:`${pe}ch`}}),F==="select"&&M&&M.length>0?e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--suffix",value:q??M[0]?.value,disabled:c,onChange:d=>{const N=d.target.value,ae=M.find(je=>je.value===(q??M[0]?.value)),_e=M.find(je=>je.value===N);Z?.(N,ae?.weight,_e?.weight)},children:M.map(d=>e.jsx("option",{value:d.value,children:d.label},d.value))}):k?e.jsx("span",{className:"nice-input__icon nice-input__icon--suffix",children:k}):null,A&&!n&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__plus",onClick:ve,onMouseDown:()=>P(ve),onMouseUp:U,onMouseLeave:U,disabled:c,"aria-label":te("controls.increment","Increment"),children:e.jsx(o.oa,{name:"plus",size:16})})]})}),W&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),X==="right"&&t&&e.jsx("div",{className:"nice-field__error",role:"alert",children:t}),X==="right"&&!t&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]}),X!=="right"&&t&&e.jsx("div",{className:"nice-field__error",role:"alert",children:t}),X!=="right"&&!t&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]})});Ce.displayName="NiceNumberInput";const Be=Object.freeze(Object.defineProperty({__proto__:null,NiceNumberInput:Ce},Symbol.toStringTag,{value:"Module"})),Re=r.forwardRef(({label:i,helperText:a,error:t,required:l,disabled:c,size:n="md",name:s,id:x,className:p,style:h,accessMode:m,displayStyle:j,options:K,value:_,onChange:$,placeholder:E,multiple:b=!1,searchable:Y=!1,clearable:L=!1,emptyText:w,maxHeight:D=240,optionsSource:g,valueField:S,labelField:z,virtualScroll:C,optionHeight:T=36,onSearch:G,loading:k,renderOption:A,multipleAutosize:H=!1,showKeyboardHints:Q,labelPlacement:O,errorPlacement:ce,labelWidth:X,controlWidth:W,displayMode:re},ee)=>{const v=o.$c(m,x),y=v==="hidden";(v==="disabled"||v==="readOnly")&&(c=!0);const{t:F}=o.Gt(),M=o.rc("input",j),q=o.ac("input",j),Z=o.hc(x),ue=o.sc({enabled:re,disabled:c}),[ne,J]=r.useState(!1),[de,te]=r.useState(""),[se,f]=r.useState(-1),[B,I]=r.useState(0),R=r.useRef(null),V=r.useRef(null),[oe,xe]=r.useState(null);r.useLayoutEffect(()=>{!k&&V.current&&xe(V.current.offsetWidth)},[k,_,j]);const[pe,ye]=r.useState(null);r.useLayoutEffect(()=>{b&&!H&&V.current&&pe==null&&ye(V.current.offsetWidth)},[b,H,pe]);const ge=o.Kd(g??null,S??g?.keyField??"id",z??"name"),he=g?ge.options:(K??[]).map(u=>typeof u=="string"?{value:u,label:u}:u);o.vc(R,()=>{J(!1),te("")});const fe=r.useMemo(()=>_?Array.isArray(_)?_:[_]:[],[_]),ie=r.useMemo(()=>{if(!de&&!G||G)return he;const u=de.toLowerCase();return he.filter(U=>U.label.toLowerCase().includes(u)||String(U.value).toLowerCase().includes(u))},[he,de,G]),we=r.useMemo(()=>{const u=new Map;for(const U of ie){const P=U.group||"";u.has(P)||u.set(P,[]),u.get(P).push(U)}return u},[ie]),me=r.useCallback(u=>{if(b){const U=fe.includes(u)?fe.filter(P=>P!==u):[...fe,u];$?.(U)}else $?.(u),J(!1),te("")},[b,fe,$]),Me=r.useCallback(u=>{if(u.key==="Escape"){J(!1),te("");return}if(u.key==="Enter"||u.key===" "){if(!ne){J(!0),u.preventDefault();return}se>=0&&ie[se]&&(me(ie[se].value),u.preventDefault());return}u.key==="ArrowDown"&&(u.preventDefault(),f(U=>Math.min(U+1,ie.length-1))),u.key==="ArrowUp"&&(u.preventDefault(),f(U=>Math.max(U-1,0)))},[ne,se,ie,me]),ve=r.useMemo(()=>fe.length===0?null:b?fe.map(u=>he.find(U=>U.value===u)?.label||u).join(", "):he.find(u=>u.value===fe[0])?.label||fe[0],[fe,he,b]),$e=r.useCallback(u=>{u.stopPropagation(),$?.(b?[]:"")},[$,b]),Ne=r.useMemo(()=>[{key:"Enter",description:F("shortcuts.select","Select")},{key:"Space",description:F("shortcuts.openDropdown","Open dropdown")},o.Jc.moveUp,o.Jc.moveDown,o.Jc.cancel],[F]);return y?null:e.jsxs("div",{className:`nice-field ${W==null?"nice-field--select-auto":""} nice-field--${n} ${O==="left"?"nice-field--label-left":""} ${k?"nice-field--loading":""} ${p||""}`,style:{...h,...X!=null&&{"--nice-field-label-width":typeof X=="number"?`${X}px`:X},...W!=null&&{"--nice-field-control-width":typeof W=="number"?`${W}px`:W},...k&&oe!=null&&{"--nice-select-locked-width":`${oe}px`}},"aria-busy":k||void 0,children:[i&&e.jsxs("label",{htmlFor:Z,className:`nice-field__label ${l?"nice-field__label--required":""}`,children:[i,Q&&e.jsx(o.ha,{shortcuts:Ne,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[ue.isDisplay?e.jsx(o.cc,{value:ve,placeholder:E||F("controls.select","Select..."),disabled:c,onActivate:()=>{ue.enterEdit(),J(!0)},ariaLabel:i}):e.jsxs("div",{className:"nice-select",ref:R,children:[e.jsxs("button",{ref:u=>{V.current=u,typeof ee=="function"?ee(u):ee&&(ee.current=u)},type:"button",id:Z,role:"combobox","aria-expanded":ne,"aria-haspopup":"listbox","aria-invalid":!!t,className:`nice-select__trigger nice-select__trigger--${n} nice-select--ds-${q} ${ne?"nice-select__trigger--open":""} ${t?"nice-select__trigger--error":""} ${c?"nice-select__trigger--disabled":""}`,style:{...M,...b&&!H&&pe!=null?{width:pe,maxWidth:pe,overflow:"hidden"}:{}},disabled:c,onClick:()=>J(!ne),onKeyDown:Me,children:[ve?e.jsx("span",{style:b&&!H?{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0,children:ve}):e.jsx("span",{className:"nice-select__placeholder",children:E||F("controls.select","Select...")}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[L&&fe.length>0&&e.jsx("span",{className:"nice-input__clear",onClick:$e,role:"button","aria-label":F("controls.clear","Clear"),children:e.jsx(o.oa,{name:"close",size:14})}),e.jsx("span",{className:`nice-select__chevron ${ne?"nice-select__chevron--open":""}`,children:e.jsx(o.oa,{name:"chevron-down",size:16})})]})]}),ne&&e.jsxs("div",{className:"nice-select__dropdown",role:"listbox",style:{maxHeight:D},onScroll:C?u=>I(u.currentTarget.scrollTop):void 0,children:[(Y||G)&&e.jsx("div",{className:"nice-select__search",children:e.jsx("input",{type:"text",value:de,onChange:u=>{te(u.target.value),f(0),G?.(u.target.value)},placeholder:F("controls.search","Search..."),autoFocus:!0})}),k&&e.jsx("div",{className:"nice-select__loading",children:e.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!k&&ie.length===0?e.jsx("div",{className:"nice-select__empty",children:w||F("controls.noResults","No results found")}):C&&!Array.from(we.keys()).some(u=>u!=="")?(()=>{const U=ie.length*T,P=Math.max(0,Math.floor(B/T)-3),be=Math.min(ie.length,Math.ceil((B+D)/T)+3),ke=ie.slice(P,be);return e.jsx("div",{style:{height:U,position:"relative"},children:ke.map((le,d)=>{const N=P+d,ae=fe.includes(le.value);return e.jsx("div",{role:"option","aria-selected":ae,className:`nice-select__option ${ae?"nice-select__option--selected":""} ${N===se?"nice-select__option--highlighted":""} ${le.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:N*T,left:0,right:0,height:T,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!le.disabled&&me(String(le.value)),onMouseEnter:()=>f(N),children:A?A(le,ae):e.jsxs(e.Fragment,{children:[le.icon&&e.jsx("span",{children:le.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:le.label}),le.description&&e.jsx("div",{className:"nice-select__option-desc",children:le.description})]}),ae&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},le.value)})})})():Array.from(we.entries()).map(([u,U])=>e.jsxs(r.Fragment,{children:[u&&e.jsx("div",{className:"nice-select__group-label",children:u}),U.map(P=>{const be=fe.includes(P.value),ke=ie.indexOf(P);return e.jsx("div",{role:"option","aria-selected":be,className:`nice-select__option ${be?"nice-select__option--selected":""} ${ke===se?"nice-select__option--highlighted":""} ${P.disabled?"nice-select__option--disabled":""}`,onClick:()=>!P.disabled&&me(String(P.value)),onMouseEnter:()=>f(ke),children:A?A(P,be):e.jsxs(e.Fragment,{children:[P.icon&&e.jsx("span",{children:P.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:P.label}),P.description&&e.jsx("div",{className:"nice-select__option-desc",children:P.description})]}),be&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},P.value)})]},u))]})]}),k&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),ce==="right"&&t&&e.jsx("div",{id:`${Z}-error`,className:"nice-field__error",role:"alert",children:t}),ce==="right"&&!t&&a&&e.jsx("div",{id:`${Z}-helper`,className:"nice-field__helper",children:a})]}),ce!=="right"&&t&&e.jsx("div",{id:`${Z}-error`,className:"nice-field__error",role:"alert",children:t}),ce!=="right"&&!t&&a&&e.jsx("div",{id:`${Z}-helper`,className:"nice-field__helper",children:a})]})});Re.displayName="NiceSelect";const Ue=Object.freeze(Object.defineProperty({__proto__:null,NiceSelect:Re},Symbol.toStringTag,{value:"Module"})),Ee=r.forwardRef(({label:i,checked:a=!1,indeterminate:t=!1,onChange:l,disabled:c,readOnly:n,loading:s,required:x,size:p="md",name:h,id:m,className:j,style:K,error:_,helperText:$,accessMode:E,displayStyle:b,showKeyboardHints:Y,labelPlacement:L,errorPlacement:w,labelWidth:D,controlWidth:g},S)=>{const z=o.$c(E,m),C=z==="hidden";(z==="disabled"||z==="readOnly")&&(c=!0);const{t:T}=o.Gt(),G=o.hc(m);o.ac("toggle",b);const k=r.useMemo(()=>[{key:"Space",description:T("shortcuts.toggle","Toggle")}],[T]),A=r.useCallback(H=>{H&&(H.indeterminate=t),typeof S=="function"?S(H):S&&(S.current=H)},[t,S]);return C?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${p} ${L==="left"?"nice-field--label-left":""} ${w==="right"?"nice-field--error-right":""} ${s?"nice-field--loading":""} ${j||""}`,style:{...K,...D!=null&&{"--nice-field-label-width":typeof D=="number"?`${D}px`:D},...g!=null&&{"--nice-field-control-width":typeof g=="number"?`${g}px`:g}},"aria-busy":s||void 0,children:[L==="left"&&i&&e.jsx("span",{className:`nice-field__label ${x?"nice-field__label--required":""}`,children:i}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-checkbox ${p!=="md"?`nice-checkbox--${p}`:""} ${c||s?"nice-checkbox--disabled":""}`,htmlFor:G,children:[e.jsx("input",{ref:A,id:G,type:"checkbox",className:"nice-checkbox__input",name:h,checked:a,disabled:c||s,readOnly:n,"aria-invalid":!!_,onChange:H=>{n||s||l?.(H.target.checked)}}),e.jsx("span",{className:"nice-checkbox__box",children:e.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t?e.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"}):e.jsx("polyline",{points:"2 6 5 9 10 3"})})}),L!=="left"&&i&&e.jsx("span",{children:i}),Y&&e.jsx(o.ha,{shortcuts:k,size:"sm"})]}),s&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),w==="right"&&_&&e.jsx("div",{id:`${G}-error`,className:"nice-field__error",role:"alert",children:_}),w==="right"&&!_&&$&&e.jsx("div",{id:`${G}-helper`,className:"nice-field__helper",children:$})]}),w!=="right"&&_&&e.jsx("div",{id:`${G}-error`,className:"nice-field__error",role:"alert",children:_}),w!=="right"&&!_&&$&&e.jsx("div",{id:`${G}-helper`,className:"nice-field__helper",children:$})]})});Ee.displayName="NiceCheckbox";const Pe=Object.freeze(Object.defineProperty({__proto__:null,NiceCheckbox:Ee},Symbol.toStringTag,{value:"Module"})),Te=r.forwardRef(({label:i,checked:a=!1,onChange:t,disabled:l,readOnly:c,loading:n,required:s,size:x="md",name:p,id:h,className:m,style:j,accessMode:K,displayStyle:_,showKeyboardHints:$,error:E,helperText:b,labelPlacement:Y,errorPlacement:L,labelWidth:w,controlWidth:D},g)=>{const S=o.$c(K,h),z=S==="hidden";(S==="disabled"||S==="readOnly")&&(l=!0);const{t:C}=o.Gt(),T=o.hc(h);o.rc("toggle",_);const G=o.ac("toggle",_),k=r.useMemo(()=>[{key:"Space",description:C("shortcuts.toggle","Toggle on/off")}],[C]);return z?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${x} ${Y==="left"?"nice-field--label-left":""} ${n?"nice-field--loading":""} ${m||""}`,style:{...j,...w!=null&&{"--nice-field-label-width":typeof w=="number"?`${w}px`:w},...D!=null&&{"--nice-field-control-width":typeof D=="number"?`${D}px`:D}},"aria-busy":n||void 0,children:[Y==="left"&&i&&e.jsx("span",{className:`nice-field__label ${s?"nice-field__label--required":""}`,children:i}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-toggle nice-toggle--ds-${G} ${x!=="md"?`nice-toggle--${x}`:""} ${l||n?"nice-toggle--disabled":""}`,htmlFor:T,children:[e.jsx("input",{ref:g,id:T,type:"checkbox",className:"nice-toggle__input",name:p,checked:a,disabled:l||n,readOnly:c,role:"switch","aria-checked":a,"aria-invalid":!!E,onChange:A=>{c||n||t?.(A.target.checked)}}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),Y!=="left"&&i&&e.jsx("span",{children:i}),$&&e.jsx(o.ha,{shortcuts:k,size:"sm"})]}),n&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),L==="right"&&E&&e.jsx("div",{id:`${T}-error`,className:"nice-field__error",role:"alert",children:E}),L==="right"&&!E&&b&&e.jsx("div",{id:`${T}-helper`,className:"nice-field__helper",children:b})]}),L!=="right"&&E&&e.jsx("div",{id:`${T}-error`,className:"nice-field__error",role:"alert",children:E}),L!=="right"&&!E&&b&&e.jsx("div",{id:`${T}-helper`,className:"nice-field__helper",children:b})]})});Te.displayName="NiceToggle";const Ke=["var(--nice-danger, #ef4444)","var(--nice-warning, #f97316)","var(--nice-warning, #f59e0b)","var(--nice-success, #84cc16)","var(--nice-success, #10b981)","var(--nice-info, #06b6d4)","var(--nice-primary, #3b82f6)","var(--nice-info, #6366f1)","var(--nice-accent, #8b5cf6)","var(--nice-accent-pink, #ec4899)","var(--nice-text-secondary, #64748b)","var(--nice-text, #1e293b)"];function ze(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}function Ve(i){const a=/^#?([0-9a-f]{6})$/i.exec(i.trim());if(!a)return{r:0,g:0,b:0};const t=parseInt(a[1],16);return{r:t>>16&255,g:t>>8&255,b:t&255}}function Ze(i,a,t){const l=c=>Math.max(0,Math.min(255,Math.round(c))).toString(16).padStart(2,"0");return`#${l(i)}${l(a)}${l(t)}`}function qe(i,a,t){const l=i/255,c=a/255,n=t/255,s=Math.max(l,c,n),x=Math.min(l,c,n),p=(s+x)/2;let h=0,m=0;if(s!==x){const j=s-x;switch(m=p>.5?j/(2-s-x):j/(s+x),s){case l:h=(c-n)/j+(c<n?6:0);break;case c:h=(n-l)/j+2;break;case n:h=(l-c)/j+4;break}h*=60}return{h:Math.round(h),s:Math.round(m*100),l:Math.round(p*100)}}function Je(i,a,t){const l=a/100,c=t/100,n=(1-Math.abs(2*c-1))*l,s=n*(1-Math.abs(i/60%2-1)),x=c-n/2;let p=0,h=0,m=0;return i<60?[p,h,m]=[n,s,0]:i<120?[p,h,m]=[s,n,0]:i<180?[p,h,m]=[0,n,s]:i<240?[p,h,m]=[0,s,n]:i<300?[p,h,m]=[s,0,n]:[p,h,m]=[n,0,s],{r:Math.round((p+x)*255),g:Math.round((h+x)*255),b:Math.round((m+x)*255)}}function Ye(i,a,t){const l=i/255,c=a/255,n=t/255,s=Math.max(l,c,n),x=Math.min(l,c,n),p=s-x;let h=0;p!==0&&(s===l?h=(c-n)/p%6:s===c?h=(n-l)/p+2:h=(l-c)/p+4,h*=60,h<0&&(h+=360));const m=s===0?0:p/s;return{h:Math.round(h),s:Math.round(m*100),v:Math.round(s*100)}}function Oe(i,a,t){const l=a/100,c=t/100,n=c*l,s=n*(1-Math.abs(i/60%2-1)),x=c-n;let p=0,h=0,m=0;return i<60?[p,h,m]=[n,s,0]:i<120?[p,h,m]=[s,n,0]:i<180?[p,h,m]=[0,n,s]:i<240?[p,h,m]=[0,s,n]:i<300?[p,h,m]=[s,0,n]:[p,h,m]=[n,0,s],{r:Math.round((p+x)*255),g:Math.round((h+x)*255),b:Math.round((m+x)*255)}}function Qe(i){const a=/^#?([0-9a-f]{6})$/i.exec(i.trim()),t=/^#?([0-9a-f]{8})$/i.exec(i.trim());if(t){const l=t[1];return{r:parseInt(l.slice(0,2),16),g:parseInt(l.slice(2,4),16),b:parseInt(l.slice(4,6),16),a:parseInt(l.slice(6,8),16)/255}}if(a){const l=parseInt(a[1],16);return{r:l>>16&255,g:l>>8&255,b:l&255,a:1}}return{r:0,g:0,b:0,a:1}}function Xe(i,a,t,l,c){const n=x=>Math.max(0,Math.min(255,Math.round(x))).toString(16).padStart(2,"0"),s=`#${n(i)}${n(a)}${n(t)}`;return c?`${s}${n(l*255)}`:s}const Le=r.forwardRef(({label:i,helperText:a,error:t,required:l,disabled:c,id:n,className:s,style:x,accessMode:p,displayStyle:h,value:m="var(--nice-primary, #3b82f6)",onChange:j,presets:K=Ke,showInput:_=!0,showRandom:$=!0,withAlpha:E=!1,compact:b=!1,showKeyboardHints:Y,size:L="md",labelPlacement:w,errorPlacement:D,labelWidth:g,controlWidth:S,loading:z},C)=>{const T=o.$c(p,n),G=T==="hidden";(T==="disabled"||T==="readOnly")&&(c=!0);const{t:k}=o.Gt(),A=o.hc(n);o.ac("input",h);const H=r.useCallback(()=>{c||j?.(ze())},[c,j]),[Q,O]=r.useState(!1),[ce,X]=r.useState(null),W=r.useRef(null),re=r.useRef(null);r.useLayoutEffect(()=>{if(!Q||!re.current)return;const v=()=>{const y=re.current?.getBoundingClientRect();if(!y)return;const F=280,M=360;let q=y.left,Z=y.bottom+6;q+F>window.innerWidth-8&&(q=Math.max(8,window.innerWidth-F-8)),Z+M>window.innerHeight-8&&(Z=Math.max(8,y.top-M-6)),X({left:q,top:Z})};return v(),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[Q]),r.useEffect(()=>{if(!Q)return;const v=F=>{const M=F.target;W.current?.contains(M)||re.current?.contains(M)||O(!1)},y=F=>{F.key==="Escape"&&O(!1)};return document.addEventListener("mousedown",v),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",y)}},[Q]);const ee=r.useMemo(()=>[{key:"Enter",description:k("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:k("shortcuts.navigatePresets","Navigate presets")}],[k]);return G?null:e.jsxs("div",{className:`nice-field nice-field--${L} ${w==="left"?"nice-field--label-left":""} ${b?"nice-color-picker--compact":""} ${z?"nice-field--loading":""} ${s||""}`,style:{...x,...g!=null&&{"--nice-field-label-width":typeof g=="number"?`${g}px`:g},...S!=null&&{"--nice-field-control-width":typeof S=="number"?`${S}px`:S}},"aria-busy":z||void 0,children:[i&&e.jsxs("label",{htmlFor:A,className:`nice-field__label ${l?"nice-field__label--required":""}`,children:[i,Y&&e.jsx(o.ha,{shortcuts:ee,size:"sm"})]}),e.jsx("div",{className:"nice-field__control",children:e.jsxs("div",{className:"nice-color-picker",children:[e.jsxs("div",{className:"nice-color-picker__preview-row",children:[e.jsx("div",{ref:re,className:"nice-color-picker__swatch",id:A,style:{background:m},onClick:v=>{v.stopPropagation(),c||O(y=>!y)},onKeyDown:v=>{!c&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),O(y=>!y))},role:"button",tabIndex:0,"aria-label":k("colorPicker.openPalette","Open color palette"),"aria-haspopup":"dialog","aria-expanded":Q,children:e.jsx("input",{ref:v=>{typeof C=="function"?C(v):C&&(C.current=v)},type:"hidden",value:m,disabled:c,readOnly:!0})}),_&&e.jsx("div",{className:"nice-input nice-input--sm",style:b?{flex:1,minWidth:0}:{width:100},children:e.jsx("input",{className:"nice-input__native",type:"text",value:m,disabled:c,onChange:v=>j?.(v.target.value),maxLength:7})}),$&&!b&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:H,disabled:c,title:k("colorPicker.random","Random"),"aria-label":k("colorPicker.random","Random"),style:{fontSize:"0.65rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:k("colorPicker.random","Random")}),z&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),D==="right"&&t&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:t}),D==="right"&&!t&&a&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:a})]}),Q&&ce&&typeof document<"u"&&Ie.createPortal(e.jsx("div",{ref:W,className:"nice-color-picker__popup nice-color-picker__popup--portal",role:"dialog","aria-label":k("colorPicker.palette","Color palette"),style:{position:"fixed",left:ce.left,top:ce.top},onClick:v=>v.stopPropagation(),children:(()=>{const v=Qe(m),y={r:v.r,g:v.g,b:v.b},F=E?v.a:1,M=qe(y.r,y.g,y.b),q=Ye(y.r,y.g,y.b),Z=(f,B,I,R=F)=>j?.(Xe(f,B,I,R,E)),ue=(f,B,I)=>Z(f,B,I),ne=(f,B,I)=>{const R=Je(f,B,I);Z(R.r,R.g,R.b)},J=(f,B,I)=>{const R=Oe(f,B,I);Z(R.r,R.g,R.b)},de=f=>Z(y.r,y.g,y.b,f),te=f=>{if(c)return;const B=f.currentTarget,I=V=>{const oe=B.getBoundingClientRect(),xe=Math.max(0,Math.min(oe.width,V.clientX-oe.left)),pe=Math.max(0,Math.min(oe.height,V.clientY-oe.top)),ye=Math.round(xe/oe.width*100),ge=100-Math.round(pe/oe.height*100);J(q.h,ye,ge)};I(f);const R=()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",R)};document.addEventListener("pointermove",I),document.addEventListener("pointerup",R)},se=`hsl(${q.h}, 100%, 50%)`;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-color-picker__popup-header",children:e.jsx("input",{type:"text",className:"nice-input__native nice-color-picker__popup-hex",value:m,disabled:c,onChange:f=>j?.(f.target.value),maxLength:E?9:7,"aria-label":k("colorPicker.hexValue","Hex value")})}),e.jsx("input",{type:"range",min:0,max:360,value:q.h,disabled:c,onChange:f=>J(Number(f.target.value),q.s,q.v),className:"nice-color-picker__hue-slider","aria-label":k("colorPicker.hue","Hue")}),e.jsx("div",{className:"nice-color-picker__sv",style:{background:`linear-gradient(to top, var(--nice-text, #000), transparent), linear-gradient(to right, var(--nice-bg, #FFF), ${se})`},onPointerDown:te,role:"application","aria-label":k("colorPicker.svPalette","Saturation/value palette"),children:e.jsx("span",{className:"nice-color-picker__sv-marker",style:{left:`${q.s}%`,top:`${100-q.v}%`}})}),e.jsxs("div",{className:"nice-color-picker__sliders",children:[e.jsx("div",{className:"nice-color-picker__slider-col",children:["h","s","l"].map(f=>{const B=f==="h"?360:100,I=M[f],R=V=>ne(f==="h"?V:M.h,f==="s"?V:M.s,f==="l"?V:M.l);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:f.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:B,value:I,disabled:c,onChange:V=>R(Number(V.target.value))}),e.jsx("input",{type:"number",min:0,max:B,value:I,disabled:c,onChange:V=>R(Number(V.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},f)})}),e.jsx("div",{className:"nice-color-picker__slider-col",children:["r","g","b"].map(f=>{const B=y[f],I=R=>ue(f==="r"?R:y.r,f==="g"?R:y.g,f==="b"?R:y.b);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:f.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:255,value:B,disabled:c,onChange:R=>I(Number(R.target.value))}),e.jsx("input",{type:"number",min:0,max:255,value:B,disabled:c,onChange:R=>I(Number(R.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},f)})})]}),E&&e.jsxs("div",{className:"nice-color-picker__alpha-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:"A"}),e.jsx("input",{type:"range",min:0,max:100,value:Math.round(F*100),disabled:c,onChange:f=>de(Number(f.target.value)/100),className:"nice-color-picker__alpha-slider",style:{background:`linear-gradient(to right, transparent, rgb(${y.r},${y.g},${y.b}))`},"aria-label":k("colorPicker.alpha","Alpha")}),e.jsx("input",{type:"number",min:0,max:100,value:Math.round(F*100),disabled:c,onChange:f=>de((Number(f.target.value)||0)/100),className:"nice-input__native nice-color-picker__slider-num"})]}),K.length>0&&e.jsx("div",{className:"nice-color-picker__popup-presets",children:K.map(f=>e.jsx("div",{className:`nice-color-picker__preset ${m===f?"nice-color-picker__preset--active":""}`,style:{background:f},onClick:()=>{j?.(f),O(!1)},role:"button",tabIndex:0,"aria-label":f,onKeyDown:B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),j?.(f),O(!1))}},f))})]})})()}),document.body)]})}),D!=="right"&&t&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:t}),D!=="right"&&!t&&a&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:a})]})});Le.displayName="NiceColorPicker";const We=Object.freeze(Object.defineProperty({__proto__:null,NiceColorPicker:Le,hexToRgb:Ve,rgbToHex:Ze},Symbol.toStringTag,{value:"Module"})),Fe=r.forwardRef(({children:i,variant:a="primary",size:t="md",type:l="button",disabled:c,loading:n,fullWidth:s,onClick:x,leftIcon:p,rightIcon:h,error:m,errorPlacement:j="bottom",ariaLabel:K,className:_,style:$,id:E,accessMode:b,displayStyle:Y,...L},w)=>{const D=o.Ys(a),g=o.Js(t),S=o.$c(b,E),z=S==="hidden";(S==="disabled"||S==="readOnly")&&(c=!0);const C=o.rc("button",Y),T=o.ac("button",Y),G=D!=="primary"?(({background:H,color:Q,...O})=>O)(C):C,k=e.jsxs("button",{ref:w,type:l,id:E,className:`nice-btn nice-btn--${D} nice-btn--${g} nice-btn--ds-${T} ${s?"nice-btn--full-width":""} ${n?"nice-btn--loading":""} ${m&&!j?"nice-btn--has-error":""} ${_||""}`,style:{...G,...$},disabled:c||n,"aria-busy":n||void 0,"aria-disabled":c||n||void 0,"aria-label":K,onClick:x,...L,children:[n&&e.jsx("svg",{className:"nice-btn__spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3","aria-hidden":"true",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})}),!n&&p&&e.jsx("span",{"aria-hidden":"true",children:p}),!n&&e.jsx("span",{children:i}),n&&e.jsx("span",{style:{visibility:"hidden"},"aria-hidden":"true",children:i}),!n&&h&&e.jsx("span",{"aria-hidden":"true",children:h})]});if(z)return null;if(!m)return k;const A=e.jsx("div",{className:"nice-field__error",role:"alert",children:m});return j==="right"?e.jsxs("span",{className:`nice-btn-field nice-btn-field--right nice-field--${g}`,style:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:"8px",width:"fit-content"},children:[k,A]}):z?null:e.jsxs("span",{className:`nice-btn-field nice-btn-field--bottom nice-field--${g}`,style:{display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",width:"fit-content"},children:[k,A]})});Fe.displayName="NiceButton";const en=({tabs:i,activeTab:a,onChange:t,variant:l="default",vertical:c,size:n="md",className:s,style:x,displayStyle:p})=>{const h=o.rc("tab",p),m=o.ac("tab",p),[j,K]=r.useState(a||i[0]?.id),_=a??j,$=r.useCallback(b=>{K(b),t?.(b)},[t]),E=i.find(b=>b.id===_)?.content;return e.jsxs("div",{className:`nice-tabs nice-tabs--${n} nice-tabs--ds-${m} ${s||""}`,style:{...h,...x,...c?{display:"flex",gap:16}:{}},children:[e.jsx("div",{className:`nice-tabs__list ${l!=="default"?`nice-tabs__list--${l}`:""} ${c?"nice-tabs__list--vertical":""}`,role:"tablist",children:i.map(b=>e.jsxs("button",{type:"button",role:"tab","aria-selected":_===b.id,className:`nice-tabs__tab ${_===b.id?"nice-tabs__tab--active":""} ${b.disabled?"nice-tabs__tab--disabled":""}`,disabled:b.disabled,onClick:()=>$(b.id),children:[b.icon,e.jsx("span",{children:b.label}),b.badge!==void 0&&e.jsx("span",{className:"nice-tabs__badge",children:b.badge})]},b.id))}),E&&e.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",children:E})]})},nn=Object.freeze({AR:["#74acdf","#ffffff","#74acdf"],AT:["#ed2939","#ffffff","#ed2939"],AU:["#012169","#ffffff","#e4002b"],BE:["#000000","#fae042","#ed2939"],BR:["#009c3b","#ffdf00","#002776"],CA:["#ff0000","#ffffff","#ff0000"],CH:["#d52b1e","#ffffff","#d52b1e"],CN:["#de2910","#ffde00","#de2910"],CZ:["#11457e","#ffffff","#d7141a"],DE:["#000000","#dd0000","#ffce00"],DK:["#c8102e","#ffffff","#c8102e"],EE:["#0072ce","#000000","#ffffff"],EG:["#ce1126","#ffffff","#000000"],ES:["#aa151b","#f1bf00","#aa151b"],FI:["#ffffff","#003580","#ffffff"],FR:["#0055a4","#ffffff","#ef4135"],GB:["#012169","#ffffff","#c8102e"],GR:["#0d5eaf","#ffffff","#0d5eaf"],HR:["#171796","#ffffff","#ff0000"],HU:["#ce2939","#ffffff","#477050"],IE:["#169b62","#ffffff","#ff883e"],IL:["#ffffff","#0038b8","#ffffff"],IN:["#ff9933","#ffffff","#138808"],IS:["#02529c","#ffffff","#dc1e35"],IT:["#009246","#ffffff","#ce2b37"],JP:["#ffffff","#bc002d","#ffffff"],KR:["#ffffff","#cd2e3a","#0047a0"],LT:["#fdb913","#006a44","#c1272d"],LU:["#ed2939","#ffffff","#00a1de"],LV:["#9e3039","#ffffff","#9e3039"],MX:["#006847","#ffffff","#ce1126"],NL:["#ae1c28","#ffffff","#21468b"],NO:["#ef2b2d","#ffffff","#002868"],NZ:["#012169","#ffffff","#cc142b"],PL:["#ffffff","#dc143c"],PT:["#006600","#ff0000"],RO:["#002b7f","#fcd116","#ce1126"],RU:["#ffffff","#0039a6","#d52b1e"],SE:["#006aa7","#fecc00","#006aa7"],SK:["#ffffff","#0b4ea2","#ee1c25"],TR:["#e30a17","#ffffff","#e30a17"],UA:["#005bbb","#ffd500"],US:["#b22234","#ffffff","#3c3b6e"],VN:["#da251d","#ffff00","#da251d"],ZA:["#007a4d","#ffffff","#de3831"],AD:["#10069f","#fedf00","#d50032"],AE:["#00732f","#ffffff","#000000"],AF:["#000000","#d32011","#007a36"],AG:["#ce1126","#fcd116","#000000"],AL:["#e41e20","#000000","#e41e20"],AM:["#d90012","#0033a0","#f2a800"],AO:["#ce1126","#000000","#ffc500"],AZ:["#0092bc","#ed2939","#509e2f"],BA:["#002395","#fecb00","#ffffff"],BB:["#00267f","#ffc726","#00267f"],BD:["#006a4e","#f42a41","#006a4e"],BF:["#ef2b2d","#009e49","#fcd116"],BG:["#ffffff","#00966e","#d62612"],BH:["#ffffff","#ce1126","#ce1126"],BI:["#1eb53a","#ffffff","#ce1126"],BJ:["#008751","#fcd116","#e8112d"],BN:["#f7e017","#ffffff","#000000"],BO:["#d52b1e","#f9e300","#007934"],BS:["#00778b","#ffc72c","#000000"],BT:["#ffcc33","#ff4e12","#ffcc33"],BW:["#75aadb","#ffffff","#000000"],BY:["#c8313e","#007c30","#ffffff"],BZ:["#003f87","#ce1126","#003f87"],CD:["#007fff","#f7d618","#ce1021"],CF:["#003082","#ffffff","#289728"],CG:["#009543","#fbde4a","#dc241f"],CI:["#f77f00","#ffffff","#009e60"],CM:["#007a5e","#ce1126","#fcd116"],CO:["#fcd116","#003893","#ce1126"],CR:["#002b7f","#ffffff","#ce1126"],CU:["#002590","#ffffff","#cf142b"],CV:["#003893","#ffffff","#cf2027"],CY:["#ffffff","#d57800","#ffffff"],DJ:["#6ab2e7","#ffffff","#12ad2b"],DM:["#006b3f","#ffffff","#000000"],DO:["#002d62","#ffffff","#ce1126"],DZ:["#006233","#ffffff","#d21034"],EC:["#ffd100","#034ea2","#ed1c24"],ER:["#ea0437","#0084c9","#418fde"],ET:["#078930","#fcdd09","#da121a"],FJ:["#68bfe5","#cc0000","#ffffff"],GA:["#3a75c4","#ffe700","#009e60"],GD:["#ce1126","#fcd116","#007a5e"],GE:["#ffffff","#ff0000","#ffffff"],GH:["#ce1126","#fcd116","#006b3f"],GM:["#ce1126","#ffffff","#0c1c8c"],GN:["#ce1126","#fcd116","#009460"],GQ:["#3e9a00","#ffffff","#e32118"],GT:["#4997d0","#ffffff","#4997d0"],GW:["#ce1126","#fcd116","#009e49"],GY:["#009e49","#ffffff","#fcd116"],HK:["#de2910","#ffffff","#de2910"],HN:["#0073cf","#ffffff","#0073cf"],HT:["#00209f","#d21034","#00209f"],ID:["#ff0000","#ffffff","#ff0000"],IQ:["#ce1126","#ffffff","#000000"],IR:["#239f40","#ffffff","#da0000"],JM:["#000000","#fed100","#009b3a"],JO:["#000000","#ffffff","#007a3d"],KE:["#000000","#bb0000","#006600"],KG:["#ff0000","#fcd116","#ff0000"],KH:["#032ea1","#e00025","#032ea1"],KM:["#fcd116","#ffffff","#ce1126"],KP:["#024fa2","#ed1c27","#024fa2"],KW:["#007a3d","#ffffff","#ce1126"],KZ:["#00afca","#fec50c","#00afca"],LA:["#ce1126","#002868","#ce1126"],LB:["#ed1c24","#ffffff","#ed1c24"],LI:["#002780","#ce1126","#002780"],LK:["#ffbe29","#8d153a","#00534e"],LR:["#bf0a30","#ffffff","#002868"],LS:["#00209f","#ffffff","#009543"],LY:["#e70013","#000000","#239e46"],MA:["#c1272d","#006233","#c1272d"],MD:["#0046ae","#ffd200","#cc092f"],ME:["#d4af37","#cc0033","#d4af37"],MG:["#ffffff","#fc3d32","#007e3a"],MH:["#003893","#dd7500","#ffffff"],MK:["#d20000","#ffe600","#d20000"],ML:["#14b53a","#fcd116","#ce1126"],MM:["#fecb00","#34b233","#ea2839"],MN:["#c4272f","#015197","#c4272f"],MO:["#00785a","#ffd700","#ffffff"],MR:["#006233","#ffc400","#d01c1f"],MT:["#ffffff","#cf142b","#ffffff"],MU:["#ea2839","#1a206d","#00a04d"],MV:["#d21034","#007e3a","#ffffff"],MW:["#000000","#ce1126","#339e35"],MY:["#cc0000","#ffffff","#010066"],MZ:["#009a44","#ffffff","#000000"],NA:["#003580","#ffffff","#009543"],NE:["#ff8000","#ffffff","#0db02b"],NG:["#008753","#ffffff","#008753"],NI:["#0067c6","#ffffff","#0067c6"],NP:["#dc143c","#003893","#dc143c"],OM:["#dc241f","#ffffff","#008000"],PA:["#ffffff","#cc0033","#005aa7"],PE:["#d91023","#ffffff","#d91023"],PG:["#ce1126","#000000","#fcd116"],PH:["#0038a8","#ffffff","#ce1126"],PK:["#ffffff","#01411c","#01411c"],PS:["#000000","#ffffff","#007a3d"],PY:["#d52b1e","#ffffff","#0038a8"],QA:["#ffffff","#8a1538","#8a1538"],RS:["#c6363c","#0c4076","#ffffff"],RW:["#00a1de","#fad201","#00a651"],SA:["#006c35","#ffffff","#006c35"],SB:["#0051ba","#fcd116","#215b33"],SC:["#003f87","#fcd116","#d62828"],SD:["#d21034","#ffffff","#000000"],SG:["#ed2939","#ffffff","#ed2939"],SI:["#ffffff","#0000ff","#ff0000"],SL:["#1eb53a","#ffffff","#0072c6"],SM:["#ffffff","#5eb6e4","#ffffff"],SN:["#00853f","#fdef42","#e31b23"],SO:["#4189dd","#ffffff","#4189dd"],SR:["#377e3f","#ffffff","#b40a2d"],SS:["#000000","#ce1126","#078930"],ST:["#12ad2b","#ffce00","#d21034"],SV:["#0047ab","#ffffff","#0047ab"],SY:["#ce1126","#ffffff","#000000"],SZ:["#3e5eb9","#ffd900","#b10c0c"],TD:["#002664","#fecb00","#c60c30"],TG:["#006a4e","#fcd116","#d21034"],TH:["#ed1c24","#ffffff","#241d4f"],TJ:["#cc0000","#ffffff","#006600"],TL:["#dc241f","#ffc726","#000000"],TM:["#00853e","#ffffff","#cc0000"],TN:["#e70013","#ffffff","#e70013"],TO:["#ffffff","#c10000","#c10000"],TT:["#ce1126","#ffffff","#000000"],TW:["#fe0000","#000095","#fe0000"],TZ:["#1eb53a","#fcd116","#00a3dd"],UG:["#000000","#fcdc04","#d90000"],UY:["#ffffff","#0038a8","#ffffff"],UZ:["#1eb53a","#ffffff","#0099b5"],VA:["#ffe000","#ffffff","#ffe000"],VE:["#fcd116","#00247d","#cf142b"],VU:["#000000","#ce1126","#009543"],WS:["#002b7f","#ffffff","#cc0033"],YE:["#ce1126","#ffffff","#000000"],ZM:["#198a00","#de2010","#ef7d00"],ZW:["#078930","#fcd116","#cf2027"]}),De=["#cbd5e1","#94a3b8","#cbd5e1"];function cn(i){return i?nn[i.toUpperCase()]??De:De}const tn=Ge.Flags3x2,sn=({code:i,size:a=22,className:t})=>{const l=i?.toUpperCase(),c=l?tn[l]:void 0,n=a,s=Math.round(a*2/3);return c?e.jsx("span",{className:t,role:"img","aria-label":`${l} flag`,style:{display:"inline-block",width:n,height:s,boxSizing:"content-box",border:"1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle",lineHeight:0},dangerouslySetInnerHTML:{__html:c.replace("<svg ",`<svg width="${n}" height="${s}" preserveAspectRatio="xMidYMid slice" `)}}):e.jsx(Ae,{code:i,size:a,className:t})},Ae=({code:i,size:a=18,className:t})=>{const l=cn(i);return e.jsx("span",{className:t,role:"img","aria-label":`${i} flag`,style:{display:"inline-flex",width:a,height:Math.round(a*.7),boxSizing:"content-box",border:"1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:l.map((c,n)=>e.jsx("span",{style:{flex:1,background:c}},n))})};function fn(i,a,t,l=280){const[c,n]=r.useState(t==="left"?"left":"right"),s=r.useCallback(()=>{if(t!=="auto"){n(t);return}const x=a.current;if(!x||typeof window>"u")return;const p=x.getBoundingClientRect(),m=window.innerWidth-p.left,j=p.right;m>=l&&m>j?n("left"):n("right")},[t,a,l]);return r.useEffect(()=>{if(i)return s(),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),()=>{window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0)}},[i,s]),c}const ln=({colors:i,size:a=28,shape:t="page",className:l})=>{const c=a,n=Math.round(a*.75),s=i.border??"color-mix(in srgb, currentColor 30%, transparent)";if(t==="swatch"){const K=[i.primary,i.background,i.backgroundSecondary??i.background,i.textColor];return e.jsx("span",{className:l,role:"img","aria-label":"Theme preview",style:{display:"inline-flex",width:c,height:n,border:`1px solid ${s}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:K.map((_,$)=>e.jsx("span",{style:{flex:1,background:_}},$))})}const x=Math.max(2,Math.round(n*.22)),p=i.backgroundSecondary?Math.max(3,Math.round(c*.28)):0,h=Math.max(1,Math.round(n*.08)),m=Math.max(1,Math.round(n*.05)),j=Math.max(2,Math.round(c*.08));return e.jsxs("span",{className:l,role:"img","aria-label":"Theme preview",style:{position:"relative",display:"inline-block",width:c,height:n,boxSizing:"content-box",background:i.background,border:`1px solid ${s}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:[e.jsx("span",{style:{position:"absolute",top:0,left:0,right:0,height:x,background:i.primary}}),p>0&&e.jsx("span",{style:{position:"absolute",top:x,left:0,bottom:0,width:p,background:i.backgroundSecondary}}),e.jsx("span",{style:{position:"absolute",top:x+m,left:p+j,right:j,height:h,background:i.textColor,opacity:.8,borderRadius:1}}),e.jsx("span",{style:{position:"absolute",top:x+m*2+h,left:p+j,width:`${Math.max(20,c-p-j*2-4)}px`,height:h,background:i.textColor,opacity:.5,borderRadius:1}})]})};exports.FlagIcon=sn;exports.FlagSwatch=Ae;exports.NiceButton=Fe;exports.NiceCheckbox=Ee;exports.NiceCheckbox$1=Pe;exports.NiceColorPicker=Le;exports.NiceColorPicker$1=We;exports.NiceNumberInput=Ce;exports.NiceNumberInput$1=Be;exports.NiceSelect=Re;exports.NiceSelect$1=Ue;exports.NiceTabs=en;exports.NiceTextInput=Se;exports.NiceTextInput$1=He;exports.NiceToggle=Te;exports.ThemePreviewSwatch=ln;exports.useDropdownAlignment=fn;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),r=require("./core-CLfcCDKc.cjs"),l=require("react"),Ie=require("react-dom"),Ue=require("./vendor-DHEorsoy.cjs"),Ee=l.forwardRef(({label:t,helperText:f,error:s,required:d,disabled:i,readOnly:n,size:c="md",name:x,id:o,className:u,style:h,accessMode:w,displayStyle:G,variant:m,value:y,defaultValue:k,onChange:v,onBlur:P,onKeyDown:M,placeholder:b,type:C="text",maxLength:N,prefix:L,suffix:V,clearable:R,autoFocus:A,submitOnEnter:I,onSubmit:S,showKeyboardHints:H,labelPlacement:T,errorPlacement:J,loading:U,labelWidth:le,controlWidth:se,displayMode:ee,...he},ne)=>{const O=r.Dc(w,o),me=O==="hidden";O==="disabled"&&(i=!0),O==="readOnly"&&(n=!0);const{t:j}=r.Gt(),_=r.bc(o),te=r.rc("input",G),Y=r.ac("input",G),Q=m==="filled"?"filled":m==="underlined"?"underlined":"",z=l.useCallback(()=>v?.(""),[v]),X=r.sc({enabled:ee,readOnly:n,disabled:i}),re=r.Zc({enabled:I,onSubmit:S}),de=l.useCallback(B=>{re(B),M?.(B)},[re,M]),W=l.useMemo(()=>{const B=[];return I&&B.push({key:"Enter",description:j("shortcuts.submit","Submit")}),R&&B.push({key:"Escape",description:j("shortcuts.clear","Clear")}),B},[I,R,j]);return me?null:e.jsxs("div",{className:`nice-field nice-field--${c} ${T==="left"?"nice-field--label-left":""} ${T==="inside"?"nice-field--label-inside":""} ${U?"nice-field--loading":""} ${u||""}`,style:{...h,...le!=null&&{"--nice-field-label-width":typeof le=="number"?`${le}px`:le},...se!=null&&{"--nice-field-control-width":typeof se=="number"?`${se}px`:se}},"aria-busy":U||void 0,"data-floating":T==="inside"&&y?"true":void 0,children:[t&&T!=="inside"&&e.jsxs("label",{htmlFor:_,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:[t,H&&W.length>0&&e.jsx(r.ha,{shortcuts:W,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[X.isDisplay?e.jsx(r.cc,{value:y??k??"",placeholder:b,disabled:i,readOnly:n,onActivate:X.enterEdit,ariaLabel:t}):e.jsxs("div",{className:`nice-input nice-input--${c} nice-input--ds-${Q||Y} ${s?"nice-input--error":""} ${i?"nice-input--disabled":""} ${n?"nice-input--readonly":""}`,style:m?void 0:te,children:[L&&e.jsx("span",{className:"nice-input__icon",children:L}),e.jsx("input",{ref:B=>{typeof ne=="function"?ne(B):ne&&(ne.current=B),X.autoFocusRef(B)},id:_,className:"nice-input__native",type:C,name:x,value:y,defaultValue:k,placeholder:b,disabled:i||U,readOnly:n,maxLength:N,autoFocus:A,"aria-invalid":!!s,"aria-describedby":s?`${_}-error`:f?`${_}-helper`:void 0,onChange:B=>v?.(B.target.value),onBlur:B=>{ee&&X.exitEdit(),P?.(B)},onKeyDown:de,...he}),R&&y&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:z,"aria-label":j("controls.clear","Clear"),children:e.jsx(r.oa,{name:"close",size:14})}),V&&e.jsx("span",{className:"nice-input__icon",children:V}),t&&T==="inside"&&e.jsx("label",{htmlFor:_,className:`nice-input__floating-label ${d?"nice-input__floating-label--required":""}`,children:t})]}),U&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),J==="right"&&s&&e.jsx("div",{id:`${_}-error`,className:"nice-field__error",role:"alert",children:s}),J==="right"&&!s&&f&&e.jsx("div",{id:`${_}-helper`,className:"nice-field__helper",children:f})]}),J!=="right"&&s&&e.jsx("div",{id:`${_}-error`,className:"nice-field__error",role:"alert",children:s}),J!=="right"&&!s&&f&&e.jsx("div",{id:`${_}-helper`,className:"nice-field__helper",children:f})]})});Ee.displayName="NiceTextInput";const Ke=Object.freeze(Object.defineProperty({__proto__:null,NiceTextInput:Ee},Symbol.toStringTag,{value:"Module"})),Le=l.forwardRef(({label:t,helperText:f,error:s,required:d,disabled:i,readOnly:n,size:c="md",name:x,id:o,className:u,style:h,accessMode:w,displayStyle:G,value:m,onChange:y,onBlur:k,onKeyDown:v,placeholder:P,min:M,max:b,step:C=1,precision:N,prefix:L,prefixType:V="label",prefixOptions:R,prefixValue:A,onPrefixChange:I,suffix:S,showStepper:H=!0,submitOnEnter:T,onSubmit:J,showKeyboardHints:U,labelPlacement:le,errorPlacement:se,loading:ee,labelWidth:he,controlWidth:ne,formatPreset:O,format:me,suffixType:j="label",suffixOptions:_,suffixValue:te,onSuffixChange:Y,suffixSeparator:Q=!1,displayMode:z},X)=>{const re=r.Dc(w,o),de=re==="hidden";re==="disabled"&&(i=!0),re==="readOnly"&&(n=!0);const{t:W}=r.Gt(),B=r.bc(o),ye=r.rc("input",G),g=r.ac("input",G),[D,F]=l.useState(!1),[E,fe]=l.useState(null),ie=r.sc({enabled:z,readOnly:n,disabled:i}),we=l.useMemo(()=>{let a=3;return b!=null&&(a=String(Math.abs(Math.floor(b))).length),M!=null&&M<0&&(a+=1),N&&(a+=N+1),Math.max(3,a)+1},[b,M,N]),ke=l.useCallback(a=>{if(me)return me(a);if(!O)return N!=null?a.toFixed(N):String(a);switch(O){case"integer":return Math.round(a).toLocaleString();case"decimal":return a.toLocaleString(void 0,{minimumFractionDigits:N??2,maximumFractionDigits:N??2});case"money":return a.toLocaleString(void 0,{minimumFractionDigits:N??2,maximumFractionDigits:N??2,useGrouping:!0});case"percent":return(a*100).toLocaleString(void 0,{minimumFractionDigits:N??0,maximumFractionDigits:N??2})+"%";default:return String(a)}},[me,O,N]),ae=l.useMemo(()=>D&&E!==null?E:m==null?"":D?N!=null?m.toFixed(N):String(m):ke(m),[m,D,E,ke,N]),$e=m!=null&&m<0,ve=!!(L||V==="select"&&R&&R.length>0),xe=$e&&ve&&!D,Me=xe?ae.replace(/^[-−]/,""):ae,ce=l.useCallback(a=>{let $=a;return M!==void 0&&($=Math.max(M,$)),b!==void 0&&($=Math.min(b,$)),N!==void 0&&($=parseFloat($.toFixed(N))),$},[M,b,N]),oe=l.useCallback(a=>{const $=a.target.value;if(fe($),$===""||$==="-"||$==="."||$==="-."){$===""&&y?.(null);return}const Z=parseFloat($);if(!isNaN(Z)){let ue=Z;M!==void 0&&(ue=Math.max(M,ue)),b!==void 0&&(ue=Math.min(b,ue)),y?.(ue)}},[y,M,b]),Ne=l.useCallback(()=>{const a=je.current,$=ce((a??0)+C);je.current=$,y?.($)},[C,y,ce]),be=l.useCallback(()=>{const a=je.current,$=ce((a??0)-C);je.current=$,y?.($)},[C,y,ce]),je=l.useRef(m);je.current=m;const _e=l.useRef(null),ge=l.useCallback(()=>{_e.current&&(clearTimeout(_e.current),_e.current=null)},[]),Se=l.useCallback(a=>{ge();let $=300;const Z=()=>{a(),$=Math.max(30,$*.82),_e.current=setTimeout(Z,$)};_e.current=setTimeout(Z,400)},[ge]),p=r.Zc({enabled:T,onSubmit:J}),q=l.useCallback(a=>{p(a),a.key==="ArrowUp"?(a.preventDefault(),Ne()):a.key==="ArrowDown"&&(a.preventDefault(),be()),v?.(a)},[p,v,Ne,be]),K=l.useMemo(()=>{const a=[];return T&&a.push(r.Yc.submit),H&&(a.push({key:"ArrowUp",description:W("shortcuts.increment","Increase value")}),a.push({key:"ArrowDown",description:W("shortcuts.decrement","Decrease value")})),a},[T,H,W]);return de?null:e.jsxs("div",{className:`nice-field nice-field--${c} ${le==="left"?"nice-field--label-left":""} ${ee?"nice-field--loading":""} ${u||""}`,style:{...h,...he!=null&&{"--nice-field-label-width":typeof he=="number"?`${he}px`:he},...ne!=null&&{"--nice-field-control-width":typeof ne=="number"?`${ne}px`:ne}},"aria-busy":ee||void 0,children:[t&&e.jsxs("label",{htmlFor:B,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:[t,U&&K.length>0&&e.jsx(r.ha,{shortcuts:K,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[ie.isDisplay?e.jsx(r.cc,{value:m==null?"":L?e.jsxs(e.Fragment,{children:[L,ae]}):ae,placeholder:P,disabled:i,readOnly:n,onActivate:ie.enterEdit,ariaLabel:t}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:`nice-input nice-input--number nice-input--${c} nice-input--ds-${g} ${Q?"nice-input--suffix-sep":""} ${s?"nice-input--error":""} ${i?"nice-input--disabled":""} ${n?"nice-input--readonly":""}`,style:ye,children:[H&&!n&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__minus",onClick:be,onMouseDown:()=>Se(be),onMouseUp:ge,onMouseLeave:ge,disabled:i,"aria-label":W("controls.decrement","Decrement"),children:e.jsx(r.oa,{name:"minus",size:16})}),V==="select"&&R&&R.length>0?e.jsxs(e.Fragment,{children:[xe&&e.jsx("span",{className:"nice-input__sign",children:"−"}),e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--prefix",value:A??R[0]?.value,disabled:i,onChange:a=>{const $=a.target.value,Z=R.find(pe=>pe.value===(A??R[0]?.value)),ue=R.find(pe=>pe.value===$);I?.($,Z?.weight,ue?.weight)},children:R.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))})]}):L?e.jsxs("span",{className:"nice-input__icon nice-input__icon--prefix",children:[xe&&e.jsx("span",{className:"nice-input__sign",children:"−"}),L]}):null,e.jsx("input",{ref:a=>{typeof X=="function"?X(a):X&&(X.current=a),ie.autoFocusRef(a)},id:B,className:"nice-input__native",type:!D&&(me||O)?"text":"number",name:x,value:Me,placeholder:P,min:M,max:b,step:C,disabled:i||ee,readOnly:n,"aria-invalid":!!s,onChange:oe,onFocus:a=>{F(!0),fe(null),a.target.select()},onBlur:a=>{if(F(!1),fe(null),m!=null&&N!==void 0){const $=parseFloat(m.toFixed(N));$!==m&&y?.($)}z&&ie.exitEdit(),k?.(a)},onKeyDown:q,style:{width:`${we}ch`}}),j==="select"&&_&&_.length>0?e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--suffix",value:te??_[0]?.value,disabled:i,onChange:a=>{const $=a.target.value,Z=_.find(pe=>pe.value===(te??_[0]?.value)),ue=_.find(pe=>pe.value===$);Y?.($,Z?.weight,ue?.weight)},children:_.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))}):S?e.jsx("span",{className:"nice-input__icon nice-input__icon--suffix",children:S}):null,H&&!n&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__plus",onClick:Ne,onMouseDown:()=>Se(Ne),onMouseUp:ge,onMouseLeave:ge,disabled:i,"aria-label":W("controls.increment","Increment"),children:e.jsx(r.oa,{name:"plus",size:16})})]})}),ee&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),se==="right"&&s&&e.jsx("div",{className:"nice-field__error",role:"alert",children:s}),se==="right"&&!s&&f&&e.jsx("div",{className:"nice-field__helper",children:f})]}),se!=="right"&&s&&e.jsx("div",{className:"nice-field__error",role:"alert",children:s}),se!=="right"&&!s&&f&&e.jsx("div",{className:"nice-field__helper",children:f})]})});Le.displayName="NiceNumberInput";const ze=Object.freeze(Object.defineProperty({__proto__:null,NiceNumberInput:Le},Symbol.toStringTag,{value:"Module"}));function Re(t){const f=t?.closest?.("[data-theme], .nice-dark, .nice-light, .dark");if(!f)return"";const s=f.getAttribute("data-theme");return s==="dark"||f.classList.contains("nice-dark")||f.classList.contains("dark")?"nice-dark":s==="light"||f.classList.contains("nice-light")?"nice-light":""}function He(t,f,s,d){const n=l.useRef(null),[c,x]=l.useState(null),[o,u]=l.useState(""),w=l.useContext(r.Er)?.portalTarget??(typeof document<"u"?document.body:null),G=l.useRef(s);return G.current=s,l.useLayoutEffect(()=>{if(!t||!f.current)return;u(Re(f.current));const m=()=>{const y=f.current;if(!y)return;const k=y.getBoundingClientRect(),v=n.current?.offsetHeight??320;let P=k.bottom;P+v>window.innerHeight-8&&k.top-v>8&&(P=k.top-v);let M=k.left;M+k.width>window.innerWidth-8&&(M=Math.max(8,window.innerWidth-k.width-8)),x({left:M,top:P,width:k.width})};return m(),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[t,f,320]),l.useEffect(()=>{if(!t)return;const m=k=>{const v=k.target;f.current?.contains(v)||n.current?.contains(v)||(v instanceof Element?v:v?.parentElement??null)?.closest('.nice-select__dropdown, [role="listbox"], [role="option"]')||G.current()},y=k=>{k.key==="Escape"&&G.current()};return document.addEventListener("mousedown",m),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",y)}},[t,f]),{popupRef:n,coords:c,themeClass:o,portalTarget:w}}const De=l.forwardRef(({label:t,helperText:f,error:s,required:d,disabled:i,size:n="md",name:c,id:x,className:o,style:u,accessMode:h,displayStyle:w,options:G,value:m,onChange:y,placeholder:k,multiple:v=!1,searchable:P=!0,clearable:M=!1,emptyText:b,maxHeight:C=240,optionsSource:N,valueField:L,labelField:V,virtualScroll:R,optionHeight:A=36,onSearch:I,loading:S,renderOption:H,multipleAutosize:T=!1,showKeyboardHints:J,labelPlacement:U,errorPlacement:le,labelWidth:se,controlWidth:ee,displayMode:he},ne)=>{const O=r.Dc(h,x),me=O==="hidden";(O==="disabled"||O==="readOnly")&&(i=!0);const{t:j}=r.Gt(),_=r.rc("input",w),te=r.ac("input",w),Y=r.bc(x),Q=r.sc({enabled:he,disabled:i}),[z,X]=l.useState(!1),[re,de]=l.useState(""),[W,B]=l.useState(-1),[ye,g]=l.useState(0),D=l.useRef(null),F=l.useRef(null),[E,fe]=l.useState(null);l.useLayoutEffect(()=>{!S&&F.current&&fe(F.current.offsetWidth)},[S,m,w]);const[ie,we]=l.useState(null);l.useLayoutEffect(()=>{v&&!T&&F.current&&ie==null&&we(F.current.offsetWidth)},[v,T,ie]);const ke=r.Jd(N??null,L??N?.keyField??"id",V??"name"),ae=N?ke.options:(G??[]).map(p=>typeof p=="string"?{value:p,label:p}:p),{popupRef:$e,coords:ve,themeClass:xe,portalTarget:Me}=He(z,D,()=>{X(!1),de("")}),ce=l.useMemo(()=>m?Array.isArray(m)?m:[m]:[],[m]),oe=l.useMemo(()=>{if(!re&&!I||I)return ae;const p=re.toLowerCase();return ae.filter(q=>q.label.toLowerCase().includes(p)||String(q.value).toLowerCase().includes(p))},[ae,re,I]),Ne=l.useMemo(()=>{const p=new Map;for(const q of oe){const K=q.group||"";p.has(K)||p.set(K,[]),p.get(K).push(q)}return p},[oe]),be=l.useCallback(p=>{if(v){const q=ce.includes(p)?ce.filter(K=>K!==p):[...ce,p];y?.(q)}else y?.(p),X(!1),de("")},[v,ce,y]),je=l.useCallback(p=>{if(p.key==="Escape"){X(!1),de("");return}if(p.key==="Enter"||p.key===" "){if(!z){X(!0),p.preventDefault();return}W>=0&&oe[W]&&(be(oe[W].value),p.preventDefault());return}p.key==="ArrowDown"&&(p.preventDefault(),B(q=>Math.min(q+1,oe.length-1))),p.key==="ArrowUp"&&(p.preventDefault(),B(q=>Math.max(q-1,0)))},[z,W,oe,be]),_e=l.useMemo(()=>ce.length===0?null:v?ce.map(p=>ae.find(q=>q.value===p)?.label||p).join(", "):ae.find(p=>p.value===ce[0])?.label||ce[0],[ce,ae,v]),ge=l.useCallback(p=>{p.stopPropagation(),y?.(v?[]:"")},[y,v]),Se=l.useMemo(()=>[{key:"Enter",description:j("shortcuts.select","Select")},{key:"Space",description:j("shortcuts.openDropdown","Open dropdown")},r.Yc.moveUp,r.Yc.moveDown,r.Yc.cancel],[j]);return me?null:e.jsxs("div",{className:`nice-field ${ee==null?"nice-field--select-auto":""} nice-field--${n} ${U==="left"?"nice-field--label-left":""} ${S?"nice-field--loading":""} ${o||""}`,style:{...u,...se!=null&&{"--nice-field-label-width":typeof se=="number"?`${se}px`:se},...ee!=null&&{"--nice-field-control-width":typeof ee=="number"?`${ee}px`:ee},...S&&E!=null&&{"--nice-select-locked-width":`${E}px`}},"aria-busy":S||void 0,children:[t&&e.jsxs("label",{htmlFor:Y,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:[t,J&&e.jsx(r.ha,{shortcuts:Se,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[Q.isDisplay?e.jsx(r.cc,{value:_e,placeholder:k||j("controls.select","Select..."),disabled:i,onActivate:()=>{Q.enterEdit(),X(!0)},ariaLabel:t}):e.jsxs("div",{className:"nice-select",ref:D,children:[e.jsxs("button",{ref:p=>{F.current=p,typeof ne=="function"?ne(p):ne&&(ne.current=p)},type:"button",id:Y,role:"combobox","aria-expanded":z,"aria-haspopup":"listbox","aria-invalid":!!s,className:`nice-select__trigger nice-select__trigger--${n} nice-select--ds-${te} ${z?"nice-select__trigger--open":""} ${s?"nice-select__trigger--error":""} ${i?"nice-select__trigger--disabled":""}`,style:{..._,...v&&!T&&ie!=null?{width:ie,maxWidth:ie,overflow:"hidden"}:{}},disabled:i,onClick:()=>X(!z),onKeyDown:je,children:[_e?e.jsx("span",{style:v&&!T?{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0,children:_e}):e.jsx("span",{className:"nice-select__placeholder",children:k||j("controls.select","Select...")}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[M&&ce.length>0&&e.jsx("span",{className:"nice-input__clear",onClick:ge,role:"button","aria-label":j("controls.clear","Clear"),children:e.jsx(r.oa,{name:"close",size:14})}),e.jsx("span",{className:`nice-select__chevron ${z?"nice-select__chevron--open":""}`,children:e.jsx(r.oa,{name:"chevron-down",size:16})})]})]}),z&&ve&&Me&&Ie.createPortal(e.jsxs("div",{ref:$e,className:`nice-select__dropdown${xe?` ${xe}`:""}`,"data-theme":xe==="nice-dark"?"dark":xe==="nice-light"?"light":void 0,role:"listbox",style:{maxHeight:C,position:"fixed",left:ve.left,top:ve.top,width:ve.width,minWidth:ve.width,zIndex:1e3},onScroll:R?p=>g(p.currentTarget.scrollTop):void 0,children:[(P||I)&&e.jsx("div",{className:"nice-select__search",children:e.jsx("input",{type:"text",value:re,onChange:p=>{de(p.target.value),B(0),I?.(p.target.value)},placeholder:j("controls.search","Search..."),autoFocus:!0})}),S&&e.jsx("div",{className:"nice-select__loading",children:e.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!S&&oe.length===0?e.jsx("div",{className:"nice-select__empty",children:b||j("controls.noResults","No results found")}):R&&!Array.from(Ne.keys()).some(p=>p!=="")?(()=>{const q=oe.length*A,K=Math.max(0,Math.floor(ye/A)-3),a=Math.min(oe.length,Math.ceil((ye+C)/A)+3),$=oe.slice(K,a);return e.jsx("div",{style:{height:q,position:"relative"},children:$.map((Z,ue)=>{const pe=K+ue,Ce=ce.includes(Z.value);return e.jsx("div",{role:"option","aria-selected":Ce,className:`nice-select__option ${Ce?"nice-select__option--selected":""} ${pe===W?"nice-select__option--highlighted":""} ${Z.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:pe*A,left:0,right:0,height:A,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!Z.disabled&&be(String(Z.value)),onMouseEnter:()=>B(pe),children:H?H(Z,Ce):e.jsxs(e.Fragment,{children:[Z.icon&&e.jsx("span",{children:Z.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:Z.label}),Z.description&&e.jsx("div",{className:"nice-select__option-desc",children:Z.description})]}),Ce&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},Z.value)})})})():Array.from(Ne.entries()).map(([p,q])=>e.jsxs(l.Fragment,{children:[p&&e.jsx("div",{className:"nice-select__group-label",children:p}),q.map(K=>{const a=ce.includes(K.value),$=oe.indexOf(K);return e.jsx("div",{role:"option","aria-selected":a,className:`nice-select__option ${a?"nice-select__option--selected":""} ${$===W?"nice-select__option--highlighted":""} ${K.disabled?"nice-select__option--disabled":""}`,onClick:()=>!K.disabled&&be(String(K.value)),onMouseEnter:()=>B($),children:H?H(K,a):e.jsxs(e.Fragment,{children:[K.icon&&e.jsx("span",{children:K.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:K.label}),K.description&&e.jsx("div",{className:"nice-select__option-desc",children:K.description})]}),a&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},K.value)})]},p))]}),Me)]}),S&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),le==="right"&&s&&e.jsx("div",{id:`${Y}-error`,className:"nice-field__error",role:"alert",children:s}),le==="right"&&!s&&f&&e.jsx("div",{id:`${Y}-helper`,className:"nice-field__helper",children:f})]}),le!=="right"&&s&&e.jsx("div",{id:`${Y}-error`,className:"nice-field__error",role:"alert",children:s}),le!=="right"&&!s&&f&&e.jsx("div",{id:`${Y}-helper`,className:"nice-field__helper",children:f})]})});De.displayName="NiceSelect";const Ye=Object.freeze(Object.defineProperty({__proto__:null,NiceSelect:De},Symbol.toStringTag,{value:"Module"})),Te=l.forwardRef(({label:t,checked:f=!1,indeterminate:s=!1,onChange:d,disabled:i,readOnly:n,loading:c,required:x,size:o="md",name:u,id:h,className:w,style:G,error:m,helperText:y,accessMode:k,displayStyle:v,showKeyboardHints:P,labelPlacement:M,errorPlacement:b,labelWidth:C,controlWidth:N},L)=>{const V=r.Dc(k,h),R=V==="hidden";(V==="disabled"||V==="readOnly")&&(i=!0);const{t:A}=r.Gt(),I=r.bc(h);r.ac("toggle",v);const S=l.useMemo(()=>[{key:"Space",description:A("shortcuts.toggle","Toggle")}],[A]),H=l.useCallback(T=>{T&&(T.indeterminate=s),typeof L=="function"?L(T):L&&(L.current=T)},[s,L]);return R?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${o} ${M==="left"?"nice-field--label-left":""} ${b==="right"?"nice-field--error-right":""} ${c?"nice-field--loading":""} ${w||""}`,style:{...G,...C!=null&&{"--nice-field-label-width":typeof C=="number"?`${C}px`:C},...N!=null&&{"--nice-field-control-width":typeof N=="number"?`${N}px`:N}},"aria-busy":c||void 0,children:[M==="left"&&t&&e.jsx("span",{className:`nice-field__label ${x?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-checkbox ${o!=="md"?`nice-checkbox--${o}`:""} ${i||c?"nice-checkbox--disabled":""}`,htmlFor:I,children:[e.jsx("input",{ref:H,id:I,type:"checkbox",className:"nice-checkbox__input",name:u,checked:f,disabled:i||c,readOnly:n,"aria-invalid":!!m,onChange:T=>{n||c||d?.(T.target.checked)}}),e.jsx("span",{className:"nice-checkbox__box",children:e.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:f?e.jsx("polyline",{points:"2 6 5 9 10 3"}):e.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"})})}),M!=="left"&&t&&e.jsx("span",{children:t}),P&&e.jsx(r.ha,{shortcuts:S,size:"sm"})]}),c&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),b==="right"&&m&&e.jsx("div",{id:`${I}-error`,className:"nice-field__error",role:"alert",children:m}),b==="right"&&!m&&y&&e.jsx("div",{id:`${I}-helper`,className:"nice-field__helper",children:y})]}),b!=="right"&&m&&e.jsx("div",{id:`${I}-error`,className:"nice-field__error",role:"alert",children:m}),b!=="right"&&!m&&y&&e.jsx("div",{id:`${I}-helper`,className:"nice-field__helper",children:y})]})});Te.displayName="NiceCheckbox";const Ze=Object.freeze(Object.defineProperty({__proto__:null,NiceCheckbox:Te},Symbol.toStringTag,{value:"Module"})),Be=l.forwardRef(({label:t,checked:f=!1,onChange:s,disabled:d,readOnly:i,loading:n,required:c,size:x="md",name:o,id:u,className:h,style:w,accessMode:G,displayStyle:m,showKeyboardHints:y,error:k,helperText:v,labelPlacement:P,errorPlacement:M,labelWidth:b,controlWidth:C},N)=>{const L=r.Dc(G,u),V=L==="hidden";(L==="disabled"||L==="readOnly")&&(d=!0);const{t:R}=r.Gt(),A=r.bc(u);r.rc("toggle",m);const I=r.ac("toggle",m),S=l.useMemo(()=>[{key:"Space",description:R("shortcuts.toggle","Toggle on/off")}],[R]);return V?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${x} ${P==="left"?"nice-field--label-left":""} ${n?"nice-field--loading":""} ${h||""}`,style:{...w,...b!=null&&{"--nice-field-label-width":typeof b=="number"?`${b}px`:b},...C!=null&&{"--nice-field-control-width":typeof C=="number"?`${C}px`:C}},"aria-busy":n||void 0,children:[P==="left"&&t&&e.jsx("span",{className:`nice-field__label ${c?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-toggle nice-toggle--ds-${I} ${x!=="md"?`nice-toggle--${x}`:""} ${d||n?"nice-toggle--disabled":""}`,htmlFor:A,children:[e.jsx("input",{ref:N,id:A,type:"checkbox",className:"nice-toggle__input",name:o,checked:f,disabled:d||n,readOnly:i,role:"switch","aria-checked":f,"aria-invalid":!!k,onChange:H=>{i||n||s?.(H.target.checked)}}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),P!=="left"&&t&&e.jsx("span",{children:t}),y&&e.jsx(r.ha,{shortcuts:S,size:"sm"})]}),n&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),M==="right"&&k&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:k}),M==="right"&&!k&&v&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:v})]}),M!=="right"&&k&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:k}),M!=="right"&&!k&&v&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:v})]})});Be.displayName="NiceToggle";const Ve=["var(--nice-danger, #ef4444)","var(--nice-warning, #f97316)","var(--nice-warning, #f59e0b)","var(--nice-success, #84cc16)","var(--nice-success, #10b981)","var(--nice-info, #06b6d4)","var(--nice-primary, #3b82f6)","var(--nice-info, #6366f1)","var(--nice-accent, #8b5cf6)","var(--nice-accent-pink, #ec4899)","var(--nice-text-secondary, #64748b)","var(--nice-text, #1e293b)"];function qe(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}function Je(t){const f=/^#?([0-9a-f]{6})$/i.exec(t.trim());if(!f)return{r:0,g:0,b:0};const s=parseInt(f[1],16);return{r:s>>16&255,g:s>>8&255,b:s&255}}function Oe(t,f,s){const d=i=>Math.max(0,Math.min(255,Math.round(i))).toString(16).padStart(2,"0");return`#${d(t)}${d(f)}${d(s)}`}function Qe(t,f,s){const d=t/255,i=f/255,n=s/255,c=Math.max(d,i,n),x=Math.min(d,i,n),o=(c+x)/2;let u=0,h=0;if(c!==x){const w=c-x;switch(h=o>.5?w/(2-c-x):w/(c+x),c){case d:u=(i-n)/w+(i<n?6:0);break;case i:u=(n-d)/w+2;break;case n:u=(d-i)/w+4;break}u*=60}return{h:Math.round(u),s:Math.round(h*100),l:Math.round(o*100)}}function Xe(t,f,s){const d=f/100,i=s/100,n=(1-Math.abs(2*i-1))*d,c=n*(1-Math.abs(t/60%2-1)),x=i-n/2;let o=0,u=0,h=0;return t<60?[o,u,h]=[n,c,0]:t<120?[o,u,h]=[c,n,0]:t<180?[o,u,h]=[0,n,c]:t<240?[o,u,h]=[0,c,n]:t<300?[o,u,h]=[c,0,n]:[o,u,h]=[n,0,c],{r:Math.round((o+x)*255),g:Math.round((u+x)*255),b:Math.round((h+x)*255)}}function We(t,f,s){const d=t/255,i=f/255,n=s/255,c=Math.max(d,i,n),x=Math.min(d,i,n),o=c-x;let u=0;o!==0&&(c===d?u=(i-n)/o%6:c===i?u=(n-d)/o+2:u=(d-i)/o+4,u*=60,u<0&&(u+=360));const h=c===0?0:o/c;return{h:Math.round(u),s:Math.round(h*100),v:Math.round(c*100)}}function en(t,f,s){const d=f/100,i=s/100,n=i*d,c=n*(1-Math.abs(t/60%2-1)),x=i-n;let o=0,u=0,h=0;return t<60?[o,u,h]=[n,c,0]:t<120?[o,u,h]=[c,n,0]:t<180?[o,u,h]=[0,n,c]:t<240?[o,u,h]=[0,c,n]:t<300?[o,u,h]=[c,0,n]:[o,u,h]=[n,0,c],{r:Math.round((o+x)*255),g:Math.round((u+x)*255),b:Math.round((h+x)*255)}}function nn(t){let f=t.trim();const s=/var\([^,]+,\s*(#[0-9a-fA-F]{3,8})\s*\)/.exec(f);s&&(f=s[1]);const d=/^#?([0-9a-f]{3})$/i.exec(f);d&&(f=`#${d[1].split("").map(c=>c+c).join("")}`);const i=/^#?([0-9a-f]{6})$/i.exec(f),n=/^#?([0-9a-f]{8})$/i.exec(f);if(n){const c=n[1];return{r:parseInt(c.slice(0,2),16),g:parseInt(c.slice(2,4),16),b:parseInt(c.slice(4,6),16),a:parseInt(c.slice(6,8),16)/255}}if(i){const c=parseInt(i[1],16);return{r:c>>16&255,g:c>>8&255,b:c&255,a:1}}return{r:0,g:0,b:0,a:1}}function tn(t,f,s,d,i){const n=x=>Math.max(0,Math.min(255,Math.round(x))).toString(16).padStart(2,"0"),c=`#${n(t)}${n(f)}${n(s)}`;return i?`${c}${n(d*255)}`:c}const Ae=l.forwardRef(({label:t,helperText:f,error:s,required:d,disabled:i,id:n,className:c,style:x,accessMode:o,displayStyle:u,value:h="var(--nice-primary, #3b82f6)",onChange:w,presets:G=Ve,showInput:m=!1,showRandom:y=!1,withAlpha:k=!1,compact:v=!1,showKeyboardHints:P,size:M="md",labelPlacement:b,errorPlacement:C,labelWidth:N,controlWidth:L,loading:V},R)=>{const A=r.Dc(o,n),I=A==="hidden";(A==="disabled"||A==="readOnly")&&(i=!0);const{t:S}=r.Gt(),H=r.bc(n);r.ac("input",u);const T=l.useCallback(()=>{i||w?.(qe())},[i,w]),[J,U]=l.useState(!1),[le,se]=l.useState(null),[ee,he]=l.useState(""),ne=l.useRef(null),O=l.useRef(null);l.useLayoutEffect(()=>{if(!J||!O.current)return;he(Re(O.current));const j=()=>{const _=O.current?.getBoundingClientRect();if(!_)return;const te=280,Y=360;let Q=_.left,z=_.bottom+6;Q+te>window.innerWidth-8&&(Q=Math.max(8,window.innerWidth-te-8)),z+Y>window.innerHeight-8&&(z=Math.max(8,_.top-Y-6)),se({left:Q,top:z})};return j(),window.addEventListener("scroll",j,!0),window.addEventListener("resize",j),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",j)}},[J]),l.useEffect(()=>{if(!J)return;const j=te=>{const Y=te.target;ne.current?.contains(Y)||O.current?.contains(Y)||U(!1)},_=te=>{te.key==="Escape"&&U(!1)};return document.addEventListener("mousedown",j),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",_)}},[J]);const me=l.useMemo(()=>[{key:"Enter",description:S("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:S("shortcuts.navigatePresets","Navigate presets")}],[S]);return I?null:e.jsxs("div",{className:`nice-field nice-field--${M} ${b==="left"?"nice-field--label-left":""} ${v?"nice-color-picker--compact":""} ${V?"nice-field--loading":""} ${c||""}`,style:{...x,...N!=null&&{"--nice-field-label-width":typeof N=="number"?`${N}px`:N},...L!=null&&{"--nice-field-control-width":typeof L=="number"?`${L}px`:L}},"aria-busy":V||void 0,children:[t&&e.jsxs("label",{htmlFor:H,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:[t,P&&e.jsx(r.ha,{shortcuts:me,size:"sm"})]}),e.jsx("div",{className:"nice-field__control",children:e.jsxs("div",{className:"nice-color-picker",children:[e.jsxs("div",{className:"nice-color-picker__preview-row",children:[e.jsx("div",{ref:O,className:"nice-color-picker__swatch",id:H,style:{background:h},onClick:j=>{j.stopPropagation(),i||U(_=>!_)},onKeyDown:j=>{!i&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),U(_=>!_))},role:"button",tabIndex:0,"aria-label":S("colorPicker.openPalette","Open color palette"),"aria-haspopup":"dialog","aria-expanded":J,children:e.jsx("input",{ref:j=>{typeof R=="function"?R(j):R&&(R.current=j)},type:"hidden",value:h,disabled:i,readOnly:!0})}),m&&e.jsx("div",{className:"nice-input nice-input--sm",style:v?{flex:1,minWidth:0}:{width:100},children:e.jsx("input",{className:"nice-input__native",type:"text",value:h,disabled:i,onChange:j=>w?.(j.target.value),maxLength:k?9:7})}),y&&!v&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:T,disabled:i,title:S("colorPicker.random","Random"),"aria-label":S("colorPicker.random","Random"),style:{fontSize:"0.65rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:S("colorPicker.random","Random")}),V&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),C==="right"&&s&&e.jsx("div",{id:`${H}-error`,className:"nice-field__error",role:"alert",children:s}),C==="right"&&!s&&f&&e.jsx("div",{id:`${H}-helper`,className:"nice-field__helper",children:f})]}),J&&le&&typeof document<"u"&&Ie.createPortal(e.jsx("div",{ref:ne,className:`nice-color-picker__popup nice-color-picker__popup--portal ${ee}`,"data-theme":ee==="nice-dark"?"dark":ee==="nice-light"?"light":void 0,role:"dialog","aria-label":S("colorPicker.palette","Color palette"),style:{position:"fixed",left:le.left,top:le.top},onClick:j=>j.stopPropagation(),children:(()=>{const j=nn(h),_={r:j.r,g:j.g,b:j.b},te=k?j.a:1,Y=Qe(_.r,_.g,_.b),Q=We(_.r,_.g,_.b),z=(g,D,F,E=te)=>w?.(tn(g,D,F,E,k)),X=(g,D,F)=>z(g,D,F),re=(g,D,F)=>{const E=Xe(g,D,F);z(E.r,E.g,E.b)},de=(g,D,F)=>{const E=en(g,D,F);z(E.r,E.g,E.b)},W=g=>z(_.r,_.g,_.b,g),B=g=>{if(i)return;const D=g.currentTarget,F=fe=>{const ie=D.getBoundingClientRect(),we=Math.max(0,Math.min(ie.width,fe.clientX-ie.left)),ke=Math.max(0,Math.min(ie.height,fe.clientY-ie.top)),ae=Math.round(we/ie.width*100),$e=100-Math.round(ke/ie.height*100);de(Q.h,ae,$e)};F(g);const E=()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",E)};document.addEventListener("pointermove",F),document.addEventListener("pointerup",E)},ye=`hsl(${Q.h}, 100%, 50%)`;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-color-picker__popup-header",children:e.jsx("input",{type:"text",className:"nice-input__native nice-color-picker__popup-hex",value:h,disabled:i,onChange:g=>w?.(g.target.value),maxLength:k?9:7,"aria-label":S("colorPicker.hexValue","Hex value")})}),e.jsx("input",{type:"range",min:0,max:360,value:Q.h,disabled:i,onChange:g=>de(Number(g.target.value),Q.s,Q.v),className:"nice-color-picker__hue-slider","aria-label":S("colorPicker.hue","Hue")}),e.jsx("div",{className:"nice-color-picker__sv",style:{background:`linear-gradient(to top, var(--nice-text, #000), transparent), linear-gradient(to right, var(--nice-bg, #FFF), ${ye})`},onPointerDown:B,role:"application","aria-label":S("colorPicker.svPalette","Saturation/value palette"),children:e.jsx("span",{className:"nice-color-picker__sv-marker",style:{left:`${Q.s}%`,top:`${100-Q.v}%`}})}),e.jsxs("div",{className:"nice-color-picker__sliders",children:[e.jsx("div",{className:"nice-color-picker__slider-col",children:["h","s","l"].map(g=>{const D=g==="h"?360:100,F=Y[g],E=fe=>re(g==="h"?fe:Y.h,g==="s"?fe:Y.s,g==="l"?fe:Y.l);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:g.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:D,value:F,disabled:i,onChange:fe=>E(Number(fe.target.value))}),e.jsx("input",{type:"number",min:0,max:D,value:F,disabled:i,onChange:fe=>E(Number(fe.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},g)})}),e.jsx("div",{className:"nice-color-picker__slider-col",children:["r","g","b"].map(g=>{const D=_[g],F=E=>X(g==="r"?E:_.r,g==="g"?E:_.g,g==="b"?E:_.b);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:g.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:255,value:D,disabled:i,onChange:E=>F(Number(E.target.value))}),e.jsx("input",{type:"number",min:0,max:255,value:D,disabled:i,onChange:E=>F(Number(E.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},g)})})]}),k&&e.jsxs("div",{className:"nice-color-picker__alpha-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:"A"}),e.jsx("input",{type:"range",min:0,max:100,value:Math.round(te*100),disabled:i,onChange:g=>W(Number(g.target.value)/100),className:"nice-color-picker__alpha-slider",style:{background:`linear-gradient(to right, transparent, rgb(${_.r},${_.g},${_.b}))`},"aria-label":S("colorPicker.alpha","Alpha")}),e.jsx("input",{type:"number",min:0,max:100,value:Math.round(te*100),disabled:i,onChange:g=>W((Number(g.target.value)||0)/100),className:"nice-input__native nice-color-picker__slider-num"})]}),G.length>0&&e.jsx("div",{className:"nice-color-picker__popup-presets",children:G.map(g=>e.jsx("div",{className:`nice-color-picker__preset ${h===g?"nice-color-picker__preset--active":""}`,style:{background:g},onClick:()=>{w?.(g),U(!1)},role:"button",tabIndex:0,"aria-label":g,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),w?.(g),U(!1))}},g))})]})})()}),document.body)]})}),C!=="right"&&s&&e.jsx("div",{id:`${H}-error`,className:"nice-field__error",role:"alert",children:s}),C!=="right"&&!s&&f&&e.jsx("div",{id:`${H}-helper`,className:"nice-field__helper",children:f})]})});Ae.displayName="NiceColorPicker";const cn=Object.freeze(Object.defineProperty({__proto__:null,NiceColorPicker:Ae,hexToRgb:Je,rgbToHex:Oe},Symbol.toStringTag,{value:"Module"})),sn=({tabs:t,activeTab:f,onChange:s,variant:d="default",vertical:i,size:n="md",iconOnly:c=!1,centered:x="auto",className:o,style:u,displayStyle:h})=>{const w=x==="auto"?c:x,G=r.rc("tab",h),m=r.ac("tab",h),[y,k]=l.useState(f||t[0]?.id),v=f??y,P=l.useCallback(b=>{k(b),s?.(b)},[s]),M=t.find(b=>b.id===v)?.content;return e.jsxs("div",{className:`nice-tabs nice-tabs--${n} ${i?"nice-tabs--vertical":""} ${c?"nice-tabs--icon-only":""} nice-tabs--ds-${m} ${o||""}`,style:{...G,...u},children:[e.jsx("div",{className:`nice-tabs__list ${d!=="default"?`nice-tabs__list--${d}`:""} ${i?"nice-tabs__list--vertical":""} ${w?"nice-tabs__list--centered":""}`,role:"tablist",children:t.map(b=>e.jsxs("button",{type:"button",role:"tab","aria-selected":v===b.id,"aria-label":c?b.label:void 0,title:c?b.label:void 0,className:`nice-tabs__tab ${v===b.id?"nice-tabs__tab--active":""} ${b.disabled?"nice-tabs__tab--disabled":""}`,disabled:b.disabled,onClick:()=>P(b.id),children:[b.icon,!c&&e.jsx("span",{children:b.label}),b.badge!==void 0&&e.jsx("span",{className:"nice-tabs__badge",children:b.badge})]},b.id))}),e.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",children:M})]})},Ge=l.forwardRef(({children:t,variant:f="primary",size:s="md",type:d="button",disabled:i,loading:n,fullWidth:c,onClick:x,leftIcon:o,rightIcon:u,error:h,errorPlacement:w="bottom",ariaLabel:G,className:m,style:y,id:k,accessMode:v,displayStyle:P,...M},b)=>{const C=r.Ys(f),N=r.Js(s),L=r.Dc(v,k),V=L==="hidden";(L==="disabled"||L==="readOnly")&&(i=!0);const R=r.rc("button",P),A=r.ac("button",P);let I=R;if(C!=="primary"){const U={...R};delete U.background,delete U.color,(C==="outline"||C==="ghost")&&(delete U.border,delete U.borderColor,delete U.borderWidth,delete U.borderStyle,delete U.boxShadow),I=U}const S=t!=null&&t!==!1&&!(typeof t=="string"&&t.trim()===""),H=!S&&!!(o||u),T=e.jsxs("button",{ref:b,type:d,id:k,className:`nice-btn nice-btn--${C} nice-btn--${N} nice-btn--ds-${A} ${H?"nice-btn--icon-only":""} ${c?"nice-btn--full-width":""} ${n?"nice-btn--loading":""} ${h&&!w?"nice-btn--has-error":""} ${m||""}`,style:{...I,...y},disabled:i||n,"aria-busy":n||void 0,"aria-disabled":i||n||void 0,"aria-label":G,onClick:x,...M,children:[n&&e.jsx("svg",{className:"nice-btn__spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3","aria-hidden":"true",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})}),!n&&o&&e.jsx("span",{className:"nice-btn__icon","aria-hidden":"true",children:o}),!n&&S&&e.jsx("span",{children:t}),n&&S&&e.jsx("span",{style:{visibility:"hidden"},"aria-hidden":"true",children:t}),n&&H&&e.jsx("span",{className:"nice-btn__icon",style:{visibility:"hidden"},"aria-hidden":"true",children:o||u}),!n&&u&&e.jsx("span",{className:"nice-btn__icon","aria-hidden":"true",children:u})]});if(V)return null;if(!h)return T;const J=e.jsx("div",{className:"nice-field__error",role:"alert",children:h});return w==="right"?e.jsxs("span",{className:`nice-btn-field nice-btn-field--right nice-field--${N}`,style:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:"8px",width:"fit-content"},children:[T,J]}):V?null:e.jsxs("span",{className:`nice-btn-field nice-btn-field--bottom nice-field--${N}`,style:{display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",width:"fit-content"},children:[T,J]})});Ge.displayName="NiceButton";const fn=Object.freeze({AR:["#74acdf","#ffffff","#74acdf"],AT:["#ed2939","#ffffff","#ed2939"],AU:["#012169","#ffffff","#e4002b"],BE:["#000000","#fae042","#ed2939"],BR:["#009c3b","#ffdf00","#002776"],CA:["#ff0000","#ffffff","#ff0000"],CH:["#d52b1e","#ffffff","#d52b1e"],CN:["#de2910","#ffde00","#de2910"],CZ:["#11457e","#ffffff","#d7141a"],DE:["#000000","#dd0000","#ffce00"],DK:["#c8102e","#ffffff","#c8102e"],EE:["#0072ce","#000000","#ffffff"],EG:["#ce1126","#ffffff","#000000"],ES:["#aa151b","#f1bf00","#aa151b"],FI:["#ffffff","#003580","#ffffff"],FR:["#0055a4","#ffffff","#ef4135"],GB:["#012169","#ffffff","#c8102e"],GR:["#0d5eaf","#ffffff","#0d5eaf"],HR:["#171796","#ffffff","#ff0000"],HU:["#ce2939","#ffffff","#477050"],IE:["#169b62","#ffffff","#ff883e"],IL:["#ffffff","#0038b8","#ffffff"],IN:["#ff9933","#ffffff","#138808"],IS:["#02529c","#ffffff","#dc1e35"],IT:["#009246","#ffffff","#ce2b37"],JP:["#ffffff","#bc002d","#ffffff"],KR:["#ffffff","#cd2e3a","#0047a0"],LT:["#fdb913","#006a44","#c1272d"],LU:["#ed2939","#ffffff","#00a1de"],LV:["#9e3039","#ffffff","#9e3039"],MX:["#006847","#ffffff","#ce1126"],NL:["#ae1c28","#ffffff","#21468b"],NO:["#ef2b2d","#ffffff","#002868"],NZ:["#012169","#ffffff","#cc142b"],PL:["#ffffff","#dc143c"],PT:["#006600","#ff0000"],RO:["#002b7f","#fcd116","#ce1126"],RU:["#ffffff","#0039a6","#d52b1e"],SE:["#006aa7","#fecc00","#006aa7"],SK:["#ffffff","#0b4ea2","#ee1c25"],TR:["#e30a17","#ffffff","#e30a17"],UA:["#005bbb","#ffd500"],US:["#b22234","#ffffff","#3c3b6e"],VN:["#da251d","#ffff00","#da251d"],ZA:["#007a4d","#ffffff","#de3831"],AD:["#10069f","#fedf00","#d50032"],AE:["#00732f","#ffffff","#000000"],AF:["#000000","#d32011","#007a36"],AG:["#ce1126","#fcd116","#000000"],AL:["#e41e20","#000000","#e41e20"],AM:["#d90012","#0033a0","#f2a800"],AO:["#ce1126","#000000","#ffc500"],AZ:["#0092bc","#ed2939","#509e2f"],BA:["#002395","#fecb00","#ffffff"],BB:["#00267f","#ffc726","#00267f"],BD:["#006a4e","#f42a41","#006a4e"],BF:["#ef2b2d","#009e49","#fcd116"],BG:["#ffffff","#00966e","#d62612"],BH:["#ffffff","#ce1126","#ce1126"],BI:["#1eb53a","#ffffff","#ce1126"],BJ:["#008751","#fcd116","#e8112d"],BN:["#f7e017","#ffffff","#000000"],BO:["#d52b1e","#f9e300","#007934"],BS:["#00778b","#ffc72c","#000000"],BT:["#ffcc33","#ff4e12","#ffcc33"],BW:["#75aadb","#ffffff","#000000"],BY:["#c8313e","#007c30","#ffffff"],BZ:["#003f87","#ce1126","#003f87"],CD:["#007fff","#f7d618","#ce1021"],CF:["#003082","#ffffff","#289728"],CG:["#009543","#fbde4a","#dc241f"],CI:["#f77f00","#ffffff","#009e60"],CM:["#007a5e","#ce1126","#fcd116"],CO:["#fcd116","#003893","#ce1126"],CR:["#002b7f","#ffffff","#ce1126"],CU:["#002590","#ffffff","#cf142b"],CV:["#003893","#ffffff","#cf2027"],CY:["#ffffff","#d57800","#ffffff"],DJ:["#6ab2e7","#ffffff","#12ad2b"],DM:["#006b3f","#ffffff","#000000"],DO:["#002d62","#ffffff","#ce1126"],DZ:["#006233","#ffffff","#d21034"],EC:["#ffd100","#034ea2","#ed1c24"],ER:["#ea0437","#0084c9","#418fde"],ET:["#078930","#fcdd09","#da121a"],FJ:["#68bfe5","#cc0000","#ffffff"],GA:["#3a75c4","#ffe700","#009e60"],GD:["#ce1126","#fcd116","#007a5e"],GE:["#ffffff","#ff0000","#ffffff"],GH:["#ce1126","#fcd116","#006b3f"],GM:["#ce1126","#ffffff","#0c1c8c"],GN:["#ce1126","#fcd116","#009460"],GQ:["#3e9a00","#ffffff","#e32118"],GT:["#4997d0","#ffffff","#4997d0"],GW:["#ce1126","#fcd116","#009e49"],GY:["#009e49","#ffffff","#fcd116"],HK:["#de2910","#ffffff","#de2910"],HN:["#0073cf","#ffffff","#0073cf"],HT:["#00209f","#d21034","#00209f"],ID:["#ff0000","#ffffff","#ff0000"],IQ:["#ce1126","#ffffff","#000000"],IR:["#239f40","#ffffff","#da0000"],JM:["#000000","#fed100","#009b3a"],JO:["#000000","#ffffff","#007a3d"],KE:["#000000","#bb0000","#006600"],KG:["#ff0000","#fcd116","#ff0000"],KH:["#032ea1","#e00025","#032ea1"],KM:["#fcd116","#ffffff","#ce1126"],KP:["#024fa2","#ed1c27","#024fa2"],KW:["#007a3d","#ffffff","#ce1126"],KZ:["#00afca","#fec50c","#00afca"],LA:["#ce1126","#002868","#ce1126"],LB:["#ed1c24","#ffffff","#ed1c24"],LI:["#002780","#ce1126","#002780"],LK:["#ffbe29","#8d153a","#00534e"],LR:["#bf0a30","#ffffff","#002868"],LS:["#00209f","#ffffff","#009543"],LY:["#e70013","#000000","#239e46"],MA:["#c1272d","#006233","#c1272d"],MD:["#0046ae","#ffd200","#cc092f"],ME:["#d4af37","#cc0033","#d4af37"],MG:["#ffffff","#fc3d32","#007e3a"],MH:["#003893","#dd7500","#ffffff"],MK:["#d20000","#ffe600","#d20000"],ML:["#14b53a","#fcd116","#ce1126"],MM:["#fecb00","#34b233","#ea2839"],MN:["#c4272f","#015197","#c4272f"],MO:["#00785a","#ffd700","#ffffff"],MR:["#006233","#ffc400","#d01c1f"],MT:["#ffffff","#cf142b","#ffffff"],MU:["#ea2839","#1a206d","#00a04d"],MV:["#d21034","#007e3a","#ffffff"],MW:["#000000","#ce1126","#339e35"],MY:["#cc0000","#ffffff","#010066"],MZ:["#009a44","#ffffff","#000000"],NA:["#003580","#ffffff","#009543"],NE:["#ff8000","#ffffff","#0db02b"],NG:["#008753","#ffffff","#008753"],NI:["#0067c6","#ffffff","#0067c6"],NP:["#dc143c","#003893","#dc143c"],OM:["#dc241f","#ffffff","#008000"],PA:["#ffffff","#cc0033","#005aa7"],PE:["#d91023","#ffffff","#d91023"],PG:["#ce1126","#000000","#fcd116"],PH:["#0038a8","#ffffff","#ce1126"],PK:["#ffffff","#01411c","#01411c"],PS:["#000000","#ffffff","#007a3d"],PY:["#d52b1e","#ffffff","#0038a8"],QA:["#ffffff","#8a1538","#8a1538"],RS:["#c6363c","#0c4076","#ffffff"],RW:["#00a1de","#fad201","#00a651"],SA:["#006c35","#ffffff","#006c35"],SB:["#0051ba","#fcd116","#215b33"],SC:["#003f87","#fcd116","#d62828"],SD:["#d21034","#ffffff","#000000"],SG:["#ed2939","#ffffff","#ed2939"],SI:["#ffffff","#0000ff","#ff0000"],SL:["#1eb53a","#ffffff","#0072c6"],SM:["#ffffff","#5eb6e4","#ffffff"],SN:["#00853f","#fdef42","#e31b23"],SO:["#4189dd","#ffffff","#4189dd"],SR:["#377e3f","#ffffff","#b40a2d"],SS:["#000000","#ce1126","#078930"],ST:["#12ad2b","#ffce00","#d21034"],SV:["#0047ab","#ffffff","#0047ab"],SY:["#ce1126","#ffffff","#000000"],SZ:["#3e5eb9","#ffd900","#b10c0c"],TD:["#002664","#fecb00","#c60c30"],TG:["#006a4e","#fcd116","#d21034"],TH:["#ed1c24","#ffffff","#241d4f"],TJ:["#cc0000","#ffffff","#006600"],TL:["#dc241f","#ffc726","#000000"],TM:["#00853e","#ffffff","#cc0000"],TN:["#e70013","#ffffff","#e70013"],TO:["#ffffff","#c10000","#c10000"],TT:["#ce1126","#ffffff","#000000"],TW:["#fe0000","#000095","#fe0000"],TZ:["#1eb53a","#fcd116","#00a3dd"],UG:["#000000","#fcdc04","#d90000"],UY:["#ffffff","#0038a8","#ffffff"],UZ:["#1eb53a","#ffffff","#0099b5"],VA:["#ffe000","#ffffff","#ffe000"],VE:["#fcd116","#00247d","#cf142b"],VU:["#000000","#ce1126","#009543"],WS:["#002b7f","#ffffff","#cc0033"],YE:["#ce1126","#ffffff","#000000"],ZM:["#198a00","#de2010","#ef7d00"],ZW:["#078930","#fcd116","#cf2027"]}),Fe=["#cbd5e1","#94a3b8","#cbd5e1"];function ln(t){return t?fn[t.toUpperCase()]??Fe:Fe}const an=Ue.Flags3x2,rn=({code:t,size:f=22,className:s})=>{const d=t?.toUpperCase(),i=d?an[d]:void 0,n=f,c=Math.round(f*2/3);return i?e.jsx("span",{className:s,role:"img","aria-label":`${d} flag`,style:{display:"inline-block",width:n,height:c,boxSizing:"content-box",border:"1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle",lineHeight:0},dangerouslySetInnerHTML:{__html:i.replace("<svg ",`<svg width="${n}" height="${c}" preserveAspectRatio="xMidYMid slice" `)}}):e.jsx(Pe,{code:t,size:f,className:s})},Pe=({code:t,size:f=18,className:s})=>{const d=ln(t);return e.jsx("span",{className:s,role:"img","aria-label":`${t} flag`,style:{display:"inline-flex",width:f,height:Math.round(f*.7),boxSizing:"content-box",border:"1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:d.map((i,n)=>e.jsx("span",{style:{flex:1,background:i}},n))})};function on(t,f,s,d=280){const[i,n]=l.useState(s==="left"?"left":"right"),c=l.useCallback(()=>{if(s!=="auto"){n(s);return}const x=f.current;if(!x||typeof window>"u")return;const o=x.getBoundingClientRect(),h=window.innerWidth-o.left,w=o.right;h>=d&&h>w?n("left"):n("right")},[s,f,d]);return l.useEffect(()=>{if(t)return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[t,c]),i}const dn=({colors:t,size:f=28,shape:s="page",className:d})=>{const i=f,n=Math.round(f*.75),c=t.border??"color-mix(in srgb, currentColor 30%, transparent)";if(s==="swatch"){const G=[t.primary,t.background,t.backgroundSecondary??t.background,t.textColor];return e.jsx("span",{className:d,role:"img","aria-label":"Theme preview",style:{display:"inline-flex",width:i,height:n,border:`1px solid ${c}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:G.map((m,y)=>e.jsx("span",{style:{flex:1,background:m}},y))})}const x=Math.max(2,Math.round(n*.22)),o=t.backgroundSecondary?Math.max(3,Math.round(i*.28)):0,u=Math.max(1,Math.round(n*.08)),h=Math.max(1,Math.round(n*.05)),w=Math.max(2,Math.round(i*.08));return e.jsxs("span",{className:d,role:"img","aria-label":"Theme preview",style:{position:"relative",display:"inline-block",width:i,height:n,boxSizing:"content-box",background:t.background,border:`1px solid ${c}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:[e.jsx("span",{style:{position:"absolute",top:0,left:0,right:0,height:x,background:t.primary}}),o>0&&e.jsx("span",{style:{position:"absolute",top:x,left:0,bottom:0,width:o,background:t.backgroundSecondary}}),e.jsx("span",{style:{position:"absolute",top:x+h,left:o+w,right:w,height:u,background:t.textColor,opacity:.8,borderRadius:1}}),e.jsx("span",{style:{position:"absolute",top:x+h*2+u,left:o+w,width:`${Math.max(20,i-o-w*2-4)}px`,height:u,background:t.textColor,opacity:.5,borderRadius:1}})]})};exports.FlagIcon=rn;exports.FlagSwatch=Pe;exports.NiceButton=Ge;exports.NiceCheckbox=Te;exports.NiceCheckbox$1=Ze;exports.NiceColorPicker=Ae;exports.NiceColorPicker$1=cn;exports.NiceNumberInput=Le;exports.NiceNumberInput$1=ze;exports.NiceSelect=De;exports.NiceSelect$1=Ye;exports.NiceTabs=sn;exports.NiceTextInput=Ee;exports.NiceTextInput$1=Ke;exports.NiceToggle=Be;exports.ThemePreviewSwatch=dn;exports.scopeThemeClass=Re;exports.useAnchoredPopup=He;exports.useDropdownAlignment=on;