@techzyapp/ui-library 1.0.44 → 1.0.46

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 (377) hide show
  1. package/dist/{AdminRoot-9KE3ll-D.js → AdminRoot-BZ1v5vN9.js} +7 -7
  2. package/dist/{AdminRoot-9KE3ll-D.js.map → AdminRoot-BZ1v5vN9.js.map} +1 -1
  3. package/dist/{AdminRoot-BMzHo0n7.cjs → AdminRoot-DJ4-UMAB.cjs} +2 -2
  4. package/dist/{AdminRoot-BMzHo0n7.cjs.map → AdminRoot-DJ4-UMAB.cjs.map} +1 -1
  5. package/dist/{Alert-BFfzpPNd.js → Alert-BU7GlQna.js} +3 -3
  6. package/dist/{Alert-BFfzpPNd.js.map → Alert-BU7GlQna.js.map} +1 -1
  7. package/dist/{Alert-DS8TzpIS.cjs → Alert-CVQOjuEq.cjs} +2 -2
  8. package/dist/{Alert-DS8TzpIS.cjs.map → Alert-CVQOjuEq.cjs.map} +1 -1
  9. package/dist/{Breadcrumbs-CloqFpp1.js → Breadcrumbs-BMz_YVPa.js} +3 -3
  10. package/dist/{Breadcrumbs-CloqFpp1.js.map → Breadcrumbs-BMz_YVPa.js.map} +1 -1
  11. package/dist/{Breadcrumbs-N2-sZWW5.cjs → Breadcrumbs-BbC0o4JE.cjs} +2 -2
  12. package/dist/{Breadcrumbs-N2-sZWW5.cjs.map → Breadcrumbs-BbC0o4JE.cjs.map} +1 -1
  13. package/dist/{Button-5LQtDA9d.js → Button-C415LPw_.js} +2 -2
  14. package/dist/{Button-5LQtDA9d.js.map → Button-C415LPw_.js.map} +1 -1
  15. package/dist/{Button-Bxztlybi.cjs → Button-mBZOvgyZ.cjs} +2 -2
  16. package/dist/{Button-Bxztlybi.cjs.map → Button-mBZOvgyZ.cjs.map} +1 -1
  17. package/dist/{Calendar-BIKo_aus.js → Calendar-B0f6h9-A.js} +3 -3
  18. package/dist/{Calendar-BIKo_aus.js.map → Calendar-B0f6h9-A.js.map} +1 -1
  19. package/dist/{Calendar-CsBgaKZ-.cjs → Calendar-hO051hfk.cjs} +2 -2
  20. package/dist/{Calendar-CsBgaKZ-.cjs.map → Calendar-hO051hfk.cjs.map} +1 -1
  21. package/dist/{Card-Csn3FaMl.cjs → Card-BdNr5row.cjs} +2 -2
  22. package/dist/{Card-Csn3FaMl.cjs.map → Card-BdNr5row.cjs.map} +1 -1
  23. package/dist/{Card-DMwQ7rMk.js → Card-ssUNaOF_.js} +3 -3
  24. package/dist/{Card-DMwQ7rMk.js.map → Card-ssUNaOF_.js.map} +1 -1
  25. package/dist/{Chip-BdCZ44I8.cjs → Chip-BpJN4rzY.cjs} +2 -2
  26. package/dist/{Chip-BdCZ44I8.cjs.map → Chip-BpJN4rzY.cjs.map} +1 -1
  27. package/dist/{Chip-C7IkFuM1.js → Chip-C0x-6g2h.js} +2 -2
  28. package/dist/{Chip-C7IkFuM1.js.map → Chip-C0x-6g2h.js.map} +1 -1
  29. package/dist/{CodeBlock-C10JN6DR.js → CodeBlock-DKnWINdV.js} +3 -3
  30. package/dist/{CodeBlock-C10JN6DR.js.map → CodeBlock-DKnWINdV.js.map} +1 -1
  31. package/dist/{CodeBlock-BnXxxqAW.cjs → CodeBlock-DTrzN95i.cjs} +2 -2
  32. package/dist/{CodeBlock-BnXxxqAW.cjs.map → CodeBlock-DTrzN95i.cjs.map} +1 -1
  33. package/dist/{ColorPicker-z8_-77LO.js → ColorPicker-Bidev2DJ.js} +3 -3
  34. package/dist/{ColorPicker-z8_-77LO.js.map → ColorPicker-Bidev2DJ.js.map} +1 -1
  35. package/dist/{ColorPicker-CVddGc-n.cjs → ColorPicker-Doaegll4.cjs} +2 -2
  36. package/dist/{ColorPicker-CVddGc-n.cjs.map → ColorPicker-Doaegll4.cjs.map} +1 -1
  37. package/dist/{ColorPickerPanel-DJY6-EqO.cjs → ColorPickerPanel-048Fj7wv.cjs} +2 -2
  38. package/dist/{ColorPickerPanel-DJY6-EqO.cjs.map → ColorPickerPanel-048Fj7wv.cjs.map} +1 -1
  39. package/dist/{ColorPickerPanel-y4A2LLLf.js → ColorPickerPanel-DThSuUoz.js} +2 -2
  40. package/dist/{ColorPickerPanel-y4A2LLLf.js.map → ColorPickerPanel-DThSuUoz.js.map} +1 -1
  41. package/dist/{ColorRamp-DvRsdOWy.cjs → ColorRamp-CGw4D9bf.cjs} +2 -2
  42. package/dist/{ColorRamp-DvRsdOWy.cjs.map → ColorRamp-CGw4D9bf.cjs.map} +1 -1
  43. package/dist/{ColorRamp-Dvit8yoP.js → ColorRamp-Reb0q69d.js} +2 -2
  44. package/dist/{ColorRamp-Dvit8yoP.js.map → ColorRamp-Reb0q69d.js.map} +1 -1
  45. package/dist/{ConfigProvider-Cf-awvZs.cjs → ConfigProvider-DBU6rOIA.cjs} +2 -2
  46. package/dist/{ConfigProvider-Cf-awvZs.cjs.map → ConfigProvider-DBU6rOIA.cjs.map} +1 -1
  47. package/dist/{ConfigProvider-CYgmMH4j.js → ConfigProvider-DVDGtCUc.js} +2 -2
  48. package/dist/{ConfigProvider-CYgmMH4j.js.map → ConfigProvider-DVDGtCUc.js.map} +1 -1
  49. package/dist/{CopyButton-BOp7waEt.cjs → CopyButton-Cnab62vt.cjs} +2 -2
  50. package/dist/{CopyButton-BOp7waEt.cjs.map → CopyButton-Cnab62vt.cjs.map} +1 -1
  51. package/dist/{CopyButton-_iMBE4q_.js → CopyButton-Dm8-V4ku.js} +3 -3
  52. package/dist/{CopyButton-_iMBE4q_.js.map → CopyButton-Dm8-V4ku.js.map} +1 -1
  53. package/dist/{DatePicker-X5hZVSW6.js → DatePicker-C4MTCmDn.js} +4 -4
  54. package/dist/{DatePicker-X5hZVSW6.js.map → DatePicker-C4MTCmDn.js.map} +1 -1
  55. package/dist/{DatePicker-UQwpH-rw.cjs → DatePicker-CaGeW_-j.cjs} +2 -2
  56. package/dist/{DatePicker-UQwpH-rw.cjs.map → DatePicker-CaGeW_-j.cjs.map} +1 -1
  57. package/dist/{DateTimePicker-Ch1kUHEb.js → DateTimePicker-B0CjHKPV.js} +7 -7
  58. package/dist/{DateTimePicker-Ch1kUHEb.js.map → DateTimePicker-B0CjHKPV.js.map} +1 -1
  59. package/dist/{DateTimePicker-ClTZGMON.cjs → DateTimePicker-DXKaAYey.cjs} +2 -2
  60. package/dist/{DateTimePicker-ClTZGMON.cjs.map → DateTimePicker-DXKaAYey.cjs.map} +1 -1
  61. package/dist/{DescriptionList-IVAvgpEL.cjs → DescriptionList-BSDwobDc.cjs} +2 -2
  62. package/dist/{DescriptionList-IVAvgpEL.cjs.map → DescriptionList-BSDwobDc.cjs.map} +1 -1
  63. package/dist/{DescriptionList-Cque-iYk.js → DescriptionList-BkUS5egS.js} +4 -4
  64. package/dist/{DescriptionList-Cque-iYk.js.map → DescriptionList-BkUS5egS.js.map} +1 -1
  65. package/dist/{EmptyState-C84B-E8a.cjs → EmptyState-CkkFHKrh.cjs} +2 -2
  66. package/dist/{EmptyState-C84B-E8a.cjs.map → EmptyState-CkkFHKrh.cjs.map} +1 -1
  67. package/dist/{EmptyState-Yts_p-jZ.js → EmptyState-DXoaPC7o.js} +2 -2
  68. package/dist/{EmptyState-Yts_p-jZ.js.map → EmptyState-DXoaPC7o.js.map} +1 -1
  69. package/dist/{ErrorBoundary-BgMOPle0.js → ErrorBoundary-CSP_Ctg6.js} +3 -3
  70. package/dist/{ErrorBoundary-BgMOPle0.js.map → ErrorBoundary-CSP_Ctg6.js.map} +1 -1
  71. package/dist/{ErrorBoundary-DtYswKp3.cjs → ErrorBoundary-tZjKtO28.cjs} +2 -2
  72. package/dist/{ErrorBoundary-DtYswKp3.cjs.map → ErrorBoundary-tZjKtO28.cjs.map} +1 -1
  73. package/dist/{ErrorState-Aa8LVjkl.cjs → ErrorState-JH4JdrTI.cjs} +2 -2
  74. package/dist/{ErrorState-Aa8LVjkl.cjs.map → ErrorState-JH4JdrTI.cjs.map} +1 -1
  75. package/dist/{ErrorState-BE9Rcmht.js → ErrorState-WYsly5-i.js} +7 -7
  76. package/dist/{ErrorState-BE9Rcmht.js.map → ErrorState-WYsly5-i.js.map} +1 -1
  77. package/dist/{FileCard-Chfx0QdF.cjs → FileCard-BIfPqeek.cjs} +2 -2
  78. package/dist/{FileCard-Chfx0QdF.cjs.map → FileCard-BIfPqeek.cjs.map} +1 -1
  79. package/dist/{FileCard-m3i_8yKR.js → FileCard-D4TB3qGG.js} +3 -3
  80. package/dist/{FileCard-m3i_8yKR.js.map → FileCard-D4TB3qGG.js.map} +1 -1
  81. package/dist/FileUploader-DPVF76Ha.js +701 -0
  82. package/dist/FileUploader-DPVF76Ha.js.map +1 -0
  83. package/dist/FileUploader-YE_DfTNC.cjs +2 -0
  84. package/dist/FileUploader-YE_DfTNC.cjs.map +1 -0
  85. package/dist/{Flag-BvZB3295.cjs → Flag-B6OhgwZr.cjs} +2 -2
  86. package/dist/{Flag-BvZB3295.cjs.map → Flag-B6OhgwZr.cjs.map} +1 -1
  87. package/dist/{Flag-C1HwnZXJ.js → Flag-Q3vI7cgt.js} +2 -2
  88. package/dist/{Flag-C1HwnZXJ.js.map → Flag-Q3vI7cgt.js.map} +1 -1
  89. package/dist/{FullscreenToggle-B4ynXdCP.js → FullscreenToggle-CxwGPLdd.js} +3 -3
  90. package/dist/{FullscreenToggle-B4ynXdCP.js.map → FullscreenToggle-CxwGPLdd.js.map} +1 -1
  91. package/dist/{FullscreenToggle-CEFZQ5OC.cjs → FullscreenToggle-ipX55Nj4.cjs} +2 -2
  92. package/dist/{FullscreenToggle-CEFZQ5OC.cjs.map → FullscreenToggle-ipX55Nj4.cjs.map} +1 -1
  93. package/dist/{IconButton-wW1o4HHw.cjs → IconButton-U_sr2Ahy.cjs} +2 -2
  94. package/dist/{IconButton-wW1o4HHw.cjs.map → IconButton-U_sr2Ahy.cjs.map} +1 -1
  95. package/dist/{IconButton-EaExCXRq.js → IconButton-re6xITGO.js} +2 -2
  96. package/dist/{IconButton-EaExCXRq.js.map → IconButton-re6xITGO.js.map} +1 -1
  97. package/dist/ImageEditor-1n50vo_v.cjs +64 -0
  98. package/dist/ImageEditor-1n50vo_v.cjs.map +1 -0
  99. package/dist/{ImageEditor-DTFQZ6ON.js → ImageEditor-BwrG1fk7.js} +968 -948
  100. package/dist/ImageEditor-BwrG1fk7.js.map +1 -0
  101. package/dist/{Loader-D_Foo6Hj.js → Loader-7v1QBvHY.js} +2 -2
  102. package/dist/{Loader-D_Foo6Hj.js.map → Loader-7v1QBvHY.js.map} +1 -1
  103. package/dist/{Loader-DNR2_YHm.cjs → Loader-BE3SQr7W.cjs} +2 -2
  104. package/dist/{Loader-DNR2_YHm.cjs.map → Loader-BE3SQr7W.cjs.map} +1 -1
  105. package/dist/{LocationPicker-DGbnbTW9.js → LocationPicker-BvKtZFq0.js} +6 -6
  106. package/dist/{LocationPicker-DGbnbTW9.js.map → LocationPicker-BvKtZFq0.js.map} +1 -1
  107. package/dist/{LocationPicker-CdO37PKg.cjs → LocationPicker-CVJ4jVn2.cjs} +2 -2
  108. package/dist/{LocationPicker-CdO37PKg.cjs.map → LocationPicker-CVJ4jVn2.cjs.map} +1 -1
  109. package/dist/{Modal-Du-uVpYw.cjs → Modal-CxODxl81.cjs} +2 -2
  110. package/dist/{Modal-Du-uVpYw.cjs.map → Modal-CxODxl81.cjs.map} +1 -1
  111. package/dist/{Modal-1rIBMvKH.js → Modal-DpoiMMM3.js} +3 -3
  112. package/dist/{Modal-1rIBMvKH.js.map → Modal-DpoiMMM3.js.map} +1 -1
  113. package/dist/{MultiSelect-lAAaD0uL.cjs → MultiSelect-2GouMRTl.cjs} +2 -2
  114. package/dist/{MultiSelect-lAAaD0uL.cjs.map → MultiSelect-2GouMRTl.cjs.map} +1 -1
  115. package/dist/{MultiSelect-BoqunsM9.js → MultiSelect-B7KwEhL5.js} +4 -4
  116. package/dist/{MultiSelect-BoqunsM9.js.map → MultiSelect-B7KwEhL5.js.map} +1 -1
  117. package/dist/{NumberField-DHFGNQjZ.js → NumberField-ThojS4K3.js} +3 -3
  118. package/dist/{NumberField-DHFGNQjZ.js.map → NumberField-ThojS4K3.js.map} +1 -1
  119. package/dist/{NumberField-CyUA6eob.cjs → NumberField-o2z2QNK1.cjs} +2 -2
  120. package/dist/{NumberField-CyUA6eob.cjs.map → NumberField-o2z2QNK1.cjs.map} +1 -1
  121. package/dist/{OtpField-CIy5OtXI.cjs → OtpField-BhZq44vV.cjs} +2 -2
  122. package/dist/{OtpField-CIy5OtXI.cjs.map → OtpField-BhZq44vV.cjs.map} +1 -1
  123. package/dist/{OtpField-pL9nj4AW.js → OtpField-C3MlMZ2F.js} +2 -2
  124. package/dist/{OtpField-pL9nj4AW.js.map → OtpField-C3MlMZ2F.js.map} +1 -1
  125. package/dist/{PageError-C5SO0mVJ.js → PageError-63Gk6fVC.js} +5 -5
  126. package/dist/{PageError-C5SO0mVJ.js.map → PageError-63Gk6fVC.js.map} +1 -1
  127. package/dist/{PageError-DbokLmOY.cjs → PageError-CCKWbrc5.cjs} +2 -2
  128. package/dist/{PageError-DbokLmOY.cjs.map → PageError-CCKWbrc5.cjs.map} +1 -1
  129. package/dist/{PageLayout-Du-D6Pd4.js → PageLayout-BekkDBtT.js} +4 -4
  130. package/dist/{PageLayout-Du-D6Pd4.js.map → PageLayout-BekkDBtT.js.map} +1 -1
  131. package/dist/{PageLayout-B7ZDiNq8.cjs → PageLayout-CDPUYu6A.cjs} +2 -2
  132. package/dist/{PageLayout-B7ZDiNq8.cjs.map → PageLayout-CDPUYu6A.cjs.map} +1 -1
  133. package/dist/{PageNotFound-DSkoMfed.js → PageNotFound-BD3zX3cd.js} +5 -5
  134. package/dist/{PageNotFound-DSkoMfed.js.map → PageNotFound-BD3zX3cd.js.map} +1 -1
  135. package/dist/{PageNotFound-DfNwdtgJ.cjs → PageNotFound-CTR6htwa.cjs} +2 -2
  136. package/dist/{PageNotFound-DfNwdtgJ.cjs.map → PageNotFound-CTR6htwa.cjs.map} +1 -1
  137. package/dist/{Pagination-DO2Os4an.cjs → Pagination-BJvLUjQ0.cjs} +2 -2
  138. package/dist/{Pagination-DO2Os4an.cjs.map → Pagination-BJvLUjQ0.cjs.map} +1 -1
  139. package/dist/{Pagination-BH8ACaAC.js → Pagination-qKjISBJ9.js} +2 -2
  140. package/dist/{Pagination-BH8ACaAC.js.map → Pagination-qKjISBJ9.js.map} +1 -1
  141. package/dist/{PaletteField-BfvcJvGM.cjs → PaletteField-CDS9CJW9.cjs} +2 -2
  142. package/dist/{PaletteField-BfvcJvGM.cjs.map → PaletteField-CDS9CJW9.cjs.map} +1 -1
  143. package/dist/{PaletteField-BFb0PQ-S.js → PaletteField-y8KpR4Ap.js} +3 -3
  144. package/dist/{PaletteField-BFb0PQ-S.js.map → PaletteField-y8KpR4Ap.js.map} +1 -1
  145. package/dist/{PhoneField-C-wOm7g5.cjs → PhoneField-Df3J6Hhg.cjs} +2 -2
  146. package/dist/{PhoneField-C-wOm7g5.cjs.map → PhoneField-Df3J6Hhg.cjs.map} +1 -1
  147. package/dist/{PhoneField-DFhGWgbK.js → PhoneField-OjsuevPx.js} +4 -4
  148. package/dist/{PhoneField-DFhGWgbK.js.map → PhoneField-OjsuevPx.js.map} +1 -1
  149. package/dist/{Popconfirm-_53vtMI0.cjs → Popconfirm-BKzJ_EZy.cjs} +2 -2
  150. package/dist/{Popconfirm-_53vtMI0.cjs.map → Popconfirm-BKzJ_EZy.cjs.map} +1 -1
  151. package/dist/{Popconfirm-o5da44ra.js → Popconfirm-aCyniPnH.js} +3 -3
  152. package/dist/{Popconfirm-o5da44ra.js.map → Popconfirm-aCyniPnH.js.map} +1 -1
  153. package/dist/{Progress-BSinoQ8t.cjs → Progress-DWOoLd8u.cjs} +2 -2
  154. package/dist/{Progress-BSinoQ8t.cjs.map → Progress-DWOoLd8u.cjs.map} +1 -1
  155. package/dist/{Progress-CHzNwegP.js → Progress-DzxbkcaD.js} +2 -2
  156. package/dist/{Progress-CHzNwegP.js.map → Progress-DzxbkcaD.js.map} +1 -1
  157. package/dist/{QrCode-tNNnsbHM.cjs → QrCode-C8uAPiHq.cjs} +2 -2
  158. package/dist/{QrCode-tNNnsbHM.cjs.map → QrCode-C8uAPiHq.cjs.map} +1 -1
  159. package/dist/{QrCode-C3hAfNP6.js → QrCode-DaJYqBc1.js} +2 -2
  160. package/dist/{QrCode-C3hAfNP6.js.map → QrCode-DaJYqBc1.js.map} +1 -1
  161. package/dist/{RemoveDialog-Hi_gV-8A.cjs → RemoveDialog-BnOtR6-q.cjs} +2 -2
  162. package/dist/{RemoveDialog-Hi_gV-8A.cjs.map → RemoveDialog-BnOtR6-q.cjs.map} +1 -1
  163. package/dist/{RemoveDialog-CXy-PY-G.js → RemoveDialog-MhEU5Zl3.js} +5 -5
  164. package/dist/{RemoveDialog-CXy-PY-G.js.map → RemoveDialog-MhEU5Zl3.js.map} +1 -1
  165. package/dist/RichTextEditor-Cnrnvv1f.cjs +2 -0
  166. package/dist/RichTextEditor-Cnrnvv1f.cjs.map +1 -0
  167. package/dist/RichTextEditor-zkoxujnO.js +1148 -0
  168. package/dist/RichTextEditor-zkoxujnO.js.map +1 -0
  169. package/dist/{RootLayout-CjT5uHlt.js → RootLayout-C4r9i5Go.js} +15 -15
  170. package/dist/{RootLayout-CjT5uHlt.js.map → RootLayout-C4r9i5Go.js.map} +1 -1
  171. package/dist/{RootLayout-iSGY4MsS.cjs → RootLayout-Z9PuRfsa.cjs} +2 -2
  172. package/dist/{RootLayout-iSGY4MsS.cjs.map → RootLayout-Z9PuRfsa.cjs.map} +1 -1
  173. package/dist/{Select-DVoL547R.cjs → Select-CylqFHce.cjs} +2 -2
  174. package/dist/{Select-DVoL547R.cjs.map → Select-CylqFHce.cjs.map} +1 -1
  175. package/dist/{Select-DuLDLnnb.js → Select-jT94L1vq.js} +3 -3
  176. package/dist/{Select-DuLDLnnb.js.map → Select-jT94L1vq.js.map} +1 -1
  177. package/dist/{Sidebar-DvQmuBNK.js → Sidebar-B1O2RsbR.js} +3 -3
  178. package/dist/{Sidebar-DvQmuBNK.js.map → Sidebar-B1O2RsbR.js.map} +1 -1
  179. package/dist/{Sidebar-DRQo4zAF.cjs → Sidebar-Bcm0fgVm.cjs} +2 -2
  180. package/dist/{Sidebar-DRQo4zAF.cjs.map → Sidebar-Bcm0fgVm.cjs.map} +1 -1
  181. package/dist/{Slider-DxnCQRSH.cjs → Slider-CV7ug0WF.cjs} +2 -2
  182. package/dist/{Slider-DxnCQRSH.cjs.map → Slider-CV7ug0WF.cjs.map} +1 -1
  183. package/dist/{Slider-D-QjclQJ.js → Slider-DC-ugZwT.js} +2 -2
  184. package/dist/{Slider-D-QjclQJ.js.map → Slider-DC-ugZwT.js.map} +1 -1
  185. package/dist/{SpeedDial-BBQ9y6lm.js → SpeedDial-C6yiMUe8.js} +2 -2
  186. package/dist/{SpeedDial-BBQ9y6lm.js.map → SpeedDial-C6yiMUe8.js.map} +1 -1
  187. package/dist/{SpeedDial-37OMwj9C.cjs → SpeedDial-DOgm2DDX.cjs} +2 -2
  188. package/dist/{SpeedDial-37OMwj9C.cjs.map → SpeedDial-DOgm2DDX.cjs.map} +1 -1
  189. package/dist/{Stepper-CU5Y0kfj.js → Stepper-BZdYGpBN.js} +2 -2
  190. package/dist/{Stepper-CU5Y0kfj.js.map → Stepper-BZdYGpBN.js.map} +1 -1
  191. package/dist/{Stepper-WqkfGPnQ.cjs → Stepper-DqM86TGV.cjs} +2 -2
  192. package/dist/{Stepper-WqkfGPnQ.cjs.map → Stepper-DqM86TGV.cjs.map} +1 -1
  193. package/dist/{Table-BnlvrRMr.cjs → Table-BgaCwRDQ.cjs} +2 -2
  194. package/dist/{Table-BnlvrRMr.cjs.map → Table-BgaCwRDQ.cjs.map} +1 -1
  195. package/dist/{Table-BECUUZtf.js → Table-FZlVWoYi.js} +16 -16
  196. package/dist/{Table-BECUUZtf.js.map → Table-FZlVWoYi.js.map} +1 -1
  197. package/dist/{Tabs-BXAHddi7.js → Tabs-BqQPkorY.js} +2 -2
  198. package/dist/{Tabs-BXAHddi7.js.map → Tabs-BqQPkorY.js.map} +1 -1
  199. package/dist/{Tabs-DiL1vNW3.cjs → Tabs-kGeyFhJ6.cjs} +2 -2
  200. package/dist/{Tabs-DiL1vNW3.cjs.map → Tabs-kGeyFhJ6.cjs.map} +1 -1
  201. package/dist/{TagsField-BsV_6dff.cjs → TagsField-B_sjp48X.cjs} +2 -2
  202. package/dist/{TagsField-BsV_6dff.cjs.map → TagsField-B_sjp48X.cjs.map} +1 -1
  203. package/dist/{TagsField-C1SgykAj.js → TagsField-ByTx9JXK.js} +4 -4
  204. package/dist/{TagsField-C1SgykAj.js.map → TagsField-ByTx9JXK.js.map} +1 -1
  205. package/dist/{TextField-DUv689u2.cjs → TextField-CBYJIfau.cjs} +2 -2
  206. package/dist/{TextField-DUv689u2.cjs.map → TextField-CBYJIfau.cjs.map} +1 -1
  207. package/dist/{TextField-oZI7thoU.js → TextField-CyKIx-d-.js} +3 -3
  208. package/dist/{TextField-oZI7thoU.js.map → TextField-CyKIx-d-.js.map} +1 -1
  209. package/dist/{ThemeToggle-xn3roH0u.cjs → ThemeToggle-D2dIqiBa.cjs} +2 -2
  210. package/dist/{ThemeToggle-xn3roH0u.cjs.map → ThemeToggle-D2dIqiBa.cjs.map} +1 -1
  211. package/dist/{ThemeToggle-5uHCUsX7.js → ThemeToggle-Dg6IishB.js} +3 -3
  212. package/dist/{ThemeToggle-5uHCUsX7.js.map → ThemeToggle-Dg6IishB.js.map} +1 -1
  213. package/dist/{TimeColumns-lO33mhX7.js → TimeColumns-Cx8J5qzW.js} +2 -2
  214. package/dist/{TimeColumns-lO33mhX7.js.map → TimeColumns-Cx8J5qzW.js.map} +1 -1
  215. package/dist/{TimeColumns-By23LHZw.cjs → TimeColumns-DVmK_T_P.cjs} +2 -2
  216. package/dist/{TimeColumns-By23LHZw.cjs.map → TimeColumns-DVmK_T_P.cjs.map} +1 -1
  217. package/dist/{TimePicker-BHFNH8LR.cjs → TimePicker-0nZOPRKp.cjs} +2 -2
  218. package/dist/{TimePicker-BHFNH8LR.cjs.map → TimePicker-0nZOPRKp.cjs.map} +1 -1
  219. package/dist/{TimePicker-Dl5p833O.js → TimePicker-sAhtvqQ4.js} +5 -5
  220. package/dist/{TimePicker-Dl5p833O.js.map → TimePicker-sAhtvqQ4.js.map} +1 -1
  221. package/dist/{Toaster-BPBFZiTr.js → Toaster-BOW9rzLq.js} +3 -3
  222. package/dist/{Toaster-BPBFZiTr.js.map → Toaster-BOW9rzLq.js.map} +1 -1
  223. package/dist/{Toaster-D4T89N1S.cjs → Toaster-DYGo92ke.cjs} +2 -2
  224. package/dist/{Toaster-D4T89N1S.cjs.map → Toaster-DYGo92ke.cjs.map} +1 -1
  225. package/dist/{TranslatedFields-LdeJeHEp.cjs → TranslatedFields-C_DuLotV.cjs} +2 -2
  226. package/dist/{TranslatedFields-LdeJeHEp.cjs.map → TranslatedFields-C_DuLotV.cjs.map} +1 -1
  227. package/dist/{TranslatedFields-Clsr84XC.js → TranslatedFields-CcE0td9p.js} +5 -5
  228. package/dist/{TranslatedFields-Clsr84XC.js.map → TranslatedFields-CcE0td9p.js.map} +1 -1
  229. package/dist/{UserCard-CQOiWppq.cjs → UserCard-DLVptkLr.cjs} +2 -2
  230. package/dist/{UserCard-CQOiWppq.cjs.map → UserCard-DLVptkLr.cjs.map} +1 -1
  231. package/dist/{UserCard-Cr75RwZb.js → UserCard-DeONbaKj.js} +3 -3
  232. package/dist/{UserCard-Cr75RwZb.js.map → UserCard-DeONbaKj.js.map} +1 -1
  233. package/dist/components/Alert/index.cjs +1 -1
  234. package/dist/components/Alert/index.js +1 -1
  235. package/dist/components/Breadcrumbs/index.cjs +1 -1
  236. package/dist/components/Breadcrumbs/index.js +1 -1
  237. package/dist/components/Button/index.cjs +1 -1
  238. package/dist/components/Button/index.js +1 -1
  239. package/dist/components/Card/index.cjs +1 -1
  240. package/dist/components/Card/index.js +1 -1
  241. package/dist/components/Chip/index.cjs +1 -1
  242. package/dist/components/Chip/index.js +1 -1
  243. package/dist/components/CodeBlock/index.cjs +1 -1
  244. package/dist/components/CodeBlock/index.js +1 -1
  245. package/dist/components/ColorPicker/index.cjs +1 -1
  246. package/dist/components/ColorPicker/index.js +1 -1
  247. package/dist/components/ColorRamp/index.cjs +1 -1
  248. package/dist/components/ColorRamp/index.js +1 -1
  249. package/dist/components/CopyButton/index.cjs +1 -1
  250. package/dist/components/CopyButton/index.js +1 -1
  251. package/dist/components/DatePicker/index.cjs +1 -1
  252. package/dist/components/DatePicker/index.js +1 -1
  253. package/dist/components/DateTimePicker/index.cjs +1 -1
  254. package/dist/components/DateTimePicker/index.js +1 -1
  255. package/dist/components/DescriptionList/index.cjs +1 -1
  256. package/dist/components/DescriptionList/index.js +1 -1
  257. package/dist/components/EmptyState/index.cjs +1 -1
  258. package/dist/components/EmptyState/index.js +1 -1
  259. package/dist/components/ErrorState/index.cjs +1 -1
  260. package/dist/components/ErrorState/index.js +2 -2
  261. package/dist/components/FileCard/index.cjs +1 -1
  262. package/dist/components/FileCard/index.js +1 -1
  263. package/dist/components/FileUploader/index.cjs +1 -1
  264. package/dist/components/FileUploader/index.js +1 -1
  265. package/dist/components/Flag/index.cjs +1 -1
  266. package/dist/components/Flag/index.js +1 -1
  267. package/dist/components/FullscreenToggle/index.cjs +1 -1
  268. package/dist/components/FullscreenToggle/index.js +1 -1
  269. package/dist/components/IconButton/index.cjs +1 -1
  270. package/dist/components/IconButton/index.js +1 -1
  271. package/dist/components/ImageEditor/index.cjs +1 -1
  272. package/dist/components/ImageEditor/index.js +1 -1
  273. package/dist/components/Loader/index.cjs +1 -1
  274. package/dist/components/Loader/index.js +1 -1
  275. package/dist/components/LocationPicker/index.cjs +1 -1
  276. package/dist/components/LocationPicker/index.js +1 -1
  277. package/dist/components/Modal/index.cjs +1 -1
  278. package/dist/components/Modal/index.js +1 -1
  279. package/dist/components/MultiSelect/index.cjs +1 -1
  280. package/dist/components/MultiSelect/index.js +1 -1
  281. package/dist/components/NumberField/index.cjs +1 -1
  282. package/dist/components/NumberField/index.js +1 -1
  283. package/dist/components/OtpField/index.cjs +1 -1
  284. package/dist/components/OtpField/index.js +1 -1
  285. package/dist/components/PageError/index.cjs +1 -1
  286. package/dist/components/PageError/index.js +1 -1
  287. package/dist/components/PageLayout/index.cjs +1 -1
  288. package/dist/components/PageLayout/index.js +1 -1
  289. package/dist/components/PageNotFound/index.cjs +1 -1
  290. package/dist/components/PageNotFound/index.js +1 -1
  291. package/dist/components/Pagination/index.cjs +1 -1
  292. package/dist/components/Pagination/index.js +1 -1
  293. package/dist/components/PaletteField/index.cjs +1 -1
  294. package/dist/components/PaletteField/index.js +1 -1
  295. package/dist/components/PhoneField/index.cjs +1 -1
  296. package/dist/components/PhoneField/index.js +1 -1
  297. package/dist/components/Popconfirm/index.cjs +1 -1
  298. package/dist/components/Popconfirm/index.js +1 -1
  299. package/dist/components/Progress/index.cjs +1 -1
  300. package/dist/components/Progress/index.js +1 -1
  301. package/dist/components/QrCode/index.cjs +1 -1
  302. package/dist/components/QrCode/index.js +1 -1
  303. package/dist/components/RemoveDialog/index.cjs +1 -1
  304. package/dist/components/RemoveDialog/index.js +1 -1
  305. package/dist/components/RichTextEditor/index.cjs +1 -1
  306. package/dist/components/RichTextEditor/index.js +1 -1
  307. package/dist/components/RichTextEditor/nodes/ImageNode.d.cts +17 -5
  308. package/dist/components/RichTextEditor/nodes/ImageNode.d.ts +17 -5
  309. package/dist/components/RootLayout/index.cjs +1 -1
  310. package/dist/components/RootLayout/index.js +1 -1
  311. package/dist/components/Select/index.cjs +1 -1
  312. package/dist/components/Select/index.js +1 -1
  313. package/dist/components/Sidebar/index.cjs +1 -1
  314. package/dist/components/Sidebar/index.js +1 -1
  315. package/dist/components/Slider/index.cjs +1 -1
  316. package/dist/components/Slider/index.js +1 -1
  317. package/dist/components/SpeedDial/index.cjs +1 -1
  318. package/dist/components/SpeedDial/index.js +1 -1
  319. package/dist/components/Stepper/index.cjs +1 -1
  320. package/dist/components/Stepper/index.js +1 -1
  321. package/dist/components/Table/index.cjs +1 -1
  322. package/dist/components/Table/index.js +1 -1
  323. package/dist/components/Tabs/index.cjs +1 -1
  324. package/dist/components/Tabs/index.js +1 -1
  325. package/dist/components/TagsField/index.cjs +1 -1
  326. package/dist/components/TagsField/index.js +1 -1
  327. package/dist/components/TextField/index.cjs +1 -1
  328. package/dist/components/TextField/index.js +1 -1
  329. package/dist/components/ThemeToggle/index.cjs +1 -1
  330. package/dist/components/ThemeToggle/index.js +1 -1
  331. package/dist/components/TimePicker/index.cjs +1 -1
  332. package/dist/components/TimePicker/index.js +1 -1
  333. package/dist/components/Toast/index.cjs +1 -1
  334. package/dist/components/Toast/index.js +1 -1
  335. package/dist/components/TranslatedFields/index.cjs +1 -1
  336. package/dist/components/TranslatedFields/index.js +1 -1
  337. package/dist/components/UserCard/index.cjs +1 -1
  338. package/dist/components/UserCard/index.js +1 -1
  339. package/dist/entries/app.cjs +1 -1
  340. package/dist/entries/app.js +1 -1
  341. package/dist/entries/components.cjs +1 -1
  342. package/dist/entries/components.js +53 -53
  343. package/dist/entries/i18n.cjs +1 -1
  344. package/dist/entries/i18n.js +2 -2
  345. package/dist/entries/theme.cjs +1 -1
  346. package/dist/entries/theme.js +1 -1
  347. package/dist/i18n/messages.d.cts +5 -0
  348. package/dist/i18n/messages.d.ts +5 -0
  349. package/dist/index.cjs +1 -1
  350. package/dist/index.css +1 -1
  351. package/dist/index.js +56 -56
  352. package/dist/{messages-BZYBZ3GR.js → messages-DeQuvGln.js} +47 -12
  353. package/dist/messages-DeQuvGln.js.map +1 -0
  354. package/dist/{messages-CTHjpVJq.cjs → messages-dL9MkVze.cjs} +9 -9
  355. package/dist/messages-dL9MkVze.cjs.map +1 -0
  356. package/dist/{useHomeTo-Biyc-Un8.js → useHomeTo-BL3e8Sc6.js} +2 -2
  357. package/dist/{useHomeTo-Biyc-Un8.js.map → useHomeTo-BL3e8Sc6.js.map} +1 -1
  358. package/dist/{useHomeTo-D7wcH6aw.cjs → useHomeTo-W1PDW5CU.cjs} +2 -2
  359. package/dist/{useHomeTo-D7wcH6aw.cjs.map → useHomeTo-W1PDW5CU.cjs.map} +1 -1
  360. package/dist/{useOptionMenu-BTt8t9SM.js → useOptionMenu-BkKiZ6Ax.js} +3 -3
  361. package/dist/{useOptionMenu-BTt8t9SM.js.map → useOptionMenu-BkKiZ6Ax.js.map} +1 -1
  362. package/dist/{useOptionMenu-B40OOVsO.cjs → useOptionMenu-CVl7VHXl.cjs} +2 -2
  363. package/dist/{useOptionMenu-B40OOVsO.cjs.map → useOptionMenu-CVl7VHXl.cjs.map} +1 -1
  364. package/package.json +1 -1
  365. package/dist/FileUploader-B27Y4rak.js +0 -706
  366. package/dist/FileUploader-B27Y4rak.js.map +0 -1
  367. package/dist/FileUploader-DkvFO0N_.cjs +0 -2
  368. package/dist/FileUploader-DkvFO0N_.cjs.map +0 -1
  369. package/dist/ImageEditor-DTFQZ6ON.js.map +0 -1
  370. package/dist/ImageEditor-D_HKfDbx.cjs +0 -60
  371. package/dist/ImageEditor-D_HKfDbx.cjs.map +0 -1
  372. package/dist/RichTextEditor-BhVE1q4U.cjs +0 -2
  373. package/dist/RichTextEditor-BhVE1q4U.cjs.map +0 -1
  374. package/dist/RichTextEditor-DQz9jGD3.js +0 -1011
  375. package/dist/RichTextEditor-DQz9jGD3.js.map +0 -1
  376. package/dist/messages-BZYBZ3GR.js.map +0 -1
  377. package/dist/messages-CTHjpVJq.cjs.map +0 -1
