@nice2dev/ui 1.1.10 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/CHANGELOG.md +183 -0
  2. package/README.md +12 -20
  3. package/dist/NiceApiExplorer.doc-CFJndg5h.js +25 -0
  4. package/dist/NiceApiExplorer.doc-TEx67kV5.cjs +1 -0
  5. package/dist/NiceBPMNDesigner.doc-6lK1pXRq.js +32 -0
  6. package/dist/NiceBPMNDesigner.doc-BY8t7qOi.cjs +8 -0
  7. package/dist/NiceBackupDiffViewer.doc-CYvOeX19.js +25 -0
  8. package/dist/NiceBackupDiffViewer.doc-ChQaZCg1.cjs +1 -0
  9. package/dist/NiceBackupList.doc-BdQCw0_D.cjs +1 -0
  10. package/dist/NiceBackupList.doc-BwjIAoqz.js +25 -0
  11. package/dist/NiceBackupRestoreDialog.doc-B2iiqTps.cjs +1 -0
  12. package/dist/NiceBackupRestoreDialog.doc-DuXSGJiD.js +25 -0
  13. package/dist/NiceBackupScheduler.doc-BpY45181.js +31 -0
  14. package/dist/NiceBackupScheduler.doc-ByeL3iH1.cjs +7 -0
  15. package/dist/NiceBackupStatusBadge.doc-BA3dYgiW.cjs +1 -0
  16. package/dist/NiceBackupStatusBadge.doc-CxwkVarP.js +25 -0
  17. package/dist/NiceBackupTagEditor.doc-Bej1KHco.cjs +7 -0
  18. package/dist/NiceBackupTagEditor.doc-CNy4uNws.js +31 -0
  19. package/dist/NiceBottomSheet.doc-keq-Fzlz.cjs +8 -0
  20. package/dist/NiceBottomSheet.doc-v-UPUKQk.js +32 -0
  21. package/dist/NiceBranchManager.doc-BTyRjX7X.cjs +6 -0
  22. package/dist/NiceBranchManager.doc-Cz4SyEqE.js +30 -0
  23. package/dist/NiceButton-3AcJJ15c.cjs +1 -0
  24. package/dist/NiceButton-5tWvfXKl.cjs +1 -0
  25. package/dist/NiceButton-DHSgQT1_.js +112 -0
  26. package/dist/NiceButton-vkI07DP0.js +88 -0
  27. package/dist/NiceCodeEditor-B8At55f5.js +1179 -0
  28. package/dist/NiceCodeEditor-BJSEzhcY.cjs +260 -0
  29. package/dist/NiceCodeEditor-VGIDWSkS.js +1181 -0
  30. package/dist/NiceCodeEditor-qX39PSnQ.cjs +260 -0
  31. package/dist/NiceColorPicker-CQhhjZ8w.cjs +1 -0
  32. package/dist/NiceColorPicker-Cbop7VMu.js +491 -0
  33. package/dist/NiceColorPicker-DCgmE-3H.cjs +1 -0
  34. package/dist/NiceColorPicker-DK30kJgy.js +486 -0
  35. package/dist/NiceColorPicker-DtPFxDKM.cjs +1 -0
  36. package/dist/NiceColorPicker-bNJBAU_c.js +598 -0
  37. package/dist/NiceConnectorConfigForm.doc-BKrDuhXw.cjs +7 -0
  38. package/dist/NiceConnectorConfigForm.doc-BsHeXz3M.js +31 -0
  39. package/dist/NiceDataBranchGraph.doc-Axidz41W.js +29 -0
  40. package/dist/NiceDataBranchGraph.doc-sjLmrrtE.cjs +5 -0
  41. package/dist/NiceDataBranchManager.doc-B1-Rp2X4.cjs +6 -0
  42. package/dist/NiceDataBranchManager.doc-GUqfTFvW.js +30 -0
  43. package/dist/NiceDataConflictResolver.doc-CjQryrTu.cjs +5 -0
  44. package/dist/NiceDataConflictResolver.doc-L-TcnQMX.js +29 -0
  45. package/dist/NiceDataDiffViewer.doc-BzGrf0U-.cjs +6 -0
  46. package/dist/NiceDataDiffViewer.doc-goxhSldH.js +30 -0
  47. package/dist/NiceDataGrid-BDEIbuBS.js +2218 -0
  48. package/dist/NiceDataGrid-BOCJr6XF.js +2217 -0
  49. package/dist/NiceDataGrid-BV5Oh-gy.cjs +10 -0
  50. package/dist/NiceDataGrid-CS5aB-EN.cjs +10 -0
  51. package/dist/NiceDataGrid-Dd7SI-M6.cjs +10 -0
  52. package/dist/NiceDataGrid-DjZchXYG.js +2217 -0
  53. package/dist/NiceDataMapper.doc-QmnmnvVq.js +30 -0
  54. package/dist/NiceDataMapper.doc-ytGVtYVr.cjs +6 -0
  55. package/dist/NiceDataMergeBuilder.doc-BcmzKxh2.cjs +6 -0
  56. package/dist/NiceDataMergeBuilder.doc-BvYa4aUJ.js +30 -0
  57. package/dist/NiceDataSnapshot.doc-C73K1biG.cjs +6 -0
  58. package/dist/NiceDataSnapshot.doc-hU7wnOzM.js +30 -0
  59. package/dist/NiceDesktopViews.doc-DJjYlyP2.cjs +1 -0
  60. package/dist/NiceDesktopViews.doc-ly-VUAJj.js +25 -0
  61. package/dist/NiceDeviceControlCard.doc-BZIo92-w.cjs +1 -0
  62. package/dist/NiceDeviceControlCard.doc-DIzZcW9L.js +25 -0
  63. package/dist/NiceDocumentViewer-B9VIVKyw.js +726 -0
  64. package/dist/NiceDocumentViewer-CDXAmPp7.cjs +180 -0
  65. package/dist/NiceDocumentationViewer.doc-BSNGa7a_.js +25 -0
  66. package/dist/NiceDocumentationViewer.doc-CrwlvPFg.cjs +1 -0
  67. package/dist/NiceEnergyChart.doc-DW-jllDV.cjs +1 -0
  68. package/dist/NiceEnergyChart.doc-DnEehTff.js +25 -0
  69. package/dist/NiceFeatureGate.doc-DN17uS_B.cjs +3 -0
  70. package/dist/NiceFeatureGate.doc-DNfFSRrh.js +27 -0
  71. package/dist/NiceForm-BCEXovJR.cjs +1 -0
  72. package/dist/NiceForm-BcN4p2kG.cjs +1 -0
  73. package/dist/NiceForm-D7oyWHXg.js +4820 -0
  74. package/dist/NiceForm-DUhxXArr.js +4817 -0
  75. package/dist/NiceForm-tIXS-M6b.js +4770 -0
  76. package/dist/NiceForm-uCeVmTrD.cjs +1 -0
  77. package/dist/NiceFormItem.doc-BJwEnDz2.js +36 -0
  78. package/dist/NiceFormItem.doc-Ck3PgaPD.cjs +12 -0
  79. package/dist/NiceGantt-CTbqCuwv.cjs +1 -0
  80. package/dist/NiceGantt-Dao7pN9z.js +328 -0
  81. package/dist/NiceGantt.doc-B6YZcJvG.cjs +11 -0
  82. package/dist/NiceGantt.doc-DsI1QXly.js +48 -0
  83. package/dist/NiceGitBlame.doc-BQ2KvGkD.js +30 -0
  84. package/dist/NiceGitBlame.doc-DuTSjZVN.cjs +6 -0
  85. package/dist/NiceGitDiffViewer.doc-D24AGos_.js +30 -0
  86. package/dist/NiceGitDiffViewer.doc-D9FVquBC.cjs +6 -0
  87. package/dist/NiceGitGraph.doc-C-8VGMIz.js +29 -0
  88. package/dist/NiceGitGraph.doc-eRvTmefl.cjs +5 -0
  89. package/dist/NiceGitHooks.doc-DCTVw7HX.cjs +5 -0
  90. package/dist/NiceGitHooks.doc-OCFj5w6v.js +29 -0
  91. package/dist/NiceHtmlEditor-BYk1roA4.cjs +10 -0
  92. package/dist/NiceHtmlEditor-C5kLeF9H.cjs +10 -0
  93. package/dist/NiceHtmlEditor-CFVMIC5L.js +848 -0
  94. package/dist/NiceHtmlEditor-DUwcqj5N.cjs +10 -0
  95. package/dist/NiceHtmlEditor-DiAphF1k.js +889 -0
  96. package/dist/NiceHtmlEditor-mWebBmy1.js +849 -0
  97. package/dist/NiceInstanceMonitor.doc-BSDZp5xa.js +31 -0
  98. package/dist/NiceInstanceMonitor.doc-HVbLufnh.cjs +7 -0
  99. package/dist/NiceLocaleManager.doc-CbVHDEWu.js +25 -0
  100. package/dist/NiceLocaleManager.doc-XH6hMW0Z.cjs +1 -0
  101. package/dist/NiceLockButton.doc-BMhSj3TB.cjs +1 -0
  102. package/dist/NiceLockButton.doc-DvHGhcfm.js +25 -0
  103. package/dist/NiceLoginForm-BHyDY7br.cjs +1 -0
  104. package/dist/NiceLoginForm-BuxFY2Rk.js +750 -0
  105. package/dist/NiceLoginForm-DQe77Isv.js +747 -0
  106. package/dist/NiceLoginForm-NBCo-DUZ.cjs +1 -0
  107. package/dist/NiceLoginForm.css +1 -0
  108. package/dist/NiceMAM.doc-CsQ57saR.cjs +8 -0
  109. package/dist/NiceMAM.doc-hjW7buTH.js +32 -0
  110. package/dist/NiceMention--3P3vO-W.cjs +430 -0
  111. package/dist/NiceMention-CA7CL5BI.js +11263 -0
  112. package/dist/NiceMention-CHcKRl-L.cjs +430 -0
  113. package/dist/NiceMention-Co2cqkVM.js +11316 -0
  114. package/dist/NiceMention-DJD0BLcp.js +11269 -0
  115. package/dist/NiceMention-DcaUEMSg.cjs +430 -0
  116. package/dist/NiceMention.css +1 -1
  117. package/dist/NiceModal-C4p8a82e.cjs +1 -0
  118. package/dist/NiceModal-TNlkaL_i.js +85 -0
  119. package/dist/NiceModuleLifecyclePanel-BWbKdVC_.js +7054 -0
  120. package/dist/NiceModuleLifecyclePanel-CZHIzvkE.cjs +1 -0
  121. package/dist/NiceModuleLifecyclePanel-DV3F_QdI.cjs +1 -0
  122. package/dist/NiceModuleLifecyclePanel-OC9YK2kG.js +7052 -0
  123. package/dist/NiceModuleLifecyclePanel-_OcfDmtC.cjs +1 -0
  124. package/dist/NiceModuleLifecyclePanel-gaZkIEtK.js +6825 -0
  125. package/dist/NiceModuleLifecyclePanel.css +1 -1
  126. package/dist/NiceNetworkDiscoveryPanel.doc-B0RtGaS3.js +25 -0
  127. package/dist/NiceNetworkDiscoveryPanel.doc-BFgFZI5G.cjs +1 -0
  128. package/dist/NicePagination-8XsBbMNx.js +165 -0
  129. package/dist/NicePagination-B3nZDZem.js +165 -0
  130. package/dist/NicePagination-B8rg1Y67.cjs +1 -0
  131. package/dist/NicePagination-CkOoXf0f.js +165 -0
  132. package/dist/NicePagination-D7lek1G7.cjs +1 -0
  133. package/dist/NicePagination-OjTEfZJE.cjs +1 -0
  134. package/dist/NicePipelineEditor.doc-CjqDKe2x.js +29 -0
  135. package/dist/NicePipelineEditor.doc-DZ0pTVTp.cjs +5 -0
  136. package/dist/NicePipelineMonitor.doc-C88-TagI.cjs +5 -0
  137. package/dist/NicePipelineMonitor.doc-CFtH4XJx.js +29 -0
  138. package/dist/NicePivotGrid-BJRSciWl.js +1183 -0
  139. package/dist/NicePivotGrid-BaZa2YZW.js +1157 -0
  140. package/dist/NicePivotGrid-CS1dPmNI.cjs +152 -0
  141. package/dist/NicePivotGrid-D2AxqDzJ.js +1183 -0
  142. package/dist/NicePivotGrid-DxQ6Py9D.cjs +152 -0
  143. package/dist/NicePivotGrid-DyOPhPO8.cjs +152 -0
  144. package/dist/NiceRoomGrid.doc-DJPVUQVg.cjs +8 -0
  145. package/dist/NiceRoomGrid.doc-DLHJS_Wb.js +32 -0
  146. package/dist/NiceSavedQueryPanel-B5HhqlAI.cjs +586 -0
  147. package/dist/NiceSavedQueryPanel-BC84uRfh.cjs +586 -0
  148. package/dist/NiceSavedQueryPanel-CMStDOKe.js +5125 -0
  149. package/dist/NiceSavedQueryPanel-CMfcODIO.js +5120 -0
  150. package/dist/NiceSavedQueryPanel-D2i34e_b.cjs +586 -0
  151. package/dist/NiceSavedQueryPanel-mPO2THs7.js +5142 -0
  152. package/dist/NiceSavedQueryPanel.css +1 -1
  153. package/dist/NiceSceneBar.doc-09sc3yuF.cjs +1 -0
  154. package/dist/NiceSceneBar.doc-DLePMuVU.js +25 -0
  155. package/dist/NiceSceneSelector.doc-CPzCAy-d.cjs +7 -0
  156. package/dist/NiceSceneSelector.doc-FCLZvPc0.js +31 -0
  157. package/dist/NiceScheduler-7gP7vcLy.cjs +5 -0
  158. package/dist/NiceScheduler-BAJRzFQN.js +1690 -0
  159. package/dist/NiceScheduler-Cy7F9tgH.js +1693 -0
  160. package/dist/NiceScheduler-DquRUZxD.cjs +5 -0
  161. package/dist/NiceScheduler-dJ7gHDv7.cjs +5 -0
  162. package/dist/NiceScheduler-l8N4yCWd.js +1716 -0
  163. package/dist/NiceSchedulerViews.doc-C9opZpgg.cjs +1 -0
  164. package/dist/NiceSchedulerViews.doc-Dy7ZH1iL.js +25 -0
  165. package/dist/NiceSelect-CZR8Zu_k.js +420 -0
  166. package/dist/NiceSelect-DIKGbaJo.cjs +1 -0
  167. package/dist/NiceSelect-DZB1Rs9x.js +435 -0
  168. package/dist/NiceSelect-tMz9QQUs.cjs +1 -0
  169. package/dist/NiceSensorGaugePanel.doc-BHirbWLn.cjs +8 -0
  170. package/dist/NiceSensorGaugePanel.doc-DjKmooI6.js +32 -0
  171. package/dist/NiceSpotlight.doc-BVZFfDVI.cjs +10 -0
  172. package/dist/NiceSpotlight.doc-JqwkzrEm.js +34 -0
  173. package/dist/NiceStateDesigner.doc-CfnwiwfU.js +29 -0
  174. package/dist/NiceStateDesigner.doc-DV4zEC50.cjs +5 -0
  175. package/dist/NiceStepper.doc-5VjaLM6r.js +31 -0
  176. package/dist/NiceStepper.doc-f8lYpr33.cjs +7 -0
  177. package/dist/NiceStreamDashboard.doc-74KUXya1.cjs +8 -0
  178. package/dist/NiceStreamDashboard.doc-k8PQfCM0.js +32 -0
  179. package/dist/NiceTaskInbox.doc-CHrxthqp.js +32 -0
  180. package/dist/NiceTaskInbox.doc-CdCTfgBq.cjs +8 -0
  181. package/dist/NiceTestBuilder.doc-BoBzLfa0.js +30 -0
  182. package/dist/NiceTestBuilder.doc-Cj1fNTvk.cjs +6 -0
  183. package/dist/NiceTranscoder.doc-Dnirl3wg.cjs +7 -0
  184. package/dist/NiceTranscoder.doc-cInCYZh7.js +31 -0
  185. package/dist/NiceVideoAnnotator.doc-C1iEi7OM.cjs +7 -0
  186. package/dist/NiceVideoAnnotator.doc-C8zyfKH_.js +31 -0
  187. package/dist/NiceVideoEditor.doc-C6mhEb-q.cjs +7 -0
  188. package/dist/NiceVideoEditor.doc-lrwmKjqj.js +31 -0
  189. package/dist/NiceWindow-BEov3s9F.js +2094 -0
  190. package/dist/NiceWindow-CDt6PCEg.cjs +1 -0
  191. package/dist/NiceWindow-CWN8OCHF.js +2109 -0
  192. package/dist/NiceWindow-Dd8qjkIW.cjs +1 -0
  193. package/dist/NiceWindow.css +1 -1
  194. package/dist/charts-Bo2WAI5T.cjs +768 -0
  195. package/dist/charts-ByrdMeQP.js +4767 -0
  196. package/dist/charts-C047IMVn.cjs +768 -0
  197. package/dist/charts-CCXSb3xk.js +4752 -0
  198. package/dist/charts-CqETcUhH.js +4752 -0
  199. package/dist/charts-DouiiHOT.cjs +768 -0
  200. package/dist/charts.cjs +1 -1
  201. package/dist/charts.css +1 -1
  202. package/dist/charts.d.ts +28 -18
  203. package/dist/charts.mjs +1 -1
  204. package/dist/core-B8eBUE4m.js +438 -0
  205. package/dist/core-BL-KmGYC.js +795 -0
  206. package/dist/core-Chg-oYCr.cjs +1 -0
  207. package/dist/core-CxBnKAhs.cjs +1 -0
  208. package/dist/core-D_LRh59n.js +795 -0
  209. package/dist/core-lBFqvT0V.cjs +1 -0
  210. package/dist/core-lazy-Bh2yg4Et.js +351 -0
  211. package/dist/core-lazy-CkWKjfc6.cjs +1 -0
  212. package/dist/data-branching-Dak1_ZKR.cjs +1 -0
  213. package/dist/data-branching-DiLAO4Qt.js +6386 -0
  214. package/dist/data-branching-Km4lc8P_.cjs +1 -0
  215. package/dist/data-branching-YQtJJEtn.js +6273 -0
  216. package/dist/data-branching.cjs +1 -1
  217. package/dist/data-branching.mjs +1 -1
  218. package/dist/data.cjs +1 -1
  219. package/dist/data.d.ts +22 -69
  220. package/dist/data.mjs +3 -3
  221. package/dist/devops-D5yIDM3e.js +8312 -0
  222. package/dist/devops-DkVluHBp.cjs +17 -0
  223. package/dist/devops-rVpB0ZAX.cjs +17 -0
  224. package/dist/devops-zsMUueTd.js +8648 -0
  225. package/dist/devops.cjs +1 -1
  226. package/dist/devops.d.ts +3 -3
  227. package/dist/devops.mjs +1 -1
  228. package/dist/editors.cjs +1 -1
  229. package/dist/editors.d.ts +106 -63
  230. package/dist/editors.mjs +55 -54
  231. package/dist/feedback.cjs +1 -1
  232. package/dist/feedback.d.ts +76 -2
  233. package/dist/feedback.mjs +10 -9
  234. package/dist/index.cjs +261 -261
  235. package/dist/index.css +1 -1
  236. package/dist/index.d.ts +831 -433
  237. package/dist/index.mjs +27339 -26540
  238. package/dist/injectStyleOnce-BzC_BCs_.js +9 -0
  239. package/dist/injectStyleOnce-DeWaxcdf.cjs +1 -0
  240. package/dist/lazy.cjs +1 -1
  241. package/dist/lazy.d.ts +9 -7
  242. package/dist/lazy.mjs +55 -55
  243. package/dist/navigation.cjs +1 -1
  244. package/dist/navigation.css +1 -0
  245. package/dist/navigation.d.ts +99 -43
  246. package/dist/navigation.mjs +504 -547
  247. package/dist/no-code-6WyYb3hL.cjs +331 -0
  248. package/dist/no-code-BH5oVFC6.js +8186 -0
  249. package/dist/no-code-CnHG5_Vn.js +8186 -0
  250. package/dist/no-code-DMKlg1Zl.cjs +331 -0
  251. package/dist/no-code-DiTEnuRv.js +8288 -0
  252. package/dist/no-code-wG9c0z_T.cjs +331 -0
  253. package/dist/no-code.cjs +1 -1
  254. package/dist/no-code.css +1 -1
  255. package/dist/no-code.d.ts +25 -18
  256. package/dist/no-code.mjs +3 -3
  257. package/dist/overlays.cjs +1 -1
  258. package/dist/overlays.d.ts +36 -30
  259. package/dist/overlays.mjs +24 -490
  260. package/dist/pickerCommons-0vyK1Knv.js +547 -0
  261. package/dist/pickerCommons-BCRiHDE_.cjs +1 -0
  262. package/dist/pickerCommons-BFbItm8o.cjs +1 -0
  263. package/dist/pickerCommons-BHirHJyn.js +548 -0
  264. package/dist/pickerCommons-Bt8JIaTN.cjs +1 -0
  265. package/dist/pickerCommons-DkumQ3KE.js +548 -0
  266. package/dist/pickerCommons.css +1 -1
  267. package/dist/style.css +15 -9
  268. package/package.json +4 -6
  269. package/css/legacy-bg-text-aliases.css +0 -87
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),m=require("@nice2dev/ui-core"),t=require("react"),jn=require("./NiceColorPicker-DCgmE-3H.cjs"),xn=require("./pickerCommons-Bt8JIaTN.cjs"),ct=require("react-dom"),kn=require("./NiceSelect-tMz9QQUs.cjs"),qe=require("./no-code-DMKlg1Zl.cjs"),Nt=require("./core-Chg-oYCr.cjs");function vt({text:n,query:a}){if(!a)return e.jsx(e.Fragment,{children:n});const i=n.toLowerCase().indexOf(a.toLowerCase());return i<0?e.jsx(e.Fragment,{children:n}):e.jsxs("span",{children:[n.slice(0,i),e.jsx("strong",{children:n.slice(i,i+a.length)}),n.slice(i+a.length)]})}const Mt=[],ot=({options:n=Mt,value:a,defaultValue:i,onChange:o,minSearchLength:s=1,maxResults:r=10,onSearch:d,clearable:N,loading:$,multiple:D,renderOption:ce,highlightMatch:T=!0,showAll:w=!0,menuGap:Z,label:ae,error:O,helperText:A,required:j,disabled:ne,readOnly:X,size:B="md",id:ue,className:oe,style:M,accessMode:F,showKeyboardHints:L,displayStyle:I,labelPlacement:J,errorPlacement:S,labelWidth:te,controlWidth:U})=>{m.useComponentDisplayStyle("input",I),m.useComponentDisplayClass("input",I);const H=m.useNiceAccessMode(F,ue),pe=H==="hidden";(H==="disabled"||H==="readOnly")&&(ne=!0);const y=m.useControlId(ue),{t:f}=m.useNiceTranslation(),[h,W]=m.useControllableState({value:a,defaultValue:i,fallbackValue:D?[]:"",onChange:o,componentName:"NiceAutocomplete"}),K=t.useMemo(()=>D?Array.isArray(h)?h:h?[h]:[]:[],[h,D]),[C,b]=t.useState(()=>D||Array.isArray(h)?"":n.find(_=>String(_.value)===h)?.label??h??""),[q,z]=t.useState(!1),le=t.useRef(null),[Q,se]=t.useState(-1),de=t.useRef(null),fe=t.useRef(null),{popupRef:ie,coords:E,ready:Ce,themeClass:Y,portalTarget:_e}=kn.useAnchoredPopup(q,le,()=>z(!1)),G=t.useMemo(()=>{const _=[m.COMMON_SHORTCUTS.moveDown,m.COMMON_SHORTCUTS.moveUp,m.COMMON_SHORTCUTS.submit,m.COMMON_SHORTCUTS.cancel];return D&&_.push({key:"Backspace",description:f("shortcuts.removeLastTag","Remove last tag")}),_},[D,f]);t.useEffect(()=>{D||b(Array.isArray(h)?"":n.find(_=>String(_.value)===h)?.label??h??"")},[h,D,n]);const Me=t.useMemo(()=>{if(C.length<s)return w?(d?n:[...n].sort((Ne,He)=>Ne.label.localeCompare(He.label))).slice(0,r):[];if(d)return n.slice(0,r);const _=C.toLowerCase();return n.filter(u=>u.label.toLowerCase().includes(_)).slice(0,r)},[n,C,s,r,d,w]),g=t.useMemo(()=>{const _=new Map;for(const u of Me){const Ne=u.group||"";_.has(Ne)||_.set(Ne,[]),_.get(Ne).push(u)}return _},[Me]),k=t.useCallback(_=>{X||(b(_),z(_.length>=s),se(0),d?.(_))},[s,d,X]),P=t.useCallback(_=>{if(!X)if(D){const u=String(_.value),Ne=K.includes(u)?K.filter(He=>He!==u):[...K,u];W(Ne),b("")}else b(_.label),W(String(_.value)),z(!1)},[W,D,K,X]),De=_=>{if(!X){if(D&&_.key==="Backspace"&&!C&&K.length>0){W(K.slice(0,-1));return}if(!q&&(_.key==="ArrowDown"||_.key==="ArrowUp")){_.preventDefault(),z(!0),se(0);return}q&&(_.key==="ArrowDown"?(_.preventDefault(),se(u=>u<0?0:Math.min(u+1,Me.length-1))):_.key==="ArrowUp"?(_.preventDefault(),se(u=>u<=0?Me.length-1:u-1)):(_.key==="Enter"||_.key==="Tab")&&Q>=0&&Q<Me.length?(_.preventDefault(),P(Me[Q])):_.key==="Escape"&&z(!1))}},me=t.useCallback(_=>{X||W(K.filter(u=>u!==_))},[K,W,X]);return pe?null:e.jsxs("div",{className:`nice-field nice-field--${B} ${J==="left"?"nice-field--label-left":""} ${$?"nice-field--loading":""} ${oe||""}`,style:{width:"fit-content",...M,...te!=null&&{"--nice-field-label-width":typeof te=="number"?`${te}px`:te},...U!=null&&{"--nice-field-control-width":typeof U=="number"?`${U}px`:U},...Z!=null&&{"--nice-dropdown-gap":`${Z}px`}},ref:de,"aria-busy":$||void 0,children:[ae&&e.jsxs("label",{className:`nice-field__label ${j?"nice-field__label--required":""}`,htmlFor:y,children:[ae,L&&e.jsx(m.NiceKeyboardHint,{shortcuts:G,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",style:{position:"relative"},children:[e.jsx("div",{ref:le,className:`nice-input nice-input--${B} ${O?"nice-input--error":""} ${ne?"nice-input--disabled":""}`,style:{width:"220px"},children:e.jsxs("div",{className:"nice-field__input-wrap",style:{display:"flex",flexWrap:D?"wrap":"nowrap",gap:4,alignItems:"center",flex:1,minWidth:0},children:[D&&K.map(_=>{const u=n.find(Ne=>String(Ne.value)===_);return e.jsxs("span",{className:"nice-autocomplete__tag",children:[u?.label||_,!X&&e.jsx("button",{type:"button",className:"nice-autocomplete__tag-remove",onClick:()=>me(_),"aria-label":f("controls.remove","Remove"),children:e.jsx(m.NiceIcon,{name:"close",size:14})})]},_)}),e.jsx("input",{ref:fe,id:y,type:"text",className:"nice-input__native",value:C,onChange:_=>k(_.target.value),onFocus:()=>!X&&(w||C.length>=s)&&z(!0),onKeyDown:De,disabled:ne,readOnly:X,required:j,role:"combobox","aria-expanded":q,"aria-autocomplete":"list",autoComplete:"off",style:{flex:1,minWidth:60,border:"none",outline:"none",background:"transparent",color:"inherit",padding:0,font:"inherit"}}),N&&!D&&C&&!ne&&!X&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:()=>{b(""),W("")},"aria-label":f("controls.clear","Clear"),children:e.jsx(m.NiceIcon,{name:"close",size:14})})]})}),q&&Me.length>0&&E&&_e&&ct.createPortal(e.jsx("ul",{ref:ie,className:`nice-dropdown__list${Y?` ${Y}`:""}`,"data-theme":Y==="nice-dark"?"dark":Y==="nice-light"?"light":void 0,role:"listbox",style:{position:"fixed",left:E.left,top:E.top,width:E.width,minWidth:E.width,zIndex:1e3,opacity:Ce?1:0,pointerEvents:Ce?void 0:"none"},children:Array.from(g.entries()).map(([_,u])=>e.jsxs(t.Fragment,{children:[_&&e.jsx("li",{className:"nice-dropdown__group-label",children:_}),u.map(Ne=>{const Be=Me.indexOf(Ne)===Q,Ee=D&&K.includes(String(Ne.value));return e.jsx("li",{role:"option",className:`nice-dropdown__option ${Be?"nice-dropdown__option--active":""} ${Ee?"nice-dropdown__option--selected":""}`,onMouseDown:ee=>{ee.preventDefault(),P(Ne)},"aria-selected":Be,children:ce?ce(Ne,C):T?e.jsx(vt,{text:Ne.label,query:C}):Ne.label},String(Ne.value))})]},_))}),_e),$&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),S==="right"&&O&&e.jsx("div",{id:`${y}-error`,className:"nice-field__error",role:"alert",children:O}),S==="right"&&!O&&A&&e.jsx("div",{id:`${y}-helper`,className:"nice-field__helper",children:A})]}),S!=="right"&&O&&e.jsx("div",{id:`${y}-error`,className:"nice-field__error",role:"alert",children:O}),S!=="right"&&!O&&A&&e.jsx("div",{id:`${y}-helper`,className:"nice-field__helper",children:A})]})},rt={phone:"(999) 999-9999","credit-card":"9999 9999 9999 9999",date:"99/99/9999",ssn:"999-99-9999",zip:"99-999",time:"99:99",iban:"aa99 9999 9999 9999 9999 9999"};function jt(n){return[...n].map(a=>a==="9"?{type:"digit"}:a==="a"?{type:"letter"}:a==="*"?{type:"alphanum"}:{type:"literal",literal:a})}function kt(n,a){return a.type==="digit"?/\d/.test(n):a.type==="letter"?/[a-zA-Z]/.test(n):a.type==="alphanum"?/[a-zA-Z0-9]/.test(n):!1}function et(n,a,i){let o=0,s="";for(const r of a)r.type==="literal"?s+=r.literal:o<n.length?(s+=n[o],o++):s+=i;return s}function $t(n,a){return n.map(i=>i.type==="literal"?i.literal:a).join("")}const Hn=t.forwardRef(({label:n,helperText:a,error:i,required:o,disabled:s,readOnly:r,size:d="md",name:N,id:$,className:D,style:ce,value:T="",onChange:w,onBlur:Z,onKeyDown:ae,mask:O,maskPreset:A,maskChar:j="_",placeholder:ne,showMaskAsPlaceholder:X=!0,clearable:B=!1,autoFocus:ue,labelPlacement:oe,errorPlacement:M,loading:F,labelWidth:L,controlWidth:I,...J},S)=>{const{t:te}=m.useNiceTranslation(),U=m.useControlId($),H=t.useRef(null),[pe,y]=t.useState(!1),f=O||(A?rt[A]:"")||"999",h=t.useMemo(()=>jt(f),[f]),W=t.useMemo(()=>et(T,h,j),[T,h,j]),K=pe||T?W:"",C=ne??(X?$t(h,j):void 0),b=t.useCallback(fe=>{H.current=fe,typeof S=="function"?S(fe):S&&(S.current=fe)},[S]),q=t.useCallback(fe=>{const ie=et(fe,h,j);w?.(fe,ie)},[w,h,j]),z=t.useCallback(fe=>{const ie=fe.currentTarget,E=ie.value,Ce=ie.selectionStart??E.length;let Y="",_e=0;for(let G=0;G<E.length&&_e<h.length;G++){const Me=E[G];for(;_e<h.length&&h[_e].type==="literal";)_e++;if(_e>=h.length)break;kt(Me,h[_e])&&(Y+=Me,_e++)}q(Y),requestAnimationFrame(()=>{let G=0,Me=0;for(let g=0;g<h.length;g++){if(h[g].type==="literal")G=g+1;else if(Me<Y.length)Me++,G=g+1;else{G=g;break}if(G>=Ce&&Me>=Y.length)break}Me>=Y.length&&Y.length>0&&(G=Math.min(G,h.length)),ie.setSelectionRange(G,G)})},[h,q]),le=t.useCallback(fe=>{if(fe.key==="Backspace"&&T.length>0){fe.preventDefault();const ie=T.slice(0,-1);q(ie)}ae?.(fe)},[T,q,ae]),Q=t.useCallback(()=>y(!0),[]),se=t.useCallback(fe=>{y(!1),Z?.(fe)},[Z]),de=t.useCallback(()=>{q(""),H.current?.focus()},[q]);return e.jsxs("div",{className:`nice-field nice-field--masked nice-field--${d} ${oe==="left"?"nice-field--label-left":""} ${F?"nice-field--loading":""} ${D||""}`,style:{...ce,...L!=null&&{"--nice-field-label-width":typeof L=="number"?`${L}px`:L},...I!=null&&{"--nice-field-control-width":typeof I=="number"?`${I}px`:I}},"aria-busy":F||void 0,children:[n&&e.jsx("label",{htmlFor:U,className:`nice-field__label ${o?"nice-field__label--required":""}`,children:n}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("div",{className:`nice-input nice-input--${d} ${i?"nice-input--error":""} ${s?"nice-input--disabled":""} ${r?"nice-input--readonly":""}`,style:{width:"fit-content",minWidth:0},children:[e.jsx("input",{ref:b,id:U,className:"nice-input__native nice-masked-input",type:"text",name:N,value:K,placeholder:C,disabled:s||F,readOnly:r,autoFocus:ue,style:{width:`${f.length}ch`,minWidth:0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontVariantNumeric:"tabular-nums"},"aria-invalid":!!i,"aria-describedby":i?`${U}-error`:a?`${U}-helper`:void 0,onInput:z,onChange:()=>{},onKeyDown:le,onFocus:Q,onBlur:se,...J}),B&&T&&e.jsx("button",{type:"button",className:"nice-input__clear",disabled:s||r,onClick:de,"aria-label":te("controls.clear","Clear"),children:e.jsx(m.NiceIcon,{name:"close",size:14})})]}),F&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),M==="right"&&i&&e.jsx("div",{id:`${U}-error`,className:"nice-field__error",role:"alert",children:i}),M==="right"&&!i&&a&&e.jsx("div",{id:`${U}-helper`,className:"nice-field__helper",children:a})]}),M!=="right"&&i&&e.jsx("div",{id:`${U}-error`,className:"nice-field__error",role:"alert",children:i}),M!=="right"&&!i&&a&&e.jsx("div",{id:`${U}-helper`,className:"nice-field__helper",children:a})]})});Hn.displayName="NiceMaskedInput";const wt=[{id:"length",label:"At least 8 characters",test:n=>n.length>=8},{id:"uppercase",label:"At least one uppercase letter",test:n=>/[A-Z]/.test(n)},{id:"lowercase",label:"At least one lowercase letter",test:n=>/[a-z]/.test(n)},{id:"digit",label:"At least one digit",test:n=>/\d/.test(n)},{id:"special",label:"At least one special character",test:n=>/[^a-zA-Z0-9]/.test(n)}];function Tt(n,a){if(!n)return{level:"none",passed:[],ratio:0};const i=a.filter(r=>r.test(n)).map(r=>r.id),o=i.length/a.length;let s="weak";return o>=1?s="strong":o>=.75?s="good":o>=.5&&(s="fair"),{level:s,passed:i,ratio:o}}const zn=t.forwardRef(({label:n,helperText:a,error:i,required:o,disabled:s,readOnly:r,size:d="md",name:N,id:$,className:D,style:ce,value:T="",onChange:w,onBlur:Z,onKeyDown:ae,placeholder:O,maxLength:A,showToggle:j=!0,showStrength:ne=!1,strengthRules:X,validationPlacement:B="bottom",autoFocus:ue,autoComplete:oe,labelPlacement:M,errorPlacement:F,loading:L,labelWidth:I,controlWidth:J,...S},te)=>{const{t:U}=m.useNiceTranslation(),H=m.useControlId($),[pe,y]=t.useState(!1),f=X??wt,h=t.useMemo(()=>ne?Tt(T,f):null,[ne,T,f]),W=t.useCallback(()=>y(C=>!C),[]),K=ne&&h&&T?e.jsxs("div",{className:`nice-password__strength ${B==="right"?"nice-password__strength--right":""}`,children:[e.jsx("div",{className:"nice-password__meter",children:e.jsx("div",{className:`nice-password__meter-fill nice-password__meter-fill--${h.level}`,style:{width:`${h.ratio*100}%`}})}),e.jsx("span",{className:`nice-password__strength-label nice-password__strength-label--${h.level}`,children:U(`password.strength.${h.level}`,h.level.charAt(0).toUpperCase()+h.level.slice(1))}),e.jsx("ul",{className:"nice-password__rules",children:f.map(C=>{const b=h.passed.includes(C.id);return e.jsxs("li",{className:`nice-password__rule ${b?"nice-password__rule--passed":""}`,children:[e.jsx("span",{className:"nice-password__rule-icon",children:e.jsx(m.NiceIcon,{name:b?"check":"close",size:14})}),C.label]},C.id)})})]}):null;return e.jsxs("div",{className:`nice-field nice-field--${d} ${M==="left"?"nice-field--label-left":""} ${L?"nice-field--loading":""} ${D||""}`,style:{...ce,...I!=null&&{"--nice-field-label-width":typeof I=="number"?`${I}px`:I},...J!=null&&{"--nice-field-control-width":typeof J=="number"?`${J}px`:J}},"aria-busy":L||void 0,children:[n&&e.jsx("label",{htmlFor:H,className:`nice-field__label ${o?"nice-field__label--required":""}`,style:B==="right"&&M==="left"?{alignSelf:"flex-start",paddingTop:6}:void 0,children:n}),e.jsxs("div",{className:"nice-field__control",style:B==="right"?{alignItems:"flex-start"}:void 0,children:[e.jsxs("div",{style:B==="right"?{display:"flex",flexDirection:"column",flex:"1 1 auto",minWidth:0}:{display:"contents"},children:[e.jsxs("div",{className:`nice-input nice-input--${d} ${i?"nice-input--error":""} ${s?"nice-input--disabled":""} ${r?"nice-input--readonly":""}`,children:[e.jsx("input",{ref:te,id:H,className:"nice-input__native",type:pe?"text":"password",name:N,value:T,placeholder:O,disabled:s||L,readOnly:r,maxLength:A,autoFocus:ue,autoComplete:oe,"aria-invalid":!!i,"aria-describedby":i?`${H}-error`:a?`${H}-helper`:void 0,onChange:C=>w?.(C.target.value),onBlur:Z,onKeyDown:ae,...S}),j&&e.jsx("button",{type:"button",className:"nice-password__toggle",onClick:W,disabled:s,tabIndex:-1,"aria-label":pe?U("password.hide","Hide password"):U("password.show","Show password"),children:e.jsx(m.NiceIcon,{name:pe?"eye-off":"eye",size:18})})]}),B==="right"&&F!=="right"&&i&&e.jsx("div",{id:`${H}-error`,className:"nice-field__error",role:"alert",children:i}),B==="right"&&F!=="right"&&!i&&a&&e.jsx("div",{id:`${H}-helper`,className:"nice-field__helper",children:a})]}),L&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),B==="right"&&K,F==="right"&&i&&e.jsx("div",{id:`${H}-error`,className:"nice-field__error",role:"alert",children:i}),F==="right"&&!i&&a&&e.jsx("div",{id:`${H}-helper`,className:"nice-field__helper",children:a})]}),B!=="right"&&K,B!=="right"&&F!=="right"&&i&&e.jsx("div",{id:`${H}-error`,className:"nice-field__error",role:"alert",children:i}),B!=="right"&&F!=="right"&&!i&&a&&e.jsx("div",{id:`${H}-helper`,className:"nice-field__helper",children:a})]})});zn.displayName="NicePasswordInput";const Pn=({label:n,helperText:a,error:i,required:o,disabled:s,size:r="md",name:d,id:N,className:$,style:D,accessMode:ce,options:T,value:w,onChange:Z,direction:ae="horizontal",showKeyboardHints:O,displayStyle:A,labelPlacement:j,errorPlacement:ne,labelWidth:X,controlWidth:B,loading:ue,readOnly:oe})=>{m.useComponentDisplayClass("toggle",A);const M=m.useNiceAccessMode(ce,N),F=M==="hidden";(M==="disabled"||M==="readOnly")&&(s=!0);const{t:L}=m.useNiceTranslation(),I=m.useControlId(N),J=d||I,S=t.useMemo(()=>[{key:"ArrowUp",description:L("shortcuts.previousOption","Previous option")},{key:"ArrowDown",description:L("shortcuts.nextOption","Next option")},{key:"Space",description:L("shortcuts.select","Select")}],[L]);return F?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--inline-block nice-field--${r} ${j==="left"?"nice-field--label-left":""} ${ne==="right"?"nice-field--error-right":""} ${ue?"nice-field--loading":""} ${$||""}`,style:{...D,...X!=null&&{"--nice-field-label-width":typeof X=="number"?`${X}px`:X},...B!=null&&{"--nice-field-control-width":typeof B=="number"?`${B}px`:B}},role:"radiogroup","aria-labelledby":`${I}-label`,"aria-busy":ue||void 0,children:[n&&e.jsxs("span",{id:`${I}-label`,className:`nice-field__label ${o?"nice-field__label--required":""}`,children:[n,O&&e.jsx(m.NiceKeyboardHint,{shortcuts:S,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[e.jsx("div",{className:`nice-radio-group ${ae==="vertical"?"nice-radio-group--vertical":""}`,children:T.map(te=>e.jsxs("label",{className:`nice-radio ${s||te.disabled||ue?"nice-radio--disabled":""} ${oe?"nice-radio--readonly":""}`,children:[e.jsx("input",{type:"radio",className:"nice-radio__input",name:J,value:te.value,checked:w===te.value,disabled:s||te.disabled||ue,"aria-readonly":oe||void 0,onChange:()=>{oe||Z?.(te.value)}}),e.jsx("span",{className:"nice-radio__circle",children:e.jsx("span",{className:"nice-radio__dot"})}),e.jsx("span",{children:te.label})]},te.value))}),ue&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),ne==="right"&&i&&e.jsx("div",{id:`${I}-error`,className:"nice-field__error",role:"alert",children:i}),ne==="right"&&!i&&a&&e.jsx("div",{id:`${I}-helper`,className:"nice-field__helper",children:a})]}),ne!=="right"&&i&&e.jsx("div",{id:`${I}-error`,className:"nice-field__error",role:"alert",children:i}),ne!=="right"&&!i&&a&&e.jsx("div",{id:`${I}-helper`,className:"nice-field__helper",children:a})]})},St=Object.freeze(Object.defineProperty({__proto__:null,NiceRadioGroup:Pn},Symbol.toStringTag,{value:"Module"})),Dt=({filled:n,size:a})=>e.jsxs("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n==="half"&&e.jsx("defs",{children:e.jsxs("linearGradient",{id:"halfGrad",children:[e.jsx("stop",{offset:"50%",stopColor:"currentColor"}),e.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),e.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z",fill:n==="full"?"currentColor":n==="half"?"url(#halfGrad)":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]}),Rt={xxs:10,xs:14,sm:18,md:22,lg:28,xl:34,xxl:42,small:18,medium:22,large:28},$n=t.forwardRef(({value:n=0,onChange:a,count:i=5,half:o=!1,readOnly:s=!1,disabled:r=!1,size:d="md",label:N,icon:$,name:D,error:ce,helperText:T,required:w,id:Z,className:ae,style:O,labelPlacement:A,errorPlacement:j,labelWidth:ne,controlWidth:X,valuePlacement:B="none",valueTemplate:ue,loading:oe,...M},F)=>{const{t:L}=m.useNiceTranslation(),I=m.useControlId(Z),[J,S]=t.useState(null),te=Rt[d],U=!s&&!r&&!oe,H=J??n,pe=C=>H>=C+1?"full":o&&H>=C+.5?"half":"empty",y=t.useCallback((C,b)=>{if(!U)return;const q=b&&o?C+.5:C+1;a?.(q===n?0:q)},[U,o,a,n]),f=t.useCallback((C,b)=>{if(U)if(o){const q=b.currentTarget.getBoundingClientRect(),z=b.clientX-q.left<q.width/2;S(z?C+.5:C+1)}else S(C+1)},[U,o]),h=t.useCallback(()=>{U&&S(null)},[U]),W=t.useCallback(C=>{if(!U)return;const b=o?.5:1;if(C.key==="ArrowRight"||C.key==="ArrowUp"){C.preventDefault();const q=Math.min(i,n+b);a?.(q)}else if(C.key==="ArrowLeft"||C.key==="ArrowDown"){C.preventDefault();const q=Math.max(0,n-b);a?.(q)}},[U,o,i,n,a]),K=ue?ue.replace("{value}",String(n)):String(n);return e.jsxs("div",{className:`nice-field nice-field--${d} ${A==="left"?"nice-field--label-left":""} ${oe?"nice-field--loading":""} ${ae||""}`,style:{...O,...ne!=null&&{"--nice-field-label-width":typeof ne=="number"?`${ne}px`:ne},...X!=null&&{"--nice-field-control-width":typeof X=="number"?`${X}px`:X}},"aria-busy":oe||void 0,...M,children:[N&&e.jsx("label",{htmlFor:I,className:`nice-field__label ${w?"nice-field__label--required":""}`,children:N}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("div",{ref:F,id:I,className:`nice-rating nice-rating--${d} ${r?"nice-rating--disabled":""} ${s?"nice-rating--readonly":""}`,role:"slider","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":i,"aria-label":N||L("controls.rating","Rating"),"aria-invalid":!!ce,tabIndex:U?0:-1,onMouseLeave:h,onKeyDown:W,children:[D&&e.jsx("input",{type:"hidden",name:D,value:n}),Array.from({length:i},(C,b)=>{const q=pe(b);return e.jsx("span",{className:`nice-rating__star nice-rating__star--${q}`,onClick:z=>{if(!U)return;const le=z.currentTarget.getBoundingClientRect(),Q=o&&z.clientX-le.left<le.width/2;y(b,Q)},onMouseMove:z=>f(b,z),"aria-label":`${b+1} ${L("controls.star","star")}`,children:$?$(q):e.jsx(Dt,{filled:q,size:te})},b)}),oe&&e.jsx("span",{className:"nice-rating__loading",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})})]}),B==="right"&&!oe&&e.jsx("span",{className:"nice-rating__value",children:K}),B==="bottom"&&!oe&&e.jsx("div",{className:"nice-rating__value nice-rating__value--bottom",children:K}),j==="right"&&ce&&e.jsx("div",{id:`${I}-error`,className:"nice-field__error",role:"alert",children:ce}),j==="right"&&!ce&&T&&e.jsx("div",{id:`${I}-helper`,className:"nice-field__helper",children:T})]}),j!=="right"&&ce&&e.jsx("div",{id:`${I}-error`,className:"nice-field__error",role:"alert",children:ce}),j!=="right"&&!ce&&T&&e.jsx("div",{id:`${I}-helper`,className:"nice-field__helper",children:T})]})});$n.displayName="NiceRating";const At=Object.freeze(Object.defineProperty({__proto__:null,NiceRating:$n},Symbol.toStringTag,{value:"Module"})),wn=t.forwardRef(({label:n,helperText:a,error:i,required:o,disabled:s,id:r,className:d,style:N,accessMode:$,value:D=0,onChange:ce,min:T=0,max:w=100,step:Z=1,showValue:ae=!0,showMinMax:O=!1,formatValue:A,showKeyboardHints:j,displayStyle:ne,size:X="md",labelPlacement:B,errorPlacement:ue,labelWidth:oe,controlWidth:M,loading:F,showTicks:L=!1,tickInterval:I,maxTicks:J=21,showTickLabels:S=!1},te)=>{m.useComponentDisplayClass("input",ne);const U=m.useNiceAccessMode($,r),H=U==="hidden";(U==="disabled"||U==="readOnly")&&(s=!0);const{t:pe}=m.useNiceTranslation(),y=m.useControlId(r),f=t.useMemo(()=>(D-T)/(w-T)*100,[D,T,w]),h=A?A(D):D.toString(),W=t.useMemo(()=>{if(!L)return[];const b=w-T;if(b<=0)return[T,w];let q=I??Z,z=Math.floor(b/q)+1;return z>J&&(q=b/(J-1),z=J),Array.from({length:z},(le,Q)=>{const se=T+Q*q;return Q===z-1?w:se})},[L,T,w,Z,I,J]),K=t.useMemo(()=>[m.COMMON_SHORTCUTS.increment,m.COMMON_SHORTCUTS.decrement,m.COMMON_SHORTCUTS.first,m.COMMON_SHORTCUTS.last,m.COMMON_SHORTCUTS.incrementBig,m.COMMON_SHORTCUTS.decrementBig],[]),C=B==="left";return H?null:e.jsxs("div",{className:`nice-field nice-field--${X} ${C?"nice-field--label-left":""} ${F?"nice-field--loading":""} ${d||""}`,style:{...N,...oe!=null&&{"--nice-field-label-width":typeof oe=="number"?`${oe}px`:oe},...M!=null&&{"--nice-field-control-width":typeof M=="number"?`${M}px`:M}},"aria-busy":F||void 0,children:[C?n&&e.jsxs("label",{htmlFor:y,className:`nice-field__label ${o?"nice-field__label--required":""}`,children:[n,j&&e.jsx(m.NiceKeyboardHint,{shortcuts:K,size:"sm"})]}):(n||ae||j)&&e.jsxs("div",{className:"nice-slider__header",children:[n?e.jsxs("label",{htmlFor:y,className:`nice-field__label ${o?"nice-field__label--required":""}`,children:[n,j&&e.jsx(m.NiceKeyboardHint,{shortcuts:K,size:"sm"})]}):e.jsx("span",{}),ae&&e.jsx("span",{className:"nice-slider__value nice-slider__value--header",children:h})]}),e.jsxs("div",{className:"nice-field__control nice-field__control--slider",children:[e.jsxs("div",{className:`nice-slider ${s||F?"nice-slider--disabled":""} ${L?"nice-slider--with-ticks":""}`,children:[e.jsxs("div",{className:"nice-slider__track-wrapper",children:[e.jsx("div",{className:"nice-slider__track",children:e.jsx("div",{className:"nice-slider__fill",style:{width:`${f}%`}})}),L&&W.length>0&&e.jsx("div",{className:"nice-slider__ticks","aria-hidden":"true",children:W.map((b,q)=>{const z=(b-T)/(w-T)*100,le=b<=D;return e.jsx("span",{className:`nice-slider__tick ${le?"nice-slider__tick--active":""}`,style:{left:`${z}%`},children:S&&e.jsx("span",{className:"nice-slider__tick-label",children:A?A(b):b})},q)})}),e.jsx("input",{ref:te,id:y,type:"range",className:"nice-slider__native",min:T,max:w,step:Z,value:D,disabled:s||F,"aria-valuenow":D,"aria-valuemin":T,"aria-valuemax":w,onChange:b=>ce?.(parseFloat(b.target.value))}),e.jsx("div",{className:"nice-slider__thumb-visual",style:{left:`${f}%`}})]}),O&&e.jsxs("div",{className:"nice-slider__labels",children:[e.jsx("span",{children:A?A(T):T}),e.jsx("span",{children:A?A(w):w})]})]}),C&&ae&&e.jsx("span",{className:"nice-slider__value nice-slider__value--inline",children:h}),F&&e.jsx("span",{className:"nice-field__spinner nice-field__spinner--slider",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),ue==="right"&&i&&e.jsx("div",{className:"nice-field__error nice-field__error--slider",role:"alert",children:i}),ue==="right"&&!i&&a&&e.jsx("div",{className:"nice-field__helper nice-field__helper--slider",children:a})]}),ue!=="right"&&i&&e.jsx("div",{className:"nice-field__error",role:"alert",children:i}),ue!=="right"&&!i&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]})});wn.displayName="NiceSlider";const It=Object.freeze(Object.defineProperty({__proto__:null,NiceSlider:wn},Symbol.toStringTag,{value:"Module"})),dt=({options:n,suggestions:a,value:i,defaultValue:o,onChange:s,searchable:r=!0,clearable:d,maxTags:N,allowCustom:$,placeholder:D,label:ce,error:T,helperText:w,required:Z,disabled:ae,size:O="md",loading:A,id:j,className:ne,style:X,accessMode:B,showKeyboardHints:ue,labelPlacement:oe,errorPlacement:M,labelWidth:F,controlWidth:L,readOnly:I,autoExpand:J=!1})=>{const S=m.useNiceAccessMode(B,j),te=S==="hidden";(S==="disabled"||S==="readOnly")&&(ae=!0);const U=m.useControlId(j),{t:H}=m.useNiceTranslation(),[pe,y]=t.useState(!1),[f,h]=t.useState(""),W=t.useRef(null),K=t.useRef(null);m.useClickOutside(W,()=>y(!1));const C=t.useMemo(()=>[m.COMMON_SHORTCUTS.submit,m.COMMON_SHORTCUTS.cancel,{key:"Backspace",description:H("shortcuts.removeLastTag","Remove last tag")}],[H]),b=t.useMemo(()=>Array.isArray(n)&&n.length>0?n:Array.isArray(a)?a.map(E=>({label:E,value:E})):[],[n,a]),[q,z]=m.useControllableState({value:i,defaultValue:o,fallbackValue:[],onChange:s,componentName:"NiceTagBox"}),le=t.useMemo(()=>Array.isArray(q)?q:[],[q]),Q=t.useMemo(()=>{let E=b.filter(Ce=>!le.includes(String(Ce.value)));if(f){const Ce=f.toLowerCase();E=E.filter(Y=>Y.label.toLowerCase().includes(Ce))}return E},[b,le,f]),se=t.useCallback(E=>{N&&le.length>=N||(le.includes(E)||z([...le,E]),h(""))},[le,z,N]),de=t.useCallback(E=>{z(le.filter(Ce=>Ce!==E))},[le,z]),fe=E=>{I||(E.key==="Backspace"&&!f&&le.length>0?de(le[le.length-1]):E.key==="Enter"&&f?(E.preventDefault(),Q.length>0?se(String(Q[0].value)):$&&se(f)):E.key==="Escape"&&y(!1))},ie=E=>b.find(Ce=>String(Ce.value)===E)?.label??E;return te?null:e.jsxs("div",{className:`nice-field nice-field--${O} ${oe==="left"?"nice-field--label-left":""} ${A?"nice-field--loading":""} ${ne||""}`,style:{...X,...F!=null&&{"--nice-field-label-width":typeof F=="number"?`${F}px`:F},...L!=null&&{"--nice-field-control-width":typeof L=="number"?`${L}px`:L}},ref:W,"aria-busy":A||void 0,children:[ce&&e.jsxs("label",{className:`nice-field__label ${Z?"nice-field__label--required":""}`,htmlFor:U,children:[ce,ue&&e.jsx(m.NiceKeyboardHint,{shortcuts:C,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("div",{className:`nice-tagbox nice-tagbox--${O} ${J?"nice-tagbox--expand":"nice-tagbox--fixed"} ${T?"nice-tagbox--error":""} ${ae?"nice-tagbox--disabled":""} ${I?"nice-tagbox--readonly":""}`,onClick:()=>{!ae&&!A&&!I&&(y(!0),K.current?.focus())},style:{position:"relative",cursor:ae||A?"not-allowed":I?"default":"text"},children:[e.jsxs("div",{className:"nice-tagbox__tags",children:[le.map(E=>e.jsxs("span",{className:"nice-tag nice-tagbox__tag",children:[ie(E),!ae&&!I&&e.jsx("button",{type:"button",className:"nice-tag__remove",onClick:Ce=>{Ce.stopPropagation(),de(E)},"aria-label":H("controls.remove","Remove"),children:e.jsx(m.NiceIcon,{name:"close",size:14})})]},E)),r&&e.jsx("input",{ref:K,id:U,type:"text",className:"nice-tagbox__input nice-input__native",value:f,onChange:E=>{h(E.target.value),y(!0)},onFocus:()=>y(!0),onKeyDown:fe,placeholder:le.length===0?D||H("controls.select","Select..."):"",disabled:ae||A,readOnly:I,autoComplete:"off",style:{border:"none",outline:"none",background:"transparent",color:"inherit",flex:1,minWidth:80,padding:0,font:"inherit",caretColor:"var(--nice-color-primary)"}})]}),d&&le.length>0&&!ae&&!I&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:E=>{E.stopPropagation(),z([])},"aria-label":H("controls.clear","Clear"),children:e.jsx(m.NiceIcon,{name:"close",size:14})}),pe&&(Q.length>0||$&&f)&&e.jsxs("ul",{className:"nice-dropdown__list nice-tagbox__dropdown",role:"listbox",children:[Q.map(E=>e.jsx("li",{role:"option",className:"nice-dropdown__option",onMouseDown:Ce=>{Ce.preventDefault(),se(String(E.value))},children:E.label},String(E.value))),$&&f&&!Q.some(E=>String(E.value).toLowerCase()===f.toLowerCase())&&e.jsxs("li",{role:"option",className:"nice-dropdown__option nice-dropdown__option--add",onMouseDown:E=>{E.preventDefault(),se(f)},children:["+ ",H("controls.add","Add")," “",f,"”"]})]})]}),A&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),M==="right"&&T&&e.jsx("div",{id:`${U}-error`,className:"nice-field__error",role:"alert",children:T}),M==="right"&&!T&&w&&e.jsx("div",{id:`${U}-helper`,className:"nice-field__helper",children:w})]}),M!=="right"&&T&&e.jsx("div",{id:`${U}-error`,className:"nice-field__error",role:"alert",children:T}),M!=="right"&&!T&&w&&e.jsx("div",{id:`${U}-helper`,className:"nice-field__helper",children:w})]})},Tn=t.forwardRef(({label:n,helperText:a,error:i,required:o,disabled:s,readOnly:r,size:d="md",name:N,id:$,className:D,style:ce,accessMode:T,displayStyle:w,value:Z,defaultValue:ae,onChange:O,onBlur:A,onKeyDown:j,placeholder:ne,rows:X=3,maxLength:B,resize:ue="vertical",autoFocus:oe,showCount:M,counterPlacement:F="bottom",submitOnEnter:L,onSubmit:I,showKeyboardHints:J,labelPlacement:S,errorPlacement:te,loading:U,labelWidth:H,controlWidth:pe,displayMode:y},f)=>{const h=m.useNiceAccessMode(T,$),W=h==="hidden";h==="disabled"&&(s=!0),h==="readOnly"&&(r=!0);const{t:K}=m.useNiceTranslation(),C=m.useControlId($),b=m.useComponentDisplayStyle("input",w),q=m.useComponentDisplayClass("input",w),z=Z?.length??0,le=B?z>B:!1,Q=m.useDisplayModeEdit({enabled:y,readOnly:r,disabled:s}),se={key:"Enter",ctrl:!0,description:K("shortcuts.submit","Submit")},de=t.useCallback(ie=>{L&&m.matchesShortcut(ie,se)&&(ie.preventDefault(),I?.()),j?.(ie)},[L,I,j,se]),fe=t.useMemo(()=>{const ie=[];return L&&ie.push(se),ie.push({key:"Tab",description:K("shortcuts.indent","Indent (when supported)")}),ie},[L,K,se]);return W?null:e.jsxs("div",{className:`nice-field nice-field--${d} ${S==="left"?"nice-field--label-left":""} ${U?"nice-field--loading":""} ${D||""}`,style:{...ce,...H!=null&&{"--nice-field-label-width":typeof H=="number"?`${H}px`:H},...pe!=null&&{"--nice-field-control-width":typeof pe=="number"?`${pe}px`:pe}},"aria-busy":U||void 0,children:[n&&e.jsxs("label",{htmlFor:C,className:`nice-field__label ${o?"nice-field__label--required":""}`,children:[n,J&&fe.length>0&&e.jsx(m.NiceKeyboardHint,{shortcuts:fe,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control nice-field__control--textarea",children:[Q.isDisplay?e.jsx(m.DisplayModeView,{value:Z??ae??"",placeholder:ne,disabled:s,readOnly:r,onActivate:Q.enterEdit,ariaLabel:n,className:"nice-display-value--textarea"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 auto",minWidth:0},children:[e.jsx("textarea",{ref:ie=>{typeof f=="function"?f(ie):f&&(f.current=ie),Q.autoFocusRef(ie)},id:C,className:`nice-textarea nice-input--${d} nice-textarea--ds-${q} ${i?"nice-textarea--error":""} ${s?"nice-textarea--disabled":""}`,style:{...b,resize:ue},name:N,value:Z,defaultValue:ae,placeholder:ne,rows:X,maxLength:B,disabled:s||U,readOnly:r,autoFocus:oe,"aria-invalid":!!i,"aria-describedby":i?`${C}-error`:a?`${C}-helper`:void 0,onChange:ie=>O?.(ie.target.value),onBlur:ie=>{y&&Q.exitEdit(),A?.(ie)},onKeyDown:de}),F!=="right"&&(M||B)&&e.jsxs("div",{className:`nice-textarea__counter ${le?"nice-textarea__counter--over":""}`,children:[z,B?` / ${B}`:""]})]}),F==="right"&&(M||B)&&e.jsxs("div",{className:`nice-textarea__counter nice-textarea__counter--right ${le?"nice-textarea__counter--over":""}`,children:[z,B?` / ${B}`:""]})]}),U&&e.jsx("span",{className:"nice-field__spinner nice-field__spinner--textarea",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),te==="right"&&i&&e.jsx("div",{id:`${C}-error`,className:"nice-field__error",role:"alert",children:i}),te==="right"&&!i&&a&&e.jsx("div",{id:`${C}-helper`,className:"nice-field__helper",children:a})]}),te!=="right"&&i&&e.jsx("div",{id:`${C}-error`,className:"nice-field__error",role:"alert",children:i}),te!=="right"&&!i&&a&&e.jsx("div",{id:`${C}-helper`,className:"nice-field__helper",children:a})]})});Tn.displayName="NiceTextArea";const Ut=Object.freeze(Object.defineProperty({__proto__:null,NiceTextArea:Tn},Symbol.toStringTag,{value:"Module"})),Et=()=>`file-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,En=n=>{if(n===0)return"0 B";const a=1024,i=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(n)/Math.log(a));return`${parseFloat((n/Math.pow(a,o)).toFixed(2))} ${i[o]}`},On=n=>n.startsWith("image/"),Bn=n=>n.startsWith("video/"),ut=n=>n.startsWith("audio/"),Ft=n=>On(n)?"image":Bn(n)?"video":ut(n)?"music":/pdf|word|document|text|json|xml/.test(n)?"file":/excel|spreadsheet/.test(n)?"table":/powerpoint|presentation/.test(n)?"monitor":/zip|rar|7z/.test(n)?"box":"folder",Lt=n=>{if(On(n.type)||Bn(n.type)||ut(n.type))return URL.createObjectURL(n)},Ht={xxs:24,xs:32,sm:48,md:80,lg:120,xl:160,xxl:200},zt=(n,a)=>i=>{const o=new FormData;i.chunk?(o.append("chunk",i.chunk),o.append("chunkIndex",String(i.chunkIndex)),o.append("totalChunks",String(i.totalChunks)),o.append("fileName",i.file.name),o.append("fileId",i.fileId||"")):o.append("file",i.file);const s=new XMLHttpRequest;return new Promise(r=>{s.upload.addEventListener("progress",d=>{d.lengthComputable&&i.onProgress&&i.onProgress(d.loaded/d.total*100)}),s.addEventListener("load",()=>{if(s.status>=200&&s.status<300)try{const d=JSON.parse(s.responseText);r({success:!0,url:d.url,fileId:d.fileId||d.id,metadata:d})}catch{r({success:!0,url:s.responseText})}else r({success:!1,error:`Upload failed: ${s.status} ${s.statusText}`})}),s.addEventListener("error",()=>r({success:!1,error:"Network error"})),s.addEventListener("abort",()=>r({success:!1,error:"Upload cancelled"})),i.signal&&i.signal.addEventListener("abort",()=>s.abort()),s.open("POST",n),a&&Object.entries(a).forEach(([d,N])=>s.setRequestHeader(d,N)),s.send(o)})},Gn=t.forwardRef((n,a)=>{const{accept:i,multiple:o=!0,maxFileSize:s,maxFiles:r,minFileSize:d,onFilesSelected:N,uploadMode:$="instant",labelText:D,text:ce,dropzoneText:T,browseText:w,dragActiveText:Z,labelPlacement:ae="right",icon:O="upload",showFileList:A=!0,imagePreview:j,showPreview:ne=!0,listMode:X="list",previewSize:B="md",fileProgress:ue,renderPreview:oe,renderFileItem:M,variant:F="dropzone",trigger:L,dropChildren:I,autoUpload:J=!1,uploadHandler:S,uploadUrl:te,uploadHeaders:U,concurrentUploads:H=3,maxRetries:pe=3,chunkSize:y=5*1024*1024,chunkThreshold:f=10*1024*1024,validateFile:h,keepFilesAfterUpload:W=!0,initialFiles:K,disabled:C,readOnly:b,onFilesAdded:q,onUploadComplete:z,onUploadError:le,onProgress:Q,onFileRemoved:se,onChange:de,apiRef:fe,pasteFromClipboard:ie,className:E,style:Ce}=n,{t:Y}=m.useNiceTranslation(),[_e,G]=t.useState(()=>K??[]),[Me,g]=t.useState(!1),k=t.useRef(_e),P=t.useRef(null),De=t.useRef(new Map),me=t.useRef([]),_=t.useRef(new Set),u=t.useRef(0),Ne=t.useRef(()=>{}),He=t.useRef(de),Be=!!(S||te);t.useEffect(()=>{k.current=_e},[_e]),t.useEffect(()=>{He.current=de}),t.useEffect(()=>{He.current?.(_e)},[_e]),t.useEffect(()=>()=>{k.current.forEach(l=>l.previewUrl&&URL.revokeObjectURL(l.previewUrl))},[]);const Ee=t.useCallback(l=>N(l.map(V=>V.file)),[N]),ee=t.useCallback(l=>{if(h){const V=h(l);if(V)return V}if(s&&l.size>s)return Y("fileUpload.error.tooLarge","File is too large. Maximum size: {size}").replace("{size}",En(s));if(d&&l.size<d)return Y("fileUpload.error.tooSmall","File is too small. Minimum size: {size}").replace("{size}",En(d));if(i){const V=i.split(",").map(he=>he.trim().toLowerCase()),re=l.type.toLowerCase(),ve="."+(l.name.split(".").pop()?.toLowerCase()??"");if(!V.some(he=>he.startsWith(".")?ve===he:he.endsWith("/*")?re.startsWith(he.replace("/*","/")):re===he))return Y("fileUpload.error.badType","File type not allowed. Accepted types: {accept}").replace("{accept}",i)}return null},[h,s,d,i,Y]),we=t.useCallback(()=>S||(te?zt(te,U):null),[S,te,U]),Ke=t.useCallback(async(l,V,re)=>{const ve=l.file,ke=Math.ceil(ve.size/y);let he=0,Ie={success:!1};for(let Re=0;Re<ke;Re++){if(re.aborted)throw new Error("Upload cancelled");const Ve=Re*y,vn=Math.min(Ve+y,ve.size),sn=ve.slice(Ve,vn);let ln=0,Qe=!1;for(;!Qe&&ln<pe;)try{Ie=await V({file:ve,chunk:sn,chunkIndex:Re,totalChunks:ke,fileId:l.id,onProgress:cn=>{const un=(he+sn.size*cn/100)/ve.size*100;G(In=>In.map(pn=>pn.id===l.id?{...pn,progress:un}:pn))},signal:re}),Ie.success?(Qe=!0,he+=sn.size):ln++}catch(cn){if(ln++,ln>=pe)throw cn}if(!Qe)throw new Error(`Failed to upload chunk ${Re+1}/${ke}`)}return Ie},[y,pe]),Ze=t.useCallback(async(l,V)=>{const re=k.current.find(ke=>ke.id===l);if(!re||re.status==="uploading"||re.status==="success")return;const ve=new AbortController;De.current.set(l,ve),_.current.add(l),G(ke=>ke.map(he=>he.id===l?{...he,status:"uploading",progress:0,error:void 0}:he));try{const ke=re.file;let he;if(ke.size>f?he=await Ke(re,V,ve.signal):he=await V({file:ke,onProgress:Ie=>{G(Re=>Re.map(Ve=>Ve.id===l?{...Ve,progress:Ie}:Ve)),Q?.(re,Ie)},signal:ve.signal}),he.success){if(G(Ie=>Ie.map(Re=>Re.id===l?{...Re,status:"success",progress:100,uploadedUrl:he.url,uploadedAt:new Date}:Re)),z?.({...re,status:"success",uploadedUrl:he.url}),!W){const Ie=k.current.find(Re=>Re.id===l);Ie?.previewUrl&&URL.revokeObjectURL(Ie.previewUrl),G(Re=>Re.filter(Ve=>Ve.id!==l))}}else throw new Error(he.error||"Upload failed")}catch(ke){const he=ke;if(he.name==="AbortError"||he.message==="Upload cancelled")G(Ie=>Ie.map(Re=>Re.id===l?{...Re,status:"cancelled",error:Y("fileUpload.status.cancelled","Cancelled")}:Re));else{const Ie=he.message||Y("fileUpload.error.generic","Upload error");G(Re=>Re.map(Ve=>Ve.id===l?{...Ve,status:"error",error:Ie}:Ve)),le?.(re,Ie)}}finally{De.current.delete(l),_.current.delete(l),Ne.current()}},[f,Ke,Q,z,le,W,Y]),tn=t.useRef(Ze);t.useEffect(()=>{tn.current=Ze});const Ge=t.useCallback(()=>{const l=we();if(l)for(;me.current.length>0&&_.current.size<H;){const V=me.current.shift();V&&tn.current(V,l)}},[we,H]);t.useEffect(()=>{Ne.current=Ge});const je=t.useCallback(l=>{const V=we();if(!V){console.error("No upload handler configured");return}tn.current(l,V)},[we]),an=t.useCallback(l=>{De.current.get(l)?.abort(),G(V=>V.map(re=>re.id===l&&re.status==="uploading"?{...re,status:"cancelled",error:Y("fileUpload.status.cancelled","Cancelled")}:re))},[Y]),v=t.useCallback(l=>{G(V=>V.map(re=>re.id===l?{...re,status:"pending",progress:0,error:void 0}:re)),je(l)},[je]),p=t.useCallback(l=>{const V=k.current.find(ve=>ve.id===l);if(!V)return;De.current.get(l)?.abort(),V.previewUrl&&URL.revokeObjectURL(V.previewUrl);const re=k.current.filter(ve=>ve.id!==l);k.current=re,G(ve=>ve.filter(ke=>ke.id!==l)),se?.(V),$==="instant"&&Ee(re)},[se,$,Ee]),ge=t.useCallback(()=>{k.current.filter(l=>l.status==="pending").forEach(l=>me.current.push(l.id)),Ge()},[Ge]),ze=t.useCallback(()=>{De.current.forEach(l=>l.abort()),G(l=>l.map(V=>V.status==="uploading"?{...V,status:"cancelled",error:Y("fileUpload.status.cancelled","Cancelled")}:V))},[Y]),Ae=t.useCallback(()=>{ze(),k.current.forEach(l=>l.previewUrl&&URL.revokeObjectURL(l.previewUrl)),G([]),$==="instant"&&Ee([])},[ze,$,Ee]),Oe=t.useCallback(()=>{k.current.filter(l=>l.status==="error").forEach(l=>v(l.id))},[v]),Pe=t.useCallback(l=>{if(C||b)return;const V=k.current;let re=o?l:l.slice(0,1);r&&(re=re.slice(0,Math.max(0,r-V.length)));const ve=re.map(he=>{const Ie=ee(he);return{id:Et(),file:he,name:he.name,size:he.size,type:he.type,status:Ie?"error":"pending",progress:0,error:Ie||void 0,previewUrl:Lt(he)}}),ke=o?[...V,...ve]:ve;G(ke),k.current=ke,q?.(ve),$==="instant"&&Ee(ke),J&&(ve.filter(he=>he.status==="pending").forEach(he=>me.current.push(he.id)),Ge())},[C,b,o,r,ee,q,$,Ee,J,Ge]),Je=t.useCallback(()=>P.current?.click(),[]);t.useImperativeHandle(fe,()=>({addFiles:Pe,uploadAll:ge,cancelAll:ze,clearAll:Ae,getFiles:()=>k.current,getFile:l=>k.current.find(V=>V.id===l),retryFailed:Oe,openFileBrowser:Je}),[Pe,ge,ze,Ae,Oe,Je]),t.useEffect(()=>{if(!ie||C||b)return;const l=V=>{const re=V.clipboardData?.items;if(!re)return;const ve=[];for(let ke=0;ke<re.length;ke++)if(re[ke].kind==="file"){const he=re[ke].getAsFile();he&&ve.push(he)}ve.length>0&&(V.preventDefault(),Pe(ve))};return document.addEventListener("paste",l),()=>document.removeEventListener("paste",l)},[ie,C,b,Pe]);const Cn=l=>{l.preventDefault(),!(C||b)&&(u.current++,g(!0))},yn=l=>{l.preventDefault(),u.current--,u.current<=0&&(u.current=0,g(!1))},Sn=l=>{l.preventDefault(),u.current=0,g(!1),!(C||b)&&Pe(Array.from(l.dataTransfer.files))},bn=l=>{l.target.files&&Pe(Array.from(l.target.files)),l.target.value=""},Ue=t.useMemo(()=>{const l={total:_e.length,pending:0,uploading:0,success:0,error:0};for(const V of _e)V.status==="pending"?l.pending++:V.status==="uploading"?l.uploading++:V.status==="success"?l.success++:V.status==="error"&&l.error++;return l},[_e]),We=D??ce??T??Y("dropOrClick","Drop files here or click to browse"),en=Z??Y("fileUpload.dropzone.dragActive","Drop files here"),rn=l=>Y(`fileUpload.status.${l}`,{pending:"Pending",uploading:"Uploading…",success:"Uploaded",error:"Error",cancelled:"Cancelled"}[l]),Dn=l=>Be||l.status!=="pending",Rn=l=>{if(oe)return oe(l);const V=Ht[B]??80,re=j??ne;return re&&l.previewUrl&&On(l.type)?e.jsx("img",{src:l.previewUrl,alt:l.name,className:"nice-fileuploader__thumb nice-upload__thumb nice-upload__preview",style:{width:V,height:V,objectFit:"cover"}}):re&&l.previewUrl&&Bn(l.type)?e.jsxs("span",{className:"nice-upload__preview",style:{position:"relative",display:"inline-flex"},children:[e.jsx("video",{src:l.previewUrl,muted:!0,style:{width:V,height:V,objectFit:"cover"}}),e.jsx("span",{className:"nice-upload__preview-overlay","aria-hidden":"true",children:e.jsx(m.NiceIcon,{name:"play",size:20})})]}):e.jsx("span",{className:"nice-upload__preview nice-upload__preview--icon","aria-hidden":"true",children:e.jsx(m.NiceIcon,{name:Ft(l.type),size:Math.round(V*.5)})})},An=l=>{const V={upload:()=>je(l.id),cancel:()=>an(l.id),retry:()=>v(l.id),remove:()=>p(l.id)};if(M)return e.jsx(t.Fragment,{children:M(l,V)},l.id);const re=ue?.[l.name]??l.progress,ve=Dn(l);return e.jsxs("div",{className:`nice-fileuploader__file nice-upload__file nice-upload__item nice-upload__item--${l.status}`,children:[(j??ne)&&Rn(l),e.jsx("span",{className:"nice-fileuploader__filename nice-upload__filename",title:l.name,children:l.name}),e.jsx("span",{className:"nice-fileuploader__filesize nice-upload__filesize",children:En(l.size)}),ve&&e.jsx("span",{className:`nice-upload__badge nice-upload__badge--${l.status}`,children:rn(l.status)}),(l.status==="uploading"||re!=null&&re>0&&re<100)&&e.jsx("div",{className:"nice-fileuploader__progress nice-upload__progress",children:e.jsx("div",{className:"nice-fileuploader__progress-bar nice-upload__progress-bar",style:{width:`${Math.min(100,Math.max(0,re))}%`}})}),l.error&&l.status==="error"&&e.jsx("span",{className:"nice-upload__item-error",children:l.error}),l.uploadedUrl&&e.jsx("a",{className:"nice-upload__link",href:l.uploadedUrl,target:"_blank",rel:"noopener noreferrer",children:Y("fileUpload.openFile","Open file")}),!b&&!C&&e.jsxs("span",{className:"nice-upload__item-actions",children:[Be&&l.status==="pending"&&e.jsx("button",{type:"button",className:"nice-upload__btn nice-upload__btn--upload",onClick:V.upload,title:Y("fileUpload.action.upload","Upload"),"aria-label":Y("fileUpload.action.upload","Upload"),children:e.jsx(m.NiceIcon,{name:"upload",size:14})}),l.status==="uploading"&&e.jsx("button",{type:"button",className:"nice-upload__btn nice-upload__btn--cancel",onClick:V.cancel,title:Y("fileUpload.action.cancel","Cancel"),"aria-label":Y("fileUpload.action.cancel","Cancel"),children:e.jsx(m.NiceIcon,{name:"stop",size:14})}),Be&&l.status==="error"&&e.jsx("button",{type:"button",className:"nice-upload__btn nice-upload__btn--retry",onClick:V.retry,title:Y("fileUpload.action.retry","Retry"),"aria-label":Y("fileUpload.action.retry","Retry"),children:e.jsx(m.NiceIcon,{name:"refresh",size:14})}),l.status!=="uploading"&&e.jsx("button",{type:"button",className:"nice-fileuploader__remove nice-upload__remove nice-upload__btn nice-upload__btn--remove",onClick:V.remove,title:Y("remove","Remove"),"aria-label":Y("remove","Remove"),children:e.jsx(m.NiceIcon,{name:"close",size:14})})]})]},l.id)},dn=l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),Je())},Nn=e.jsx("input",{ref:P,type:"file",accept:i,multiple:o,hidden:!0,disabled:C,onChange:bn});return e.jsxs("div",{ref:a,className:`nice-fileuploader nice-upload ${C?"nice-fileuploader--disabled nice-upload--disabled":""} ${b?"nice-upload--readonly":""} ${E||""}`,style:Ce,children:[F==="button"?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"nice-upload__trigger nice-btn nice-btn--primary",onClick:Je,disabled:C||b,children:L??Y("filePicker.label","Choose files")}),Nn]}):!b&&e.jsxs("div",{className:`nice-fileuploader__dropzone nice-upload__dropzone nice-upload__dropzone--label-${ae} ${!I&&!We?"nice-upload__dropzone--icon-only":""} ${Me?"nice-fileuploader__dropzone--active nice-upload__dropzone--active":""}`,role:"button",tabIndex:C?-1:0,"aria-disabled":C||void 0,onDragEnter:Cn,onDragOver:l=>l.preventDefault(),onDragLeave:yn,onDrop:Sn,onClick:()=>!C&&Je(),onKeyDown:dn,children:[Nn,I??e.jsxs(e.Fragment,{children:[O&&e.jsx("div",{className:"nice-upload__icon","aria-hidden":"true",children:e.jsx(m.NiceIcon,{name:O,size:"lg"})}),(Me?en:We)&&e.jsxs("div",{className:"nice-fileuploader__label nice-upload__label",children:[Me?en:We,w&&e.jsxs("span",{className:"nice-upload__browse",children:[" ",w]})]})]})]}),A&&_e.length>0&&e.jsx("div",{className:`nice-fileuploader__list nice-upload__list nice-upload__list--${X}`,children:_e.map(An)}),Be&&_e.length>0&&!b&&e.jsxs("div",{className:"nice-upload__bulk",children:[Ue.pending>0&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary nice-btn--sm",onClick:ge,children:Y("fileUpload.bulk.uploadAll","Upload all ({n})").replace("{n}",String(Ue.pending))}),Ue.error>0&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--sm",onClick:Oe,children:Y("fileUpload.bulk.retryFailed","Retry failed ({n})").replace("{n}",String(Ue.error))}),e.jsx("button",{type:"button",className:"nice-btn nice-btn--sm",onClick:Ae,children:Y("fileUpload.bulk.clear","Clear")})]}),!Be&&$==="useButtons"&&_e.length>0&&!b&&e.jsxs("div",{className:"nice-fileuploader__actions nice-upload__actions",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary nice-btn--sm",onClick:()=>Ee(k.current),children:Y("upload","Upload")}),e.jsx("button",{type:"button",className:"nice-btn nice-btn--sm",onClick:Ae,children:Y("clearAll","Clear All")})]})]})});Gn.displayName="NiceUpload";const Pt=[{label:"Polska",value:"PL"},{label:"Deutschland",value:"DE"},{label:"Česko",value:"CZ"},{label:"Slovensko",value:"SK"},{label:"United Kingdom",value:"GB"},{label:"United States",value:"US"},{label:"France",value:"FR"},{label:"Italia",value:"IT"},{label:"España",value:"ES"},{label:"Nederland",value:"NL"}],Yn=({label:n,helperText:a,error:i,errorPlacement:o="bottom",required:s,disabled:r,readOnly:d,loading:N,size:$="md",className:D,style:ce,accessMode:T,id:w,value:Z,defaultValue:ae,onChange:O,columns:A=2,showState:j=!1,showBuilding:ne=!0,showApartment:X=!0,showCountry:B=!0,countryOptions:ue=Pt,defaultCountry:oe="PL",fieldLabels:M,fieldPlaceholders:F,showLabel:L=!0,labelPlacement:I,labelWidth:J,controlWidth:S})=>{const te=m.useNiceAccessMode(T,w),U=te==="hidden";te==="disabled"&&(r=!0),te==="readOnly"&&(d=!0);const{t:H}=m.useNiceTranslation(),pe=Z!==void 0,[y,f]=t.useState(ae??{}),h=pe?Z:y,W=de=>{const fe={...h,...de};pe||f(fe),O?.(fe)},K={street:M?.street??H("address.street","Street"),building:M?.building??H("address.building","Building"),apartment:M?.apartment??H("address.apartment","Apt."),postalCode:M?.postalCode??H("address.postalCode","Postal code"),city:M?.city??H("address.city","City"),state:M?.state??H("address.state","State / Region"),country:M?.country??H("address.country","Country")},C=F??{},b=h.country??oe,q=I==="left"?"left":"top",z={...ce,...J!=null&&{"--nice-field-label-width":typeof J=="number"?`${J}px`:J},...S!=null&&{"--nice-field-control-width":typeof S=="number"?`${S}px`:S}},le={display:"grid",gridTemplateColumns:`repeat(${A}, minmax(0, 1fr))`,gap:"8px 12px"},Q=A===2?{gridColumn:"span 2"}:{},se={size:$,disabled:r||N,readOnly:d,labelPlacement:q};return U?null:e.jsxs("div",{className:`nice-field nice-field--${$} nice-address nice-address--cols-${A} ${N?"nice-field--loading":""} ${D||""}`,style:z,"aria-busy":N||void 0,children:[L&&n&&e.jsx("label",{className:`nice-field__label ${s?"nice-field__label--required":""}`,children:n}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("div",{className:"nice-address__grid",style:le,children:[e.jsx("div",{style:Q,children:e.jsx(qe.NiceTextInput,{...se,label:K.street,value:h.street??"",onChange:de=>W({street:de}),placeholder:C.street,required:s})}),ne&&e.jsx(qe.NiceTextInput,{...se,label:K.building,value:h.building??"",onChange:de=>W({building:de}),placeholder:C.building}),X&&e.jsx(qe.NiceTextInput,{...se,label:K.apartment,value:h.apartment??"",onChange:de=>W({apartment:de}),placeholder:C.apartment}),e.jsx(qe.NiceTextInput,{...se,label:K.postalCode,value:h.postalCode??"",onChange:de=>W({postalCode:de}),placeholder:C.postalCode??"00-000",required:s}),e.jsx(qe.NiceTextInput,{...se,label:K.city,value:h.city??"",onChange:de=>W({city:de}),placeholder:C.city,required:s}),j&&e.jsx(qe.NiceTextInput,{...se,label:K.state,value:h.state??"",onChange:de=>W({state:de}),placeholder:C.state}),B&&e.jsx(kn.NiceSelect,{...se,label:K.country,value:b,onChange:de=>W({country:typeof de=="string"?de:String(de??"")}),options:ue,required:s})]}),N&&e.jsx("span",{className:"nice-field__spinner nice-field__spinner--address",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),o==="right"&&i&&e.jsx("div",{className:"nice-field__error",role:"alert",children:i}),o==="right"&&!i&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]}),o!=="right"&&i&&e.jsx("div",{className:"nice-field__error",role:"alert",children:i}),o!=="right"&&!i&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]})};Yn.displayName="NiceAddress";const pt=[{code:"US",name:"United States",dialCode:"+1",flag:"🇺🇸"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"🇬🇧"},{code:"DE",name:"Germany",dialCode:"+49",flag:"🇩🇪"},{code:"FR",name:"France",dialCode:"+33",flag:"🇫🇷"},{code:"PL",name:"Poland",dialCode:"+48",flag:"🇵🇱"},{code:"ES",name:"Spain",dialCode:"+34",flag:"🇪🇸"},{code:"IT",name:"Italy",dialCode:"+39",flag:"🇮🇹"},{code:"NL",name:"Netherlands",dialCode:"+31",flag:"🇳🇱"},{code:"BE",name:"Belgium",dialCode:"+32",flag:"🇧🇪"},{code:"AT",name:"Austria",dialCode:"+43",flag:"🇦🇹"},{code:"CH",name:"Switzerland",dialCode:"+41",flag:"🇨🇭"},{code:"SE",name:"Sweden",dialCode:"+46",flag:"🇸🇪"},{code:"NO",name:"Norway",dialCode:"+47",flag:"🇳🇴"},{code:"DK",name:"Denmark",dialCode:"+45",flag:"🇩🇰"},{code:"FI",name:"Finland",dialCode:"+358",flag:"🇫🇮"},{code:"PT",name:"Portugal",dialCode:"+351",flag:"🇵🇹"},{code:"IE",name:"Ireland",dialCode:"+353",flag:"🇮🇪"},{code:"CZ",name:"Czech Republic",dialCode:"+420",flag:"🇨🇿"},{code:"SK",name:"Slovakia",dialCode:"+421",flag:"🇸🇰"},{code:"HU",name:"Hungary",dialCode:"+36",flag:"🇭🇺"},{code:"RO",name:"Romania",dialCode:"+40",flag:"🇷🇴"},{code:"BG",name:"Bulgaria",dialCode:"+359",flag:"🇧🇬"},{code:"GR",name:"Greece",dialCode:"+30",flag:"🇬🇷"},{code:"UA",name:"Ukraine",dialCode:"+380",flag:"🇺🇦"},{code:"RU",name:"Russia",dialCode:"+7",flag:"🇷🇺"},{code:"CA",name:"Canada",dialCode:"+1",flag:"🇨🇦"},{code:"AU",name:"Australia",dialCode:"+61",flag:"🇦🇺"},{code:"NZ",name:"New Zealand",dialCode:"+64",flag:"🇳🇿"},{code:"JP",name:"Japan",dialCode:"+81",flag:"🇯🇵"},{code:"KR",name:"South Korea",dialCode:"+82",flag:"🇰🇷"},{code:"CN",name:"China",dialCode:"+86",flag:"🇨🇳"},{code:"IN",name:"India",dialCode:"+91",flag:"🇮🇳"},{code:"SG",name:"Singapore",dialCode:"+65",flag:"🇸🇬"},{code:"MY",name:"Malaysia",dialCode:"+60",flag:"🇲🇾"},{code:"TH",name:"Thailand",dialCode:"+66",flag:"🇹🇭"},{code:"VN",name:"Vietnam",dialCode:"+84",flag:"🇻🇳"},{code:"ID",name:"Indonesia",dialCode:"+62",flag:"🇮🇩"},{code:"PH",name:"Philippines",dialCode:"+63",flag:"🇵🇭"},{code:"BR",name:"Brazil",dialCode:"+55",flag:"🇧🇷"},{code:"MX",name:"Mexico",dialCode:"+52",flag:"🇲🇽"},{code:"AR",name:"Argentina",dialCode:"+54",flag:"🇦🇷"},{code:"CL",name:"Chile",dialCode:"+56",flag:"🇨🇱"},{code:"CO",name:"Colombia",dialCode:"+57",flag:"🇨🇴"},{code:"PE",name:"Peru",dialCode:"+51",flag:"🇵🇪"},{code:"ZA",name:"South Africa",dialCode:"+27",flag:"🇿🇦"},{code:"EG",name:"Egypt",dialCode:"+20",flag:"🇪🇬"},{code:"NG",name:"Nigeria",dialCode:"+234",flag:"🇳🇬"},{code:"KE",name:"Kenya",dialCode:"+254",flag:"🇰🇪"},{code:"AE",name:"United Arab Emirates",dialCode:"+971",flag:"🇦🇪"},{code:"SA",name:"Saudi Arabia",dialCode:"+966",flag:"🇸🇦"},{code:"IL",name:"Israel",dialCode:"+972",flag:"🇮🇱"},{code:"TR",name:"Turkey",dialCode:"+90",flag:"🇹🇷"},{code:"AF",name:"Afghanistan",dialCode:"+93",flag:"🇦🇫"},{code:"AL",name:"Albania",dialCode:"+355",flag:"🇦🇱"},{code:"DZ",name:"Algeria",dialCode:"+213",flag:"🇩🇿"},{code:"AD",name:"Andorra",dialCode:"+376",flag:"🇦🇩"},{code:"AO",name:"Angola",dialCode:"+244",flag:"🇦🇴"},{code:"AG",name:"Antigua and Barbuda",dialCode:"+1268",flag:"🇦🇬"},{code:"AM",name:"Armenia",dialCode:"+374",flag:"🇦🇲"},{code:"AZ",name:"Azerbaijan",dialCode:"+994",flag:"🇦🇿"},{code:"BS",name:"Bahamas",dialCode:"+1242",flag:"🇧🇸"},{code:"BH",name:"Bahrain",dialCode:"+973",flag:"🇧🇭"},{code:"BD",name:"Bangladesh",dialCode:"+880",flag:"🇧🇩"},{code:"BB",name:"Barbados",dialCode:"+1246",flag:"🇧🇧"},{code:"BY",name:"Belarus",dialCode:"+375",flag:"🇧🇾"},{code:"BZ",name:"Belize",dialCode:"+501",flag:"🇧🇿"},{code:"BJ",name:"Benin",dialCode:"+229",flag:"🇧🇯"},{code:"BT",name:"Bhutan",dialCode:"+975",flag:"🇧🇹"},{code:"BO",name:"Bolivia",dialCode:"+591",flag:"🇧🇴"},{code:"BA",name:"Bosnia and Herzegovina",dialCode:"+387",flag:"🇧🇦"},{code:"BW",name:"Botswana",dialCode:"+267",flag:"🇧🇼"},{code:"BN",name:"Brunei",dialCode:"+673",flag:"🇧🇳"},{code:"BF",name:"Burkina Faso",dialCode:"+226",flag:"🇧🇫"},{code:"BI",name:"Burundi",dialCode:"+257",flag:"🇧🇮"},{code:"CV",name:"Cape Verde",dialCode:"+238",flag:"🇨🇻"},{code:"KH",name:"Cambodia",dialCode:"+855",flag:"🇰🇭"},{code:"CM",name:"Cameroon",dialCode:"+237",flag:"🇨🇲"},{code:"CF",name:"Central African Republic",dialCode:"+236",flag:"🇨🇫"},{code:"TD",name:"Chad",dialCode:"+235",flag:"🇹🇩"},{code:"KM",name:"Comoros",dialCode:"+269",flag:"🇰🇲"},{code:"CG",name:"Congo",dialCode:"+242",flag:"🇨🇬"},{code:"CD",name:"DR Congo",dialCode:"+243",flag:"🇨🇩"},{code:"CR",name:"Costa Rica",dialCode:"+506",flag:"🇨🇷"},{code:"CI",name:"Côte d'Ivoire",dialCode:"+225",flag:"🇨🇮"},{code:"HR",name:"Croatia",dialCode:"+385",flag:"🇭🇷"},{code:"CU",name:"Cuba",dialCode:"+53",flag:"🇨🇺"},{code:"CY",name:"Cyprus",dialCode:"+357",flag:"🇨🇾"},{code:"DJ",name:"Djibouti",dialCode:"+253",flag:"🇩🇯"},{code:"DM",name:"Dominica",dialCode:"+1767",flag:"🇩🇲"},{code:"DO",name:"Dominican Republic",dialCode:"+1809",flag:"🇩🇴"},{code:"EC",name:"Ecuador",dialCode:"+593",flag:"🇪🇨"},{code:"SV",name:"El Salvador",dialCode:"+503",flag:"🇸🇻"},{code:"GQ",name:"Equatorial Guinea",dialCode:"+240",flag:"🇬🇶"},{code:"ER",name:"Eritrea",dialCode:"+291",flag:"🇪🇷"},{code:"EE",name:"Estonia",dialCode:"+372",flag:"🇪🇪"},{code:"SZ",name:"Eswatini",dialCode:"+268",flag:"🇸🇿"},{code:"ET",name:"Ethiopia",dialCode:"+251",flag:"🇪🇹"},{code:"FJ",name:"Fiji",dialCode:"+679",flag:"🇫🇯"},{code:"GA",name:"Gabon",dialCode:"+241",flag:"🇬🇦"},{code:"GM",name:"Gambia",dialCode:"+220",flag:"🇬🇲"},{code:"GE",name:"Georgia",dialCode:"+995",flag:"🇬🇪"},{code:"GH",name:"Ghana",dialCode:"+233",flag:"🇬🇭"},{code:"GD",name:"Grenada",dialCode:"+1473",flag:"🇬🇩"},{code:"GT",name:"Guatemala",dialCode:"+502",flag:"🇬🇹"},{code:"GN",name:"Guinea",dialCode:"+224",flag:"🇬🇳"},{code:"GW",name:"Guinea-Bissau",dialCode:"+245",flag:"🇬🇼"},{code:"GY",name:"Guyana",dialCode:"+592",flag:"🇬🇾"},{code:"HT",name:"Haiti",dialCode:"+509",flag:"🇭🇹"},{code:"HN",name:"Honduras",dialCode:"+504",flag:"🇭🇳"},{code:"HK",name:"Hong Kong",dialCode:"+852",flag:"🇭🇰"},{code:"IS",name:"Iceland",dialCode:"+354",flag:"🇮🇸"},{code:"IQ",name:"Iraq",dialCode:"+964",flag:"🇮🇶"},{code:"IR",name:"Iran",dialCode:"+98",flag:"🇮🇷"},{code:"JM",name:"Jamaica",dialCode:"+1876",flag:"🇯🇲"},{code:"JO",name:"Jordan",dialCode:"+962",flag:"🇯🇴"},{code:"KZ",name:"Kazakhstan",dialCode:"+7",flag:"🇰🇿"},{code:"KW",name:"Kuwait",dialCode:"+965",flag:"🇰🇼"},{code:"KG",name:"Kyrgyzstan",dialCode:"+996",flag:"🇰🇬"},{code:"LA",name:"Laos",dialCode:"+856",flag:"🇱🇦"},{code:"LV",name:"Latvia",dialCode:"+371",flag:"🇱🇻"},{code:"LB",name:"Lebanon",dialCode:"+961",flag:"🇱🇧"},{code:"LS",name:"Lesotho",dialCode:"+266",flag:"🇱🇸"},{code:"LR",name:"Liberia",dialCode:"+231",flag:"🇱🇷"},{code:"LY",name:"Libya",dialCode:"+218",flag:"🇱🇾"},{code:"LI",name:"Liechtenstein",dialCode:"+423",flag:"🇱🇮"},{code:"LT",name:"Lithuania",dialCode:"+370",flag:"🇱🇹"},{code:"LU",name:"Luxembourg",dialCode:"+352",flag:"🇱🇺"},{code:"MO",name:"Macau",dialCode:"+853",flag:"🇲🇴"},{code:"MK",name:"North Macedonia",dialCode:"+389",flag:"🇲🇰"},{code:"MG",name:"Madagascar",dialCode:"+261",flag:"🇲🇬"},{code:"MW",name:"Malawi",dialCode:"+265",flag:"🇲🇼"},{code:"MV",name:"Maldives",dialCode:"+960",flag:"🇲🇻"},{code:"ML",name:"Mali",dialCode:"+223",flag:"🇲🇱"},{code:"MT",name:"Malta",dialCode:"+356",flag:"🇲🇹"},{code:"MR",name:"Mauritania",dialCode:"+222",flag:"🇲🇷"},{code:"MU",name:"Mauritius",dialCode:"+230",flag:"🇲🇺"},{code:"MD",name:"Moldova",dialCode:"+373",flag:"🇲🇩"},{code:"MC",name:"Monaco",dialCode:"+377",flag:"🇲🇨"},{code:"MN",name:"Mongolia",dialCode:"+976",flag:"🇲🇳"},{code:"ME",name:"Montenegro",dialCode:"+382",flag:"🇲🇪"},{code:"MA",name:"Morocco",dialCode:"+212",flag:"🇲🇦"},{code:"MZ",name:"Mozambique",dialCode:"+258",flag:"🇲🇿"},{code:"MM",name:"Myanmar",dialCode:"+95",flag:"🇲🇲"},{code:"NA",name:"Namibia",dialCode:"+264",flag:"🇳🇦"},{code:"NP",name:"Nepal",dialCode:"+977",flag:"🇳🇵"},{code:"NI",name:"Nicaragua",dialCode:"+505",flag:"🇳🇮"},{code:"NE",name:"Niger",dialCode:"+227",flag:"🇳🇪"},{code:"KP",name:"North Korea",dialCode:"+850",flag:"🇰🇵"},{code:"OM",name:"Oman",dialCode:"+968",flag:"🇴🇲"},{code:"PK",name:"Pakistan",dialCode:"+92",flag:"🇵🇰"},{code:"PS",name:"Palestine",dialCode:"+970",flag:"🇵🇸"},{code:"PA",name:"Panama",dialCode:"+507",flag:"🇵🇦"},{code:"PG",name:"Papua New Guinea",dialCode:"+675",flag:"🇵🇬"},{code:"PY",name:"Paraguay",dialCode:"+595",flag:"🇵🇾"},{code:"QA",name:"Qatar",dialCode:"+974",flag:"🇶🇦"},{code:"RW",name:"Rwanda",dialCode:"+250",flag:"🇷🇼"},{code:"WS",name:"Samoa",dialCode:"+685",flag:"🇼🇸"},{code:"SM",name:"San Marino",dialCode:"+378",flag:"🇸🇲"},{code:"ST",name:"São Tomé and Príncipe",dialCode:"+239",flag:"🇸🇹"},{code:"SN",name:"Senegal",dialCode:"+221",flag:"🇸🇳"},{code:"RS",name:"Serbia",dialCode:"+381",flag:"🇷🇸"},{code:"SC",name:"Seychelles",dialCode:"+248",flag:"🇸🇨"},{code:"SL",name:"Sierra Leone",dialCode:"+232",flag:"🇸🇱"},{code:"SI",name:"Slovenia",dialCode:"+386",flag:"🇸🇮"},{code:"SB",name:"Solomon Islands",dialCode:"+677",flag:"🇸🇧"},{code:"SO",name:"Somalia",dialCode:"+252",flag:"🇸🇴"},{code:"SS",name:"South Sudan",dialCode:"+211",flag:"🇸🇸"},{code:"LK",name:"Sri Lanka",dialCode:"+94",flag:"🇱🇰"},{code:"SD",name:"Sudan",dialCode:"+249",flag:"🇸🇩"},{code:"SR",name:"Suriname",dialCode:"+597",flag:"🇸🇷"},{code:"SY",name:"Syria",dialCode:"+963",flag:"🇸🇾"},{code:"TW",name:"Taiwan",dialCode:"+886",flag:"🇹🇼"},{code:"TJ",name:"Tajikistan",dialCode:"+992",flag:"🇹🇯"},{code:"TZ",name:"Tanzania",dialCode:"+255",flag:"🇹🇿"},{code:"TL",name:"Timor-Leste",dialCode:"+670",flag:"🇹🇱"},{code:"TG",name:"Togo",dialCode:"+228",flag:"🇹🇬"},{code:"TO",name:"Tonga",dialCode:"+676",flag:"🇹🇴"},{code:"TT",name:"Trinidad and Tobago",dialCode:"+1868",flag:"🇹🇹"},{code:"TN",name:"Tunisia",dialCode:"+216",flag:"🇹🇳"},{code:"TM",name:"Turkmenistan",dialCode:"+993",flag:"🇹🇲"},{code:"UG",name:"Uganda",dialCode:"+256",flag:"🇺🇬"},{code:"UY",name:"Uruguay",dialCode:"+598",flag:"🇺🇾"},{code:"UZ",name:"Uzbekistan",dialCode:"+998",flag:"🇺🇿"},{code:"VU",name:"Vanuatu",dialCode:"+678",flag:"🇻🇺"},{code:"VA",name:"Vatican City",dialCode:"+379",flag:"🇻🇦"},{code:"VE",name:"Venezuela",dialCode:"+58",flag:"🇻🇪"},{code:"YE",name:"Yemen",dialCode:"+967",flag:"🇾🇪"},{code:"ZM",name:"Zambia",dialCode:"+260",flag:"🇿🇲"},{code:"ZW",name:"Zimbabwe",dialCode:"+263",flag:"🇿🇼"}],Vn=({value:n,defaultValue:a,onChange:i,placeholder:o,showSearch:s=!0,searchPlaceholder:r,showDialCode:d,showFlag:N,showFlagInValue:$,showFlagInMenu:D,showTextInValue:ce,showTextInMenu:T,showDialCodeInValue:w,showDialCodeInMenu:Z,showCodeInValue:ae=!1,showCodeInMenu:O=!1,compact:A=!1,variant:j="default",dropdownAlign:ne,disabled:X=!1,countries:B,priorityCountries:ue=["US","GB","DE","FR","PL"],allowClear:oe=!1,size:M="md",className:F="",style:L,label:I,helperText:J,error:S,required:te,readOnly:U,loading:H,labelPlacement:pe,errorPlacement:y,labelWidth:f,controlWidth:h,id:W,"data-testid":K="nice-country-picker"})=>{const{t:C}=m.useNiceTranslation(),b=t.useRef(null),q=t.useRef(null),z=t.useRef(null),[le,Q]=t.useState(a),[se,de]=t.useState(!1),[fe,ie]=t.useState(""),[E,Ce]=t.useState(0),Y=$??N??!0,_e=D??N??!0,G=ce??!A,Me=T??!0,g=w??d??!A,k=Z??d??!0,P=xn.useDropdownAlignment(se,q,ne??(A?"auto":"left")),De=n!==void 0?n:le,me=t.useMemo(()=>{let ee=pt;if(B){const we=new Set(B.map(Ke=>Ke.toUpperCase()));ee=ee.filter(Ke=>we.has(Ke.code))}return ee},[B]),_=t.useMemo(()=>{if(!ue?.length)return me;const ee=new Set(ue.map(Ze=>Ze.toUpperCase())),we=me.filter(Ze=>ee.has(Ze.code)),Ke=me.filter(Ze=>!ee.has(Ze.code));return[...we,...Ke]},[me,ue]),u=t.useMemo(()=>{if(!fe)return _;const ee=fe.toLowerCase();return _.filter(we=>we.name.toLowerCase().includes(ee)||we.code.toLowerCase().includes(ee)||we.dialCode.includes(ee))},[_,fe]),Ne=t.useMemo(()=>De?me.find(ee=>ee.code===De)??null:null,[De,me]);t.useEffect(()=>{if(!se)return;const ee=we=>{b.current&&!b.current.contains(we.target)&&(de(!1),ie(""))};return document.addEventListener("mousedown",ee),()=>document.removeEventListener("mousedown",ee)},[se]),t.useEffect(()=>{se&&s&&z.current&&z.current.focus()},[se,s]),t.useEffect(()=>{Ce(0)},[fe]);const He=t.useCallback(ee=>{n===void 0&&Q(ee.code),i?.(ee),de(!1),ie("")},[n,i]),Be=t.useCallback(ee=>{ee.stopPropagation(),n===void 0&&Q(void 0),i?.(null)},[n,i]),Ee=t.useCallback(ee=>{if(!se){(ee.key==="Enter"||ee.key===" "||ee.key==="ArrowDown")&&(ee.preventDefault(),de(!0));return}switch(ee.key){case"ArrowDown":ee.preventDefault(),Ce(we=>Math.min(we+1,u.length-1));break;case"ArrowUp":ee.preventDefault(),Ce(we=>Math.max(we-1,0));break;case"Enter":ee.preventDefault(),u[E]&&He(u[E]);break;case"Escape":ee.preventDefault(),de(!1),ie("");break}},[se,u,E,He]);return e.jsxs("div",{ref:b,className:`nice-field nice-field--${M} nice-field--country-picker ${pe==="left"?"nice-field--label-left":""} ${y==="right"?"nice-field--error-right":""} ${S?"nice-field--error":""} ${H?"nice-field--loading":""} nice-country-picker nice-country-picker--${M} ${A?"nice-country-picker--compact":""} ${j==="ghost"?"nice-country-picker--ghost":""} ${se?"nice-country-picker--open":""} ${X?"nice-country-picker--disabled":""} ${F}`,style:{...L,...f!=null&&{"--nice-field-label-width":typeof f=="number"?`${f}px`:f},...h!=null&&{"--nice-field-control-width":typeof h=="number"?`${h}px`:h}},"data-testid":K,"aria-busy":H||void 0,children:[I&&e.jsxs("label",{className:"nice-field__label",htmlFor:W,children:[I,te&&e.jsx("span",{className:"nice-field__required",children:"*"})]}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("button",{ref:q,type:"button",className:"nice-country-picker__trigger",onClick:()=>!X&&!U&&de(!se),onKeyDown:Ee,disabled:X,id:W,"aria-haspopup":"listbox","aria-expanded":se,"aria-invalid":S?!0:void 0,"data-testid":`${K}-trigger`,children:[Ne?e.jsxs("span",{className:"nice-country-picker__value",children:[Y&&e.jsx("span",{className:"nice-country-picker__flag","aria-hidden":"true",children:e.jsx(xn.FlagIcon,{code:Ne.code})}),G&&e.jsx("span",{className:"nice-country-picker__name",children:Ne.name}),ae&&e.jsx("span",{className:"nice-country-picker__code",children:Ne.code}),g&&e.jsxs("span",{className:"nice-country-picker__dial-code",children:["(",Ne.dialCode,")"]})]}):e.jsx("span",{className:"nice-country-picker__placeholder",children:A?"":o??C("controls.select","Select country")}),e.jsxs("span",{className:"nice-country-picker__icons",children:[oe&&Ne&&!X&&!U&&e.jsx("span",{className:"nice-country-picker__clear",onClick:Be,"aria-label":C("clear","Clear"),children:e.jsx(m.NiceIcon,{name:"close",size:14})}),j!=="ghost"&&e.jsx("span",{className:"nice-country-picker__arrow",children:e.jsx(m.NiceIcon,{name:se?"chevron-up":"chevron-down",size:16})})]})]}),se&&e.jsxs("div",{className:`nice-country-picker__dropdown nice-country-picker__dropdown--align-${P}`,role:"listbox","data-testid":`${K}-dropdown`,children:[s&&e.jsx("div",{className:"nice-country-picker__search",children:e.jsx("input",{ref:z,type:"text",value:fe,onChange:ee=>ie(ee.target.value),onKeyDown:Ee,placeholder:r??C("search","Search"),className:"nice-country-picker__search-input","data-testid":`${K}-search`})}),e.jsx("div",{className:"nice-country-picker__list",children:u.length===0?e.jsx("div",{className:"nice-country-picker__empty",children:C("noData","No countries found")}):u.map((ee,we)=>e.jsxs("div",{className:`nice-country-picker__option ${ee.code===De?"nice-country-picker__option--selected":""} ${we===E?"nice-country-picker__option--highlighted":""}`,onClick:()=>He(ee),onMouseEnter:()=>Ce(we),role:"option","aria-selected":ee.code===De,"data-testid":`${K}-option-${ee.code}`,children:[_e&&e.jsx("span",{className:"nice-country-picker__flag","aria-hidden":"true",children:e.jsx(xn.FlagIcon,{code:ee.code})}),Me&&e.jsx("span",{className:"nice-country-picker__name",children:ee.name}),O&&e.jsx("span",{className:"nice-country-picker__code",children:ee.code}),k&&e.jsx("span",{className:"nice-country-picker__dial-code",children:ee.dialCode})]},ee.code))})]}),H&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),y==="right"&&S&&e.jsx("div",{className:"nice-field__error",role:"alert",children:S}),y==="right"&&!S&&J&&e.jsx("div",{className:"nice-field__helper",children:J})]}),y!=="right"&&S&&e.jsx("div",{className:"nice-field__error",role:"alert",children:S}),y!=="right"&&!S&&J&&e.jsx("div",{className:"nice-field__helper",children:J})]})};Vn.displayName="NiceCountryPicker";const Ot=["Su","Mo","Tu","We","Th","Fr","Sa"];function Bt(n,a){return new Date(n,a+1,0).getDate()}function Gt(n,a){return new Date(n,a,1).getDay()}function nt(n,a,i){return`${n}-${String(a+1).padStart(2,"0")}-${String(i).padStart(2,"0")}`}function Yt(n){const a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()));a.setUTCDate(a.getUTCDate()+4-(a.getUTCDay()||7));const i=new Date(Date.UTC(a.getUTCFullYear(),0,1));return Math.ceil(((a.getTime()-i.getTime())/864e5+1)/7)}const tt=["January","February","March","April","May","June","July","August","September","October","November","December"],Kn=({value:n,onChange:a,min:i,max:o,disabledDates:s=[],firstDayOfWeek:r=1,size:d="md",showWeekNumbers:N,onMonthChange:$,className:D,style:ce,accessMode:T,id:w,multiple:Z,selectedDates:ae,onSelectedDatesChange:O,selectionMode:A="single",rangeStart:j,rangeEnd:ne,onRangeChange:X,renderDay:B,showKeyboardHints:ue,persistPreferences:oe=!1,fullWidth:M=!1,cookies:F=!1,localStorage:L=!0,sessionStorage:I=!1,storageMode:J,storageKey:S})=>{const te=m.useNiceAccessMode(T,w),U=te==="hidden",H=te==="disabled"||te==="readOnly",{t:pe}=m.useNiceTranslation(),y=new Date,f=(A==="range"?j:n)||n,h=f?new Date(f):y,W=Nt.useStorageAdapter(S??"nice-calendar"),K=t.useMemo(()=>oe?W.get("prefs")??{}:{},[oe,W]),C=K.firstDayOfWeek??r,[b,q]=t.useState(K.lastViewYear??h.getFullYear()),[z,le]=t.useState(K.lastViewMonth??h.getMonth()),[Q,se]=t.useState(K.preferredView??"days"),[de,fe]=t.useState([]),ie=ae??de,[E,Ce]=t.useState(null),Y=t.useCallback(v=>{if(!oe)return;const p=W.get("prefs")??{};W.set("prefs",{...p,...v})},[oe,W]),_e=t.useCallback(v=>{se(v),Y({preferredView:v})},[Y]),G=t.useCallback((v,p)=>{Y({lastViewYear:v,lastViewMonth:p})},[Y]),Me=t.useMemo(()=>[m.COMMON_SHORTCUTS.moveUp,m.COMMON_SHORTCUTS.moveDown,m.COMMON_SHORTCUTS.moveLeft,m.COMMON_SHORTCUTS.moveRight,{key:"Enter",description:pe("shortcuts.selectDate","Select date")},m.COMMON_SHORTCUTS.pageUp,m.COMMON_SHORTCUTS.pageDown],[pe]),g=t.useMemo(()=>Bt(b,z),[b,z]),k=t.useMemo(()=>(Gt(b,z)-C+7)%7,[b,z,C]),P=t.useMemo(()=>{const v=[...Ot];for(let p=0;p<C;p++)v.push(v.shift());return v},[C]),De=t.useCallback(v=>{const p=ge=>/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])/.test(ge);return i&&p(i)&&v<i||o&&p(o)&&v>o?!0:s.includes(v)},[i,o,s]),me=t.useCallback(v=>{if(Q==="years"){q(ze=>ze+v*10);return}if(Q==="months"){q(ze=>ze+v);return}let p=z+v,ge=b;p<0&&(p=11,ge--),p>11&&(p=0,ge++),le(p),q(ge),G(ge,p),$?.(ge,p)},[z,b,$,Q,G]),_=nt(y.getFullYear(),y.getMonth(),y.getDate()),u=A==="range",Ne=t.useCallback(v=>u?v===j||v===ne:Z?ie.includes(v):v===n,[u,j,ne,Z,ie,n]),[He,Be]=t.useMemo(()=>{if(!u||!j)return["",""];const v=ne||E;return v?v<j?[v,j]:[j,v]:[j,j]},[u,j,ne,E]),Ee=t.useCallback(v=>{if(!H){if(u){const p=!j||ne?{start:v,end:""}:v<j?{start:v,end:j}:{start:j,end:v};Ce(null),X?.(p),a?.(v);return}if(Z){const p=ie.includes(v)?ie.filter(ge=>ge!==v):[...ie,v];ae===void 0&&fe(p),O?.(p)}a?.(v)}},[H,u,j,ne,X,Z,ie,ae,a,O]),ee=t.useCallback(()=>{Q==="days"?_e("months"):Q==="months"&&_e("years")},[Q,_e]),we=t.useCallback(v=>{le(v),_e("days"),G(b,v),$?.(b,v)},[b,$,_e,G]),Ke=t.useCallback(v=>{q(v),_e("months")},[_e]),Ze=Q==="years"?`${b-b%10} – ${b-b%10+9}`:Q==="months"?`${b}`:`${tt[z]} ${b}`,tn=Q==="years"?"decade":Q==="months"?"year":"month",Ge=[];for(let v=0;v<k;v++)Ge.push(null);for(let v=1;v<=g;v++)Ge.push(v);for(;Ge.length%7!==0;)Ge.push(null);const je=[];for(let v=0;v<Ge.length;v+=7)je.push(Ge.slice(v,v+7));const an=b-b%10;return U?null:e.jsxs("div",{className:`nice-calendar nice-calendar--${d}${M?" nice-calendar--full-width":""} ${D||""}`,style:ce,children:[e.jsxs("div",{className:"nice-calendar__header",children:[e.jsx("button",{type:"button",className:"nice-calendar__nav",onClick:()=>me(-1),"aria-label":`Previous ${tn}`,children:e.jsx(m.NiceIcon,{name:"chevron-left",size:16})}),e.jsx("button",{type:"button",className:"nice-calendar__title",onClick:ee,"aria-label":Q==="days"?"Show month picker":Q==="months"?"Show year picker":void 0,disabled:Q==="years",children:Ze}),e.jsx("button",{type:"button",className:"nice-calendar__nav",onClick:()=>me(1),"aria-label":`Next ${tn}`,children:e.jsx(m.NiceIcon,{name:"chevron-right",size:16})}),ue&&e.jsx(m.NiceKeyboardHint,{shortcuts:Me,size:"sm"})]}),Q==="days"&&e.jsxs("table",{className:"nice-calendar__grid",role:"grid",onMouseLeave:u?()=>Ce(null):void 0,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[N&&e.jsx("th",{className:"nice-calendar__wk",children:"W"}),P.map(v=>e.jsx("th",{children:v},v))]})}),e.jsx("tbody",{children:je.map((v,p)=>e.jsxs("tr",{children:[N&&e.jsx("td",{className:"nice-calendar__wk",children:v.find(ge=>ge!=null)?Yt(new Date(b,z,v.find(ge=>ge!=null))):""}),v.map((ge,ze)=>{if(ge==null)return e.jsx("td",{className:"nice-calendar__empty-cell"},ze);const Ae=nt(b,z,ge),Oe=De(Ae),Pe=Ne(Ae),Je=Ae===_,yn=He!==""&&Ae>=He&&Ae<=Be?` nice-calendar__day--in-range${Ae===He?" nice-calendar__day--range-start":""}${Ae===Be?" nice-calendar__day--range-end":""}`:"";return e.jsx("td",{className:`nice-calendar__day${Pe?" nice-calendar__day--selected":""}${yn}${Je?" nice-calendar__day--today":""}${Oe?" nice-calendar__day--disabled":""}`,onClick:()=>!Oe&&Ee(Ae),onMouseEnter:u&&!Oe?()=>Ce(Ae):void 0,role:"gridcell","aria-selected":Pe,"aria-disabled":Oe,children:B?B(Ae,ge):ge},ze)})]},p))})]}),Q==="months"&&e.jsx("div",{className:"nice-calendar__picker-grid",children:tt.map((v,p)=>e.jsx("button",{type:"button",className:`nice-calendar__picker-cell${p===z&&b===h.getFullYear()?" nice-calendar__picker-cell--selected":""}`,onClick:()=>we(p),children:v.slice(0,3)},p))}),Q==="years"&&e.jsx("div",{className:"nice-calendar__picker-grid",children:Array.from({length:12},(v,p)=>an-1+p).map(v=>e.jsx("button",{type:"button",className:`nice-calendar__picker-cell${v===b?" nice-calendar__picker-cell--selected":""}${v<an||v>an+9?" nice-calendar__picker-cell--other":""}`,onClick:()=>Ke(v),children:v},v))})]})};Kn.displayName="NiceCalendar";const Vt={"date-local":{inputType:"date",localized:!0},"date-utc":{inputType:"date",localized:!1},"datetime-local":{inputType:"datetime-local",localized:!0},"datetime-utc":{inputType:"datetime-local",localized:!1},"month-local":{inputType:"month",localized:!0},"month-utc":{inputType:"month",localized:!1},week:{inputType:"week",localized:!1},time:{inputType:"time",localized:!1}},it={date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm",month:"yyyy-MM",week:"yyyy-Www",time:"HH:mm"},Kt={"yyyy-MM-dd":"YYYY-MM-DD","yyyy-MM-ddTHH:mm":"YYYY-MM-DDTHH:MM","yyyy-MM":"YYYY-MM","yyyy-Www":"YYYY-Www","HH:mm":"HH:MM"};function Ln(n){const a=(n||"").toLowerCase().replace("_","-"),i=a.split("-")[0],o={pl:"dd.MM.yyyy","pl-pl":"dd.MM.yyyy",de:"dd.MM.yyyy","de-de":"dd.MM.yyyy","de-at":"dd.MM.yyyy","de-ch":"dd.MM.yyyy",cs:"dd.MM.yyyy","cs-cz":"dd.MM.yyyy",sk:"dd.MM.yyyy","sk-sk":"dd.MM.yyyy",ru:"dd.MM.yyyy","ru-ru":"dd.MM.yyyy",fi:"dd.MM.yyyy","fi-fi":"dd.MM.yyyy",no:"dd.MM.yyyy",nb:"dd.MM.yyyy",nn:"dd.MM.yyyy",da:"dd.MM.yyyy","da-dk":"dd.MM.yyyy",tr:"dd.MM.yyyy","tr-tr":"dd.MM.yyyy",sl:"dd.MM.yyyy",hr:"dd.MM.yyyy",sr:"dd.MM.yyyy",ro:"dd.MM.yyyy",bg:"dd.MM.yyyy",uk:"dd.MM.yyyy",is:"dd.MM.yyyy",et:"dd.MM.yyyy",lv:"dd.MM.yyyy",lt:"dd.MM.yyyy","en-gb":"dd/MM/yyyy","en-au":"dd/MM/yyyy","en-ie":"dd/MM/yyyy","en-nz":"dd/MM/yyyy","en-in":"dd/MM/yyyy",fr:"dd/MM/yyyy","fr-fr":"dd/MM/yyyy","fr-be":"dd/MM/yyyy",es:"dd/MM/yyyy","es-es":"dd/MM/yyyy",pt:"dd/MM/yyyy","pt-pt":"dd/MM/yyyy","pt-br":"dd/MM/yyyy",it:"dd/MM/yyyy","it-it":"dd/MM/yyyy",nl:"dd-MM-yyyy","nl-nl":"dd-MM-yyyy","nl-be":"dd/MM/yyyy",el:"dd/MM/yyyy",hu:"yyyy.MM.dd",en:"MM/dd/yyyy","en-us":"MM/dd/yyyy","en-ca":"MM/dd/yyyy",ja:"yyyy/MM/dd","ja-jp":"yyyy/MM/dd",ko:"yyyy.MM.dd","ko-kr":"yyyy.MM.dd",zh:"yyyy/MM/dd","zh-cn":"yyyy/MM/dd","zh-tw":"yyyy/MM/dd",sv:"yyyy-MM-dd","sv-se":"yyyy-MM-dd"};if(o[a])return o[a];if(o[i])return o[i];try{const r=new Intl.DateTimeFormat(n,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(2024,0,15));let d="";for(const N of r)if(N.type==="day")d+="dd";else if(N.type==="month")d+="MM";else if(N.type==="year")d+="yyyy";else if(N.type==="literal"){const $=N.value.replace(/[\u00A0\u202F\u2009]/g," ").trim();d+=$||"."}return!/y/.test(d)||!/M/.test(d)||!/d/.test(d)?"yyyy-MM-dd":d}catch{return"yyyy-MM-dd"}}function qt(n){const i=Ln(n).replace(/dd[^\w]*/g,"").replace(/[^\w]*dd/g,"");return!/y/.test(i)||!/M/.test(i)?"yyyy-MM":i}function qn(){if(typeof document<"u"){const n=document.documentElement?.lang;if(n&&/^[a-zA-Z]{2,}/.test(n))return n}return typeof navigator<"u"&&navigator.language?navigator.language:"en-US"}function Zt(n,a,i,o=!1){it[n]||(n="date");let s=it[n];o&&(n==="datetime-local"||n==="time")&&(s=s.replace("HH:mm","HH:mm:ss"));let r=s;a&&(n==="date"||n==="datetime-local"||n==="month")&&(n==="date"?r=Ln(i):n==="datetime-local"?r=`${Ln(i)} HH:mm${o?":ss":""}`:r=qt(i)),n==="datetime-local"&&(r=r.replace("T"," · "));const d=Kt[r]??r.replace(/y/g,"Y").replace(/M/g,"M").replace(/d/g,"D").replace(/H/g,"H").replace(/m/g,"M").replace(/s/g,"S");return{displayTpl:r,isoTpl:s,placeholder:d}}const Jt=new Set(["y","M","d","H","m","s","w"]);function nn(n){return Jt.has(n)}function Zn(n){let a=0;for(const i of n)nn(i)&&a++;return a}function Jn(n,a){let i="",o=0;for(const s of n)if(nn(s)){if(o>=a.length)break;i+=a[o++]}else{if(o===0)break;o>=a.length,i+=s}return i}function Qt(n,a,i){if(i.length===0)return"";const o={};let s=0;for(const N of n)nn(N)&&(s>=i.length?(o[N]??(o[N]=[])).push(""):(o[N]??(o[N]=[])).push(i[s]),s++);const r={};let d="";for(const N of a)if(nn(N)){const $=o[N]??[],D=r[N]??0;d+=$[D]??"",r[N]=D+1}return d}function on(n,a,i){if(i.length===0)return"";const o={};let s=0;for(const N of a)nn(N)&&((o[N]??(o[N]=[])).push(i[s]??""),s++);const r={};let d="";for(const N of n)if(nn(N)){const $=o[N]??[],D=r[N]??0;d+=$[D]??"",r[N]=D+1}return d.replace(/\s+$/,"")}function at(n,a,i){const o=Zn(a);if(i.length<o)return"";const s=Qt(n,a,i);if(s.length<o)return"";let r="",d=0;for(const N of a)nn(N)?r+=s[d++]:r+=N;return r}function st(n,a,i){return n&&(a&&n<a?a:i&&n>i?i:n)}function $e(n){return n.toString().padStart(2,"0")}function _n(n){const a=/(\d{2}):(\d{2})(?::(\d{2}))?$/.exec(n);return a?{hours:Number(a[1]),minutes:Number(a[2]),seconds:Number(a[3]??0)}:null}function lt(n,a,i,o,s){const r=s?`${$e(a)}:${$e(i)}:${$e(o)}`:`${$e(a)}:${$e(i)}`;return n.replace(/\d{2}:\d{2}(?::\d{2})?$/,r)}function ft(n,a){if(n<=0)return a;const i=Math.floor(n/864e5),o=`${$e(Math.floor(n%864e5/36e5))}:${$e(Math.floor(n%36e5/6e4))}:${$e(Math.floor(n%6e4/1e3))}`;return i>0?`${i}d ${o}`:o}function Xt(n,a){if(n<=0)return a;const i=Math.floor(n/864e5),o=Math.floor(n%864e5/36e5),s=Math.floor(n%36e5/6e4),r=Math.floor(n%6e4/1e3),d=[];return i&&d.push(`${i}d`),(i||o)&&d.push(`${o}h`),(i||o||s)&&d.push(`${s}m`),d.push(`${r}s`),d.join(" ")}function Wt(n,a){if(n<=0)return a;const i=Math.floor(n/1e3),o=Math.floor(i/3600),s=Math.floor(i%3600/60),r=i%60;return o>0?`${$e(o)}:${$e(s)}:${$e(r)}`:`${$e(s)}:${$e(r)}`}function ei(n,a){if(n<=0)return a;const i=Math.floor(n/1e3),o=Math.floor(i/86400);if(o)return`${o}d`;const s=Math.floor(i/3600);if(s)return`${s}h`;const r=Math.floor(i/60);return r?`${r}m`:`${i}s`}function ni(n,a){if(n<=0)return a;const i=Math.floor(n/1e3),o=Math.floor(i/86400),s=Math.floor(i%86400/3600),r=Math.floor(i%3600/60),d=[];return o&&d.push(`${o} ${o===1?"day":"days"}`),s&&d.push(`${s} ${s===1?"hour":"hours"}`),r&&d.push(`${r} ${r===1?"minute":"minutes"}`),d.length?d.join(", "):"less than a minute"}const ti={verbose:ft,compact:Xt,short:Wt,minimal:ei,words:ni};function ii(n,a,i){const o=n?_n(n):null,{hours:s,minutes:r,seconds:d}=o??{hours:0,minutes:0,seconds:0},N=new Date(i);if(a!=null){const D=typeof a=="string"?new Date(a):new Date(a.getTime());if(!Number.isNaN(D.getTime()))return D.setHours(s,r,d,0),D}if(n&&/^\d{4}-\d{2}-\d{2}T/.test(n)){const D=new Date(n);if(!Number.isNaN(D.getTime()))return D}const $=new Date(N);return $.setHours(s,r,d,0),$.getTime()<=N.getTime()&&$.setDate($.getDate()+1),$}function hn(n,a){if(!n)return"";const i=n.replace(/[^0-9]/g,""),o=Zn(a);return i.slice(0,o)}function Xe(n,a,i){const o=Jn(n,i);let s=0;const r=Math.min(a,o.length);for(let d=0;d<r;d++)nn(n[d])&&s++;return Math.min(s,i.length)}function ai(n,a,i){if(i<=0)return 0;const o=Jn(n,a);let s=0;for(let r=0;r<o.length;r++)if(nn(n[r])&&(s++,s===i)){let d=r+1;for(;d<o.length&&!nn(n[d]);)d++;return d}return o.length}const Fn=40;function si(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}const li=({part:n,label:a,value:i,max:o,step:s,onPick:r,onStep:d,startHold:N,stopHold:$})=>{const D=t.useRef(null),ce=t.useRef(!1),T=t.useRef(null),w=t.useRef(null),Z=t.useMemo(()=>{const M=[],F=s>0?s:1;for(let L=0;L<=o;L+=F)M.push(L);return M},[o,s]),ae=Math.max(0,Math.min(Z.length-1,Math.round(i/(s>0?s:1)))),O=Z.length,A=t.useMemo(()=>[...Z,...Z,...Z],[Z]),j=O+ae,ne=t.useRef(!1);t.useLayoutEffect(()=>{const M=D.current;if(!M)return;const F=j*Fn;if(Math.abs(M.scrollTop-F)<1)return;const L=Math.abs(M.scrollTop/Fn-j);ce.current=!0,T.current&&(clearTimeout(T.current),T.current=null);const I=ne.current&&L<=3&&!si();M.scrollTo({top:F,behavior:I?"smooth":"instant"}),ne.current=!0,w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{ce.current=!1},380)},[j]),t.useEffect(()=>()=>{T.current&&clearTimeout(T.current),w.current&&clearTimeout(w.current)},[]);const X=()=>{ce.current||(T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{const M=D.current;if(!M)return;const F=Math.round(M.scrollTop/Fn),L=Z[(F%O+O)%O];L!==i&&r(L)},110))},B=M=>{M.key==="ArrowUp"?(M.preventDefault(),d(-1)):M.key==="ArrowDown"&&(M.preventDefault(),d(1))},ue=M=>{const F=M.replace(/\D/g,"");if(!F)return;const L=Number(F.slice(-2));r(Math.max(0,Math.min(o,L)))},oe=M=>{D.current&&D.current.scrollBy({top:M.deltaY})};return e.jsxs("div",{className:"nice-datetime-popup__spinner",role:"group","aria-label":a,children:[e.jsx("div",{ref:D,className:"nice-datetime-popup__spin-column",role:"listbox",tabIndex:-1,"aria-label":a,"aria-activedescendant":`${n}-opt-${j}`,onScroll:X,children:A.map((M,F)=>e.jsx("button",{type:"button",id:`${n}-opt-${F}`,role:"option","aria-selected":F===j,className:`nice-datetime-popup__spin-item${F===j?" is-selected":""}`,onClick:()=>r(M),tabIndex:-1,children:$e(M)},F))}),e.jsxs("div",{className:"nice-datetime-popup__spin-center",onWheel:oe,children:[e.jsx("button",{type:"button",className:"nice-datetime-popup__spin-btn",onClick:()=>d(-1),onPointerDown:()=>N(()=>d(-1)),onPointerUp:$,onPointerLeave:$,"aria-label":`${a} -`,tabIndex:-1,children:e.jsx(m.NiceIcon,{name:"chevron-up",size:14})}),e.jsx("input",{className:"nice-datetime-popup__spin-value",inputMode:"numeric","aria-label":a,value:$e(i),onFocus:M=>M.currentTarget.select(),onChange:M=>ue(M.target.value),onKeyDown:B}),e.jsx("button",{type:"button",className:"nice-datetime-popup__spin-btn",onClick:()=>d(1),onPointerDown:()=>N(()=>d(1)),onPointerUp:$,onPointerLeave:$,"aria-label":`${a} +`,tabIndex:-1,children:e.jsx(m.NiceIcon,{name:"chevron-down",size:14})})]})]})},ci=({hours:n,minutes:a,minuteStep:i,onChange:o,t:s})=>{const[r,d]=t.useState("hours"),N=t.useRef(null),$=100,D=78,ce=52,T=62,w=65,Z=18,ae=n>=12?"PM":"AM",O=n%12===0?12:n%12,A=(y,f)=>{const h=(y-90)*Math.PI/180;return{x:$+f*Math.cos(h),y:$+f*Math.sin(h)}},j=y=>{const f=ae==="PM"?y%12+12:y%12;o(f,a)},ne=y=>{const f=i&&i>1?i:1,h=Math.round(y/f)*f%60;o(n,h)},X=y=>{if(y===ae)return;const f=y==="PM"?n+12:n-12;o((f%24+24)%24,a)},B=y=>{const f=y.currentTarget.getBoundingClientRect(),h=(y.clientX-f.left)/f.width*200-$,W=(y.clientY-f.top)/f.height*200-$;let K=Math.atan2(W,h)*180/Math.PI+90;return K<0&&(K+=360),{ang:K,radius:Math.hypot(h,W)}},ue=(y,f)=>{if(y==="hours"){const h=Math.round(f/30)%12;j(h===0?12:h)}else ne(Math.round(f/6)%60)},oe=y=>{const{ang:f,radius:h}=B(y);if(h<Z)return;const W=h>w?"hours":"minutes";N.current=W,d(W),y.currentTarget.setPointerCapture?.(y.pointerId),ue(W,f)},M=y=>{const f=N.current;f&&ue(f,B(y).ang)},F=y=>{N.current&&(N.current=null,y.currentTarget.releasePointerCapture?.(y.pointerId))},L=Array.from({length:12},(y,f)=>f+1),I=i&&i>1?i:5,J=[];for(let y=0;y<60;y+=I)J.push(y);const S=i&&i>1?i:1,te=Math.round(a/S)*S%60,U=r==="hours",H=A(O%12*30,D),pe=A(te*6,ce);return e.jsxs("div",{className:"nice-datetime-popup__clock",children:[e.jsxs("div",{className:"nice-datetime-popup__clock-readout",children:[e.jsx("button",{type:"button",className:`nice-datetime-popup__clock-seg${r==="hours"?" nice-datetime-popup__clock-seg--active":""}`,onClick:()=>d("hours"),"aria-label":s("datetime.hours","Hours"),children:$e(O)}),e.jsx("span",{className:"nice-datetime-popup__clock-colon",children:":"}),e.jsx("button",{type:"button",className:`nice-datetime-popup__clock-seg${r==="minutes"?" nice-datetime-popup__clock-seg--active":""}`,onClick:()=>d("minutes"),"aria-label":s("datetime.minutes","Minutes"),children:$e(a)}),e.jsxs("div",{className:"nice-datetime-popup__clock-ampm",role:"group",children:[e.jsx("button",{type:"button",className:`nice-datetime-popup__clock-period${ae==="AM"?" nice-datetime-popup__clock-period--active":""}`,onClick:()=>X("AM"),"aria-pressed":ae==="AM",children:"AM"}),e.jsx("button",{type:"button",className:`nice-datetime-popup__clock-period${ae==="PM"?" nice-datetime-popup__clock-period--active":""}`,onClick:()=>X("PM"),"aria-pressed":ae==="PM",children:"PM"})]})]}),e.jsxs("svg",{viewBox:"0 0 200 200",className:"nice-datetime-popup__clock-face",onPointerDown:oe,onPointerMove:M,onPointerUp:F,onPointerCancel:F,role:"img","aria-label":s("datetime.clockMode","Analog clock"),children:[e.jsx("circle",{cx:$,cy:$,r:96,className:"nice-datetime-popup__clock-bg"}),J.map(y=>{const f=A(y*6,T);return e.jsx("circle",{cx:f.x,cy:f.y,r:y===te?2.6:1.5,className:`nice-datetime-popup__clock-tick${y===te?" nice-datetime-popup__clock-tick--active":""}`},`tick-${y}`)}),e.jsx("line",{x1:$,y1:$,x2:H.x,y2:H.y,className:`nice-datetime-popup__clock-hand nice-datetime-popup__clock-hand--hour${U?" nice-datetime-popup__clock-hand--active":""}`}),e.jsx("line",{x1:$,y1:$,x2:pe.x,y2:pe.y,className:`nice-datetime-popup__clock-hand nice-datetime-popup__clock-hand--minute${U?"":" nice-datetime-popup__clock-hand--active"}`}),e.jsx("circle",{cx:H.x,cy:H.y,r:15,className:"nice-datetime-popup__clock-knob"}),e.jsx("circle",{cx:pe.x,cy:pe.y,r:12,className:"nice-datetime-popup__clock-knob nice-datetime-popup__clock-knob--minute"}),e.jsx("circle",{cx:$,cy:$,r:4,className:"nice-datetime-popup__clock-center"}),L.map(y=>{const f=A(y*30,D);return e.jsx("text",{x:f.x,y:f.y,className:`nice-datetime-popup__clock-num${y===O?" nice-datetime-popup__clock-num--active":""}`,textAnchor:"middle",dominantBaseline:"central",children:y},`h-${y}`)}),J.map(y=>{const f=A(y*6,ce);return e.jsx("text",{x:f.x,y:f.y,className:`nice-datetime-popup__clock-num nice-datetime-popup__clock-num--minute${y===te?" nice-datetime-popup__clock-num--active":""}`,textAnchor:"middle",dominantBaseline:"central",children:$e(y)},`m-${y}`)})]})]})},gn=t.forwardRef(({label:n,helperText:a,error:i,required:o,disabled:s,readOnly:r,size:d="md",name:N,id:$,className:D,style:ce,accessMode:T,value:w,onChange:Z,onBlur:ae,onKeyDown:O,min:A,max:j,type:ne,dateFormatPreset:X,submitOnEnter:B,onSubmit:ue,showKeyboardHints:oe,displayStyle:M,labelPlacement:F,errorPlacement:L,loading:I,labelWidth:J,controlWidth:S,placeholder:te,clearable:U=!1,showPickerButton:H=!0,displayLocale:pe,keyboardShortcuts:y=!0,showSeconds:f=!1,minuteStep:h=1,showNow:W=!1,hourFormat:K="24",timeSelectorType:C="spinners",targetDate:b,onTargetChange:q,countdown:z=!1,countdownFormat:le="verbose",formatCountdown:Q,countdownLabel:se,countdownInterval:de=1e3,countdownDoneText:fe},ie)=>{const E=m.useComponentDisplayStyle("input",M),Ce=m.useComponentDisplayClass("input",M),Y=m.useNiceAccessMode(T,$),_e=Y==="hidden";Y==="disabled"&&(s=!0),Y==="readOnly"&&(r=!0);const{t:G}=m.useNiceTranslation(),Me=m.useControlId($),g=t.useRef(null),k=t.useRef(null),P=t.useRef(null),De=t.useRef(null),[me,_]=t.useState(!1),[u,Ne]=t.useState(null),[He,Be]=t.useState(""),[Ee,ee]=t.useState(C);t.useEffect(()=>{ee(C)},[C]);const Ke=t.useContext(m.NiceThemeContext)?.portalTarget??(typeof document<"u"?document.body:null),{start:Ze,stop:tn}=m.useHoldRepeat(),Ge=X?Vt[X]:null,je=Ge?.inputType??ne??"date",an=Ge?.localized??!1,v=pe??qn(),p=t.useMemo(()=>Zt(je,an,v,f),[je,an,v,f]),ge=t.useMemo(()=>Zn(p.isoTpl),[p.isoTpl]),[ze,Ae]=t.useState(()=>{const c=hn(w,p.isoTpl);return on(p.displayTpl,p.isoTpl,c)}),Oe=t.useRef(ze);t.useEffect(()=>{Oe.current=ze},[ze]);const Pe=t.useRef(w??""),Je=t.useRef(null);t.useEffect(()=>{const c=w??"";if(c===Pe.current)return;const x=hn(c,p.isoTpl),R=on(p.displayTpl,p.isoTpl,x);Ae(R),Pe.current=c},[w,p.displayTpl,p.isoTpl]),t.useEffect(()=>{const c=hn(w,p.isoTpl);Ae(on(p.displayTpl,p.isoTpl,c))},[p.displayTpl,p.isoTpl]),t.useEffect(()=>{if(Je.current==null)return;const c=Je.current;Je.current=null;const x=g.current;if(x&&document.activeElement===x)try{x.setSelectionRange(c,c)}catch{}});const Cn=t.useMemo(()=>Jn(p.displayTpl,ze),[p.displayTpl,ze]),yn=te??p.placeholder,Sn=Math.max(p.displayTpl.length+1,9),bn=m.useSubmitOnEnter({enabled:B,onSubmit:ue}),Ue=t.useCallback((c,x)=>{const R=c.slice(0,ge);Oe.current=R,Ae(R),Je.current=ai(p.displayTpl,R,Math.max(0,Math.min(R.length,x)));const ye=st(at(p.displayTpl,p.isoTpl,R),A,j);ye!==Pe.current&&(Pe.current=ye,Z?.(ye))},[Z,p.displayTpl,p.isoTpl,ge,A,j]),We=t.useCallback(c=>{const x=st(c,A,j),R=hn(x,p.isoTpl);Pe.current=x,Ae(on(p.displayTpl,p.isoTpl,R)),Z?.(x)},[Z,p.displayTpl,p.isoTpl,A,j]),en=je==="time"||je==="datetime-local",rn=t.useCallback(()=>at(p.displayTpl,p.isoTpl,Oe.current),[p.displayTpl,p.isoTpl]),Dn=t.useCallback(()=>{if(s||r)return;const c=rn(),x=c?_n(c):null;if(!x)return;const R=x.hours>=12?x.hours-12:x.hours+12;We(lt(c,R,x.minutes,x.seconds,f))},[s,r,rn,We,f]),Rn=(()=>{const c=_n(w??"");return c&&c.hours>=12?"PM":"AM"})(),An=t.useCallback(c=>{if(bn(c),r||s){O?.(c);return}const x=c.key;if(c.ctrlKey||c.metaKey||c.altKey){O?.(c);return}if(en&&(x==="ArrowUp"||x==="ArrowDown")){const xe=rn(),Se=xe?_n(xe):null;if(Se){c.preventDefault();const be=x==="ArrowUp"?1:-1;let{minutes:Le,seconds:Ye}=Se;f?Ye=((Ye+be)%60+60)%60:Le=((Le+be*h)%60+60)%60,We(lt(xe,Se.hours,Le,Ye,f)),O?.(c);return}}const R=Oe.current;if(x==="Escape"&&R.length>0){c.preventDefault(),Ue("",0),O?.(c);return}if(y&&(p.isoTpl==="yyyy-MM-dd"||p.isoTpl==="yyyy-MM-ddTHH:mm"||p.isoTpl==="yyyy-MM")){const xe=be=>{const Le=String(be.getFullYear()).padStart(4,"0"),Ye=String(be.getMonth()+1).padStart(2,"0"),fn=String(be.getDate()).padStart(2,"0");let mn="";if(p.isoTpl==="yyyy-MM")mn=`${Le}-${Ye}`;else if(p.isoTpl==="yyyy-MM-dd")mn=`${Le}-${Ye}-${fn}`;else{const Ct=String(be.getHours()).padStart(2,"0"),bt=String(be.getMinutes()).padStart(2,"0");mn=`${Le}-${Ye}-${fn}T${Ct}:${bt}`}We(mn)},Se=()=>{if(w&&/^\d{4}-\d{2}/.test(w)){const be=new Date(w);if(!Number.isNaN(be.getTime()))return be}return new Date};if(x==="t"||x==="T"){c.preventDefault(),xe(new Date),O?.(c);return}if(x==="+"||x==="="||x==="-"){c.preventDefault();const be=x==="-"?-1:1,Le=Se();Le.setDate(Le.getDate()+be),xe(Le),O?.(c);return}if(x==="m"||x==="M"){c.preventDefault();const be=Se();be.setMonth(be.getMonth()+(x==="M"?-1:1)),xe(be),O?.(c);return}if(x==="y"||x==="Y"){c.preventDefault();const be=Se();be.setFullYear(be.getFullYear()+(x==="Y"?-1:1)),xe(be),O?.(c);return}}const ye=c.currentTarget,Te=ye.selectionStart??0,Fe=ye.selectionEnd??0;if(/^[0-9]$/.test(x)){c.preventDefault();const xe=Xe(p.displayTpl,Te,R),Se=Xe(p.displayTpl,Fe,R),be=R.slice(0,xe),Le=R.slice(Se);let Ye=(be+x+Le).slice(0,ge);xe===Se&&be.length+1+Le.length>ge&&(Ye=(be+x+Le.slice(1)).slice(0,ge)),Ue(Ye,xe+1),O?.(c);return}if(x==="Backspace"){if(c.preventDefault(),Te!==Fe){const xe=Xe(p.displayTpl,Te,R),Se=Xe(p.displayTpl,Fe,R),be=R.slice(0,xe)+R.slice(Se);Ue(be,xe)}else{const xe=Xe(p.displayTpl,Te,R);if(xe===0){O?.(c);return}const Se=R.slice(0,xe-1)+R.slice(xe);Ue(Se,xe-1)}O?.(c);return}if(x==="Delete"){if(c.preventDefault(),Te!==Fe){const xe=Xe(p.displayTpl,Te,R),Se=Xe(p.displayTpl,Fe,R),be=R.slice(0,xe)+R.slice(Se);Ue(be,xe)}else{const xe=Xe(p.displayTpl,Te,R);if(xe>=R.length){O?.(c);return}const Se=R.slice(0,xe)+R.slice(xe+1);Ue(Se,xe)}O?.(c);return}O?.(c)},[Ue,s,bn,O,r,p.displayTpl,p.isoTpl,ge,y,w,en,rn,We,f,h]),[dn,Nn]=t.useState(()=>Date.now());t.useEffect(()=>{if(!z)return;const c=window.setInterval(()=>Nn(Date.now()),Math.max(100,de));return()=>window.clearInterval(c)},[z,de]);const l=t.useMemo(()=>ii(w,b,dn),[w,b,dn]),V=t.useRef(0);t.useEffect(()=>{if(!q)return;const c=l.getTime();c!==V.current&&(V.current=c,q(l))},[l,q]);const re=t.useMemo(()=>{if(!z)return null;const c=l.getTime()-dn;return Q?Q(c,l):(ti[le]??ft)(c,fe??G("datetime.countdownDone","Done"))},[z,l,dn,Q,le,fe,G]),ve=t.useCallback(c=>{if(r||s)return;const x=c.clipboardData.getData("text");if(!x)return;c.preventDefault();const R=Oe.current,ye=x.replace(/[^0-9]/g,"");let Te;ye.length===ge&&(x.includes("-")||x.includes("T"))?Te=on(p.displayTpl,p.isoTpl,ye):Te=ye.slice(0,ge);const Fe=c.currentTarget,xe=Fe.selectionStart??0,Se=Fe.selectionEnd??0,be=Xe(p.displayTpl,xe,R),Le=Xe(p.displayTpl,Se,R),Ye=R.slice(0,be),fn=R.slice(Le),mn=(Ye+Te+fn).slice(0,ge);Ue(mn,Math.min(ge,Ye.length+Te.length))},[Ue,s,r,p.displayTpl,p.isoTpl,ge]),ke=t.useCallback(c=>{const x=c;if(x.inputType==="insertText"||x.inputType==="insertCompositionText"||x.inputType==="insertFromComposition"){const R=x.data??"";if(!/^[0-9]+$/.test(R)){c.preventDefault();return}if(R.length>1){c.preventDefault();const ye=c.currentTarget,Te=ye.selectionStart??0,Fe=ye.selectionEnd??0,xe=Oe.current,Se=Xe(p.displayTpl,Te,xe),be=Xe(p.displayTpl,Fe,xe),Le=xe.slice(0,Se),Ye=xe.slice(be),fn=(Le+R+Ye).slice(0,ge);Ue(fn,Math.min(ge,Le.length+R.length))}}},[Ue,p.displayTpl,ge]),he=t.useCallback(c=>{if(r||s)return;const x=c.target.value,R=x.replace(/[^0-9]/g,"").slice(0,ge);if(R!==Oe.current)if(R.length===ge&&(x.includes("-")||x.includes("T")||x.includes(":"))){const ye=on(p.displayTpl,p.isoTpl,R);Ue(ye,ye.length)}else Ue(R,R.length)},[Ue,s,r,p.displayTpl,p.isoTpl,ge]),Ie=t.useCallback(()=>{Ue("",0),requestAnimationFrame(()=>g.current?.focus())},[Ue]),Re=t.useCallback(()=>{if(s||r)return;if(je==="date"||je==="datetime-local"||je==="time"){_(R=>!R);return}const c=k.current;if(!c)return;const x=c;try{if(typeof x.showPicker=="function"){x.showPicker();return}}catch{}c.focus(),c.click()},[s,r,je]),Ve=t.useCallback(c=>{const x=c.target.value,R=hn(x,p.isoTpl),ye=on(p.displayTpl,p.isoTpl,R);Pe.current=x,Ae(ye),Z?.(x),requestAnimationFrame(()=>g.current?.focus())},[Z,p.displayTpl,p.isoTpl]),vn=t.useCallback(()=>{if(s||r)return;const c=new Date,x=Se=>String(Se).padStart(2,"0"),R=`${c.getFullYear()}-${x(c.getMonth()+1)}-${x(c.getDate())}`,ye=`${x(c.getHours())}:${x(c.getMinutes())}`,Te=f?`${ye}:${x(c.getSeconds())}`:ye;let Fe;je==="time"?Fe=Te:je==="datetime-local"?Fe=`${R}T${Te}`:je==="month"?Fe=`${c.getFullYear()}-${x(c.getMonth()+1)}`:Fe=R;const xe=hn(Fe,p.isoTpl);Pe.current=Fe,Ae(on(p.displayTpl,p.isoTpl,xe)),Z?.(Fe)},[s,r,je,f,Z,p.displayTpl,p.isoTpl]),sn=je==="date"||je==="datetime-local",ln=(()=>{const c=/^(\d{4}-\d{2}-\d{2})/.exec(w??"");return c?c[1]:""})(),Qe=_n(w??"")??{hours:0,minutes:0,seconds:0},cn=()=>{const c=new Date;return`${c.getFullYear()}-${$e(c.getMonth()+1)}-${$e(c.getDate())}`},un=(c,x)=>{const R=f?`${$e(x.hours)}:${$e(x.minutes)}:${$e(x.seconds)}`:`${$e(x.hours)}:${$e(x.minutes)}`;let ye;je==="time"?ye=R:je==="datetime-local"?ye=`${c}T${R}`:ye=c,We(ye)},In=c=>{c&&un(c,en?Qe:{hours:0,minutes:0,seconds:0})},pn=(c,x)=>{un(sn?ln||cn():"",{...Qe,[c]:x})},Qn=c=>c==="hours"?23:59,Xn=c=>c==="minutes"&&h&&h>0?h:1,ht=(c,x)=>{const R=Qn(c),ye=Xn(c),Te=R+1,Fe=((Qe[c]+x*ye)%Te+Te)%Te;pn(c,Fe)},Un=(c,x,R)=>e.jsx(li,{part:c,label:G(x,R),value:Qe[c],max:Qn(c),step:Xn(c),onPick:ye=>pn(c,ye),onStep:ye=>ht(c,ye),startHold:Ze,stopHold:tn}),gt=()=>{un(cn(),en?Qe:{hours:0,minutes:0,seconds:0})},Mn=(()=>{const c=cn(),x=A&&A.length>=10?A.slice(0,10):A,R=j&&j.length>=10?j.slice(0,10):j;return!!(x&&c<x||R&&c>R)})(),yt=()=>{_(!1),requestAnimationFrame(()=>g.current?.focus())};t.useLayoutEffect(()=>{if(!me)return;const c=P.current?.getBoundingClientRect();c&&(Ne({left:c.left,top:c.bottom+6}),Be(kn.scopeThemeClass(P.current)))},[me]),t.useEffect(()=>{if(!me)return;const c=ye=>{const Te=ye.target;P.current?.contains(Te)||De.current?.contains(Te)||_(!1)},x=ye=>{ye.key==="Escape"&&_(!1)},R=()=>{const ye=P.current?.getBoundingClientRect();ye&&Ne({left:ye.left,top:ye.bottom+6})};return document.addEventListener("mousedown",c),document.addEventListener("keydown",x),window.addEventListener("scroll",R,!0),window.addEventListener("resize",R),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",x),window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R)}},[me]);const _t=t.useCallback(c=>{g.current=c,typeof ie=="function"?ie(c):ie&&(ie.current=c)},[ie]),Wn=t.useMemo(()=>{const c=[];return B&&c.push(m.COMMON_SHORTCUTS.submit),c.push({key:"Esc",description:G("shortcuts.clearDate","Clear value")}),c},[B,G]),xt=je==="time";return _e?null:e.jsxs("div",{className:`nice-field nice-field--${d}${F?` nice-field--label-${F}`:""}${L==="right"?" nice-field--error-right":""} ${I?"nice-field--loading":""} ${D||""}`,style:{...ce,...J!=null&&{"--nice-field-label-width":typeof J=="number"?`${J}px`:J},...S!=null&&{"--nice-field-control-width":typeof S=="number"?`${S}px`:S}},"aria-busy":I||void 0,children:[n&&e.jsxs("label",{htmlFor:Me,className:`nice-field__label ${o?"nice-field__label--required":""}`,children:[n,oe&&Wn.length>0&&e.jsx(m.NiceKeyboardHint,{shortcuts:Wn,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("div",{ref:P,className:`nice-input nice-input--date nice-input--${d} nice-input--ds-${Ce} ${i?"nice-input--error":""} ${s?"nice-input--disabled":""} ${r?"nice-input--readonly":""}`,style:{...E,width:"fit-content",position:"relative"},children:[e.jsx("input",{ref:_t,id:Me,className:"nice-input__native nice-masked-input",type:"text",name:N,value:Cn,placeholder:yn,disabled:s||I,readOnly:r,autoComplete:"off",spellCheck:!1,inputMode:"numeric","aria-invalid":!!i,"aria-label":n?void 0:G("controls.date","Date"),"data-display-tpl":p.displayTpl,"data-iso-tpl":p.isoTpl,style:{width:`${Sn}ch`,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontVariantNumeric:"tabular-nums"},onBeforeInput:ke,onChange:he,onBlur:ae,onKeyDown:An,onPaste:ve}),U&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:Ie,disabled:!w||s||r,"aria-label":G("controls.clear","Clear"),tabIndex:w&&!s&&!r?0:-1,children:e.jsx(m.NiceIcon,{name:"close",size:14})}),H&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"nice-input__picker-trigger",onClick:Re,"aria-label":G("controls.openPicker","Open picker"),tabIndex:-1,disabled:s||r,children:xt?e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.8"}),e.jsx("path",{d:"M12 7v5l3.5 2",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]}):e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("rect",{x:"3.25",y:"4.5",width:"17.5",height:"16.5",rx:"2",stroke:"currentColor",strokeWidth:"1.7"}),e.jsx("line",{x1:"16",y1:"2.5",x2:"16",y2:"6.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),e.jsx("line",{x1:"8",y1:"2.5",x2:"8",y2:"6.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),e.jsx("line",{x1:"3.25",y1:"9.75",x2:"20.75",y2:"9.75",stroke:"currentColor",strokeWidth:"1.5"})]})}),e.jsx("input",{ref:k,type:je,className:"nice-input__picker-companion",value:w??"",min:A,max:j,step:je==="time"||je==="datetime-local"?f?1:h?h*60:void 0:void 0,onChange:Ve,tabIndex:-1,"aria-hidden":"true",style:{position:"absolute",width:0,height:0,opacity:0,pointerEvents:"none",border:0,padding:0,left:0,bottom:0}})]}),en&&K==="12"&&!s&&!r&&e.jsx("button",{type:"button",className:"nice-input__ampm",onClick:Dn,disabled:!w,"aria-label":G("datetime.toggleAmPm","Toggle AM/PM"),tabIndex:-1,children:Rn}),W&&!s&&!r&&e.jsx("button",{type:"button",className:"nice-input__now",onClick:vn,tabIndex:-1,children:G("controls.now","Now")})]}),me&&u&&Ke&&ct.createPortal(e.jsxs("div",{ref:De,className:`nice-datetime-popup${He?` ${He}`:""}`,style:{position:"fixed",left:u.left,top:u.top,zIndex:1e3},role:"dialog","aria-label":G("controls.openPicker","Open picker"),children:[e.jsxs("div",{className:"nice-datetime-popup__body",children:[sn&&e.jsx("div",{className:"nice-datetime-popup__col nice-datetime-popup__col--date",children:e.jsx(Kn,{value:ln,onChange:In,min:A&&A.length>=10?A.slice(0,10):void 0,max:j&&j.length>=10?j.slice(0,10):void 0})}),en&&e.jsxs("div",{className:"nice-datetime-popup__col nice-datetime-popup__col--time",children:[e.jsxs("div",{className:"nice-datetime-popup__time-modes",role:"group","aria-label":G("datetime.timeSelector","Time selector"),children:[e.jsx("button",{type:"button",className:`nice-datetime-popup__mode-btn${Ee==="spinners"?" nice-datetime-popup__mode-btn--active":""}`,onClick:()=>ee("spinners"),"aria-pressed":Ee==="spinners","aria-label":G("datetime.spinnersMode","Spinner wheels"),title:G("datetime.spinnersMode","Spinner wheels"),tabIndex:-1,children:e.jsx(m.NiceIcon,{name:"list",size:16})}),e.jsx("button",{type:"button",className:`nice-datetime-popup__mode-btn${Ee==="clock"?" nice-datetime-popup__mode-btn--active":""}`,onClick:()=>ee("clock"),"aria-pressed":Ee==="clock","aria-label":G("datetime.clockMode","Analog clock"),title:G("datetime.clockMode","Analog clock"),tabIndex:-1,children:e.jsx(m.NiceIcon,{name:"clock",size:16})})]}),Ee==="clock"?e.jsx(ci,{hours:Qe.hours,minutes:Qe.minutes,minuteStep:h,onChange:(c,x)=>un(sn?ln||cn():"",{...Qe,hours:c,minutes:x}),t:G}):e.jsxs("div",{className:"nice-datetime-popup__time",role:"group",children:[Un("hours","datetime.hours","Hours"),e.jsx("span",{className:"nice-datetime-popup__time-sep",children:":"}),Un("minutes","datetime.minutes","Minutes"),f&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"nice-datetime-popup__time-sep",children:":"}),Un("seconds","datetime.seconds","Seconds")]})]})]})]}),e.jsxs("div",{className:"nice-datetime-popup__footer",children:[U&&e.jsx("button",{type:"button",className:"nice-datetime-popup__btn",onClick:Ie,children:G("controls.clear","Clear")}),sn&&e.jsx("button",{type:"button",className:"nice-datetime-popup__btn",onClick:gt,disabled:Mn,"aria-disabled":Mn||void 0,children:G("controls.today","Today")}),en&&e.jsx("button",{type:"button",className:"nice-datetime-popup__btn",onClick:vn,disabled:Mn,"aria-disabled":Mn||void 0,children:G("controls.now","Now")}),e.jsx("button",{type:"button",className:"nice-datetime-popup__btn nice-datetime-popup__btn--primary",onClick:yt,children:G("controls.confirm","Confirm")})]})]}),Ke),z&&re!=null&&e.jsxs("span",{className:"nice-datetime__countdown","aria-live":"polite",children:[se&&e.jsxs("span",{className:"nice-datetime__countdown-label",children:[se," "]}),e.jsx("span",{className:"nice-datetime__countdown-value",children:re})]}),I&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),L==="right"&&i&&e.jsx("div",{className:"nice-field__error",role:"alert",children:i}),L==="right"&&!i&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]}),L!=="right"&&i&&e.jsx("div",{className:"nice-field__error",role:"alert",children:i}),L!=="right"&&!i&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]})});gn.displayName="NiceDateTimePicker";const oi=Object.freeze(Object.defineProperty({__proto__:null,NiceDateTimePicker:gn,getDefaultLocale:qn},Symbol.toStringTag,{value:"Module"})),mt=({items:n,data:a,onFieldChange:i,onSubmit:o,dataSource:s,recordKey:r,columns:d=1,responsiveColumns:N,gap:$=16,labelPosition:D="top",size:ce="md",readOnly:T,disabled:w,className:Z,style:ae,accessMode:O,id:A,autoSaveDelay:j,onDirtyChange:ne,showActions:X,submitLabel:B="Submit",resetLabel:ue="Reset",onCancel:oe,cancelLabel:M="Cancel"})=>{const F=m.useNiceAccessMode(O,A),L=F==="hidden";F==="disabled"&&(w=!0),F==="readOnly"&&(T=!0);const I=m.useNiceRecord(s??null,r),J=!!s&&r!=null,S=J?I.editData:a??{},[te]=t.useState(()=>({...S})),[U,H]=t.useState([]),pe=t.useMemo(()=>Object.keys(S).some(g=>S[g]!==te[g]),[S,te]),y=t.useRef(!1);t.useEffect(()=>{pe!==y.current&&(y.current=pe,ne?.(pe))},[pe,ne]);const f=t.useRef(null),h=t.useCallback(()=>{j&&(f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{J?I.save():o?.(S)},j))},[j,J,I,o,S]),W=t.useCallback((g,k)=>{T||w||(H(P=>[...P,{field:g,prev:S[g]}]),J?I.set(g,k):i?.(g,k),h())},[J,I,i,T,w,S,h]),K=t.useCallback(()=>{if(U.length===0)return;const g=U[U.length-1];H(k=>k.slice(0,-1)),J?I.set(g.field,g.prev):i?.(g.field,g.prev)},[U,J,I,i]),C=t.useCallback(g=>{g.preventDefault(),f.current&&clearTimeout(f.current),J?I.save():o?.(S)},[S,o,J,I]),b=t.useRef(null),[q,z]=t.useState(d);t.useEffect(()=>{if(!N||!b.current){z(d);return}const g=b.current,k=new ResizeObserver(P=>{const De=P[0]?.contentRect.width??0,me=Object.keys(N).map(Number).sort((_,u)=>u-_);for(const _ of me)if(De>=_){z(N[_]);return}z(d)});return k.observe(g),()=>k.disconnect()},[N,d]);const le=t.useMemo(()=>n.filter(g=>!(g.visible===!1||g.visibleWhen&&!g.visibleWhen(S))),[n,S]),Q=t.useMemo(()=>{const g=[];let k=null;for(const P of le)!k||k.name!==P.group?(k={name:P.group,items:[P]},g.push(k)):k.items.push(P);return g},[le]),se=t.useCallback(g=>{const k=S[g.field]!==void 0?S[g.field]:g.defaultValue,P=u=>W(g.field,u);if(g.render)return g.render(k,P);const De=g.type||"text",me=g.options?.map(u=>typeof u=="string"?{label:u,value:u}:{label:u.label,value:String(u.value)}),_={size:ce,disabled:w,readOnly:T};switch(De){case"number":return e.jsx(qe.NiceNumberInput,{..._,value:k??null,onChange:u=>P(u),required:g.required});case"currency":return e.jsx(qe.NiceNumberInput,{..._,value:k??null,onChange:u=>P(u),required:g.required,precision:g.precision??2,step:g.step??100,suffix:g.unit??"PLN",formatPreset:"money"});case"textarea":return e.jsx(Tn,{..._,value:k??"",onChange:u=>P(u),rows:3});case"address":return e.jsx(Yn,{..._,value:k??{},onChange:u=>P(u),required:g.required,columns:g.columns??2});case"select":return e.jsx(kn.NiceSelect,{..._,value:k??"",onChange:u=>P(u),options:me??[]});case"autocomplete":return e.jsx(ot,{..._,value:k??"",onChange:u=>P(u),options:me??[],suggestions:(me??[]).map(u=>u.label)});case"radio":return e.jsx(Pn,{..._,value:k??"",onChange:u=>P(u),options:me??[]});case"checkbox":return e.jsx(qe.NiceCheckbox,{..._,checked:!!k,onChange:u=>P(u),label:g.label});case"toggle":return e.jsx(xn.NiceToggle,{..._,checked:!!k,onChange:u=>P(u)});case"date":return e.jsx(gn,{..._,value:k??"",onChange:u=>P(u)});case"time":return e.jsx(gn,{..._,dateFormatPreset:"time",value:k??"",onChange:u=>P(u)});case"datetime":return e.jsx(gn,{..._,dateFormatPreset:"datetime-local",value:k??"",onChange:u=>P(u)});case"color":return e.jsx(jn.NiceColorPicker,{..._,value:k??"var(--nice-text-primary, #000000)",onChange:u=>P(u)});case"slider":return e.jsx(wn,{..._,value:typeof k=="number"?k:0,onChange:u=>P(u)});case"rating":return e.jsx($n,{..._,value:typeof k=="number"?k:0,onChange:u=>P(u)});case"password":return e.jsx(zn,{..._,value:k??"",onChange:u=>P(u),required:g.required});case"phone":case"tel":return e.jsx(qe.NiceTextInput,{..._,type:"tel",value:k??"",onChange:u=>P(u),required:g.required});case"country":return e.jsx(Vn,{..._,value:k??"",onChange:u=>P(u)});case"tags":return e.jsx(dt,{..._,value:Array.isArray(k)?k:[],onChange:u=>P(u),options:me??[]});case"masked":return e.jsx(Hn,{..._,value:k??"",mask:g.mask??"999-999-9999",onChange:u=>P(u)});case"file":return e.jsx(Gn,{..._,onFilesSelected:u=>P(u)});case"email":return e.jsx(qe.NiceTextInput,{..._,type:"email",value:k??"",onChange:u=>P(u),required:g.required});case"url":return e.jsx(qe.NiceTextInput,{..._,type:"url",value:k??"",onChange:u=>P(u),required:g.required});default:return e.jsx(qe.NiceTextInput,{..._,value:k??"",onChange:u=>P(u),required:g.required})}},[S,W,w,T,ce]),de=g=>e.jsxs("div",{className:"nice-form__item",style:{gridColumn:g.colSpan?`span ${g.colSpan}`:void 0},children:[g.label&&e.jsxs("label",{className:"nice-form__label",children:[g.label,g.required&&e.jsx("span",{className:"nice-field__required",children:"*"})]}),e.jsx("div",{className:"nice-form__control",children:se(g)}),g.hint&&e.jsx("div",{className:"nice-form__hint",children:g.hint})]},g.field),fe={display:"grid",gridTemplateColumns:`repeat(${q}, 1fr)`,gap:$},ie=Q.some(g=>g.name!=null),E=t.useMemo(()=>{const g=new Set,k=[];for(const P of le)P.tab&&!g.has(P.tab)&&(g.add(P.tab),k.push(P.tab));return k},[le]),Ce=E.length>0,[Y,_e]=t.useState("");t.useEffect(()=>{Ce&&!E.includes(Y)&&_e(E[0])},[Ce,E,Y]);const G=g=>{const k=[];let P=null;for(const me of g)!P||P.name!==me.group?(P={name:me.group,items:[me]},k.push(P)):P.items.push(me);return k.some(me=>me.name!=null)?k.map((me,_)=>e.jsxs("fieldset",{className:me.name?"nice-form__group":"nice-form__group nice-form__group--no-title",children:[me.name&&e.jsx("legend",{className:"nice-form__group-title",children:me.name}),e.jsx("div",{style:fe,children:me.items.map(de)})]},_)):e.jsx("div",{style:fe,children:g.map(de)})},Me=X?e.jsxs("div",{className:"nice-form__actions",children:[e.jsxs("div",{className:"nice-form__actions-left",children:[oe&&e.jsx(jn.NiceButton,{type:"button",variant:"secondary",size:ce,onClick:oe,children:M}),e.jsx(jn.NiceButton,{type:"button",variant:"ghost",size:ce,onClick:K,disabled:U.length===0,children:ue})]}),e.jsx("div",{className:"nice-form__actions-right",children:e.jsx(jn.NiceButton,{type:"submit",variant:"primary",size:ce,children:B})})]}):null;return L?null:e.jsxs("form",{ref:b,className:`nice-form nice-form--label-${D}${pe?" nice-form--dirty":""} ${Z||""}`,style:ie||Ce?{...ae}:{...fe,...ae},onSubmit:C,noValidate:!0,children:[Ce?e.jsx(xn.NiceTabs,{className:"nice-form__tabs",activeTab:Y||E[0],onChange:_e,tabs:E.map(g=>({id:g,label:g,content:e.jsx("div",{className:"nice-form__tab-panel",children:G(le.filter(k=>(k.tab??E[0])===g))})}))}):ie?Q.map((g,k)=>e.jsxs("fieldset",{className:g.name?"nice-form__group":"nice-form__group nice-form__group--no-title",children:[g.name&&e.jsx("legend",{className:"nice-form__group-title",children:g.name}),e.jsx("div",{style:fe,children:g.items.map(de)})]},k)):le.map(de),Me]})};mt.displayName="NiceForm";exports.COUNTRIES=pt;exports.MASK_PRESETS=rt;exports.NiceAddress=Yn;exports.NiceAutocomplete=ot;exports.NiceCalendar=Kn;exports.NiceCountryPicker=Vn;exports.NiceDateTimePicker=gn;exports.NiceDateTimePicker$1=oi;exports.NiceForm=mt;exports.NiceMaskedInput=Hn;exports.NicePasswordInput=zn;exports.NiceRadioGroup=Pn;exports.NiceRadioGroup$1=St;exports.NiceRating=$n;exports.NiceRating$1=At;exports.NiceSlider=wn;exports.NiceSlider$1=It;exports.NiceTagBox=dt;exports.NiceTextArea=Tn;exports.NiceTextArea$1=Ut;exports.NiceUpload=Gn;exports.getDefaultLocale=qn;
@@ -0,0 +1,36 @@
1
+ const e = "https://nice2dev.com/schemas/component-doc-v1.json", t = "NiceFormItem", n = "Form field wrapper with label and validation.", o = "form", a = "1.0.0", i = "stable", r = [{ name: "name", type: "string | (string | number)[]", description: "Field name/path" }, { name: "label", type: "React.ReactNode", description: "Field label" }, { name: "rules", type: "Rule[]", description: "Validation rules" }, { name: "required", type: "boolean", default: "false", description: "Required field" }, { name: "help", type: "React.ReactNode", description: "Help text" }, { name: "tooltip", type: "string | TooltipProps", description: "Tooltip help" }, { name: "extra", type: "React.ReactNode", description: "Extra content below input" }, { name: "children", type: "React.ReactNode", required: !0, description: "Form control" }], s = [{ title: "Form Item", description: "Field wrapper", code: `<NiceFormItem
2
+ name="username"
3
+ label="Username"
4
+ rules={[
5
+ { required: true, message: 'Username is required' },
6
+ { min: 3, message: 'Min 3 characters' }
7
+ ]}
8
+ tooltip="Your display name"
9
+ hasFeedback
10
+ >
11
+ <NiceInput placeholder="Enter username" />
12
+ </NiceFormItem>` }], c = { keyboard: [], aria: ["Label association", "Error message"] }, l = ["NiceForm", "NiceInput"], p = {
13
+ $schema: e,
14
+ name: t,
15
+ description: n,
16
+ category: o,
17
+ since: a,
18
+ status: i,
19
+ props: r,
20
+ examples: s,
21
+ accessibility: c,
22
+ seeAlso: l
23
+ };
24
+ export {
25
+ e as $schema,
26
+ c as accessibility,
27
+ o as category,
28
+ p as default,
29
+ n as description,
30
+ s as examples,
31
+ t as name,
32
+ r as props,
33
+ l as seeAlso,
34
+ a as since,
35
+ i as status
36
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceFormItem",n="Form field wrapper with label and validation.",o="form",a="1.0.0",i="stable",s=[{name:"name",type:"string | (string | number)[]",description:"Field name/path"},{name:"label",type:"React.ReactNode",description:"Field label"},{name:"rules",type:"Rule[]",description:"Validation rules"},{name:"required",type:"boolean",default:"false",description:"Required field"},{name:"help",type:"React.ReactNode",description:"Help text"},{name:"tooltip",type:"string | TooltipProps",description:"Tooltip help"},{name:"extra",type:"React.ReactNode",description:"Extra content below input"},{name:"children",type:"React.ReactNode",required:!0,description:"Form control"}],r=[{title:"Form Item",description:"Field wrapper",code:`<NiceFormItem
2
+ name="username"
3
+ label="Username"
4
+ rules={[
5
+ { required: true, message: 'Username is required' },
6
+ { min: 3, message: 'Min 3 characters' }
7
+ ]}
8
+ tooltip="Your display name"
9
+ hasFeedback
10
+ >
11
+ <NiceInput placeholder="Enter username" />
12
+ </NiceFormItem>`}],c={keyboard:[],aria:["Label association","Error message"]},l=["NiceForm","NiceInput"],p={$schema:e,name:t,description:n,category:o,since:a,status:i,props:s,examples:r,accessibility:c,seeAlso:l};exports.$schema=e;exports.accessibility=c;exports.category=o;exports.default=p;exports.description=n;exports.examples=r;exports.name=t;exports.props=s;exports.seeAlso=l;exports.since=a;exports.status=i;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),I=require("@nice2dev/ui-core"),l=require("react"),ce=[],p=(u,N)=>{const j=new Date(u);return j.setDate(j.getDate()+N),j},M=(u,N)=>Math.ceil((N.getTime()-u.getTime())/864e5),O=({tasks:u=ce,columns:N,scale:j="day",rowHeight:_=36,dayWidth:P=30,onTaskClick:Q,onTaskUpdate:x,showDependencies:Y=!0,dependencyStyle:F="square",draggable:D,zoomControls:G,className:J,style:k,accessMode:K,id:V})=>{const Z=I.useNiceAccessMode(K,V)==="hidden",{t:de}=I.useNiceTranslation(),[o,R]=l.useState(P),[f,C]=l.useState(null),L=N||[{field:"title",title:"Task",width:200}],W=L.reduce((e,t)=>e+(t.width||120),0),z=l.useRef(null),A=l.useRef(null),E=l.useRef(!1);l.useEffect(()=>{const e=z.current,t=A.current;if(!e||!t)return;const s=(c,i)=>()=>{E.current||(E.current=!0,i.scrollTop=c.scrollTop,requestAnimationFrame(()=>{E.current=!1}))},n=s(e,t),r=s(t,e);return e.addEventListener("scroll",n,{passive:!0}),t.addEventListener("scroll",r,{passive:!0}),()=>{e.removeEventListener("scroll",n),t.removeEventListener("scroll",r)}},[]);const d=l.useMemo(()=>{const e=t=>u.filter(n=>(n.parentId??null)===t).flatMap(n=>[n,...e(n.id)]);return e(null)},[u]),m=l.useMemo(()=>{if(d.length===0)return{start:new Date,end:new Date,days:30};let e=new Date(d[0].start),t=new Date(d[0].end);return d.forEach(s=>{new Date(s.start)<e&&(e=new Date(s.start)),new Date(s.end)>t&&(t=new Date(s.end))}),e=p(e,-2),t=p(t,2),{start:e,end:t,days:M(e,t)}},[d]),T=m.days*o;l.useEffect(()=>{if(!f||!x)return;const e=s=>{const n=s.clientX-f.startX,r=Math.round(n/o);if(r===0)return;const c=u.find(i=>i.id===f.taskId);if(c)if(f.mode==="move")x({...c,start:p(f.origStart,r),end:p(f.origEnd,r)});else{const i=p(f.origEnd,r);i>f.origStart&&x({...c,end:i})}},t=()=>C(null);return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[f,o,u,x]);const B=l.useCallback((e,t,s)=>{if(!D||!x)return;s.stopPropagation();const n=u.find(r=>r.id===e);n&&C({taskId:e,mode:t,startX:s.clientX,origStart:new Date(n.start),origEnd:new Date(n.end)})},[D,u,x]),H=l.useCallback(()=>R(e=>Math.min(100,e+5)),[]),U=l.useCallback(()=>R(e=>Math.max(8,e-5)),[]),ee=()=>{const e=[],t=[];new Date(m.start);const s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];if(j==="day"){let n=-1,r=0;for(let c=0;c<m.days;c++){const i=p(m.start,c);i.getMonth()!==n&&(n>=0&&e.push(a.jsxs("div",{className:"nice-gantt__header-cell",style:{width:(c-r)*o},children:[s[n]," ",i.getFullYear()]},`m${n}-${r}`)),n=i.getMonth(),r=c);const h=i.getDay()===0||i.getDay()===6;t.push(a.jsx("div",{className:`nice-gantt__header-cell nice-gantt__header-cell--sub ${h?"nice-gantt__header-cell--weekend":""}`,style:{width:o},children:i.getDate()},c))}n>=0&&e.push(a.jsx("div",{className:"nice-gantt__header-cell",style:{width:(m.days-r)*o},children:s[n]},`m${n}-last`))}return a.jsxs("div",{className:"nice-gantt__chart-header",children:[a.jsx("div",{className:"nice-gantt__header-row",children:e}),a.jsx("div",{className:"nice-gantt__header-row",children:t})]})},te=(e,t)=>{const s=M(m.start,new Date(e.start))*o,n=Math.max(M(new Date(e.start),new Date(e.end))*o,o),r=t*_+4,c=_-8,i=e.progress??0;return a.jsxs("div",{className:`nice-gantt__bar ${D?"nice-gantt__bar--draggable":""}`,title:`${e.title} (${Math.round(i)}%)`,style:{left:s,top:r,width:n,height:c,backgroundColor:e.color||"var(--nice-color-primary, #3b82f6)"},onClick:()=>Q?.(e),onMouseDown:D?h=>B(e.id,"move",h):void 0,children:[i>0&&a.jsx("div",{className:"nice-gantt__bar-progress",style:{width:`${i}%`}}),a.jsx("span",{className:"nice-gantt__bar-label",children:e.title}),D&&a.jsx("div",{className:"nice-gantt__bar-resize",onMouseDown:h=>B(e.id,"resize",h)})]},e.id)},ne=(e,t,s,n,r)=>{const h=e+10,y=s-14,S=(t+n)/2,w=n>=t?1:-1,q=Math.abs(n-t)<1,X=y<=h+4,b=q?t:S,g=X?Math.max(h,e+10):h,v=X?Math.min(y,s-10):y;if(q||!r)return[`M ${e} ${t}`,`L ${g} ${t}`,`L ${g} ${b}`,`L ${v} ${b}`,`L ${v} ${n}`,`L ${s} ${n}`].join(" ");const ae=Math.max(0,v-g),re=Math.abs(n-t),ie=Math.min(re/2||10,ae/2||10),$=Math.max(2,Math.min(10,ie));return[`M ${e} ${t}`,`L ${g-$} ${t}`,`Q ${g} ${t} ${g} ${t+w*$}`,`L ${g} ${b-w*$}`,`Q ${g} ${b} ${g+$} ${b}`,`L ${v-$} ${b}`,`Q ${v} ${b} ${v} ${b+w*$}`,`L ${v} ${n-w*$}`,`Q ${v} ${n} ${v+$} ${n}`,`L ${s} ${n}`].join(" ")},se=()=>{if(!Y)return null;const e=[],t=new Map(d.map((s,n)=>[s.id,n]));return d.forEach(s=>{(s.dependencies||[]).forEach(n=>{const r=t.get(n),c=t.get(s.id);if(r==null||c==null)return;const i=d[r],h=M(m.start,new Date(i.end))*o,y=r*_+_/2,S=M(m.start,new Date(s.start))*o,w=c*_+_/2;e.push(a.jsx("path",{d:ne(h,y,S,w,F==="rounded"),fill:"none",stroke:"var(--nice-text-secondary, #6b7280)",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round",markerEnd:"url(#arrowhead)"},`${n}-${s.id}`))})}),a.jsxs("svg",{className:"nice-gantt__deps",width:T,height:d.length*_,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[a.jsx("defs",{children:a.jsx("marker",{id:"arrowhead",markerWidth:"6",markerHeight:"4",refX:"5",refY:"2",orient:"auto",children:a.jsx("polygon",{points:"0 0, 6 2, 0 4",fill:"var(--nice-text-secondary, #6b7280)"})})}),e]})};return Z?null:a.jsxs("div",{className:`nice-gantt ${J||""}`,style:k,children:[G&&a.jsxs("div",{className:"nice-gantt__zoom-controls",children:[a.jsx("button",{type:"button",className:"nice-btn nice-btn--sm",onClick:U,children:"−"}),a.jsxs("span",{className:"nice-gantt__zoom-label",children:[o,"px"]}),a.jsx("button",{type:"button",className:"nice-btn nice-btn--sm",onClick:H,children:"+"})]}),a.jsxs("div",{className:"nice-gantt__container",children:[a.jsxs("div",{className:"nice-gantt__table",style:{width:W,minWidth:W},children:[a.jsxs("div",{className:"nice-gantt__table-header",children:[a.jsx("div",{className:"nice-gantt__table-header-row nice-gantt__table-header-row--main","aria-hidden":"true",children:" "}),a.jsx("div",{className:"nice-gantt__table-header-row nice-gantt__table-header-row--sub",children:L.map((e,t)=>a.jsx("div",{className:"nice-gantt__table-header-cell",style:{width:e.width||120},children:e.title},t))})]}),a.jsx("div",{className:"nice-gantt__table-body",ref:z,children:d.map((e,t)=>a.jsx("div",{className:"nice-gantt__table-row",style:{height:_},children:L.map((s,n)=>a.jsx("div",{className:"nice-gantt__table-cell",style:{width:s.width||120},children:e[s.field]},n))},e.id))})]}),a.jsx("div",{className:"nice-gantt__chart",children:a.jsxs("div",{className:"nice-gantt__chart-body-wrap",ref:A,children:[ee(),a.jsxs("div",{className:"nice-gantt__chart-body",style:{width:T,height:d.length*_,position:"relative"},children:[Array.from({length:m.days},(e,t)=>{const s=p(m.start,t),n=s.getDay()===0||s.getDay()===6;return a.jsx("div",{className:`nice-gantt__gridline ${n?"nice-gantt__gridline--weekend":""}`,style:{left:t*o,width:o,height:"100%",position:"absolute",top:0}},t)}),d.map((e,t)=>te(e,t)),se()]})]})})]})]})};process.env.NODE_ENV!=="production"&&(O.displayName="NiceGantt");exports.NiceGantt=O;