@nice2dev/ui 1.0.28 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/dist/NiceAssessment.doc-BB1rXcVx.cjs +1 -0
- package/dist/NiceAssessment.doc-C3QQawiZ.js +23 -0
- package/dist/NiceBackupStatusBadge.doc-Bx2bFmBQ.cjs +1 -0
- package/dist/NiceBackupStatusBadge.doc-CdDxIQ-M.js +25 -0
- package/dist/NiceConfirmDialog-BiTJVR4-.js +81 -0
- package/dist/NiceConfirmDialog-Bjw_rN4o.cjs +1 -0
- package/dist/NiceConfirmDialog-DPfYwO2B.js +81 -0
- package/dist/NiceConfirmDialog-Dyh42OiK.cjs +1 -0
- package/dist/NiceErrorBoundary-1H751jK7.cjs +1 -0
- package/dist/NiceErrorBoundary-B-txoU3Y.js +709 -0
- package/dist/NiceErrorBoundary-BHCKA1h8.cjs +1 -0
- package/dist/NiceErrorBoundary-CBxXcleR.js +695 -0
- package/dist/NiceExam.doc-BpTJpwGb.js +23 -0
- package/dist/NiceExam.doc-Br8pEbQb.cjs +1 -0
- package/dist/NiceForm-C8yEx3VV.cjs +382 -0
- package/dist/NiceForm-Ci3XG7s7.js +5000 -0
- package/dist/NiceForm-DGUTmaZT.js +5014 -0
- package/dist/NiceForm-DmU-gmyv.cjs +382 -0
- package/dist/NiceModal-BClAtR5T.js +95 -0
- package/dist/NiceModal-Crbhc7GB.cjs +1 -0
- package/dist/NiceModal-XvEKVVLa.js +95 -0
- package/dist/NiceModal-iKwtagFB.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BO8Hw_W9.js +7619 -0
- package/dist/NiceModuleLifecyclePanel-Ch7HRRoy.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-D3k8kAey.js +7582 -0
- package/dist/NiceModuleLifecyclePanel-MAyTh_s5.cjs +1 -0
- package/dist/NicePagination-BVo-4KAD.js +172 -0
- package/dist/NicePagination-CaohvQsY.cjs +1 -0
- package/dist/NicePagination-DUnMbROj.cjs +1 -0
- package/dist/NicePagination-DyC6dQ7_.js +171 -0
- package/dist/NicePinCodeInput-C43eB9h4.js +13102 -0
- package/dist/NicePinCodeInput-DsyLuc0b.cjs +696 -0
- package/dist/NicePinCodeInput-nuRCN-9R.js +13223 -0
- package/dist/NicePinCodeInput-p5IFVwfY.cjs +696 -0
- package/dist/NicePoll.doc-DCiXvOb0.js +23 -0
- package/dist/NicePoll.doc-IOgqVPhc.cjs +1 -0
- package/dist/NicePollLive.doc-CdUyiCyf.js +23 -0
- package/dist/NicePollLive.doc-xBMqHeyt.cjs +1 -0
- package/dist/NiceQuiz.doc-BhAeGrcP.cjs +1 -0
- package/dist/NiceQuiz.doc-BiZq8X1P.js +23 -0
- package/dist/NiceSavedQueryPanel-BBFV4qiF.js +6969 -0
- package/dist/NiceSavedQueryPanel-CsiVNkCT.cjs +596 -0
- package/dist/NiceSavedQueryPanel-DV4a4axz.cjs +596 -0
- package/dist/NiceSavedQueryPanel-Dgbn1ExK.js +6893 -0
- package/dist/NiceSurvey.doc-9UorYdXy.cjs +1 -0
- package/dist/NiceSurvey.doc-CPF1ZEHo.js +23 -0
- package/dist/NiceWindow-BehN3PKk.js +1592 -0
- package/dist/NiceWindow-Cm9E6EAi.cjs +1 -0
- package/dist/NiceWindow-Dqu9ik8A.cjs +1 -0
- package/dist/NiceWindow-FMrVS7zo.js +1603 -0
- package/dist/charts-B90sSFeJ.cjs +761 -0
- package/dist/charts-CJruxLRY.js +4657 -0
- package/dist/charts-D8oj6Nf5.cjs +761 -0
- package/dist/charts-DaLf19vS.js +4671 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-BIdbG6p3.js +27212 -0
- package/dist/core-BUTtIHg0.js +27766 -0
- package/dist/core-CESNSRyS.cjs +122 -0
- package/dist/core-bzK0ZnUp.cjs +122 -0
- package/dist/data-branching-ByQdcjKO.cjs +1 -0
- package/dist/data-branching-BzRFsCJu.js +6133 -0
- package/dist/data-branching-DahoQa4M.cjs +1 -0
- package/dist/data-branching-psTzlcrT.js +6255 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +1 -1
- package/dist/devops-C9gdQxuU.cjs +17 -0
- package/dist/devops-CaO_4qGz.js +7684 -0
- package/dist/devops-D7bQ3rE4.cjs +17 -0
- package/dist/devops-jCmpD6O-.js +8165 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +3 -3
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +4 -0
- package/dist/editors.mjs +3 -3
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +3 -3
- package/dist/index-BK_Uwmz0.js +67774 -0
- package/dist/index-BpixglWg.js +69337 -0
- package/dist/index-CTbp81RF.cjs +5517 -0
- package/dist/index-DLR-aWZR.cjs +5506 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +796 -545
- package/dist/index.mjs +992 -979
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.mjs +146 -146
- package/dist/no-code-B0mG7OQc.cjs +332 -0
- package/dist/no-code-BHo5WrXr.js +7425 -0
- package/dist/no-code-CikRvKeJ.js +7133 -0
- package/dist/no-code-DyA_1_Th.cjs +332 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +4 -0
- package/dist/overlays.mjs +66 -66
- package/dist/pickerCommons-BEc3pZ_s.js +2044 -0
- package/dist/pickerCommons-CqhXp4QL.js +2043 -0
- package/dist/pickerCommons-CrITwM88.cjs +1 -0
- package/dist/pickerCommons-OsYJhnFE.cjs +1 -0
- package/dist/style.css +1 -1
- 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"),p=require("./core-bzK0ZnUp.cjs"),a=require("react"),Ie=require("react-dom"),He=require("./vendor-DHEorsoy.cjs"),Se=a.forwardRef(({label:i,helperText:l,error:t,required:f,disabled:c,readOnly:n,size:s="md",name:x,id:d,className:h,style:m,accessMode:k,displayStyle:K,variant:b,value:w,defaultValue:F,onChange:_,onBlur:Q,onKeyDown:L,placeholder:M,type:R="text",maxLength:g,prefix:T,suffix:P,clearable:D,autoFocus:H,submitOnEnter:$,onSubmit:A,showKeyboardHints:O,labelPlacement:E,errorPlacement:Y,loading:le,labelWidth:fe,controlWidth:z,displayMode:Z,...oe},N)=>{const j=p.pc(k,d),V=j==="hidden";j==="disabled"&&(c=!0),j==="readOnly"&&(n=!0);const{t:I}=p.Gt(),S=p.Gs(d),ee=p.Fs("input",K),ae=p.Hs("input",K),de=b==="filled"?"filled":b==="underlined"?"underlined":"",J=a.useCallback(()=>_?.(""),[_]),q=p.Bs({enabled:Z,readOnly:n,disabled:c}),re=p.Tc({enabled:$,onSubmit:A}),ce=a.useCallback(v=>{re(v),L?.(v)},[re,L]),u=a.useMemo(()=>{const v=[];return $&&v.push({key:"Enter",description:I("shortcuts.submit","Submit")}),D&&v.push({key:"Escape",description:I("shortcuts.clear","Clear")}),v},[$,D,I]);return V?null:e.jsxs("div",{className:`nice-field nice-field--${s} ${E==="left"?"nice-field--label-left":""} ${E==="inside"?"nice-field--label-inside":""} ${le?"nice-field--loading":""} ${h||""}`,style:{...m,...fe!=null&&{"--nice-field-label-width":typeof fe=="number"?`${fe}px`:fe},...z!=null&&{"--nice-field-control-width":typeof z=="number"?`${z}px`:z}},"aria-busy":le||void 0,"data-floating":E==="inside"&&w?"true":void 0,children:[i&&E!=="inside"&&e.jsxs("label",{htmlFor:S,className:`nice-field__label ${f?"nice-field__label--required":""}`,children:[i,O&&u.length>0&&e.jsx(p.ta,{shortcuts:u,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[q.isDisplay?e.jsx(p.Os,{value:w??F??"",placeholder:M,disabled:c,readOnly:n,onActivate:q.enterEdit,ariaLabel:i}):e.jsxs("div",{className:`nice-input nice-input--${s} nice-input--ds-${de||ae} ${t?"nice-input--error":""} ${c?"nice-input--disabled":""} ${n?"nice-input--readonly":""}`,style:b?void 0:ee,children:[T&&e.jsx("span",{className:"nice-input__icon",children:T}),e.jsx("input",{ref:v=>{typeof N=="function"?N(v):N&&(N.current=v),q.autoFocusRef(v)},id:S,className:"nice-input__native",type:R,name:x,value:w,defaultValue:F,placeholder:M,disabled:c||le,readOnly:n,maxLength:g,autoFocus:H,"aria-invalid":!!t,"aria-describedby":t?`${S}-error`:l?`${S}-helper`:void 0,onChange:v=>_?.(v.target.value),onBlur:v=>{Z&&q.exitEdit(),Q?.(v)},onKeyDown:ce,...oe}),D&&w&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:J,"aria-label":I("controls.clear","Clear"),children:"✕"}),P&&e.jsx("span",{className:"nice-input__icon",children:P}),i&&E==="inside"&&e.jsx("label",{htmlFor:S,className:`nice-input__floating-label ${f?"nice-input__floating-label--required":""}`,children:i})]}),le&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),Y==="right"&&t&&e.jsx("div",{id:`${S}-error`,className:"nice-field__error",role:"alert",children:t}),Y==="right"&&!t&&l&&e.jsx("div",{id:`${S}-helper`,className:"nice-field__helper",children:l})]}),Y!=="right"&&t&&e.jsx("div",{id:`${S}-error`,className:"nice-field__error",role:"alert",children:t}),Y!=="right"&&!t&&l&&e.jsx("div",{id:`${S}-helper`,className:"nice-field__helper",children:l})]})});Se.displayName="NiceTextInput";const Ge=Object.freeze(Object.defineProperty({__proto__:null,NiceTextInput:Se},Symbol.toStringTag,{value:"Module"})),Ce=a.forwardRef(({label:i,helperText:l,error:t,required:f,disabled:c,readOnly:n,size:s="md",name:x,id:d,className:h,style:m,accessMode:k,displayStyle:K,value:b,onChange:w,onBlur:F,onKeyDown:_,placeholder:Q,min:L,max:M,step:R=1,precision:g,prefix:T,prefixType:P="label",prefixOptions:D,prefixValue:H,onPrefixChange:$,suffix:A,showStepper:O=!0,submitOnEnter:E,onSubmit:Y,showKeyboardHints:le,labelPlacement:fe,errorPlacement:z,loading:Z,labelWidth:oe,controlWidth:N,formatPreset:j,format:V,suffixType:I="label",suffixOptions:S,suffixValue:ee,onSuffixChange:ae,displayMode:de},J)=>{const q=p.pc(k,d),re=q==="hidden";q==="disabled"&&(c=!0),q==="readOnly"&&(n=!0);const{t:ce}=p.Gt(),u=p.Gs(d),v=p.Fs("input",K),U=p.Hs("input",K),[C,X]=a.useState(!1),[W,_e]=a.useState(null),xe=p.Bs({enabled:de,readOnly:n,disabled:c}),ue=a.useMemo(()=>{let r=3;return M!=null&&(r=String(Math.abs(Math.floor(M))).length),L!=null&&L<0&&(r+=1),g&&(r+=g+1),Math.max(3,r)+1},[M,L,g]),je=a.useCallback(r=>{if(V)return V(r);if(!j)return g!=null?r.toFixed(g):String(r);switch(j){case"integer":return Math.round(r).toLocaleString();case"decimal":return r.toLocaleString(void 0,{minimumFractionDigits:g??2,maximumFractionDigits:g??2});case"money":return r.toLocaleString(void 0,{minimumFractionDigits:g??2,maximumFractionDigits:g??2,useGrouping:!0});case"percent":return(r*100).toLocaleString(void 0,{minimumFractionDigits:g??0,maximumFractionDigits:g??2})+"%";default:return String(r)}},[V,j,g]),ye=a.useMemo(()=>C&&W!==null?W:b==null?"":C?g!=null?b.toFixed(g):String(b):je(b),[b,C,W,je,g]),pe=b!=null&&b<0,ie=!!(T||P==="select"&&D&&D.length>0),ne=pe&&ie&&!C,we=ne?ye.replace(/^[-−]/,""):ye,he=a.useCallback(r=>{let y=r;return L!==void 0&&(y=Math.max(L,y)),M!==void 0&&(y=Math.min(M,y)),g!==void 0&&(y=parseFloat(y.toFixed(g))),y},[L,M,g]),Me=a.useCallback(r=>{const y=r.target.value;if(_e(y),y===""||y==="-"||y==="."||y==="-."){y===""&&w?.(null);return}const se=parseFloat(y);if(!isNaN(se)){let be=se;L!==void 0&&(be=Math.max(L,be)),M!==void 0&&(be=Math.min(M,be)),w?.(be)}},[w,L,M]),ge=a.useCallback(()=>{const r=ve.current,y=he((r??0)+R);ve.current=y,w?.(y)},[R,w,he]),ke=a.useCallback(()=>{const r=ve.current,y=he((r??0)-R);ve.current=y,w?.(y)},[R,w,he]),ve=a.useRef(b);ve.current=b;const o=a.useRef(null),G=a.useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]),B=a.useCallback(r=>{G();let y=300;const se=()=>{r(),y=Math.max(30,y*.82),o.current=setTimeout(se,y)};o.current=setTimeout(se,400)},[G]),me=p.Tc({enabled:E,onSubmit:Y}),$e=a.useCallback(r=>{me(r),r.key==="ArrowUp"?(r.preventDefault(),ge()):r.key==="ArrowDown"&&(r.preventDefault(),ke()),_?.(r)},[me,_,ge,ke]),te=a.useMemo(()=>{const r=[];return E&&r.push(p.Ec.submit),O&&(r.push({key:"ArrowUp",description:ce("shortcuts.increment","Increase value")}),r.push({key:"ArrowDown",description:ce("shortcuts.decrement","Decrease value")})),r},[E,O,ce]);return re?null:e.jsxs("div",{className:`nice-field nice-field--${s} ${fe==="left"?"nice-field--label-left":""} ${Z?"nice-field--loading":""} ${h||""}`,style:{...m,...oe!=null&&{"--nice-field-label-width":typeof oe=="number"?`${oe}px`:oe},...N!=null&&{"--nice-field-control-width":typeof N=="number"?`${N}px`:N}},"aria-busy":Z||void 0,children:[i&&e.jsxs("label",{htmlFor:u,className:`nice-field__label ${f?"nice-field__label--required":""}`,children:[i,le&&te.length>0&&e.jsx(p.ta,{shortcuts:te,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[xe.isDisplay?e.jsx(p.Os,{value:b==null?"":T?e.jsxs(e.Fragment,{children:[T,ye]}):ye,placeholder:Q,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-${U} ${t?"nice-input--error":""} ${c?"nice-input--disabled":""} ${n?"nice-input--readonly":""}`,style:v,children:[O&&!n&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__minus",onClick:ke,onMouseDown:()=>B(ke),onMouseUp:G,onMouseLeave:G,disabled:c,"aria-label":ce("controls.decrement","Decrement"),children:"−"}),P==="select"&&D&&D.length>0?e.jsxs(e.Fragment,{children:[ne&&e.jsx("span",{className:"nice-input__sign",children:"−"}),e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--prefix",value:H??D[0]?.value,disabled:c,onChange:r=>{const y=r.target.value,se=D.find(Ne=>Ne.value===(H??D[0]?.value)),be=D.find(Ne=>Ne.value===y);$?.(y,se?.weight,be?.weight)},children:D.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))})]}):T?e.jsxs("span",{className:"nice-input__icon nice-input__icon--prefix",children:[ne&&e.jsx("span",{className:"nice-input__sign",children:"−"}),T]}):null,e.jsx("input",{ref:r=>{typeof J=="function"?J(r):J&&(J.current=r),xe.autoFocusRef(r)},id:u,className:"nice-input__native",type:!C&&(V||j)?"text":"number",name:x,value:we,placeholder:Q,min:L,max:M,step:R,disabled:c||Z,readOnly:n,"aria-invalid":!!t,onChange:Me,onFocus:r=>{X(!0),_e(null),r.target.select()},onBlur:r=>{if(X(!1),_e(null),b!=null&&g!==void 0){const y=parseFloat(b.toFixed(g));y!==b&&w?.(y)}de&&xe.exitEdit(),F?.(r)},onKeyDown:$e,style:{width:`${ue}ch`}}),I==="select"&&S&&S.length>0?e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--suffix",value:ee??S[0]?.value,disabled:c,onChange:r=>{const y=r.target.value,se=S.find(Ne=>Ne.value===(ee??S[0]?.value)),be=S.find(Ne=>Ne.value===y);ae?.(y,se?.weight,be?.weight)},children:S.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))}):A?e.jsx("span",{className:"nice-input__icon nice-input__icon--suffix",children:A}):null,O&&!n&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__plus",onClick:ge,onMouseDown:()=>B(ge),onMouseUp:G,onMouseLeave:G,disabled:c,"aria-label":ce("controls.increment","Increment"),children:"+"})]})}),Z&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),z==="right"&&t&&e.jsx("div",{className:"nice-field__error",role:"alert",children:t}),z==="right"&&!t&&l&&e.jsx("div",{className:"nice-field__helper",children:l})]}),z!=="right"&&t&&e.jsx("div",{className:"nice-field__error",role:"alert",children:t}),z!=="right"&&!t&&l&&e.jsx("div",{className:"nice-field__helper",children:l})]})});Ce.displayName="NiceNumberInput";const Be=Object.freeze(Object.defineProperty({__proto__:null,NiceNumberInput:Ce},Symbol.toStringTag,{value:"Module"})),Re=a.forwardRef(({label:i,helperText:l,error:t,required:f,disabled:c,size:n="md",name:s,id:x,className:d,style:h,accessMode:m,displayStyle:k,options:K,value:b,onChange:w,placeholder:F,multiple:_=!1,searchable:Q=!1,clearable:L=!1,emptyText:M,maxHeight:R=240,optionsSource:g,valueField:T,labelField:P,virtualScroll:D,optionHeight:H=36,onSearch:$,loading:A,renderOption:O,multipleAutosize:E=!1,showKeyboardHints:Y,labelPlacement:le,errorPlacement:fe,labelWidth:z,controlWidth:Z,displayMode:oe},N)=>{const j=p.pc(m,x),V=j==="hidden";(j==="disabled"||j==="readOnly")&&(c=!0);const{t:I}=p.Gt(),S=p.Fs("input",k),ee=p.Hs("input",k),ae=p.Gs(x),de=p.Bs({enabled:oe,disabled:c}),[J,q]=a.useState(!1),[re,ce]=a.useState(""),[u,v]=a.useState(-1),[U,C]=a.useState(0),X=a.useRef(null),W=a.useRef(null),[_e,xe]=a.useState(null);a.useLayoutEffect(()=>{!A&&W.current&&xe(W.current.offsetWidth)},[A,b,k]);const[ue,je]=a.useState(null);a.useLayoutEffect(()=>{_&&!E&&W.current&&ue==null&&je(W.current.offsetWidth)},[_,E,ue]);const ye=p.Nd(g??null,T??g?.keyField??"id",P??"name"),pe=g?ye.options:(K??[]).map(o=>typeof o=="string"?{value:o,label:o}:o);p.Ys(X,()=>{q(!1),ce("")});const ie=a.useMemo(()=>b?Array.isArray(b)?b:[b]:[],[b]),ne=a.useMemo(()=>{if(!re&&!$||$)return pe;const o=re.toLowerCase();return pe.filter(G=>G.label.toLowerCase().includes(o)||String(G.value).toLowerCase().includes(o))},[pe,re,$]),we=a.useMemo(()=>{const o=new Map;for(const G of ne){const B=G.group||"";o.has(B)||o.set(B,[]),o.get(B).push(G)}return o},[ne]),he=a.useCallback(o=>{if(_){const G=ie.includes(o)?ie.filter(B=>B!==o):[...ie,o];w?.(G)}else w?.(o),q(!1),ce("")},[_,ie,w]),Me=a.useCallback(o=>{if(o.key==="Escape"){q(!1),ce("");return}if(o.key==="Enter"||o.key===" "){if(!J){q(!0),o.preventDefault();return}u>=0&&ne[u]&&(he(ne[u].value),o.preventDefault());return}o.key==="ArrowDown"&&(o.preventDefault(),v(G=>Math.min(G+1,ne.length-1))),o.key==="ArrowUp"&&(o.preventDefault(),v(G=>Math.max(G-1,0)))},[J,u,ne,he]),ge=a.useMemo(()=>ie.length===0?null:_?ie.map(o=>pe.find(G=>G.value===o)?.label||o).join(", "):pe.find(o=>o.value===ie[0])?.label||ie[0],[ie,pe,_]),ke=a.useCallback(o=>{o.stopPropagation(),w?.(_?[]:"")},[w,_]),ve=a.useMemo(()=>[{key:"Enter",description:I("shortcuts.select","Select")},{key:"Space",description:I("shortcuts.openDropdown","Open dropdown")},p.Ec.moveUp,p.Ec.moveDown,p.Ec.cancel],[I]);return V?null:e.jsxs("div",{className:`nice-field ${Z==null?"nice-field--select-auto":""} nice-field--${n} ${le==="left"?"nice-field--label-left":""} ${A?"nice-field--loading":""} ${d||""}`,style:{...h,...z!=null&&{"--nice-field-label-width":typeof z=="number"?`${z}px`:z},...Z!=null&&{"--nice-field-control-width":typeof Z=="number"?`${Z}px`:Z},...A&&_e!=null&&{"--nice-select-locked-width":`${_e}px`}},"aria-busy":A||void 0,children:[i&&e.jsxs("label",{htmlFor:ae,className:`nice-field__label ${f?"nice-field__label--required":""}`,children:[i,Y&&e.jsx(p.ta,{shortcuts:ve,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[de.isDisplay?e.jsx(p.Os,{value:ge,placeholder:F||I("controls.select","Select..."),disabled:c,onActivate:()=>{de.enterEdit(),q(!0)},ariaLabel:i}):e.jsxs("div",{className:"nice-select",ref:X,children:[e.jsxs("button",{ref:o=>{W.current=o,typeof N=="function"?N(o):N&&(N.current=o)},type:"button",id:ae,role:"combobox","aria-expanded":J,"aria-haspopup":"listbox","aria-invalid":!!t,className:`nice-select__trigger nice-select__trigger--${n} nice-select--ds-${ee} ${J?"nice-select__trigger--open":""} ${t?"nice-select__trigger--error":""} ${c?"nice-select__trigger--disabled":""}`,style:{...S,..._&&!E&&ue!=null?{width:ue,maxWidth:ue,overflow:"hidden"}:{}},disabled:c,onClick:()=>q(!J),onKeyDown:Me,children:[ge?e.jsx("span",{style:_&&!E?{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0,children:ge}):e.jsx("span",{className:"nice-select__placeholder",children:F||I("controls.select","Select...")}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[L&&ie.length>0&&e.jsx("span",{className:"nice-input__clear",onClick:ke,role:"button","aria-label":I("controls.clear","Clear"),children:"✕"}),e.jsx("svg",{className:`nice-select__chevron ${J?"nice-select__chevron--open":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]})]}),J&&e.jsxs("div",{className:"nice-select__dropdown",role:"listbox",style:{maxHeight:R},onScroll:D?o=>C(o.currentTarget.scrollTop):void 0,children:[(Q||$)&&e.jsx("div",{className:"nice-select__search",children:e.jsx("input",{type:"text",value:re,onChange:o=>{ce(o.target.value),v(0),$?.(o.target.value)},placeholder:I("controls.search","Search..."),autoFocus:!0})}),A&&e.jsx("div",{className:"nice-select__loading",children:e.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!A&&ne.length===0?e.jsx("div",{className:"nice-select__empty",children:M||I("controls.noResults","No results found")}):D&&!Array.from(we.keys()).some(o=>o!=="")?(()=>{const G=ne.length*H,B=Math.max(0,Math.floor(U/H)-3),me=Math.min(ne.length,Math.ceil((U+R)/H)+3),$e=ne.slice(B,me);return e.jsx("div",{style:{height:G,position:"relative"},children:$e.map((te,r)=>{const y=B+r,se=ie.includes(te.value);return e.jsx("div",{role:"option","aria-selected":se,className:`nice-select__option ${se?"nice-select__option--selected":""} ${y===u?"nice-select__option--highlighted":""} ${te.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:y*H,left:0,right:0,height:H,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!te.disabled&&he(String(te.value)),onMouseEnter:()=>v(y),children:O?O(te,se):e.jsxs(e.Fragment,{children:[te.icon&&e.jsx("span",{children:te.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:te.label}),te.description&&e.jsx("div",{className:"nice-select__option-desc",children:te.description})]}),se&&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"})})]})},te.value)})})})():Array.from(we.entries()).map(([o,G])=>e.jsxs(a.Fragment,{children:[o&&e.jsx("div",{className:"nice-select__group-label",children:o}),G.map(B=>{const me=ie.includes(B.value),$e=ne.indexOf(B);return e.jsx("div",{role:"option","aria-selected":me,className:`nice-select__option ${me?"nice-select__option--selected":""} ${$e===u?"nice-select__option--highlighted":""} ${B.disabled?"nice-select__option--disabled":""}`,onClick:()=>!B.disabled&&he(String(B.value)),onMouseEnter:()=>v($e),children:O?O(B,me):e.jsxs(e.Fragment,{children:[B.icon&&e.jsx("span",{children:B.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:B.label}),B.description&&e.jsx("div",{className:"nice-select__option-desc",children:B.description})]}),me&&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"})})]})},B.value)})]},o))]})]}),A&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),fe==="right"&&t&&e.jsx("div",{id:`${ae}-error`,className:"nice-field__error",role:"alert",children:t}),fe==="right"&&!t&&l&&e.jsx("div",{id:`${ae}-helper`,className:"nice-field__helper",children:l})]}),fe!=="right"&&t&&e.jsx("div",{id:`${ae}-error`,className:"nice-field__error",role:"alert",children:t}),fe!=="right"&&!t&&l&&e.jsx("div",{id:`${ae}-helper`,className:"nice-field__helper",children:l})]})});Re.displayName="NiceSelect";const Ue=Object.freeze(Object.defineProperty({__proto__:null,NiceSelect:Re},Symbol.toStringTag,{value:"Module"})),Ee=a.forwardRef(({label:i,checked:l=!1,indeterminate:t=!1,onChange:f,disabled:c,readOnly:n,loading:s,required:x,size:d="md",name:h,id:m,className:k,style:K,error:b,helperText:w,accessMode:F,displayStyle:_,showKeyboardHints:Q,labelPlacement:L,errorPlacement:M,labelWidth:R,controlWidth:g},T)=>{const P=p.pc(F,m),D=P==="hidden";(P==="disabled"||P==="readOnly")&&(c=!0);const{t:H}=p.Gt(),$=p.Gs(m);p.Hs("toggle",_);const A=a.useMemo(()=>[{key:"Space",description:H("shortcuts.toggle","Toggle")}],[H]),O=a.useCallback(E=>{E&&(E.indeterminate=t),typeof T=="function"?T(E):T&&(T.current=E)},[t,T]);return D?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${d} ${L==="left"?"nice-field--label-left":""} ${M==="right"?"nice-field--error-right":""} ${s?"nice-field--loading":""} ${k||""}`,style:{...K,...R!=null&&{"--nice-field-label-width":typeof R=="number"?`${R}px`:R},...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 ${d!=="md"?`nice-checkbox--${d}`:""} ${c||s?"nice-checkbox--disabled":""}`,htmlFor:$,children:[e.jsx("input",{ref:O,id:$,type:"checkbox",className:"nice-checkbox__input",name:h,checked:l,disabled:c||s,readOnly:n,"aria-invalid":!!b,onChange:E=>{n||s||f?.(E.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}),Q&&e.jsx(p.ta,{shortcuts:A,size:"sm"})]}),s&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),M==="right"&&b&&e.jsx("div",{id:`${$}-error`,className:"nice-field__error",role:"alert",children:b}),M==="right"&&!b&&w&&e.jsx("div",{id:`${$}-helper`,className:"nice-field__helper",children:w})]}),M!=="right"&&b&&e.jsx("div",{id:`${$}-error`,className:"nice-field__error",role:"alert",children:b}),M!=="right"&&!b&&w&&e.jsx("div",{id:`${$}-helper`,className:"nice-field__helper",children:w})]})});Ee.displayName="NiceCheckbox";const Pe=Object.freeze(Object.defineProperty({__proto__:null,NiceCheckbox:Ee},Symbol.toStringTag,{value:"Module"})),Te=a.forwardRef(({label:i,checked:l=!1,onChange:t,disabled:f,readOnly:c,loading:n,required:s,size:x="md",name:d,id:h,className:m,style:k,accessMode:K,displayStyle:b,showKeyboardHints:w,error:F,helperText:_,labelPlacement:Q,errorPlacement:L,labelWidth:M,controlWidth:R},g)=>{const T=p.pc(K,h),P=T==="hidden";(T==="disabled"||T==="readOnly")&&(f=!0);const{t:D}=p.Gt(),H=p.Gs(h);p.Fs("toggle",b);const $=p.Hs("toggle",b),A=a.useMemo(()=>[{key:"Space",description:D("shortcuts.toggle","Toggle on/off")}],[D]);return P?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${x} ${Q==="left"?"nice-field--label-left":""} ${n?"nice-field--loading":""} ${m||""}`,style:{...k,...M!=null&&{"--nice-field-label-width":typeof M=="number"?`${M}px`:M},...R!=null&&{"--nice-field-control-width":typeof R=="number"?`${R}px`:R}},"aria-busy":n||void 0,children:[Q==="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-${$} ${x!=="md"?`nice-toggle--${x}`:""} ${f||n?"nice-toggle--disabled":""}`,htmlFor:H,children:[e.jsx("input",{ref:g,id:H,type:"checkbox",className:"nice-toggle__input",name:d,checked:l,disabled:f||n,readOnly:c,role:"switch","aria-checked":l,"aria-invalid":!!F,onChange:O=>{c||n||t?.(O.target.checked)}}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),Q!=="left"&&i&&e.jsx("span",{children:i}),w&&e.jsx(p.ta,{shortcuts:A,size:"sm"})]}),n&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),L==="right"&&F&&e.jsx("div",{id:`${H}-error`,className:"nice-field__error",role:"alert",children:F}),L==="right"&&!F&&_&&e.jsx("div",{id:`${H}-helper`,className:"nice-field__helper",children:_})]}),L!=="right"&&F&&e.jsx("div",{id:`${H}-error`,className:"nice-field__error",role:"alert",children:F}),L!=="right"&&!F&&_&&e.jsx("div",{id:`${H}-helper`,className:"nice-field__helper",children:_})]})});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 Ve(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}function Oe(i){const l=/^#?([0-9a-f]{6})$/i.exec(i.trim());if(!l)return{r:0,g:0,b:0};const t=parseInt(l[1],16);return{r:t>>16&255,g:t>>8&255,b:t&255}}function Ze(i,l,t){const f=c=>Math.max(0,Math.min(255,Math.round(c))).toString(16).padStart(2,"0");return`#${f(i)}${f(l)}${f(t)}`}function qe(i,l,t){const f=i/255,c=l/255,n=t/255,s=Math.max(f,c,n),x=Math.min(f,c,n),d=(s+x)/2;let h=0,m=0;if(s!==x){const k=s-x;switch(m=d>.5?k/(2-s-x):k/(s+x),s){case f:h=(c-n)/k+(c<n?6:0);break;case c:h=(n-f)/k+2;break;case n:h=(f-c)/k+4;break}h*=60}return{h:Math.round(h),s:Math.round(m*100),l:Math.round(d*100)}}function Ye(i,l,t){const f=l/100,c=t/100,n=(1-Math.abs(2*c-1))*f,s=n*(1-Math.abs(i/60%2-1)),x=c-n/2;let d=0,h=0,m=0;return i<60?[d,h,m]=[n,s,0]:i<120?[d,h,m]=[s,n,0]:i<180?[d,h,m]=[0,n,s]:i<240?[d,h,m]=[0,s,n]:i<300?[d,h,m]=[s,0,n]:[d,h,m]=[n,0,s],{r:Math.round((d+x)*255),g:Math.round((h+x)*255),b:Math.round((m+x)*255)}}function ze(i,l,t){const f=i/255,c=l/255,n=t/255,s=Math.max(f,c,n),x=Math.min(f,c,n),d=s-x;let h=0;d!==0&&(s===f?h=(c-n)/d%6:s===c?h=(n-f)/d+2:h=(f-c)/d+4,h*=60,h<0&&(h+=360));const m=s===0?0:d/s;return{h:Math.round(h),s:Math.round(m*100),v:Math.round(s*100)}}function Je(i,l,t){const f=l/100,c=t/100,n=c*f,s=n*(1-Math.abs(i/60%2-1)),x=c-n;let d=0,h=0,m=0;return i<60?[d,h,m]=[n,s,0]:i<120?[d,h,m]=[s,n,0]:i<180?[d,h,m]=[0,n,s]:i<240?[d,h,m]=[0,s,n]:i<300?[d,h,m]=[s,0,n]:[d,h,m]=[n,0,s],{r:Math.round((d+x)*255),g:Math.round((h+x)*255),b:Math.round((m+x)*255)}}function Qe(i){const l=/^#?([0-9a-f]{6})$/i.exec(i.trim()),t=/^#?([0-9a-f]{8})$/i.exec(i.trim());if(t){const f=t[1];return{r:parseInt(f.slice(0,2),16),g:parseInt(f.slice(2,4),16),b:parseInt(f.slice(4,6),16),a:parseInt(f.slice(6,8),16)/255}}if(l){const f=parseInt(l[1],16);return{r:f>>16&255,g:f>>8&255,b:f&255,a:1}}return{r:0,g:0,b:0,a:1}}function Xe(i,l,t,f,c){const n=x=>Math.max(0,Math.min(255,Math.round(x))).toString(16).padStart(2,"0"),s=`#${n(i)}${n(l)}${n(t)}`;return c?`${s}${n(f*255)}`:s}const Le=a.forwardRef(({label:i,helperText:l,error:t,required:f,disabled:c,id:n,className:s,style:x,accessMode:d,displayStyle:h,value:m="var(--nice-primary, #3b82f6)",onChange:k,presets:K=Ke,showInput:b=!0,showRandom:w=!0,withAlpha:F=!1,showKeyboardHints:_,size:Q="md",labelPlacement:L,errorPlacement:M,labelWidth:R,controlWidth:g,loading:T},P)=>{const D=p.pc(d,n),H=D==="hidden";(D==="disabled"||D==="readOnly")&&(c=!0);const{t:$}=p.Gt(),A=p.Gs(n);p.Hs("input",h);const O=a.useCallback(()=>{c||k?.(Ve())},[c,k]),[E,Y]=a.useState(!1),[le,fe]=a.useState(null),z=a.useRef(null),Z=a.useRef(null);a.useLayoutEffect(()=>{if(!E||!Z.current)return;const N=()=>{const j=Z.current?.getBoundingClientRect();if(!j)return;const V=280,I=360;let S=j.left,ee=j.bottom+6;S+V>window.innerWidth-8&&(S=Math.max(8,window.innerWidth-V-8)),ee+I>window.innerHeight-8&&(ee=Math.max(8,j.top-I-6)),fe({left:S,top:ee})};return N(),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[E]),a.useEffect(()=>{if(!E)return;const N=V=>{const I=V.target;z.current?.contains(I)||Z.current?.contains(I)||Y(!1)},j=V=>{V.key==="Escape"&&Y(!1)};return document.addEventListener("mousedown",N),document.addEventListener("keydown",j),()=>{document.removeEventListener("mousedown",N),document.removeEventListener("keydown",j)}},[E]);const oe=a.useMemo(()=>[{key:"Enter",description:$("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:$("shortcuts.navigatePresets","Navigate presets")}],[$]);return H?null:e.jsxs("div",{className:`nice-field nice-field--${Q} ${L==="left"?"nice-field--label-left":""} ${T?"nice-field--loading":""} ${s||""}`,style:{...x,...R!=null&&{"--nice-field-label-width":typeof R=="number"?`${R}px`:R},...g!=null&&{"--nice-field-control-width":typeof g=="number"?`${g}px`:g}},"aria-busy":T||void 0,children:[i&&e.jsxs("label",{htmlFor:A,className:`nice-field__label ${f?"nice-field__label--required":""}`,children:[i,_&&e.jsx(p.ta,{shortcuts:oe,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:Z,className:"nice-color-picker__swatch",id:A,style:{background:m},onClick:N=>{N.stopPropagation(),c||Y(j=>!j)},onKeyDown:N=>{!c&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),Y(j=>!j))},role:"button",tabIndex:0,"aria-label":$("colorPicker.openPalette","Open color palette"),"aria-haspopup":"dialog","aria-expanded":E,children:e.jsx("input",{ref:N=>{typeof P=="function"?P(N):P&&(P.current=N)},type:"hidden",value:m,disabled:c,readOnly:!0})}),b&&e.jsx("div",{className:"nice-input nice-input--sm",style:{width:100},children:e.jsx("input",{className:"nice-input__native",type:"text",value:m,disabled:c,onChange:N=>k?.(N.target.value),maxLength:7})}),w&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:O,disabled:c,title:$("colorPicker.random","Random"),"aria-label":$("colorPicker.random","Random"),style:{fontSize:"0.65rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:$("colorPicker.random","Random")}),T&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),M==="right"&&t&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:t}),M==="right"&&!t&&l&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:l})]}),E&&le&&typeof document<"u"&&Ie.createPortal(e.jsx("div",{ref:z,className:"nice-color-picker__popup nice-color-picker__popup--portal",role:"dialog","aria-label":$("colorPicker.palette","Color palette"),style:{position:"fixed",left:le.left,top:le.top},onClick:N=>N.stopPropagation(),children:(()=>{const N=Qe(m),j={r:N.r,g:N.g,b:N.b},V=F?N.a:1,I=qe(j.r,j.g,j.b),S=ze(j.r,j.g,j.b),ee=(u,v,U,C=V)=>k?.(Xe(u,v,U,C,F)),ae=(u,v,U)=>ee(u,v,U),de=(u,v,U)=>{const C=Ye(u,v,U);ee(C.r,C.g,C.b)},J=(u,v,U)=>{const C=Je(u,v,U);ee(C.r,C.g,C.b)},q=u=>ee(j.r,j.g,j.b,u),re=u=>{if(c)return;const v=u.currentTarget,U=X=>{const W=v.getBoundingClientRect(),_e=Math.max(0,Math.min(W.width,X.clientX-W.left)),xe=Math.max(0,Math.min(W.height,X.clientY-W.top)),ue=Math.round(_e/W.width*100),je=100-Math.round(xe/W.height*100);J(S.h,ue,je)};U(u);const C=()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",U),document.addEventListener("pointerup",C)},ce=`hsl(${S.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:u=>k?.(u.target.value),maxLength:F?9:7,"aria-label":$("colorPicker.hexValue","Hex value")})}),e.jsx("input",{type:"range",min:0,max:360,value:S.h,disabled:c,onChange:u=>J(Number(u.target.value),S.s,S.v),className:"nice-color-picker__hue-slider","aria-label":$("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), ${ce})`},onPointerDown:re,role:"application","aria-label":$("colorPicker.svPalette","Saturation/value palette"),children:e.jsx("span",{className:"nice-color-picker__sv-marker",style:{left:`${S.s}%`,top:`${100-S.v}%`}})}),e.jsxs("div",{className:"nice-color-picker__sliders",children:[e.jsx("div",{className:"nice-color-picker__slider-col",children:["h","s","l"].map(u=>{const v=u==="h"?360:100,U=I[u],C=X=>de(u==="h"?X:I.h,u==="s"?X:I.s,u==="l"?X:I.l);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:u.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:v,value:U,disabled:c,onChange:X=>C(Number(X.target.value))}),e.jsx("input",{type:"number",min:0,max:v,value:U,disabled:c,onChange:X=>C(Number(X.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},u)})}),e.jsx("div",{className:"nice-color-picker__slider-col",children:["r","g","b"].map(u=>{const v=j[u],U=C=>ae(u==="r"?C:j.r,u==="g"?C:j.g,u==="b"?C:j.b);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:u.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:255,value:v,disabled:c,onChange:C=>U(Number(C.target.value))}),e.jsx("input",{type:"number",min:0,max:255,value:v,disabled:c,onChange:C=>U(Number(C.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},u)})})]}),F&&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(V*100),disabled:c,onChange:u=>q(Number(u.target.value)/100),className:"nice-color-picker__alpha-slider",style:{background:`linear-gradient(to right, transparent, rgb(${j.r},${j.g},${j.b}))`},"aria-label":$("colorPicker.alpha","Alpha")}),e.jsx("input",{type:"number",min:0,max:100,value:Math.round(V*100),disabled:c,onChange:u=>q((Number(u.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(u=>e.jsx("div",{className:`nice-color-picker__preset ${m===u?"nice-color-picker__preset--active":""}`,style:{background:u},onClick:()=>{k?.(u),Y(!1)},role:"button",tabIndex:0,"aria-label":u,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),k?.(u),Y(!1))}},u))})]})})()}),document.body)]})}),M!=="right"&&t&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:t}),M!=="right"&&!t&&l&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:l})]})});Le.displayName="NiceColorPicker";const We=Object.freeze(Object.defineProperty({__proto__:null,NiceColorPicker:Le,hexToRgb:Oe,rgbToHex:Ze},Symbol.toStringTag,{value:"Module"})),De=a.forwardRef(({children:i,variant:l="primary",size:t="md",type:f="button",disabled:c,loading:n,fullWidth:s,onClick:x,leftIcon:d,rightIcon:h,error:m,errorPlacement:k="bottom",className:K,style:b,id:w,accessMode:F,displayStyle:_,...Q},L)=>{const M=p.Ls(l),R=p.Es(t),g=p.pc(F,w),T=g==="hidden";(g==="disabled"||g==="readOnly")&&(c=!0);const P=p.Fs("button",_),D=p.Hs("button",_),H=M!=="primary"?(({background:O,color:E,...Y})=>Y)(P):P,$=e.jsxs("button",{ref:L,type:f,id:w,className:`nice-btn nice-btn--${M} nice-btn--${R} nice-btn--ds-${D} ${s?"nice-btn--full-width":""} ${n?"nice-btn--loading":""} ${m&&!k?"nice-btn--has-error":""} ${K||""}`,style:{...H,...b},disabled:c||n,"aria-busy":n||void 0,"aria-disabled":c||n||void 0,onClick:x,...Q,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&&d&&e.jsx("span",{"aria-hidden":"true",children:d}),!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(T)return null;if(!m)return $;const A=e.jsx("div",{className:"nice-field__error",role:"alert",children:m});return k==="right"?e.jsxs("span",{className:`nice-btn-field nice-btn-field--right nice-field--${R}`,style:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:"8px",width:"fit-content"},children:[$,A]}):T?null:e.jsxs("span",{className:`nice-btn-field nice-btn-field--bottom nice-field--${R}`,style:{display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",width:"fit-content"},children:[$,A]})});De.displayName="NiceButton";const en=({tabs:i,activeTab:l,onChange:t,variant:f="default",vertical:c,size:n="md",className:s,style:x,displayStyle:d})=>{const h=p.Fs("tab",d),m=p.Hs("tab",d),[k,K]=a.useState(l||i[0]?.id),b=l??k,w=a.useCallback(_=>{K(_),t?.(_)},[t]),F=i.find(_=>_.id===b)?.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 ${f!=="default"?`nice-tabs__list--${f}`:""} ${c?"nice-tabs__list--vertical":""}`,role:"tablist",children:i.map(_=>e.jsxs("button",{type:"button",role:"tab","aria-selected":b===_.id,className:`nice-tabs__tab ${b===_.id?"nice-tabs__tab--active":""} ${_.disabled?"nice-tabs__tab--disabled":""}`,disabled:_.disabled,onClick:()=>w(_.id),children:[_.icon,e.jsx("span",{children:_.label}),_.badge!==void 0&&e.jsx("span",{className:"nice-tabs__badge",children:_.badge})]},_.id))}),F&&e.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",children:F})]})},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"]}),Fe=["#cbd5e1","#94a3b8","#cbd5e1"];function cn(i){return i?nn[i.toUpperCase()]??Fe:Fe}const tn=He.Flags3x2,sn=({code:i,size:l=22,className:t})=>{const f=i?.toUpperCase(),c=f?tn[f]:void 0,n=l,s=Math.round(l*2/3);return c?e.jsx("span",{className:t,role:"img","aria-label":`${f} 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:l,className:t})},Ae=({code:i,size:l=18,className:t})=>{const f=cn(i);return e.jsx("span",{className:t,role:"img","aria-label":`${i} flag`,style:{display:"inline-flex",width:l,height:Math.round(l*.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:f.map((c,n)=>e.jsx("span",{style:{flex:1,background:c}},n))})};function fn(i,l,t,f=280){const[c,n]=a.useState(t==="left"?"left":"right"),s=a.useCallback(()=>{if(t!=="auto"){n(t);return}const x=l.current;if(!x||typeof window>"u")return;const d=x.getBoundingClientRect(),m=window.innerWidth-d.left,k=d.right;m>=f&&m>k?n("left"):n("right")},[t,l,f]);return a.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:l=28,shape:t="page",className:f})=>{const c=l,n=Math.round(l*.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:f,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((b,w)=>e.jsx("span",{style:{flex:1,background:b}},w))})}const x=Math.max(2,Math.round(n*.22)),d=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)),k=Math.max(2,Math.round(c*.08));return e.jsxs("span",{className:f,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}}),d>0&&e.jsx("span",{style:{position:"absolute",top:x,left:0,bottom:0,width:d,background:i.backgroundSecondary}}),e.jsx("span",{style:{position:"absolute",top:x+m,left:d+k,right:k,height:h,background:i.textColor,opacity:.8,borderRadius:1}}),e.jsx("span",{style:{position:"absolute",top:x+m*2+h,left:d+k,width:`${Math.max(20,c-d-k*2-4)}px`,height:h,background:i.textColor,opacity:.5,borderRadius:1}})]})};exports.FlagIcon=sn;exports.FlagSwatch=Ae;exports.NiceButton=De;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=Ge;exports.NiceToggle=Te;exports.ThemePreviewSwatch=ln;exports.useDropdownAlignment=fn;
|