@@ -1,60 +0,0 @@
1
- "use strict";const u=require("react/jsx-runtime"),v=require("react"),G=require("clsx"),_e=require("./Button-Bxztlybi.cjs"),Z=require("./Icon-CBg21lKA.cjs"),vt=require("./IconButton-wW1o4HHw.cjs"),sn=require("./Loader-DNR2_YHm.cjs"),cn=require("./Overlay-CywFQfjm.cjs"),Ot=require("./ConfigProvider-Cf-awvZs.cjs"),ln=require("./Dropdown-C_y9_dVn.cjs"),ke=require("./ListItem-CguNjf-u.cjs"),Ee=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],ce=.2126,le=.7152,ue=.0722;function un(t,e){const n=new Array(20);for(let i=0;i<4;i++)for(let o=0;o<5;o++){let r=0;for(let a=0;a<4;a++)r+=t[i*5+a]*e[a*5+o];o===4&&(r+=t[i*5+4]),n[i*5+o]=r}return n}function nt(...t){return t.reduce((e,n)=>un(n,e),Ee)}function hn(t){return!t||t.every((e,n)=>Math.abs(e-Ee[n])<1e-6)}const Ve=t=>[1,0,0,0,t,0,1,0,0,t,0,0,1,0,t,0,0,0,1,0],xt=t=>{const e=.5*(1-t);return[t,0,0,0,e,0,t,0,0,e,0,0,t,0,e,0,0,0,1,0]},It=t=>{const e=1-t;return[ce*e+t,le*e,ue*e,0,0,ce*e,le*e+t,ue*e,0,0,ce*e,le*e,ue*e+t,0,0,0,0,0,1,0]},Tt=(t,e,n,i=0,o=0,r=0)=>[t,0,0,0,i,0,e,0,0,o,0,0,n,0,r,0,0,0,1,0],he=(t,e)=>{const n=e-t;return[n,0,0,0,t,0,n,0,0,t,0,0,n,0,t,0,0,0,1,0]},Ne=[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],be=[["default"],["chrome","fade","cold","warm","pastel"],["mono","noir","stark","wash"],["sepia","rust","blues","color"]],Nt=It(0),ee={default:null,chrome:nt(It(1.3),xt(1.15)),fade:nt(It(.7),he(.12,.92)),cold:nt(Tt(.9,.98,1.12,0,.01,.03),xt(1.04)),warm:nt(Tt(1.1,1.03,.86,.03,.01,0),xt(1.04)),pastel:nt(It(.6),he(.16,1)),mono:Nt,noir:nt(Nt,xt(1.45),Ve(-.04)),stark:nt(Nt,xt(2.1)),wash:nt(Nt,he(.22,.98)),sepia:Ne,rust:nt(Ne,Tt(1.12,.9,.7),xt(1.12)),blues:nt(Nt,Tt(.72,.88,1.08,0,.02,.08)),color:nt(It(1.65),xt(1.06))},dn=["brightness","contrast","saturation","exposure","temperature","gamma","clarity","vignette"],$e={brightness:0,contrast:0,saturation:0,exposure:0,temperature:0,gamma:0,clarity:0,vignette:0},ct={brightness:t=>t/100*.25,contrast:t=>1+t/100*.5,saturation:t=>1+t/100,exposure:t=>1+t/100*.5,temperature:t=>t/100,gamma:t=>1+t/100*.5,clarity:t=>t/100,vignette:t=>t/100};function mn(t){const e=ct.temperature(t.temperature);return nt(Tt(ct.exposure(t.exposure),ct.exposure(t.exposure),ct.exposure(t.exposure)),Ve(ct.brightness(t.brightness)),xt(ct.contrast(t.contrast)),It(ct.saturation(t.saturation)),Tt(1+.12*e,1+.02*e,1-.12*e))}function fn(t,e){return nt(t??Ee,mn(e))}const Jt=Math.PI/2,Ge=1e-6,ne=([t,e],n)=>{const i=Math.cos(n),o=Math.sin(n);return[t*i-e*o,t*o+e*i]};function We(t,e,n){const i=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n));return[t/2*i+e/2*o,t/2*o+e/2*i]}const Xt=t=>[t.x+t.width/2,t.y+t.height/2];function re(t,e,n,i){const[o,r]=We(t,e,n);return Math.max(2*o/i.width,2*r/i.height)}function Bt(t,e){const[n,i]=Xt(t.crop),[o,r]=ne([n-e.width/2,i-e.height/2],-t.rotation);return[o/t.scale,r/t.scale]}function qt([t,e],n,i,o,r,a){const[s,_]=We(n,i,o),c=Math.max(0,a.width/2-s/r),y=Math.max(0,a.height/2-_/r);return[Math.min(c,Math.max(-c,t)),Math.min(y,Math.max(-y,e))]}function Yt(t,e,n,i,o,r){const[a,s]=ne([t[0]*o,t[1]*o],i),_=r.width/2+a,c=r.height/2+s;return{x:_-e/2,y:c-n/2,width:e,height:n}}function gn(t,e,n,i){const o=[[t.x,t.y],[t.x+t.width,t.y],[t.x,t.y+t.height],[t.x+t.width,t.y+t.height]],r=1e-6*Math.max(i.width,i.height);return o.every(([a,s])=>{const[_,c]=ne([a-i.width/2,s-i.height/2],-e);return Math.abs(_/n)<=i.width/2+r/n&&Math.abs(c/n)<=i.height/2+r/n})}function pn(t,e){const{width:n,height:i}=t.crop,o=Math.max(t.scale,re(n,i,t.rotation,e)),r=qt(Bt({...t,scale:o},e),n,i,t.rotation,o,e);return{...t,scale:o,crop:Yt(r,n,i,t.rotation,o,e)}}function At(t){return{width:Math.max(1,Math.round(t.crop.width/t.scale)),height:Math.max(1,Math.round(t.crop.height/t.scale))}}function Rt(t){const e=At(t);return t.resize?{width:Math.max(1,Math.min(e.width,Math.round(t.resize.width))),height:Math.max(1,Math.min(e.height,Math.round(t.resize.height)))}:e}function Dt(t){const{crop:e}=t,n=t.resize;if(!n)return e;const i=n.width/n.height,o=e.width/e.height;if(Math.abs(o-i)<1e-9*Math.max(o,i))return e;if(o>i){const a=e.height*i;return{...e,x:e.x+(e.width-a)/2,width:a}}const r=e.width/i;return{...e,y:e.y+(e.height-r)/2,height:r}}function xn(t,e){if(!e)return{...t,resize:null};const n=At(t),i=Math.max(1,Math.min(n.width,Math.round(e.width))),o=Math.max(1,Math.min(n.height,Math.round(e.height))),r=Math.round(i*n.height/n.width)===o||Math.round(o*n.width/n.height)===i;let a=t;if(!r){const c=Dt({...t,resize:{width:i,height:o}});a={...t,crop:c,cropRatio:null}}const s=At(a),_=i>=s.width&&o>=s.height?null:{width:Math.min(i,s.width),height:Math.min(o,s.height)};return{...a,resize:_}}function _n(t,e){const n=e.resize;if(!n)return n;const i=At(t),o=At(e);if(i.width===o.width&&i.height===o.height)return n;const r=Math.max(1,Math.min(o.width,Math.round(n.width*o.width/i.width))),a=Math.max(1,Math.min(o.height,Math.round(n.height*o.height/i.height)));return r===o.width&&a===o.height?null:{width:r,height:a}}function bn(t,e){let n=t.width,i=t.height;return e&&e>0&&(n/i>e?n=i*e:i=n/e),{x:(t.width-n)/2,y:(t.height-i)/2,width:n,height:i}}function wn(t,e){return{crop:bn(t,e),cropRatio:e&&e>0?e:null,resize:null,rotation:0,flipX:!1,flipY:!1,scale:1,filter:null,colorMatrix:null,finetune:{...$e},redact:{effect:"blur",amount:0}}}function de(t,e){const n=(Math.round(t/Jt)%4+4)%4,i=e??n*Jt;let o=t-i;return o=Math.atan2(Math.sin(o),Math.cos(o)),{quarter:we(i),fine:o}}const we=t=>{const e=t%(2*Math.PI),n=e<0?e+2*Math.PI:e;return Math.abs(n-2*Math.PI)<Ge?0:n};function Pe(t,e,n){const{width:i,height:o}=t.crop,r=Bt(t,n),a=Math.max(t.scale,re(i,o,e,n)),s=qt(r,i,o,e,a,n);return{...t,rotation:e,scale:a,crop:Yt(s,i,o,e,a,n)}}function vn(t,e){const[n,i]=Xt(t.crop),o=e.width/2,r=e.height/2,[a,s]=ne([n-o,i-r],-Jt),_=t.crop.height,c=t.crop.width;return{...t,rotation:t.rotation-Jt,crop:{x:o+a-_/2,y:r+s-c/2,width:_,height:c},cropRatio:t.cropRatio?1/t.cropRatio:t.cropRatio}}function Mn(t,e){return{...t,rotation:-t.rotation,flipX:!t.flipX,crop:{...t.crop,x:e.width-t.crop.x-t.crop.width}}}function Qt(t,e){return t.scale/re(t.crop.width,t.crop.height,t.rotation,e)}const Ft=5;function Ut(t,e,n){const{width:i,height:o}=t.crop,r=Bt(t,n),a=re(i,o,t.rotation,n)*Math.min(Ft,Math.max(1,e)),s=qt(r,i,o,t.rotation,a,n);return{...t,scale:a,crop:Yt(s,i,o,t.rotation,a,n)}}function yn(t,e,n,i){const{width:o,height:r}=t.crop,a={...t,crop:{...t.crop,x:t.crop.x+e,y:t.crop.y+n}},s=qt(Bt(a,i),o,r,t.rotation,t.scale,i);return{...t,crop:Yt(s,o,r,t.rotation,t.scale,i)}}function En(t,e,n){if(!e||e<=0)return{...t,cropRatio:null};const i=Math.abs(Math.cos(t.rotation)),o=Math.abs(Math.sin(t.rotation)),r=Math.min(n.width*t.scale/(e*i+o),n.height*t.scale/(e*o+i)),a=r*e,s=qt(Bt(t,n),a,r,t.rotation,t.scale,n);return{...t,cropRatio:e,crop:Yt(s,a,r,t.rotation,t.scale,n)}}function In(t,e,n,i,o,{aspectRatio:r,minSize:a}){const s=t.crop;let _=s.x,c=s.y,y=s.x+s.width,m=s.y+s.height;const T=e.includes("n"),g=e.includes("s"),S=e.includes("w"),A=e.includes("e");if(T&&(c=Math.min(c+i,m-a)),g&&(m=Math.max(m+i,c+a)),S&&(_=Math.min(_+n,y-a)),A&&(y=Math.max(y+n,_+a)),r&&r>0){let w=y-_,N=m-c;if((T||g)&&(S||A))w/N>r?N=w/r:w=N*r,S?_=y-w:y=_+w,T?c=m-N:m=c+N;else if(T||g){w=N*r;const Y=s.x+s.width/2;_=Y-w/2,y=Y+w/2}else{N=w/r;const Y=s.y+s.height/2;c=Y-N/2,m=Y+N/2}}const E={x:_,y:c,width:y-_,height:m-c},M=w=>gn(w,t.rotation,t.scale,o);if(M(E))return{...t,crop:E};if(!(!(r&&r>0)&&(T||g)&&(S||A)))return{...t,crop:Pt(s,E,M)};const j=w=>({...w,x:_,width:y-_}),d=w=>({...w,y:c,height:m-c}),C=Pt(Pt(s,j(s),M),d,M),f=Pt(Pt(s,d(s),M),j,M),I=w=>Math.abs(w.x-E.x)+Math.abs(w.y-E.y)+Math.abs(w.width-E.width)+Math.abs(w.height-E.height);return{...t,crop:I(C)<=I(f)?C:f}}function Pt(t,e,n){const i=typeof e=="function"?e(t):e;if(n(i))return i;let o=0,r=1;for(let a=0;a<24;a++){const s=(o+r)/2;n(ze(t,i,s))?o=s:r=s}return ze(t,i,o)}const ze=(t,e,n)=>({x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,width:t.width+(e.width-t.width)*n,height:t.height+(e.height-t.height)*n});function De(t,e){const n={...t.crop,width:Math.max(1,t.crop.width),height:Math.max(1,t.crop.height)};return pn({...t,crop:n,scale:Math.max(Ge,t.scale||1)},e)}const Ke=.85,Tn=(t,e,n)=>{const i=Math.min(1,Math.max(0,(n-t)/(e-t)));return i*i*(3-2*i)},Rn=(t,e)=>Tn(.3,1,Math.hypot(t,e)/Math.SQRT2);function Ie(t,e,n,i,o,r){const a=i.matrix,s=1/i.gamma,_=Math.abs(i.gamma-1)>1e-4,c=Math.abs(i.clarity)>1e-4&&!!o,y=Math.abs(i.vignette)>1e-4&&!!r;for(let m=0;m<n;m++)for(let T=0;T<e;T++){const g=(m*e+T)*4,S=t[g+3]/255;if(S===0)continue;const A=t[g]/255,E=t[g+1]/255,M=t[g+2]/255;let l=a[0]*A+a[1]*E+a[2]*M+a[3]*S+a[4],j=a[5]*A+a[6]*E+a[7]*M+a[8]*S+a[9],d=a[10]*A+a[11]*E+a[12]*M+a[13]*S+a[14];if(c){const C=o[g]/255,f=o[g+1]/255,I=o[g+2]/255,w=o[g+3]/255,N=a[0]*C+a[1]*f+a[2]*I+a[3]*w+a[4],V=a[5]*C+a[6]*f+a[7]*I+a[8]*w+a[9],Y=a[10]*C+a[11]*f+a[12]*I+a[13]*w+a[14];l+=i.clarity*(l-N),j+=i.clarity*(j-V),d+=i.clarity*(d-Y)}if(_&&(l=Math.pow(Math.max(0,l),s),j=Math.pow(Math.max(0,j),s),d=Math.pow(Math.max(0,d),s)),y){const C=T+.5,f=m+.5,I=r[0]*C+r[1]*f+r[2],w=r[3]*C+r[4]*f+r[5],N=Rn(I,w)*Ke*Math.abs(i.vignette);i.vignette>0?(l*=1-N,j*=1-N,d*=1-N):(l+=(1-l)*N,j+=(1-j)*N,d+=(1-d)*N)}t[g]=l*255,t[g+1]=j*255,t[g+2]=d*255}}function Te(t,e,n,i){const o=Math.max(1,Math.round(i)),r=new Uint8ClampedArray(t),a=new Uint8ClampedArray(t.length);for(let _=0;_<3;_++)s(r,a,e,n,o,!0),s(a,r,e,n,o,!1);return r;function s(_,c,y,m,T,g){const S=g?m:y,A=g?y:m,E=g?4:y*4,M=T*2+1;for(let l=0;l<S;l++){const j=g?l*y*4:l*4;for(let d=0;d<4;d++){let C=0;for(let f=-T;f<=T;f++){const I=Math.min(A-1,Math.max(0,f));C+=_[j+I*E+d]}for(let f=0;f<A;f++){c[j+f*E+d]=C/M;const I=Math.max(0,f-T),w=Math.min(A-1,f+T+1);C+=_[j+w*E+d]-_[j+I*E+d]}}}}}const Re=.012,He=(t,e)=>{const n=document.createElement("canvas");return n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e)),n};async function Fe(t){if(typeof createImageBitmap=="function")try{return await createImageBitmap(t,{imageOrientation:"from-image"})}catch{}const e=URL.createObjectURL(t);try{return await Qe(e,!1)}finally{URL.revokeObjectURL(e)}}function Qe(t,e){return new Promise((n,i)=>{const o=new Image;e&&(o.crossOrigin="anonymous"),o.decoding="async",o.onload=()=>n(o),o.onerror=()=>i(new Error(`Could not load image: ${t.slice(0,80)}`)),o.src=t})}const Sn=t=>t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:{width:t.width,height:t.height};async function An(t){let e,n="";if(typeof t=="string")try{const r=await fetch(t);if(!r.ok)throw new Error(String(r.status));const a=await r.blob();n=a.type,e=await Fe(a)}catch{e=await Qe(t,!t.startsWith("data:")&&!t.startsWith("blob:"));const r=/^data:([^;,]+)/.exec(t)??/\.(png|jpe?g|webp|gif|avif)(?:[?#]|$)/i.exec(t);r&&(n=r[1].includes("/")?r[1]:`image/${r[1].toLowerCase().replace("jpg","jpeg")}`)}else n=t.type,e=await Fe(t);const{width:i,height:o}=Sn(e);if(!i||!o)throw new Error("The image has no size");return{image:e,width:i,height:o,type:n}}function Zt(t,e,n,i){const o=Math.min(1,i/Math.max(e,n));if(o>=1)return{canvas:t,width:e,height:n};const r=He(e*o,n*o),a=r.getContext("2d");return a&&(a.imageSmoothingQuality="high",a.drawImage(t,0,0,r.width,r.height)),{canvas:r,width:r.width,height:r.height}}function Ze(t,e,n,i,o=384){const r=Math.min(1,o/Math.max(e,n)),a=He(e*r,n*r),s=a.getContext("2d",{willReadFrequently:!0});if(!s)return a;s.drawImage(t,0,0,a.width,a.height);try{const _=s.getImageData(0,0,a.width,a.height);_.data.set(Te(_.data,a.width,a.height,Math.max(1,i*r))),s.putImageData(_,0,0)}catch{}return a}function jn(t,e){return t||(["image/jpeg","image/png","image/webp"].includes(e)?e:"image/png")}const Cn=[1,0,0,0,1,0],it=(t,e)=>[1,0,t,0,1,e],J=(t,e=t)=>[t,0,0,0,e,0],Je=t=>{const e=Math.cos(t),n=Math.sin(t);return[e,-n,0,n,e,0]};function Ln(t,e){return[t[0]*e[0]+t[1]*e[3],t[0]*e[1]+t[1]*e[4],t[0]*e[2]+t[1]*e[5]+t[2],t[3]*e[0]+t[4]*e[3],t[3]*e[1]+t[4]*e[4],t[3]*e[2]+t[4]*e[5]+t[5]]}const rt=(...t)=>t.reduce((e,n)=>Ln(n,e),Cn);function St([t,e,n,i,o,r]){const a=t*o-e*i,s=Math.abs(a)<1e-12?1e12:1/a;return[o*s,-e*s,(e*r-n*o)*s,-i*s,t*s,(n*i-t*r)*s]}const te=([t,e,n,i,o,r],a,s)=>[t*a+e*s+n,i*a+o*s+r],kn={blur:.015,pixelate:.05};function ve(t,e){var o,r;const n=((o=t.redact)==null?void 0:o.effect)??"blur";return Math.max(0,Math.min(100,((r=t.redact)==null?void 0:r.amount)??0))/100*(kn[n]??0)*Math.max(e.width,e.height)}function tn(t,e){const n=Math.max(1e-6,e);return{cols:Math.max(1,Math.round(t.width/n)),rows:Math.max(1,Math.round(t.height/n))}}const Nn=4,ie=(t,e)=>{const n=document.createElement("canvas");return n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e)),n};function en(t,e,n,i,o){const r=Math.min(1,Nn/Math.max(1,i),o/Math.max(e,n)),a=ie(e*r,n*r),s=a.getContext("2d",{willReadFrequently:!0});if(!s)return a;s.imageSmoothingQuality="high",s.drawImage(t,0,0,a.width,a.height);try{const _=s.getImageData(0,0,a.width,a.height);_.data.set(Te(_.data,a.width,a.height,Math.max(1,i*r))),s.putImageData(_,0,0)}catch{}return a}function Pn(t,e,n,i){const o=ie(e,n),r=o.getContext("2d");return r&&(r.imageSmoothingQuality="high",r.drawImage(en(t,e,n,i,1024),0,0,e,n)),o}function nn(t,e,n){const i=ie(e,n),o=i.getContext("2d"),r=t.getContext("2d");!o||!r||(o.imageSmoothingQuality="high",o.drawImage(t,0,0,i.width,i.height),r.save(),r.setTransform(1,0,0,1,0,0),r.globalCompositeOperation="copy",r.imageSmoothingEnabled=!1,r.drawImage(i,0,0,t.width,t.height),r.restore())}function zn(t,e,n,i){const o=ie(e,n),r=o.getContext("2d");return r&&(r.drawImage(t,0,0,e,n),nn(o,Math.max(1,Math.round(e/Math.max(2,i))),Math.max(1,Math.round(n/Math.max(2,i))))),o}const rn=t=>t.area?[t.area.x+t.area.width/2,t.area.y+t.area.height/2]:[t.width/2,t.height/2];function Se(t,e){const n=e.width/2,i=e.height/2;return rt(it(-n,-i),J(t.flipX?-1:1,t.flipY?-1:1),Je(t.rotation),J(t.scale),it(n,i))}function on(t,e){const n=Math.abs(t.flip)<.02?.02*Math.sign(t.flip||1):t.flip,[i,o]=rn(e);return rt(it(-t.center[0],-t.center[1]),Je(t.rotation),J(t.scale*n,t.scale),it(i,o))}function Dn(t){const[e,n]=Xt(t);return rt(it(-e,-n),J(2/t.width,2/t.height))}function Fn(t,e,n,i){const o=rt(J(1/i.dpr),St(on(n,i))),r=rt(o,St(Se(t,e)),J(1/e.width,1/e.height));return{toUV:r,toBlurUV:r,toCrop:rt(o,Dn(t.crop))}}function Ue(t,e,n){const i=Math.max(1,e.width-n*2),o=Math.max(1,e.height-n*2);return{center:Xt(t),scale:Math.min(i/t.width,o/t.height),rotation:0,flip:1}}const Un=`
2
- attribute vec2 a_pos;
3
- void main() { gl_Position = vec4(a_pos, 0.0, 1.0); }
4
- `,On=`
5
- #ifdef GL_FRAGMENT_PRECISION_HIGH
6
- precision highp float;
7
- #else
8
- precision mediump float;
9
- #endif
10
- uniform sampler2D u_image;
11
- uniform sampler2D u_blur;
12
- uniform vec2 u_size;
13
- uniform vec3 u_uvX; uniform vec3 u_uvY;
14
- uniform vec3 u_blurX; uniform vec3 u_blurY;
15
- uniform vec3 u_cropX; uniform vec3 u_cropY;
16
- uniform bool u_clip;
17
- uniform float u_dim;
18
- uniform vec3 u_dimColor;
19
- uniform mat4 u_cm; uniform vec4 u_co;
20
- uniform float u_gamma; uniform float u_clarity; uniform float u_vignette;
21
- uniform vec2 u_pixel; uniform vec3 u_cuvX; uniform vec3 u_cuvY;
22
-
23
- vec3 grade(vec4 c) { return (u_cm * c + u_co).rgb; }
24
-
25
- void main() {
26
- vec3 px = vec3(gl_FragCoord.x, u_size.y - gl_FragCoord.y, 1.0);
27
- vec2 cn = vec2(dot(u_cropX, px), dot(u_cropY, px));
28
- if (u_clip && (abs(cn.x) > 1.0 || abs(cn.y) > 1.0)) { gl_FragColor = vec4(0.0); return; }
29
- vec2 uv = vec2(dot(u_uvX, px), dot(u_uvY, px));
30
- vec2 buv = vec2(dot(u_blurX, px), dot(u_blurY, px));
31
- if (u_pixel.x > 0.0) {
32
- // the center of this pixel's block (whole blocks across the crop; the edge pixel stays in the last)
33
- vec2 cell = 2.0 / u_pixel;
34
- vec2 idx = floor((cn + 1.0) / cell);
35
- if (abs(cn.x) <= 1.0) idx.x = min(idx.x, u_pixel.x - 1.0);
36
- if (abs(cn.y) <= 1.0) idx.y = min(idx.y, u_pixel.y - 1.0);
37
- cn = (idx + 0.5) * cell - 1.0;
38
- vec3 q = vec3(cn, 1.0);
39
- uv = vec2(dot(u_cuvX, q), dot(u_cuvY, q));
40
- buv = uv;
41
- }
42
- if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) { gl_FragColor = vec4(0.0); return; }
43
- vec4 c = texture2D(u_image, uv);
44
- if (c.a <= 0.0) { gl_FragColor = vec4(0.0); return; }
45
- vec3 rgb = grade(c);
46
- if (u_clarity != 0.0) {
47
- vec4 bl = texture2D(u_blur, buv);
48
- rgb += u_clarity * (rgb - grade(bl));
49
- }
50
- if (u_gamma != 1.0) rgb = pow(max(rgb, 0.0), vec3(1.0 / u_gamma));
51
- if (u_vignette != 0.0) {
52
- float f = smoothstep(0.3, 1.0, length(cn) / 1.41421356) * ${Ke.toFixed(2)} * abs(u_vignette);
53
- rgb = u_vignette > 0.0 ? rgb * (1.0 - f) : rgb + (1.0 - rgb) * f;
54
- }
55
- rgb = clamp(rgb, 0.0, 1.0);
56
- if (abs(cn.x) > 1.0 || abs(cn.y) > 1.0) rgb = mix(u_dimColor, rgb, u_dim);
57
- gl_FragColor = vec4(rgb * c.a, c.a);
58
- }
59
- `;class oe{constructor(e,n){this.loc={},this.canvas=e,this.gl=n,this.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE),this.program=this.link(),n.useProgram(this.program);const i=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,i),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),n.STATIC_DRAW);const o=n.getAttribLocation(this.program,"a_pos");n.enableVertexAttribArray(o),n.vertexAttribPointer(o,2,n.FLOAT,!1,0,0);for(const r of["u_image","u_blur","u_size","u_uvX","u_uvY","u_blurX","u_blurY","u_cropX","u_cropY","u_clip","u_dim","u_dimColor","u_cm","u_co","u_gamma","u_clarity","u_vignette","u_pixel","u_cuvX","u_cuvY"])this.loc[r]=n.getUniformLocation(this.program,r);this.image=this.texture(),this.blur=this.texture(),n.uniform1i(this.loc.u_image,0),n.uniform1i(this.loc.u_blur,1)}static create(e){try{const n={premultipliedAlpha:!0,alpha:!0,antialias:!1,preserveDrawingBuffer:!0},i=e.getContext("webgl2",n)??e.getContext("webgl",n);return i?new oe(e,i):null}catch{return null}}link(){const e=this.gl,n=(o,r)=>{const a=e.createShader(o);if(e.shaderSource(a,r),e.compileShader(a),!e.getShaderParameter(a,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(a)??"shader compile failed");return a},i=e.createProgram();if(e.attachShader(i,n(e.VERTEX_SHADER,Un)),e.attachShader(i,n(e.FRAGMENT_SHADER,On)),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))throw new Error(e.getProgramInfoLog(i)??"program link failed");return i}texture(){const e=this.gl,n=e.createTexture();return e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),n}upload(e,n,i,o){const r=this.gl;r.activeTexture(r.TEXTURE0+e),r.bindTexture(r.TEXTURE_2D,n),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,i);const a=typeof WebGL2RenderingContext<"u"&&r instanceof WebGL2RenderingContext;o&&a?(r.generateMipmap(r.TEXTURE_2D),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_LINEAR)):r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR)}setImage(e,n,i=!0){this.upload(0,this.image,e,i),this.upload(1,this.blur,n,!1)}setSource(e,n=!0){this.upload(0,this.image,e,n)}render(e){const n=this.gl,{width:i,height:o}=this.canvas;n.viewport(0,0,i,o),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.uniform2f(this.loc.u_size,i,o);const r=(g,S,A)=>{n.uniform3f(this.loc[S],g[0],g[1],g[2]),n.uniform3f(this.loc[A],g[3],g[4],g[5])};r(e.toUV,"u_uvX","u_uvY"),r(e.toBlurUV,"u_blurX","u_blurY"),r(e.toCrop,"u_cropX","u_cropY"),n.uniform1i(this.loc.u_clip,e.clip?1:0),n.uniform1f(this.loc.u_dim,e.dim??1);const[a,s,_]=e.dimColor??[0,0,0];n.uniform3f(this.loc.u_dimColor,a,s,_);const c=e.matrix,y=new Float32Array(16);for(let g=0;g<4;g++)for(let S=0;S<4;S++)y[S*4+g]=c[g*5+S];n.uniformMatrix4fv(this.loc.u_cm,!1,y),n.uniform4f(this.loc.u_co,c[4],c[9],c[14],c[19]),n.uniform1f(this.loc.u_gamma,e.gamma),n.uniform1f(this.loc.u_clarity,e.clarity),n.uniform1f(this.loc.u_vignette,e.vignette);const[m,T]=e.pixel??[0,0];n.uniform2f(this.loc.u_pixel,m,T),e.pixel&&e.cropToUV&&r(e.cropToUV,"u_cuvX","u_cuvY"),n.drawArrays(n.TRIANGLE_STRIP,0,4)}dispose(e=!0){var i;const n=this.gl;n.deleteTexture(this.image),n.deleteTexture(this.blur),n.deleteProgram(this.program),e&&((i=n.getExtension("WEBGL_lose_context"))==null||i.loseContext())}}function Ae(t,e=t.colorMatrix){const n=t.finetune;return{matrix:fn(e,n),gamma:ct.gamma(n.gamma),clarity:ct.clarity(n.clarity),vignette:ct.vignette(n.vignette)}}const an=t=>!hn(t.matrix)||t.gamma!==1||t.clarity!==0||t.vignette!==0,je=(t,e)=>{const n=document.createElement("canvas");return n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e)),n};function Xn(t,e,n,i,o,r){const a=t.getContext("2d",{willReadFrequently:!0});if(!a)return;const{width:s,height:_}=t;a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,s,_);const c=(m,T,g,S)=>{const A=rt(J(1/g.width,1/g.height),St(S));if(m.save(),r.clip){const E=St(r.toCrop);m.beginPath(),[[-1,-1],[1,-1],[1,1],[-1,1]].forEach(([M,l],j)=>{const[d,C]=te(E,M,l);j===0?m.moveTo(d,C):m.lineTo(d,C)}),m.closePath(),m.clip()}m.setTransform(A[0],A[3],A[1],A[4],A[2],A[5]),m.imageSmoothingQuality="high",m.drawImage(T,0,0,g.width,g.height),m.restore()};if(c(a,e,n,r.toUV),an(r)&&y(),r.dim!=null&&r.dim<1){const m=St(r.toCrop);a.save(),a.globalCompositeOperation="source-atop",a.beginPath(),a.rect(0,0,s,_),[[-1,-1],[1,-1],[1,1],[-1,1]].forEach(([A,E],M)=>{const[l,j]=te(m,A,E);M===0?a.moveTo(l,j):a.lineTo(l,j)}),a.closePath();const[T,g,S]=(r.dimColor??[0,0,0]).map(A=>Math.round(A*255));a.fillStyle=`rgba(${T}, ${g}, ${S}, ${1-r.dim})`,a.fill("evenodd"),a.restore()}function y(){if(a)try{const m=a.getImageData(0,0,s,_);let T=null;if(r.clarity!==0){const S=je(s,_).getContext("2d",{willReadFrequently:!0});S&&(c(S,i,o,r.toBlurUV),T=S.getImageData(0,0,s,_).data)}Ie(m.data,s,_,r,T,r.toCrop),a.putImageData(m,0,0)}catch{}}}const Bn=16384,qn=16384*16384,Yn=(t,e,n)=>new Promise((i,o)=>{try{t.toBlob(r=>r?i(r):o(new Error("Encoding failed")),e,n)}catch(r){o(r)}});async function Vn(t,e,n,i,o){var M;const r=Rt(n),a=Dt(n),s=Math.min(1,Bn/Math.max(r.width,r.height),Math.sqrt(qn/(r.width*r.height))),_=Math.max(1,Math.round(r.width*s)),c=Math.max(1,Math.round(r.height*s)),y=je(_,c),m=y.getContext("2d");if(!m)throw new Error("Canvas 2D is unavailable");const T=rt(Se(n,e),it(-a.x,-a.y),J(_/a.width,c/a.height));i==="image/jpeg"&&(m.fillStyle="#fff",m.fillRect(0,0,_,c)),m.setTransform(T[0],T[3],T[1],T[4],T[2],T[5]),m.imageSmoothingEnabled=!0,m.imageSmoothingQuality="high";const g=ve(n,e),S=(M=n.redact)==null?void 0:M.effect,A=g>0&&S==="blur"?Pn(t,e.width,e.height,g):t;m.drawImage(A,0,0,e.width,e.height),m.setTransform(1,0,0,1,0,0);const E=Ae(n);if(an(E)){const l=Re*Math.max(e.width,e.height)*(_/a.width)*n.scale,j=Ze(y,_,c,l);$n(y,j,E)}if(g>0&&S==="pixelate"){const{cols:l,rows:j}=tn(a,g*n.scale);nn(y,l,j)}return Yn(y,i,o)}function $n(t,e,n){const{width:i,height:o}=t,r=t.getContext("2d",{willReadFrequently:!0}),a=document.createElement("canvas"),s=oe.create(a),_=s?Math.min(2048,s.maxTextureSize):1024,c=je(_,_),y=c.getContext("2d",{willReadFrequently:!0});try{for(let m=0;m<o;m+=_)for(let T=0;T<i;T+=_){const g=Math.min(_,i-T),S=Math.min(_,o-m),A=rt(it(T,m),J(2/i,2/o),it(-1,-1)),E=rt(it(T,m),J(1/i,1/o));if(s)c.width=g,c.height=S,y.clearRect(0,0,g,S),y.drawImage(t,T,m,g,S,0,0,g,S),a.width=g,a.height=S,s.setImage(c,e,!1),s.render({...n,toUV:J(1/g,1/S),toBlurUV:E,toCrop:A,clip:!1}),r.clearRect(T,m,g,S),r.drawImage(a,T,m);else{const M=r.getImageData(T,m,g,S);let l=null;n.clarity!==0&&(c.width=g,c.height=S,y.drawImage(e,T/i*e.width,m/o*e.height,g/i*e.width,S/o*e.height,0,0,g,S),l=y.getImageData(0,0,g,S).data),Ie(M.data,g,S,n,l,A),r.putImageData(M,T,m)}}}finally{s==null||s.dispose()}}const Gn=50,me=(t,e)=>JSON.stringify(t)===JSON.stringify(e),Wn=(t,e)=>t===e||!!t&&!!e&&t.width===e.width&&t.height===e.height,ft=t=>JSON.parse(JSON.stringify(t));class Ce{constructor(){this.snapshot={status:"idle",error:null,state:null,ui:{util:"crop",cropTab:"rotation",finetuneTab:"brightness",resizeLocked:!0},size:null,canUndo:!1,canRedo:!1,canRevert:!1},this.storeListeners=new Set,this.events=new Map,this.history=[],this.index=-1,this.initial=null,this.loaded=null,this.options=null,this.openToken=0,this.subscribe=e=>(this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}),this.getSnapshot=()=>this.snapshot}patch(e){const n=e.state!==void 0?e.state:this.snapshot.state;this.snapshot={...this.snapshot,...e,canUndo:this.index>0,canRedo:this.index<this.history.length-1,canRevert:!!n&&!!this.initial&&!me(n,this.initial)},this.storeListeners.forEach(i=>i())}on(e,n){let i=this.events.get(e);return i||this.events.set(e,i=new Set),i.add(n),()=>{i.delete(n)}}emit(e,n){var i;(i=this.events.get(e))==null||i.forEach(o=>o(n))}get image(){return this.loaded}get openOptions(){return this.options}async open(e){const n=++this.openToken;this.options=e,this.history=[],this.index=-1,this.initial=null,this.loaded=null,this.patch({status:"loading",error:null,state:null,size:null,ui:{...this.snapshot.ui,util:e.util??"crop"}});try{const i=await An(e.src);if(n!==this.openToken)return;this.loaded=i;const o={width:i.width,height:i.height},r=wn(o,e.cropAspectRatio),a=e.initialState??{},s={...r,...a,crop:{...r.crop,...a.crop},finetune:{...$e,...a.finetune},redact:{...r.redact,...a.redact}};s.filter&&s.filter!=="default"&&!s.colorMatrix&&(s.colorMatrix=ee[s.filter]??null);const _=De(s,o);this.initial=De(r,o),this.history=[ft(_)],this.index=0,this.patch({status:"ready",state:_,size:o}),this.emit("load",{size:o})}catch(i){if(n!==this.openToken)return;throw this.patch({status:"error",error:i}),i}}close(){var n;this.openToken++;const e=(n=this.loaded)==null?void 0:n.image;e&&"close"in e&&typeof e.close=="function"&&e.close(),this.loaded=null,this.emit("close")}getState(){if(!this.snapshot.state)throw new Error("No image is open");return ft(this.snapshot.state)}setState(e){this.preview(e),this.commit()}preview(e){const n=this.snapshot.state,i=this.snapshot.size;if(!n||!i)return;const o={...n,...e},r=this.index>=0?this.history[this.index]:n;"resize"in e&&!Wn(e.resize??null,r.resize)||(o.resize=_n(r,{...o,resize:r.resize})),this.patch({state:o})}commit(){const e=this.snapshot.state;e&&(this.index>=0&&me(e,this.history[this.index])||(this.history=this.history.slice(0,this.index+1),this.history.push(ft(e)),this.history.length>Gn&&this.history.shift(),this.index=this.history.length-1,this.patch({}),this.emit("update",ft(e))))}undo(){this.index<=0||(this.index--,this.patch({state:ft(this.history[this.index])}),this.emit("undo",this.getState()),this.emit("update",this.getState()))}redo(){this.index>=this.history.length-1||(this.index++,this.patch({state:ft(this.history[this.index])}),this.emit("redo",this.getState()),this.emit("update",this.getState()))}revert(){const e=this.snapshot.state;!this.initial||!e||me(e,this.initial)||(this.patch({state:ft(this.initial)}),this.commit(),this.emit("revert",this.getState()))}setUi(e){e.util&&e.util!==this.snapshot.ui.util&&this.commit(),this.patch({ui:{...this.snapshot.ui,...e}})}async process(){var a,s;const e=this.loaded,n=this.snapshot.state;if(!e||!n)throw new Error("No image is open");const i=jn((a=this.options)==null?void 0:a.outputType,e.type),r={dest:await Vn(e.image,{width:e.width,height:e.height},n,i,((s=this.options)==null?void 0:s.outputQuality)??.92),imageState:ft(n)};return this.emit("process",r),r}}const Kn=()=>new Ce,Hn=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Oe(t,e,n,{stiffness:i=240,damping:o=30}={},r){if(Hn()||typeof requestAnimationFrame!="function"){n(e),r==null||r();const A=(()=>{});return A.retarget=E=>n(E),A}const a=[...e],s=[...t],_=t.map(()=>0),c=t.map((A,E)=>Math.max(1e-5,Math.abs(a[E]-A)*.001));let y=performance.now(),m=0,T=!1;const g=A=>{if(T)return;let E=Math.min(.064,(A-y)/1e3);for(y=A;E>0;){const l=Math.min(E,.008333333333333333);for(let j=0;j<s.length;j++){const d=-i*(s[j]-a[j])-o*_[j];_[j]+=d*l,s[j]+=_[j]*l}E-=l}if(s.every((l,j)=>Math.abs(l-a[j])<c[j]&&Math.abs(_[j])<c[j]*10)){n(a),r==null||r();return}n([...s]),m=requestAnimationFrame(g)};m=requestAnimationFrame(g);const S=(()=>{T=!0,cancelAnimationFrame(m)});return S.retarget=A=>{for(let E=0;E<a.length;E++)a[E]=A[E],c[E]=Math.max(c[E],1e-5)},S}const Qn="_overlay_2796b_6",Zn="_editor_2796b_11",Jn="_header_2796b_61",tr="_headerStart_2796b_70",er="_headerCenter_2796b_74",nr="_headerEnd_2796b_79",rr="_group_2796b_84",ir="_zoomLabel_2796b_97",or="_done_2796b_105",ar="_closeIcon_2796b_116",sr="_groupDivider_2796b_120",cr="_main_2796b_148",lr="_nav_2796b_159",ur="_stage_2796b_160",hr="_toolbar_2796b_161",dr="_canvasArea_2796b_162",mr="_footer_2796b_163",fr="_footerInner_2796b_164",gr="_navList_2796b_169",pr="_toolbarRow_2796b_170",xr="_tool_2796b_161",_r="_toolActive_2796b_217",br="_shapeSlot_2796b_263",wr="_shapePreview_2796b_270",vr="_shapeCustom_2796b_276",Mr="_shapeOrientation_2796b_281",yr="_orientButton_2796b_290",Er="_orientActive_2796b_313",Ir="_viewport_2796b_330",Tr="_viewportCrop_2796b_339",Rr="_viewportPannable_2796b_342",Sr="_canvas_2796b_162",Ar="_scene_2796b_355",jr="_cropBox_2796b_362",Cr="_grid_2796b_369",Lr="_cropInteracting_2796b_398",kr="_sizeBadge_2796b_404",Nr="_sizeBadgeActive_2796b_430",Pr="_sizeTimes_2796b_433",zr="_sizeUnit_2796b_434",Dr="_handle_2796b_444",Fr="_handle_nw_2796b_448",Ur="_handle_ne_2796b_449",Or="_handle_sw_2796b_450",Xr="_handle_se_2796b_451",Br="_handle_n_2796b_448",qr="_handle_s_2796b_450",Yr="_handle_w_2796b_511",Vr="_handle_e_2796b_512",$r="_status_2796b_527",Gr="_toastError_2796b_538",Wr="_tabs_2796b_571",Kr="_tab_2796b_571",Hr="_tabActive_2796b_606",Qr="_tabDot_2796b_617",Zr="_resizePanel_2796b_628",Jr="_resizeFields_2796b_634",ti="_dimField_2796b_640",ei="_dimLabel_2796b_658",ni="_dimLabelShort_2796b_662",ri="_dimInput_2796b_665",ii="_dimUnit_2796b_681",oi="_lockButton_2796b_686",ai="_lockActive_2796b_703",si="_strip_2796b_715",ci="_fadeStart_2796b_730",li="_fadeEnd_2796b_734",ui="_stripGroup_2796b_754",hi="_filterTile_2796b_759",di="_filterThumb_2796b_773",mi="_filterActive_2796b_804",fi="_filterLabel_2796b_814",gi="_fadeIn_2796b_819",pi="_toolbarIconOnPhone_2796b_861",xi="_toolbarLabel_2796b_873",_i="_dimLabelFull_2796b_882",bi="_toolLabel_2796b_918",b={overlay:Qn,editor:Zn,header:Jn,headerStart:tr,headerCenter:er,headerEnd:nr,group:rr,zoomLabel:ir,done:or,closeIcon:ar,groupDivider:sr,main:cr,nav:lr,stage:ur,toolbar:hr,canvasArea:dr,footer:mr,footerInner:fr,navList:gr,toolbarRow:pr,tool:xr,toolActive:_r,shapeSlot:br,shapePreview:wr,shapeCustom:vr,shapeOrientation:Mr,orientButton:yr,orientActive:Er,viewport:Ir,viewportCrop:Tr,viewportPannable:Rr,canvas:Sr,scene:Ar,cropBox:jr,grid:Cr,cropInteracting:Lr,sizeBadge:kr,"tz-ie-fade":"_tz-ie-fade_2796b_1",sizeBadgeActive:Nr,sizeTimes:Pr,sizeUnit:zr,handle:Dr,handle_nw:Fr,handle_ne:Ur,handle_sw:Or,handle_se:Xr,handle_n:Br,handle_s:qr,handle_w:Yr,handle_e:Vr,status:$r,toastError:Gr,tabs:Wr,tab:Kr,tabActive:Hr,tabDot:Qr,resizePanel:Zr,resizeFields:Jr,dimField:ti,dimLabel:ei,dimLabelShort:ni,dimInput:ri,dimUnit:ii,lockButton:oi,lockActive:ai,strip:si,fadeStart:ci,fadeEnd:li,stripGroup:ui,filterTile:hi,filterThumb:di,filterActive:mi,filterLabel:fi,fadeIn:gi,toolbarIconOnPhone:pi,toolbarLabel:xi,dimLabelFull:_i,toolLabel:bi},wi=24,vi=12,Xe=4096,Mi=768,Be=.35;function yi(t){const e=t?getComputedStyle(t).getPropertyValue("--tz-color-background-rgb"):"",[n,i,o]=e.split(",").map(r=>Number(r.trim())/255);return[n,i,o].every(r=>Number.isFinite(r))?[n,i,o]:[0,0,0]}const Ei=40,Ii=["nw","ne","sw","se","n","s","w","e"],zt=t=>[t.center[0],t.center[1],Math.log(t.scale),t.rotation,t.flip],Ti=t=>({center:[t[0],t[1]],scale:Math.exp(t[2]),rotation:t[3],flip:t[4]}),Ri=v.forwardRef(function({core:e,snapshot:n,cropAspectRatio:i,viewZoom:o,onViewZoom:r,onZoomReport:a,areaRef:s},_){const{state:c,size:y,ui:m}=n,T=Ot.useColorMode(),g=m.util,S=v.useRef(null),A=v.useRef(null),[E,M]=v.useState(null),[l,j]=v.useState(null),d=v.useRef(null);d.current=l;const[C,f]=v.useState([0,0]),[I,w]=v.useState(!1),[N,V]=v.useState(0),Y=v.useRef(!1),$=v.useRef(null),B=v.useRef(null),ot=v.useRef(null),K=v.useRef(new Map),lt=v.useRef(void 0);v.useEffect(()=>{const x=S.current;if(!x)return;const p=()=>{var U;const D=x.getBoundingClientRect(),X=(U=s==null?void 0:s.current)==null?void 0:U.getBoundingClientRect();M({width:D.width,height:D.height,dpr:window.devicePixelRatio||1,area:X?Si(D,X):void 0})};if(p(),k.current=p,typeof ResizeObserver>"u")return;const P=new ResizeObserver(p);return P.observe(x),s!=null&&s.current&&P.observe(s.current),()=>P.disconnect()},[s]);const k=v.useRef(null);v.useLayoutEffect(()=>{var x;(x=k.current)==null||x.call(k)},[g,n.status]);const z=n.status==="ready"?e.image:null,[L,q]=v.useState(null);v.useEffect(()=>{const x=A.current;if(!z||!x)return;const p=oe.create(x),P=Math.min(Xe,(p==null?void 0:p.maxTextureSize)??Xe),D=Zt(z.image,z.width,z.height,P),X=Re*Math.max(z.width,z.height)*(D.width/z.width),U=Ze(D.canvas,D.width,D.height,X);return p==null||p.setImage(D.canvas,U),q({gl:p,tex:D,blur:U}),()=>{p==null||p.dispose(!1),q(null)}},[z]);const W=c&&y?Rt(c).width*c.scale/Dt(c).width:1,ut=y?Math.max(1,Math.round(y.width*W)):0,at=(c==null?void 0:c.redact.effect)??"blur",_t=(c==null?void 0:c.redact.amount)??0,[H,tt]=v.useState(null);v.useEffect(()=>{if(!L||!y){tt(null);return}const x=requestAnimationFrame(()=>{let p={...L.tex,mipmap:!0,pixelate:!1};ut<p.width&&(p={...Zt(p.canvas,p.width,p.height,Math.max(1,Math.round(Math.max(y.width,y.height)*W))),mipmap:!0,pixelate:!1});const P=ve({redact:{effect:at,amount:_t}},y);if(P<=0)return tt(p);const D=P*(p.width/y.width);if(at==="blur"){const U=en(p.canvas,p.width,p.height,D,Mi);return tt({canvas:U,width:U.width,height:U.height,mipmap:!0,pixelate:!1})}if(!L.gl){const U=zn(p.canvas,p.width,p.height,D);return tt({canvas:U,width:U.width,height:U.height,mipmap:!1,pixelate:!1})}const X=Zt(p.canvas,p.width,p.height,Math.max(p.width,p.height)/Math.max(1,D));tt({...X,mipmap:!1,pixelate:!0})});return()=>cancelAnimationFrame(x)},[L,ut,at,_t]),v.useLayoutEffect(()=>{L!=null&&L.gl&&H&&L.gl.setSource(H.canvas,H.mipmap)},[L,H]);const Q=v.useMemo(()=>{if(!c||!E)return null;const x=E.area??E;if(g==="crop")return Ue(c.crop,x,Math.min(wi,x.width*.06));const p=Dt(c),P=Ue(p,x,vi),D=c.resize?{...P,scale:Math.min(P.scale,Rt(c).width/p.width)}:P;if(o==null)return D;const X=o/c.scale,U=Math.max(0,p.width/2-x.width/2/X),et=Math.max(0,p.height/2-x.height/2/X),st=Math.max(-U,Math.min(U,C[0])),wt=Math.max(-et,Math.min(et,C[1]));return{...D,scale:X,center:[D.center[0]+st,D.center[1]+wt]}},[c,E,g,o,C,N]),Vt=v.useRef(g),yt=v.useRef(!1),bt=v.useRef({stage:E,state:c}),jt=(x,p)=>{var P;(P=B.current)==null||P.call(B),yt.current=!0,B.current=Oe(zt(x),zt(p),D=>j(Ti(D)),void 0,()=>{yt.current=!1})},[ht,ae]=v.useState(g==="crop"?Be:0),$t=v.useRef(ht);$t.current=ht,v.useEffect(()=>{const x=g==="crop"?Be:0;return Oe([$t.current],[x],([p])=>ae(Math.max(0,p)))},[g]),v.useLayoutEffect(()=>{var et,st,wt,Le;if(!Q)return;Vt.current!==g&&(Vt.current=g,d.current&&!$.current&&($.current="jump"));const x=E!==bt.current.stage&&c===bt.current.state,p=(et=bt.current.state)==null?void 0:et.resize,P=g==="resize"&&(((st=c==null?void 0:c.resize)==null?void 0:st.width)!==(p==null?void 0:p.width)||((wt=c==null?void 0:c.resize)==null?void 0:wt.height)!==(p==null?void 0:p.height)),D=bt.current.target,X=!!D&&zt(D).every((kt,se)=>Math.abs(kt-zt(Q)[se])<1e-9);bt.current={stage:E,state:c,target:Q};const U=$.current;if(U){$.current=null;const kt=d.current??Q,se=U==="rotate"?{center:Q.center,scale:kt.scale,rotation:Math.PI/2,flip:1}:U==="flip"?{center:Q.center,scale:kt.scale,rotation:0,flip:-1}:kt;jt(se,Q);return}if((x||P||X)&&yt.current&&B.current){B.current.retarget(zt(Q));return}if(P&&d.current&&!Y.current){jt(d.current,Q);return}Y.current||((Le=B.current)==null||Le.call(B),B.current=null,yt.current=!1,j(Q))},[Q]),v.useEffect(()=>()=>{var x;return(x=B.current)==null?void 0:x.call(B)},[]),v.useEffect(()=>{l&&c&&a(l.scale*c.scale)},[l,c,a]),v.useEffect(()=>{const x=A.current;if(!x||!E)return;const p=Math.max(1,Math.round(E.width*E.dpr)),P=Math.max(1,Math.round(E.height*E.dpr));x.width!==p&&(x.width=p),x.height!==P&&(x.height=P)},[E]),v.useEffect(()=>{if(!L||!H||!c||!y||!l||!E)return;const x=g==="crop"?c:{...c,crop:Dt(c)},p=Fn(x,y,l,E),P=H.pixelate?ve(c,y):0,D=P>0?{pixel:(U=>[U.cols,U.rows])(tn(x.crop,P*c.scale)),cropToUV:rt(St(p.toCrop),p.toUV)}:null,X=requestAnimationFrame(()=>{const U={...Ae(c),...p,...D,clip:ht<=.001,dim:ht,dimColor:yi(S.current)};L.gl?L.gl.render(U):A.current&&Xn(A.current,H.canvas,H,L.blur,L.blur,U)});return()=>cancelAnimationFrame(X)},[L,H,c,y,l,E,ht,T,g]),v.useImperativeHandle(_,()=>({transition(x){$.current=x}}));const dt=(l==null?void 0:l.scale)??1,Gt=v.useRef(r);Gt.current=r;const Ct=()=>{const[x,p]=[...K.current.values()];return x&&p?Math.hypot(x.x-p.x,x.y-p.y):0},mt=x=>{var P,D;if(!c||!y||x.pointerType==="mouse"&&x.button!==0||x.target.closest("button"))return;if(x.currentTarget.setPointerCapture(x.pointerId),K.current.set(x.pointerId,{x:x.clientX,y:x.clientY}),(P=B.current)==null||P.call(B),K.current.size===2){ot.current={kind:"pinch",dist:Ct(),base:c,zoom:Qt(c,y),viewZoom:((l==null?void 0:l.scale)??1)*c.scale};return}const p=(D=x.target.closest("[data-handle]"))==null?void 0:D.dataset.handle;g==="crop"?(ot.current=p?{kind:"resize",id:x.pointerId,x:x.clientX,y:x.clientY,base:c,handle:p}:{kind:"pan",id:x.pointerId,x:x.clientX,y:x.clientY,base:c},p&&(Y.current=!0),w(!0)):o!=null&&(ot.current={kind:"viewPan",id:x.pointerId,x:x.clientX,y:x.clientY,pan:C})},Lt=x=>{if(!K.current.has(x.pointerId)||!y)return;K.current.set(x.pointerId,{x:x.clientX,y:x.clientY});const p=ot.current;if(!p)return;if(p.kind==="pinch"){const X=Ct()/Math.max(1,p.dist);g==="crop"?e.preview(Ut(p.base,Math.min(Ft,p.zoom*X),y)):r(fe(p.viewZoom*X));return}if(p.id!==x.pointerId)return;const P=(x.clientX-p.x)/dt,D=(x.clientY-p.y)/dt;if(p.kind==="pan")e.preview(yn(p.base,-P,-D,y));else if(p.kind==="resize"){const X=p.base.crop,et=i||p.base.cropRatio||x.shiftKey?X.width/X.height:null;e.preview(In(p.base,p.handle,P,D,y,{aspectRatio:et,minSize:Math.max(p.base.scale,Ei/dt)}))}else p.kind==="viewPan"&&f([p.pan[0]-P,p.pan[1]-D])},Wt=x=>{if(!K.current.has(x.pointerId))return;K.current.delete(x.pointerId);const p=ot.current;if(p){if(p.kind==="pinch"){K.current.size===0&&(ot.current=null,g==="crop"&&e.commit());return}p.id===x.pointerId&&(ot.current=null,w(!1),p.kind==="resize"?(Y.current=!1,$.current="jump",e.commit(),V(P=>P+1)):p.kind==="pan"&&e.commit())}},h=x=>{if(!c||!y)return;const p=x.ctrlKey||x.metaKey;if(!(p&&R.current)){if(g==="crop"){const P=Math.exp(-x.deltaY*(p?.01:.002));e.preview(Ut(c,Math.min(Ft,Qt(c,y)*P),y)),clearTimeout(lt.current),lt.current=setTimeout(()=>e.commit(),250);return}if(p){const P=((l==null?void 0:l.scale)??1)*c.scale;r(fe(P*Math.exp(-x.deltaY*.01)))}else o!=null&&f(([P,D])=>[P+x.deltaX/dt,D+x.deltaY/dt])}};v.useEffect(()=>()=>clearTimeout(lt.current),[]);const R=v.useRef(null),F=v.useRef({state:c,size:y,util:g,view:l});F.current={state:c,size:y,util:g,view:l},v.useEffect(()=>{const x=S.current;if(!x)return;const p=X=>{const{state:U,size:et,view:st}=F.current;X.preventDefault(),!(!U||!et||K.current.size>0)&&(R.current={base:U,zoom:Qt(U,et),viewZoom:((st==null?void 0:st.scale)??1)*U.scale})},P=X=>{const U=R.current,{size:et,util:st}=F.current;if(!U||!et)return;X.preventDefault();const wt=X.scale||1;st==="crop"?e.preview(Ut(U.base,Math.min(Ft,U.zoom*wt),et)):Gt.current(fe(U.viewZoom*wt))},D=X=>{R.current&&(X.preventDefault(),R.current=null,F.current.util==="crop"&&e.commit())};return x.addEventListener("gesturestart",p),x.addEventListener("gesturechange",P),x.addEventListener("gestureend",D),()=>{x.removeEventListener("gesturestart",p),x.removeEventListener("gesturechange",P),x.removeEventListener("gestureend",D)}},[e]);let O=null;if(g==="crop"&&c&&E&&l){const x=on({...l,rotation:0,flip:1},E),[p,P]=te(x,c.crop.x,c.crop.y),[D,X]=te(x,c.crop.x+c.crop.width,c.crop.y+c.crop.height);O={left:p,top:P,width:D-p,height:X-P}}const Et=l&&E?{transform:`scaleX(${l.flip}) rotate(${l.rotation}rad)`,transformOrigin:rn(E).map(x=>`${x}px`).join(" ")}:void 0;return u.jsxs("div",{ref:S,className:G.clsx(b.viewport,g==="crop"?b.viewportCrop:o!=null&&b.viewportPannable),"data-part":"viewport",onPointerDown:mt,onPointerMove:Lt,onPointerUp:Wt,onPointerCancel:Wt,onWheel:h,children:[u.jsx("canvas",{ref:A,className:b.canvas,"data-part":"canvas"}),O&&u.jsx("div",{className:G.clsx(b.scene,b.fadeIn),style:Et,children:u.jsxs("div",{className:G.clsx(b.cropBox,I&&b.cropInteracting),style:O,"data-part":"crop",children:[u.jsx("span",{className:b.grid,"aria-hidden":"true"}),Ii.map(x=>u.jsx("span",{className:G.clsx(b.handle,b[`handle_${x}`]),"data-handle":x,"aria-hidden":"true"},x))]})}),O&&c&&l&&l.rotation===0&&l.flip===1&&u.jsxs("div",{className:G.clsx(b.sizeBadge,I&&b.sizeBadgeActive),style:{left:O.left+O.width/2,top:O.top+O.height},"data-part":"size",children:[Rt(c).width,u.jsx("span",{className:b.sizeTimes,children:"×"}),Rt(c).height,u.jsx("span",{className:b.sizeUnit,children:"px"})]})]})});function Si(t,e){const n=Math.max(0,e.left-t.left,t.right-e.right);return{x:n,y:e.top-t.top,width:Math.max(1,t.width-n*2),height:e.height}}const Me=.02,ye=8,fe=t=>Math.min(ye,Math.max(Me,t)),Ai=[{label:"1:1",ratio:1},{label:"2:1",ratio:2},{label:"3:2",ratio:3/2},{label:"4:3",ratio:4/3},{label:"5:4",ratio:5/4},{label:"16:10",ratio:16/10},{label:"16:9",ratio:16/9}],Kt=(t,e)=>Math.abs(t-e)<.001,ji=t=>t.split(":").reverse().join(":");function qe({ratio:t}){const n=t==null||t>=1?16:Math.max(6,16*t),i=t==null||t<=1?16:Math.max(6,16/t);return u.jsx("span",{className:b.shapeSlot,children:u.jsx("span",{className:G.clsx(b.shapePreview,t==null&&b.shapeCustom),style:{width:n,height:i}})})}function Ci({ratio:t,options:e,onChange:n}){const i=Ot.useT(),[o,r]=v.useState(!1),[a,s]=v.useState(!1),_=t!=null&&!Kt(t,1)?t<1:a,c=m=>{n(m),r(!1)},y=m=>{s(m),t!=null&&!Kt(t,1)&&t<1!==m&&n(1/t)};return u.jsxs(ln.Dropdown,{open:o,onOpenChange:r,closeOnSelect:!1,placement:"bottom-start",size:"sm",trigger:u.jsx(_e.Button,{variant:"text",color:"primary",size:"sm",startIcon:u.jsx(Z.Icon,{name:"MaximizeFormat"}),title:i("imageEditor.cropShape"),"aria-label":i("imageEditor.cropShape"),className:b.toolbarIconOnPhone,children:u.jsx("span",{className:b.toolbarLabel,children:i("imageEditor.cropShape")})}),children:[u.jsx("div",{className:b.shapeOrientation,role:"group","aria-label":i("imageEditor.orientation"),children:[!1,!0].map(m=>u.jsx("button",{type:"button",className:G.clsx(b.orientButton,_===m&&b.orientActive),"aria-pressed":_===m,"aria-label":i(m?"imageEditor.portrait":"imageEditor.landscape"),title:i(m?"imageEditor.portrait":"imageEditor.landscape"),onClick:()=>y(m),children:u.jsx(Z.Icon,{name:m?"Mobile":"Monitor",size:"sm"})},String(m)))}),u.jsx(ke.ListItem,{icon:u.jsx(qe,{ratio:null}),clickable:!0,selected:t==null,onClick:()=>c(null),children:i("imageEditor.custom")}),e.map(m=>{const T=_?1/m.ratio:m.ratio;return u.jsx(ke.ListItem,{icon:u.jsx(qe,{ratio:T}),clickable:!0,selected:t!=null&&Kt(t,T),onClick:()=>c(T),children:_&&!Kt(m.ratio,1)?ji(m.label):m.label},m.label)})]})}const Li=52;function ki(t,e,n){const i=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),o=Math.round(Li*i),r=document.createElement("canvas");r.width=r.height=o;const a=r.getContext("2d",{willReadFrequently:!0});if(!a)return null;const{crop:s}=n,_=o/Math.min(s.width,s.height),[c,y]=Xt(s),m=rt(Se(n,e),it(-c,-y),J(_),it(o/2,o/2));a.setTransform(m[0],m[3],m[1],m[4],m[2],m[5]),a.imageSmoothingQuality="high",a.drawImage(t,0,0,e.width,e.height),a.setTransform(1,0,0,1,0,0);let T;try{T=a.getImageData(0,0,o,o)}catch{return null}const g=Re*Math.max(e.width,e.height)*n.scale*_,S=n.finetune.clarity?Te(T.data,o,o,g):null,A=rt(it(-o/2,-o/2),J(1/_),J(2/s.width,2/s.height)),E={};for(const M of be.flat()){const l=new ImageData(new Uint8ClampedArray(T.data),o,o);Ie(l.data,o,o,Ae(n,ee[M]),S,A),a.putImageData(l,0,0),E[M]=r.toDataURL()}return E}function Ni({image:t,size:e,state:n,onSelect:i}){var C;const o=Ot.useT(),r=v.useRef(null),[a,s]=v.useState({}),[_,c]=v.useState({start:!1,end:!1}),y=n.filter??"default",m=v.useRef(null);((C=m.current)==null?void 0:C.image)!==t&&(m.current={image:t,source:Zt(t,e.width,e.height,512).canvas});const T=JSON.stringify([n.crop,n.rotation,n.flipX,n.flipY,n.scale,n.finetune]);v.useEffect(()=>{const f=setTimeout(()=>{var N;const I=(N=m.current)==null?void 0:N.source;if(!I)return;const w=ki(I,e,n);w&&s(w)},120);return()=>clearTimeout(f)},[T,t]);const g=()=>{const f=r.current;f&&c({start:f.scrollLeft>2,end:f.scrollLeft+f.clientWidth<f.scrollWidth-2})};v.useEffect(()=>{g();const f=r.current;if(!f||typeof ResizeObserver>"u")return;const I=new ResizeObserver(g);return I.observe(f),()=>I.disconnect()},[]),v.useEffect(()=>{var f,I,w;(w=(I=(f=r.current)==null?void 0:f.querySelector(`[data-filter="${y}"]`))==null?void 0:I.scrollIntoView)==null||w.call(I,{block:"nearest",inline:"nearest",behavior:"smooth"})},[y]),v.useEffect(()=>{const f=r.current;if(!f)return;const I=w=>{Math.abs(w.deltaY)<=Math.abs(w.deltaX)||(w.preventDefault(),f.scrollLeft+=w.deltaY)};return f.addEventListener("wheel",I,{passive:!1}),()=>f.removeEventListener("wheel",I)},[]);const S=v.useRef(null),A=v.useRef(0),E=f=>{if(f.pointerType!=="mouse"||f.button!==0)return;cancelAnimationFrame(A.current);const I=r.current;S.current={x:f.clientX,left:I.scrollLeft,v:0,t:performance.now(),moved:!1}},M=f=>{const I=S.current;if(!I)return;const w=r.current,N=f.clientX-I.x;if(Math.abs(N)>4&&!I.moved&&(I.moved=!0,w.setPointerCapture(f.pointerId)),!I.moved)return;const V=performance.now(),Y=I.left-N;I.v=(w.scrollLeft-Y)/Math.max(1,V-I.t),I.t=V,w.scrollLeft=Y},l=()=>{const f=S.current;if(S.current=null,!(f!=null&&f.moved))return;const I=r.current;let w=-f.v,N=performance.now();const V=$=>{const B=$-N;N=$,I.scrollLeft+=w*B,w*=Math.pow(.995,B),Math.abs(w)>.02&&(A.current=requestAnimationFrame(V))};A.current=requestAnimationFrame(V);const Y=$=>{$.stopPropagation(),$.preventDefault()};I.addEventListener("click",Y,{capture:!0,once:!0}),setTimeout(()=>I.removeEventListener("click",Y,{capture:!0}),0)};v.useEffect(()=>()=>cancelAnimationFrame(A.current),[]);const j=be.flat(),d=f=>{var N,V;if(f.key!=="ArrowLeft"&&f.key!=="ArrowRight")return;const I=j.indexOf(f.target.dataset.filter);if(I===-1)return;f.preventDefault();const w=j[Math.min(j.length-1,Math.max(0,I+(f.key==="ArrowRight"?1:-1)))];(V=(N=r.current)==null?void 0:N.querySelector(`[data-filter="${w}"]`))==null||V.focus()};return u.jsx("div",{ref:r,className:G.clsx(b.strip,_.start&&b.fadeStart,_.end&&b.fadeEnd),"data-part":"filters",role:"group","aria-label":o("imageEditor.filters"),onScroll:g,onPointerDown:E,onPointerMove:M,onPointerUp:l,onPointerCancel:l,onKeyDown:d,children:be.map((f,I)=>u.jsx("div",{className:b.stripGroup,children:f.map(w=>u.jsxs("button",{type:"button",className:G.clsx(b.filterTile,w===y&&b.filterActive),"data-filter":w,"aria-pressed":w===y,onClick:()=>i(w),children:[u.jsx("span",{className:b.filterThumb,children:a[w]&&u.jsx("img",{src:a[w],alt:"",draggable:!1})}),u.jsx("span",{className:b.filterLabel,children:o(`imageEditor.filter.${w}`)})]},w))},I))})}const Pi=[1,.75,.5,.25],gt=(t,e)=>Math.max(1,Math.min(e,Math.round(t)));function zi({max:t,value:e,locked:n,onLockedChange:i,onInput:o,onChange:r}){const a=Ot.useT(),s=e,[_,c]=v.useState({w:String(s.width),h:String(s.height)});v.useEffect(()=>{c({w:String(s.width),h:String(s.height)})},[s.width,s.height]);const m=Math.round(s.width*t.height/t.width)===s.height||Math.round(s.height*t.width/t.height)===s.width?t.width/t.height:s.width/s.height,T=v.useRef(null),g=T.current??m,S=(d,C)=>{const f=Number(C);if(!C||!Number.isFinite(f)||f<=0)return null;if(d==="w"){let N=gt(f,t.width);if(!n)return{width:N,height:s.height};const V=gt(N/g,t.height);return V<N/g-.5&&(N=gt(V*g,t.width)),{width:N,height:V}}let I=gt(f,t.height);if(!n)return{width:s.width,height:I};const w=gt(I*g,t.width);return w<I*g-.5&&(I=gt(w/g,t.height)),{width:w,height:I}},A=d=>d.width===t.width&&d.height===t.height?null:d,E=(d,C)=>{const f=C.replace(/[^\d]/g,""),I=S(d,f);c(w=>I?{w:d==="w"?f:String(I.width),h:d==="h"?f:String(I.height)}:{...w,[d]:f}),I&&o(A(I))},M=()=>{const d=Number(_.w),C=Number(_.h);let f=s;d>0&&C>0&&(f=n?S("w",_.w)??s:{width:gt(d,t.width),height:gt(C,t.height)}),c({w:String(f.width),h:String(f.height)}),r(A(f))},l=(d,C)=>{if(d.key==="Enter"){d.preventDefault(),M();return}if(d.key!=="ArrowUp"&&d.key!=="ArrowDown")return;d.preventDefault();const f=(d.shiftKey?10:1)*(d.key==="ArrowUp"?1:-1),I=C==="w"?s.width:s.height,w=S(C,String(I+f));w&&(c({w:String(w.width),h:String(w.height)}),r(A(w)))},j=d=>s.width===Math.max(1,Math.round(t.width*d))&&s.height===Math.max(1,Math.round(t.height*d));return u.jsxs("div",{className:b.resizePanel,"data-part":"resize",children:[u.jsxs("div",{className:b.resizeFields,children:[u.jsxs("label",{className:b.dimField,children:[u.jsxs("span",{className:b.dimLabel,children:[u.jsx("span",{className:b.dimLabelFull,children:a("imageEditor.width")}),u.jsx("span",{className:b.dimLabelShort,"aria-hidden":"true",children:a("imageEditor.width").charAt(0)})]}),u.jsx("input",{className:b.dimInput,inputMode:"numeric",value:_.w,"aria-label":a("imageEditor.width"),onChange:d=>E("w",d.target.value),onBlur:()=>{M(),T.current=null},onKeyDown:d=>l(d,"w"),onFocus:d=>{T.current=m,d.target.select()}}),u.jsx("span",{className:b.dimUnit,children:"px"})]}),u.jsx("button",{type:"button",className:G.clsx(b.lockButton,n&&b.lockActive),"aria-pressed":n,"aria-label":a("imageEditor.lockRatio"),title:a("imageEditor.lockRatio"),onClick:()=>i(!n),children:u.jsx(Z.Icon,{name:n?"Unlock":"LockSlash",size:"sm"})}),u.jsxs("label",{className:b.dimField,children:[u.jsxs("span",{className:b.dimLabel,children:[u.jsx("span",{className:b.dimLabelFull,children:a("imageEditor.height")}),u.jsx("span",{className:b.dimLabelShort,"aria-hidden":"true",children:a("imageEditor.height").charAt(0)})]}),u.jsx("input",{className:b.dimInput,inputMode:"numeric",value:_.h,"aria-label":a("imageEditor.height"),onChange:d=>E("h",d.target.value),onBlur:()=>{M(),T.current=null},onKeyDown:d=>l(d,"h"),onFocus:d=>{T.current=m,d.target.select()}}),u.jsx("span",{className:b.dimUnit,children:"px"})]})]}),u.jsx("div",{className:b.tabs,role:"group","aria-label":a("imageEditor.resize"),"data-part":"tabs",children:Pi.map(d=>u.jsx("button",{type:"button","aria-pressed":j(d),className:G.clsx(b.tab,j(d)&&b.tabActive),onClick:()=>r(A({width:Math.max(1,Math.round(t.width*d)),height:Math.max(1,Math.round(t.height*d))})),children:d===1?a("imageEditor.original"):`${Math.round(d*100)}%`},d))})]})}const Di="_ruler_j6c34_4",Fi="_viewport_j6c34_21",Ui="_value_j6c34_26",Oi="_track_j6c34_50",Xi="_tick_j6c34_57",Bi="_major_j6c34_66",qi="_origin_j6c34_73",Yi="_indicator_j6c34_78",pt={ruler:Di,viewport:Fi,value:Ui,track:Oi,tick:Xi,major:Bi,origin:qi,indicator:Yi},ge=9;function Ht({min:t,max:e,value:n,step:i=1,keyStep:o=1,snapPoints:r=[0],snapThreshold:a=(e-t)*.02,tickStep:s=(e-t)/20,majorEvery:_=5,resetValue:c=0,format:y=A=>String(Math.round(A)),onInput:m,onChange:T,"aria-label":g,className:S}){const A=ge/s,E=v.useRef(null),M=v.useRef(0),l=v.useRef(void 0),j=v.useRef(n);j.current=n;const d=v.useRef(!1),C=v.useRef(T);C.current=T;const f=k=>{d.current=!1,T(k)};v.useEffect(()=>()=>{cancelAnimationFrame(M.current),clearTimeout(l.current),d.current&&(d.current=!1,C.current(j.current))},[]);const I=(k,z=!0)=>{let L=Math.min(e,Math.max(t,k));if(L=Math.round(L/i)*i,z){for(const q of r)if(Math.abs(L-q)<=a){L=q;break}}return Number(L.toFixed(6))},w=k=>{k!==j.current&&(j.current=k,d.current=!0,m(k))},N=k=>{k.button===0&&(cancelAnimationFrame(M.current),k.currentTarget.setPointerCapture(k.pointerId),E.current={id:k.pointerId,startX:k.clientX,startValue:n,lastX:k.clientX,lastT:performance.now(),velocity:0,moved:!1})},V=k=>{const z=E.current;if(!z||z.id!==k.pointerId)return;const L=performance.now(),q=Math.max(1,L-z.lastT);z.velocity=.7*(-(k.clientX-z.lastX)/A/q)+.3*z.velocity,z.lastX=k.clientX,z.lastT=L,Math.abs(k.clientX-z.startX)>2&&(z.moved=!0),w(I(z.startValue-(k.clientX-z.startX)/A))},Y=k=>{const z=E.current;if(!z||z.id!==k.pointerId)return;E.current=null;let L=j.current;const q=(e-t)/1500;let W=performance.now()-z.lastT<80?Math.max(-q,Math.min(q,z.velocity)):0;if(!z.moved||Math.abs(W)<q/20)return f(I(L));let ut=performance.now();const at=_t=>{const H=Math.min(32,Math.max(0,_t-ut));ut=_t,L+=W*H,W*=Math.pow(.99,H);const tt=I(L,Math.abs(W)<q/6);if(w(tt),Math.abs(W)<q/40||tt<=t||tt>=e)return f(tt);M.current=requestAnimationFrame(at)};M.current=requestAnimationFrame(at)},$=k=>{const z=Math.abs(k.deltaX)>Math.abs(k.deltaY)?k.deltaX:k.deltaY;if(!z)return;const L=I(j.current+z/A/2);w(L),clearTimeout(l.current),l.current=setTimeout(()=>f(j.current),220)},B=k=>{const z=k.shiftKey?10:1;let L=null;const q=j.current;if(k.key==="ArrowRight"||k.key==="ArrowUp"?L=q+o*z:k.key==="ArrowLeft"||k.key==="ArrowDown"?L=q-o*z:k.key==="Home"?L=t:k.key==="End"&&(L=e),L==null)return;k.preventDefault();const W=I(L,!1);w(W),f(W)},ot=()=>{cancelAnimationFrame(M.current);const k=I(c,!1);w(k),f(k)},K=Math.floor((e-t)/s),lt=y(n);return u.jsxs("div",{role:"slider",tabIndex:0,"aria-label":g,"aria-valuemin":t,"aria-valuemax":e,"aria-valuenow":n,"aria-valuetext":lt,"aria-orientation":"horizontal",className:G.clsx(pt.ruler,S),"data-part":"ruler",onPointerDown:N,onPointerMove:V,onPointerUp:Y,onPointerCancel:Y,onWheel:$,onKeyDown:B,onDoubleClick:ot,children:[u.jsx("span",{className:pt.value,"aria-hidden":"true",children:lt}),u.jsxs("span",{className:pt.viewport,"aria-hidden":"true",children:[u.jsx("span",{className:pt.track,style:{width:K*ge,transform:`translateX(${-(n-t)*A}px)`},children:Array.from({length:K+1},(k,z)=>{const L=t+z*s;return u.jsx("span",{className:G.clsx(pt.tick,z%_===0&&pt.major,Math.abs(L-c)<1e-9&&pt.origin),style:{left:z*ge}},z)})}),u.jsx("span",{className:pt.indicator})]})]})}const Mt=[{id:"crop",icon:"Crop"},{id:"filter",icon:"Colorfilter"},{id:"finetune",icon:"Brush"},{id:"redact",icon:"Blur"},{id:"resize",icon:"Maximize3"}],Vi=["blur","pixelate"],Ye=[.05,.1,.15,.2,.25,.33,.5,.67,.75,1,1.5,2,3,4,6,8],$i='a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), input:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',pe=Math.PI/180,Gi=v.forwardRef(function({open:e,src:n,initialState:i,util:o="crop",cropAspectRatio:r,cropRatioOptions:a,outputType:s,outputQuality:_,onLoad:c,onUpdate:y,onProcess:m,onClose:T,className:g,onKeyDown:S,...A},E){const M=Ot.useT(),[l]=v.useState(()=>new Ce),j=v.useSyncExternalStore(l.subscribe,l.getSnapshot,l.getSnapshot),{state:d,size:C,ui:f,status:I}=j,w=v.useRef(null),N=v.useRef(null),V=v.useRef(null),[Y,$]=v.useState(null),[B,ot]=v.useState(1),[K,lt]=v.useState(!1),[k,z]=v.useState(!1),L=v.useRef(0),q=v.useRef(null),W=v.useRef(null),ut=v.useRef(null);f.util!=="resize"||!d?W.current=null:(!W.current||d!==ut.current&&d!==W.current)&&(W.current=d);const at=v.useRef({onLoad:c,onUpdate:y});at.current={onLoad:c,onUpdate:y},v.useEffect(()=>{const h=[l.on("load",R=>{var F,O;return(O=(F=at.current).onLoad)==null?void 0:O.call(F,R.size)}),l.on("update",R=>{var F,O;return(O=(F=at.current).onUpdate)==null?void 0:O.call(F,R)}),...["undo","redo","revert"].map(R=>l.on(R,()=>{q.current=null}))];return()=>h.forEach(R=>R())},[l]),v.useEffect(()=>{if(!(!e||!n))return $(null),z(!1),l.open({src:n,initialState:i,util:o,cropAspectRatio:r,outputType:s,outputQuality:_}).then(()=>{const h=l.getSnapshot().state;h&&(L.current=de(h.rotation).quarter)}).catch(()=>{}),()=>l.close()},[e,n,l]),v.useEffect(()=>{if(!e)return;const h=O=>{(O.ctrlKey||O.metaKey)&&O.preventDefault()},R=O=>O.preventDefault(),F=["gesturestart","gesturechange","gestureend"];return window.addEventListener("wheel",h,{passive:!1}),F.forEach(O=>document.addEventListener(O,R)),()=>{window.removeEventListener("wheel",h),F.forEach(O=>document.removeEventListener(O,R))}},[e]),v.useEffect(()=>{if(!e)return;const h=document.activeElement,R=requestAnimationFrame(()=>{var F;return(F=N.current)==null?void 0:F.focus()});return()=>{var F;cancelAnimationFrame(R),(F=h==null?void 0:h.focus)==null||F.call(h)}},[e]);const _t=h=>{N.current=h,typeof E=="function"?E(h):E&&(E.current=h)},H=()=>{const h=l.getSnapshot().state;h&&(L.current=de(h.rotation).quarter)},tt=()=>{var h;(h=w.current)==null||h.transition("jump"),l.undo(),H()},Q=()=>{var h;(h=w.current)==null||h.transition("jump"),l.redo(),H()},Vt=()=>{var h;(h=w.current)==null||h.transition("jump"),l.revert(),H()},yt=()=>{var h;!d||!C||((h=w.current)==null||h.transition("rotate"),L.current=we(L.current-Math.PI/2),l.setState(vn(d,C)))},bt=()=>{var h;!d||!C||((h=w.current)==null||h.transition("flip"),L.current=we(-L.current),l.setState(Mn(d,C)))},jt=v.useCallback(()=>T(),[T]),ht=()=>{K||jt()},ae=async()=>{if(!(!d||K)){lt(!0),z(!1);try{const h=await l.process();m==null||m(h),jt()}catch{z(!0)}finally{lt(!1)}}},$t=h=>{if(S==null||S(h),h.defaultPrevented)return;const R=h.metaKey||h.ctrlKey;if(R&&h.key.toLowerCase()==="z"){h.preventDefault(),h.shiftKey?Q():tt();return}if(R&&h.key.toLowerCase()==="y"){h.preventDefault(),Q();return}if(h.key!=="Tab"||!N.current)return;const F=[...N.current.querySelectorAll($i)].filter(x=>x.offsetParent!==null);if(F.length===0)return;const O=F[0],Et=F[F.length-1];h.shiftKey&&(document.activeElement===O||document.activeElement===N.current)?(h.preventDefault(),Et.focus()):!h.shiftKey&&document.activeElement===Et&&(h.preventDefault(),O.focus())},dt=h=>{const R=B,F=h>0?Ye.find(O=>O>R*1.01)??ye:[...Ye].reverse().find(O=>O<R*.99)??Me;$(F)},Gt=d?de(d.rotation,L.current).fine/pe:0,Ct=h=>{const R=W.current??l.getSnapshot().state;R&&(l.preview(xn(R,h)),ut.current=l.getSnapshot().state)};let mt=null;if(d&&C){if(f.util==="crop")mt=u.jsxs(u.Fragment,{children:[f.cropTab==="rotation"?u.jsx(Ht,{"aria-label":M("imageEditor.rotation"),min:-45,max:45,step:.1,tickStep:1,majorEvery:5,snapThreshold:.6,value:Number(Gt.toFixed(1)),format:h=>`${Number(h.toFixed(1))}°`,onInput:h=>{const R=l.getSnapshot().state;R&&(q.current??(q.current=R),l.preview(Pe(q.current,L.current+h*pe,C)))},onChange:h=>{const R=q.current??l.getSnapshot().state;q.current=null,R&&(l.preview(Pe(R,L.current+h*pe,C)),l.commit())}},"rotation"):u.jsx(Ht,{"aria-label":M("imageEditor.scale"),min:100,max:Ft*100,step:1,tickStep:10,majorEvery:5,snapPoints:[100],snapThreshold:4,resetValue:100,value:Math.round(Qt(d,C)*100),format:h=>`${Math.round(h)}%`,onInput:h=>{const R=l.getSnapshot().state;R&&l.preview(Ut(R,h/100,C))},onChange:h=>{const R=l.getSnapshot().state;R&&(l.preview(Ut(R,h/100,C)),l.commit())}},"scale"),u.jsx(xe,{label:M("imageEditor.crop"),value:f.cropTab,options:[{id:"rotation",label:M("imageEditor.rotation")},{id:"scale",label:M("imageEditor.scale")}],onChange:h=>l.setUi({cropTab:h})})]});else if(f.util==="filter"&&l.image)mt=u.jsx(Ni,{image:l.image.image,size:C,state:d,onSelect:h=>l.setState({filter:h==="default"?null:h,colorMatrix:ee[h]})});else if(f.util==="resize")mt=u.jsx(zi,{max:At(W.current??d),value:Rt(d),locked:f.resizeLocked,onLockedChange:h=>l.setUi({resizeLocked:h}),onInput:Ct,onChange:h=>{Ct(h),l.commit()}});else if(f.util==="redact"){const h=d.redact;mt=u.jsxs(u.Fragment,{children:[u.jsx(Ht,{"aria-label":M(`imageEditor.redact.${h.effect}`),min:0,max:100,step:1,tickStep:2.5,majorEvery:4,snapThreshold:0,value:h.amount,format:R=>String(Math.round(R)),onInput:R=>l.preview({redact:{...h,amount:R}}),onChange:R=>{l.preview({redact:{...h,amount:R}}),l.commit()}},h.effect),u.jsx(xe,{label:M("imageEditor.redact"),value:h.effect,options:Vi.map(R=>({id:R,label:M(`imageEditor.redact.${R}`)})),onChange:R=>l.setState({redact:{...h,effect:R}})})]})}else if(f.util==="finetune"){const h=f.finetuneTab;mt=u.jsxs(u.Fragment,{children:[u.jsx(Ht,{"aria-label":M(`imageEditor.finetune.${h}`),min:-100,max:100,step:1,tickStep:5,majorEvery:4,snapThreshold:3,value:d.finetune[h],format:R=>String(Math.round(R)),onInput:R=>{const F=l.getSnapshot().state;F&&l.preview({finetune:{...F.finetune,[h]:R}})},onChange:R=>{const F=l.getSnapshot().state;F&&(l.preview({finetune:{...F.finetune,[h]:R}}),l.commit())}},h),u.jsx(xe,{label:M("imageEditor.finetune"),value:h,options:dn.map(R=>({id:R,label:M(`imageEditor.finetune.${R}`),dot:d.finetune[R]!==0})),onChange:R=>l.setUi({finetuneTab:R})})]})}}const Lt=I==="ready"&&!!d,Wt=Lt&&f.util!=="crop";return u.jsx(cn.Overlay,{open:e,onClose:ht,closeOnBackdrop:!1,dim:0,className:b.overlay,children:u.jsxs("div",{ref:_t,role:"dialog","aria-modal":"true","aria-label":M("imageEditor.title"),tabIndex:-1,className:G.clsx(b.editor,g),"data-part":"editor",onKeyDown:$t,...A,children:[u.jsx(Ri,{ref:w,core:l,snapshot:j,cropAspectRatio:r,viewZoom:f.util==="crop"?null:Y,onViewZoom:$,onZoomReport:ot,areaRef:V}),u.jsxs("header",{className:b.header,"data-part":"header",children:[u.jsx("div",{className:b.headerStart,children:u.jsxs("div",{className:b.group,children:[u.jsx(vt.IconButton,{variant:"text",color:"primary",size:"sm","aria-label":M("imageEditor.close"),title:M("imageEditor.close"),onClick:ht,children:u.jsx(Z.Icon,{name:"Close",className:b.closeIcon})}),u.jsx("span",{className:b.groupDivider,"aria-hidden":"true"}),u.jsx(vt.IconButton,{variant:"text",color:"primary",size:"sm","aria-label":M("imageEditor.revert"),title:M("imageEditor.revert"),disabled:!j.canRevert,onClick:Vt,children:u.jsx(Z.Icon,{name:"ReverseTimeArrow"})})]})}),u.jsxs("div",{className:b.headerCenter,children:[u.jsxs("div",{className:b.group,children:[u.jsx(vt.IconButton,{variant:"text",color:"primary",size:"sm","aria-label":M("imageEditor.undo"),title:M("imageEditor.undo"),disabled:!j.canUndo,onClick:tt,children:u.jsx(Z.Icon,{name:"UndoArrow"})}),u.jsx("span",{className:b.groupDivider,"aria-hidden":"true"}),u.jsx(vt.IconButton,{variant:"text",color:"primary",size:"sm","aria-label":M("imageEditor.redo"),title:M("imageEditor.redo"),disabled:!j.canRedo,onClick:Q,children:u.jsx(Z.Icon,{name:"RedoArrow"})})]}),Wt&&u.jsxs("div",{className:G.clsx(b.group,b.fadeIn),children:[u.jsx(vt.IconButton,{variant:"text",color:"primary",size:"sm","aria-label":M("imageEditor.zoomOut"),title:M("imageEditor.zoomOut"),disabled:B<=Me*1.01,onClick:()=>dt(-1),children:u.jsx(Z.Icon,{name:"Minus"})}),u.jsx("span",{className:b.groupDivider,"aria-hidden":"true"}),u.jsxs("button",{type:"button",className:b.zoomLabel,"aria-label":M("imageEditor.zoom"),title:M("imageEditor.zoomFit"),onClick:()=>$(null),children:[Math.round(B*100),"%"]}),u.jsx("span",{className:b.groupDivider,"aria-hidden":"true"}),u.jsx(vt.IconButton,{variant:"text",color:"primary",size:"sm","aria-label":M("imageEditor.zoomIn"),title:M("imageEditor.zoomIn"),disabled:B>=ye*.99,onClick:()=>dt(1),children:u.jsx(Z.Icon,{name:"Add"})})]})]}),u.jsx("div",{className:b.headerEnd,children:u.jsx(vt.IconButton,{variant:"contained",color:"accent",size:"sm",loading:K,disabled:!Lt,"aria-label":M("imageEditor.done"),title:M("imageEditor.done"),onClick:ae,className:b.done,children:u.jsx(Z.Icon,{name:"CheckMarkTick"})})})]}),u.jsxs("div",{className:b.main,"data-part":"main",children:[u.jsx("nav",{className:b.nav,"data-part":"nav",children:u.jsx("div",{role:"tablist","aria-label":M("imageEditor.tools"),"aria-orientation":"vertical",className:b.navList,onKeyDown:h=>{var O;const R=Mt.findIndex(Et=>Et.id===f.util),F=h.key==="ArrowDown"||h.key==="ArrowRight"?Mt[(R+1)%Mt.length]:h.key==="ArrowUp"||h.key==="ArrowLeft"?Mt[(R+Mt.length-1)%Mt.length]:null;F&&(h.preventDefault(),l.setUi({util:F.id}),(O=h.currentTarget.querySelector(`[data-util="${F.id}"]`))==null||O.focus())},children:Mt.map(h=>{const R=f.util===h.id;return u.jsxs("button",{type:"button",role:"tab",id:`tz-ie-tab-${h.id}`,"aria-selected":R,"aria-controls":"tz-ie-panel",tabIndex:R?0:-1,title:M(`imageEditor.${h.id}`),className:G.clsx(b.tool,R&&b.toolActive),"data-util":h.id,onClick:()=>l.setUi({util:h.id}),children:[u.jsx(Z.Icon,{name:h.icon,size:"sm"}),u.jsx("span",{className:b.toolLabel,children:M(`imageEditor.${h.id}`)})]},h.id)})})}),u.jsxs("section",{className:b.stage,id:"tz-ie-panel",role:"tabpanel","aria-labelledby":`tz-ie-tab-${f.util}`,"data-part":"stage","data-util":f.util,children:[u.jsx("div",{className:b.toolbar,"data-part":"toolbar",children:Lt&&f.util==="crop"&&u.jsxs("div",{className:G.clsx(b.toolbarRow,b.fadeIn),children:[u.jsx(_e.Button,{variant:"text",color:"primary",size:"sm",startIcon:u.jsx(Z.Icon,{name:"RotateLeft"}),title:M("imageEditor.rotateLeft"),"aria-label":M("imageEditor.rotateLeft"),onClick:yt,className:b.toolbarIconOnPhone,children:u.jsx("span",{className:b.toolbarLabel,children:M("imageEditor.rotateLeft")})}),u.jsx(_e.Button,{variant:"text",color:"primary",size:"sm",startIcon:u.jsx(Z.Icon,{name:"FlipHorizontal"}),title:M("imageEditor.flipHorizontal"),"aria-label":M("imageEditor.flipHorizontal"),onClick:bt,className:b.toolbarIconOnPhone,children:u.jsx("span",{className:b.toolbarLabel,children:M("imageEditor.flipHorizontal")})}),!r&&d&&u.jsx(Ci,{ratio:d.cropRatio,options:a??Ai,onChange:h=>{var F;const R=l.getSnapshot().state;!R||!C||((F=w.current)==null||F.transition("jump"),l.setState(En(R,h,C)))}})]},"crop-toolbar")}),u.jsxs("div",{ref:V,className:b.canvasArea,"data-part":"area",children:[I==="loading"&&u.jsxs("div",{className:b.status,role:"status",children:[u.jsx(sn.Loader,{size:"lg"}),u.jsx("span",{children:M("imageEditor.loading")})]}),I==="error"&&u.jsxs("div",{className:b.status,role:"alert",children:[u.jsx(Z.Icon,{name:"Gallery",size:"lg"}),u.jsx("span",{children:M("imageEditor.loadError")})]}),k&&u.jsx("div",{className:b.toastError,role:"alert",children:M("imageEditor.processError")})]}),u.jsx("div",{className:b.footer,"data-part":"footer",children:u.jsx("div",{className:G.clsx(b.footerInner,b.fadeIn),children:mt},f.util)})]})]})]})})});function xe({label:t,value:e,options:n,onChange:i}){const o=v.useRef(null);return v.useEffect(()=>{var r,a,s;(s=(a=(r=o.current)==null?void 0:r.querySelector(`[data-tab="${e}"]`))==null?void 0:a.scrollIntoView)==null||s.call(a,{block:"nearest",inline:"nearest",behavior:"smooth"})},[e]),u.jsx("div",{ref:o,role:"tablist","aria-label":t,className:b.tabs,"data-part":"tabs",onKeyDown:r=>{var c;const a=n.findIndex(y=>y.id===e),s=r.key==="ArrowRight"?1:r.key==="ArrowLeft"?-1:0;if(!s)return;r.preventDefault();const _=n[(a+s+n.length)%n.length];i(_.id),(c=r.currentTarget.querySelector(`[data-tab="${_.id}"]`))==null||c.focus()},children:n.map(r=>u.jsxs("button",{type:"button",role:"tab","aria-selected":r.id===e,tabIndex:r.id===e?0:-1,className:G.clsx(b.tab,r.id===e&&b.tabActive),"data-tab":r.id,onClick:()=>i(r.id),children:[r.label,r.dot&&u.jsx("span",{className:b.tabDot,"aria-hidden":"true"})]},r.id))})}exports.FILTER_MATRICES=ee;exports.ImageEditor=Gi;exports.ImageEditorCore=Ce;exports.createImageEditor=Kn;
60
- //# sourceMappingURL=ImageEditor-D_HKfDbx.cjs.map