@strapi/admin 4.12.0-beta.0 → 4.12.0-beta.3

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 (226) hide show
  1. package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +1 -3
  2. package/admin/src/content-manager/components/RelationInput/components/Option.js +6 -5
  3. package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +7 -7
  4. package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFields.js +23 -21
  5. package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +21 -23
  6. package/admin/src/content-manager/pages/EditView/Information/index.js +1 -1
  7. package/admin/src/content-manager/pages/EditView/InformationBox/InformationBoxCE.js +1 -2
  8. package/admin/src/content-manager/pages/EditView/InformationBox/index.js +1 -3
  9. package/admin/src/content-manager/pages/EditView/index.js +14 -2
  10. package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +24 -22
  11. package/admin/src/content-manager/pages/ListView/components/Body/index.js +191 -0
  12. package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/ConfirmBulkActionDialog/index.js +164 -0
  13. package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/SelectedEntriesModal/index.js +468 -0
  14. package/admin/src/content-manager/{components/DynamicTable/BulkActionsBar → pages/ListView/components/BulkActionButtons}/index.js +56 -132
  15. package/admin/src/content-manager/pages/ListView/components/CellContent/RelationMultiple/index.js +63 -69
  16. package/admin/src/content-manager/pages/ListView/components/CellContent/RepeatableComponent/index.js +28 -21
  17. package/admin/src/content-manager/pages/ListView/index.js +191 -132
  18. package/admin/src/hooks/useSettingsMenu/index.js +35 -21
  19. package/admin/src/layouts/UnauthenticatedLayout/LocaleToggle/index.js +7 -7
  20. package/admin/src/pages/AuthPage/components/Login/index.js +3 -5
  21. package/admin/src/pages/AuthPage/constants.js +3 -2
  22. package/admin/src/pages/AuthPage/index.js +18 -1
  23. package/admin/src/pages/HomePage/index.js +19 -7
  24. package/admin/src/pages/ProfilePage/index.js +6 -11
  25. package/admin/src/pages/SettingsPage/components/SettingsNav/index.js +13 -11
  26. package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +17 -1
  27. package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +15 -2
  28. package/admin/src/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +2 -4
  29. package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +15 -1
  30. package/admin/src/pages/SettingsPage/pages/Users/ListPage/index.js +36 -5
  31. package/admin/src/pages/SettingsPage/pages/Users/components/MagicLink/index.js +3 -5
  32. package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +1 -3
  33. package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/index.js +16 -1
  34. package/admin/src/translations/ca.json +4 -4
  35. package/admin/src/translations/de.json +4 -4
  36. package/admin/src/translations/dk.json +2 -2
  37. package/admin/src/translations/en.json +23 -4
  38. package/admin/src/translations/es.json +4 -4
  39. package/admin/src/translations/eu.json +4 -4
  40. package/admin/src/translations/fr.json +2 -2
  41. package/admin/src/translations/gu.json +4 -4
  42. package/admin/src/translations/hi.json +4 -4
  43. package/admin/src/translations/hu.json +4 -4
  44. package/admin/src/translations/ja.json +2 -2
  45. package/admin/src/translations/ko.json +2 -2
  46. package/admin/src/translations/ml.json +4 -4
  47. package/admin/src/translations/nl.json +4 -4
  48. package/admin/src/translations/pl.json +4 -4
  49. package/admin/src/translations/pt-BR.json +4 -4
  50. package/admin/src/translations/ru.json +4 -4
  51. package/admin/src/translations/sa.json +4 -4
  52. package/admin/src/translations/sk.json +4 -4
  53. package/admin/src/translations/sv.json +4 -4
  54. package/admin/src/translations/tr.json +4 -4
  55. package/admin/src/translations/zh-Hans.json +4 -4
  56. package/admin/src/translations/zh.json +4 -4
  57. package/build/1049.758a01f5.chunk.js +1 -0
  58. package/build/{3528.4845cf92.chunk.js → 1386.762d6eb8.chunk.js} +1 -1
  59. package/build/1727.b49f0713.chunk.js +1 -0
  60. package/build/{5563.a146acac.chunk.js → 2225.15d1df72.chunk.js} +2 -2
  61. package/build/2379.d33a2e16.chunk.js +1 -0
  62. package/build/2395.b0419a54.chunk.js +26 -0
  63. package/build/2801.18f38baf.chunk.js +1 -0
  64. package/build/{7394.423886bd.chunk.js → 3100.21c343fa.chunk.js} +1 -1
  65. package/build/311.cb0884bb.chunk.js +1 -0
  66. package/build/3483.ddd2d6df.chunk.js +1 -0
  67. package/build/{970.89601f27.chunk.js → 3739.63e352f1.chunk.js} +52 -20
  68. package/build/3984.ea7b8036.chunk.js +1 -0
  69. package/build/4546.ff9fdf30.chunk.js +1 -0
  70. package/build/502.ccb38223.chunk.js +1 -0
  71. package/build/5483.ed2c7efa.chunk.js +6 -0
  72. package/build/{5542.c62d0daf.chunk.js → 5542.2415a393.chunk.js} +6 -6
  73. package/build/6158.c974fd83.chunk.js +1 -0
  74. package/build/6691.f880a0b6.chunk.js +105 -0
  75. package/build/7030.b98dcedf.chunk.js +1 -0
  76. package/build/7464.c6d0565c.chunk.js +1 -0
  77. package/build/8276.23e0763b.chunk.js +26 -0
  78. package/build/8298.fd253c9f.chunk.js +117 -0
  79. package/build/918.54414509.chunk.js +1 -0
  80. package/build/{9932.7e2b71de.chunk.js → 9806.91360bb6.chunk.js} +79 -79
  81. package/build/{9944.29289a16.chunk.js → 9944.7af075a5.chunk.js} +1 -1
  82. package/build/{Admin-authenticatedApp.9d3afb79.chunk.js → Admin-authenticatedApp.36b3826c.chunk.js} +5 -5
  83. package/build/Admin_InternalErrorPage.f45f2462.chunk.js +1 -0
  84. package/build/{Admin_homePage.be30ef4e.chunk.js → Admin_homePage.ac9dfb86.chunk.js} +23 -15
  85. package/build/{Admin_marketplace.74a58e20.chunk.js → Admin_marketplace.f0b87fce.chunk.js} +1 -1
  86. package/build/{Admin_pluginsPage.ce464189.chunk.js → Admin_pluginsPage.8728ff6e.chunk.js} +1 -1
  87. package/build/{Admin_profilePage.2131eb68.chunk.js → Admin_profilePage.a968035f.chunk.js} +2 -2
  88. package/build/Admin_settingsPage.8c600d1a.chunk.js +111 -0
  89. package/build/Upload_ConfigureTheView.345ac1e0.chunk.js +1 -0
  90. package/build/admin-app.1c3f7fd6.chunk.js +36 -0
  91. package/build/{admin-edit-roles-page.3fdd6b9d.chunk.js → admin-edit-roles-page.a49b9f4f.chunk.js} +4 -4
  92. package/build/admin-edit-users.67704088.chunk.js +10 -0
  93. package/build/{admin-roles-list.e17b00d7.chunk.js → admin-roles-list.0c129e98.chunk.js} +1 -1
  94. package/build/admin-users.3279ffb0.chunk.js +11 -0
  95. package/build/api-tokens-create-page.46c2ea84.chunk.js +1 -0
  96. package/build/{api-tokens-edit-page.9a1dd2fa.chunk.js → api-tokens-edit-page.58139df9.chunk.js} +1 -1
  97. package/build/{api-tokens-list-page.a103f526.chunk.js → api-tokens-list-page.505bf7e0.chunk.js} +2 -2
  98. package/build/audit-logs-settings-page.4b422831.chunk.js +1 -0
  99. package/build/{ca-json.1fed5d8b.chunk.js → ca-json.a53c10b6.chunk.js} +1 -1
  100. package/build/content-manager.b8d593d4.chunk.js +1103 -0
  101. package/build/{content-type-builder-list-view.a200a358.chunk.js → content-type-builder-list-view.bf9be456.chunk.js} +9 -9
  102. package/build/{content-type-builder-translation-ar-json.56d8fcf4.chunk.js → content-type-builder-translation-ar-json.3e808e2f.chunk.js} +1 -1
  103. package/build/{content-type-builder-translation-cs-json.a5b299ca.chunk.js → content-type-builder-translation-cs-json.1ef9e106.chunk.js} +1 -1
  104. package/build/{content-type-builder-translation-de-json.393a76c0.chunk.js → content-type-builder-translation-de-json.63fcff7b.chunk.js} +1 -1
  105. package/build/{content-type-builder-translation-dk-json.fbd39bb7.chunk.js → content-type-builder-translation-dk-json.fd626b67.chunk.js} +1 -1
  106. package/build/{content-type-builder-translation-en-json.38e20391.chunk.js → content-type-builder-translation-en-json.ed29ff4d.chunk.js} +1 -1
  107. package/build/{content-type-builder-translation-es-json.9288474b.chunk.js → content-type-builder-translation-es-json.a4a361a9.chunk.js} +1 -1
  108. package/build/{content-type-builder-translation-fr-json.d35e269c.chunk.js → content-type-builder-translation-fr-json.499c3a46.chunk.js} +1 -1
  109. package/build/{content-type-builder-translation-id-json.f0513929.chunk.js → content-type-builder-translation-id-json.65255f93.chunk.js} +1 -1
  110. package/build/{content-type-builder-translation-it-json.aaf16753.chunk.js → content-type-builder-translation-it-json.e268ab74.chunk.js} +1 -1
  111. package/build/{content-type-builder-translation-ko-json.8fe21a7f.chunk.js → content-type-builder-translation-ko-json.04cb309d.chunk.js} +1 -1
  112. package/build/{content-type-builder-translation-ms-json.3b5d2d3e.chunk.js → content-type-builder-translation-ms-json.f6b743b9.chunk.js} +1 -1
  113. package/build/{content-type-builder-translation-nl-json.225ef5d3.chunk.js → content-type-builder-translation-nl-json.997fe8cc.chunk.js} +1 -1
  114. package/build/{content-type-builder-translation-pl-json.92f36be2.chunk.js → content-type-builder-translation-pl-json.634f638b.chunk.js} +1 -1
  115. package/build/{content-type-builder-translation-pt-BR-json.3bd10f89.chunk.js → content-type-builder-translation-pt-BR-json.6a95dc71.chunk.js} +1 -1
  116. package/build/{content-type-builder-translation-ru-json.9bfe47ce.chunk.js → content-type-builder-translation-ru-json.3af65503.chunk.js} +1 -1
  117. package/build/{content-type-builder-translation-sk-json.d03cc18a.chunk.js → content-type-builder-translation-sk-json.c6078082.chunk.js} +1 -1
  118. package/build/{content-type-builder-translation-sv-json.d23dcd32.chunk.js → content-type-builder-translation-sv-json.a6df2462.chunk.js} +1 -1
  119. package/build/{content-type-builder-translation-th-json.7ad256e2.chunk.js → content-type-builder-translation-th-json.122277cc.chunk.js} +1 -1
  120. package/build/{content-type-builder-translation-tr-json.926f6191.chunk.js → content-type-builder-translation-tr-json.41f44f77.chunk.js} +1 -1
  121. package/build/{content-type-builder-translation-uk-json.7bf19546.chunk.js → content-type-builder-translation-uk-json.e1315acd.chunk.js} +1 -1
  122. package/build/{content-type-builder-translation-zh-Hans-json.415577fb.chunk.js → content-type-builder-translation-zh-Hans-json.6ff57db6.chunk.js} +1 -1
  123. package/build/{content-type-builder-translation-zh-json.ad24dbeb.chunk.js → content-type-builder-translation-zh-json.3532b962.chunk.js} +1 -1
  124. package/build/content-type-builder.40534de5.chunk.js +170 -0
  125. package/build/{de-json.fcac7381.chunk.js → de-json.b3be02c7.chunk.js} +1 -1
  126. package/build/{dk-json.e34cad0d.chunk.js → dk-json.842aa391.chunk.js} +1 -1
  127. package/build/{email-settings-page.45695daa.chunk.js → email-settings-page.d494d1eb.chunk.js} +2 -2
  128. package/build/{en-json.fb9f6ddd.chunk.js → en-json.4c733bd1.chunk.js} +1 -1
  129. package/build/{es-json.42096084.chunk.js → es-json.f57b5335.chunk.js} +1 -1
  130. package/build/{eu-json.fb17c8f9.chunk.js → eu-json.633025f0.chunk.js} +1 -1
  131. package/build/{fr-json.69789980.chunk.js → fr-json.aa8839d2.chunk.js} +1 -1
  132. package/build/{gu-json.4d667d0c.chunk.js → gu-json.5bd62812.chunk.js} +1 -1
  133. package/build/{hi-json.323be97d.chunk.js → hi-json.9104eb78.chunk.js} +1 -1
  134. package/build/{hu-json.fe71e6c8.chunk.js → hu-json.9f4aae42.chunk.js} +1 -1
  135. package/build/{i18n-settings-page.29308d0b.chunk.js → i18n-settings-page.47f78016.chunk.js} +1 -1
  136. package/build/index.html +1 -1
  137. package/build/{ja-json.81b6d1e3.chunk.js → ja-json.91286391.chunk.js} +1 -1
  138. package/build/{ko-json.4539f4ba.chunk.js → ko-json.fcf3ec4b.chunk.js} +1 -1
  139. package/build/main.a12c4c0f.js +2856 -0
  140. package/build/{ml-json.8988e374.chunk.js → ml-json.557aa14c.chunk.js} +1 -1
  141. package/build/{nl-json.98345913.chunk.js → nl-json.b2b16eea.chunk.js} +1 -1
  142. package/build/{pl-json.59a5dab3.chunk.js → pl-json.f094a417.chunk.js} +1 -1
  143. package/build/{pt-BR-json.9410688b.chunk.js → pt-BR-json.dec7fb01.chunk.js} +1 -1
  144. package/build/review-workflows-settings-create-view.dfd87e1f.chunk.js +1 -0
  145. package/build/review-workflows-settings-edit-view.53c00afe.chunk.js +1 -0
  146. package/build/review-workflows-settings-list-view.a34be805.chunk.js +56 -0
  147. package/build/{ru-json.678cd48b.chunk.js → ru-json.8193d8c4.chunk.js} +1 -1
  148. package/build/{runtime~main.5e9bf4b3.js → runtime~main.d197f488.js} +2 -2
  149. package/build/{sa-json.6359a11c.chunk.js → sa-json.a56836f1.chunk.js} +1 -1
  150. package/build/{sk-json.2374f129.chunk.js → sk-json.bf2f057a.chunk.js} +1 -1
  151. package/build/sso-settings-page.ed6f3f15.chunk.js +1 -0
  152. package/build/{sv-json.ae6e71ea.chunk.js → sv-json.fd0e86c6.chunk.js} +1 -1
  153. package/build/{tr-json.bac5dbd3.chunk.js → tr-json.56c32cf6.chunk.js} +1 -1
  154. package/build/transfer-tokens-create-page.1597e6ab.chunk.js +1 -0
  155. package/build/transfer-tokens-edit-page.8741529f.chunk.js +1 -0
  156. package/build/{transfer-tokens-list-page.7237443d.chunk.js → transfer-tokens-list-page.22147d2c.chunk.js} +2 -2
  157. package/build/upload-settings.cac210a0.chunk.js +14 -0
  158. package/build/upload.cbfeefa5.chunk.js +58 -0
  159. package/build/{users-advanced-settings-page.750b1f76.chunk.js → users-advanced-settings-page.18379a56.chunk.js} +1 -1
  160. package/build/users-email-settings-page.a87978e5.chunk.js +9 -0
  161. package/build/users-providers-settings-page.8876c1ee.chunk.js +14 -0
  162. package/build/{users-roles-settings-page.d286426a.chunk.js → users-roles-settings-page.0431f48c.chunk.js} +2 -2
  163. package/build/webhook-edit-page.a91f27a1.chunk.js +33 -0
  164. package/build/{webhook-list-page.940a40f1.chunk.js → webhook-list-page.65e1b5bb.chunk.js} +1 -1
  165. package/build/{zh-Hans-json.fada6f40.chunk.js → zh-Hans-json.36d81cdc.chunk.js} +1 -1
  166. package/build/{zh-json.3529f1e5.chunk.js → zh-json.1cc86ff0.chunk.js} +1 -1
  167. package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +6 -3
  168. package/ee/admin/content-manager/pages/EditView/InformationBox/index.js +1 -3
  169. package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/constants.js +2 -2
  170. package/ee/admin/pages/AuthPage/components/Login/index.js +3 -5
  171. package/ee/admin/pages/HomePage/index.js +11 -0
  172. package/ee/admin/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/index.js +1 -3
  173. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/ProtectedPage/ProtectedPage.js +1 -1
  174. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +1 -1
  175. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/CreateView/CreateView.js +38 -10
  176. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/EditView/EditView.js +57 -8
  177. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/ListView/ListView.js +3 -3
  178. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/utils/{getWorkflowValidationSchema.js → validateWorkflow.js} +33 -2
  179. package/ee/admin/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +2 -4
  180. package/ee/admin/pages/SettingsPage/pages/Users/ListPage/index.js +13 -0
  181. package/ee/admin/pages/SettingsPage/pages/Users/components/MagicLink/index.js +3 -5
  182. package/ee/admin/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +1 -3
  183. package/ee/server/constants/default-stages.json +1 -1
  184. package/ee/server/constants/workflows.js +1 -0
  185. package/ee/server/services/review-workflows/validation.js +6 -0
  186. package/ee/server/validation/review-workflows.js +6 -2
  187. package/index.js +0 -14
  188. package/package.json +12 -20
  189. package/webpack.alias.js +0 -3
  190. package/webpack.config.js +1 -75
  191. package/admin/src/content-manager/pages/ListView/components/TableRows/index.js +0 -300
  192. package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/index.js +0 -5
  193. package/build/1386.3b2aa6a7.chunk.js +0 -3
  194. package/build/1970.39a2d75e.chunk.js +0 -1
  195. package/build/2799.cf9b491f.chunk.js +0 -1
  196. package/build/3269.1ea0f5a6.chunk.js +0 -1
  197. package/build/4485.d3c6dd1d.chunk.js +0 -6
  198. package/build/539.865446c0.chunk.js +0 -1
  199. package/build/6691.e6d5ac38.chunk.js +0 -105
  200. package/build/7018.f3dad3c1.chunk.js +0 -1
  201. package/build/7259.0e25ab5d.chunk.js +0 -1
  202. package/build/9465.d8fc1377.chunk.js +0 -112
  203. package/build/Admin_InternalErrorPage.8911cb49.chunk.js +0 -1
  204. package/build/Admin_settingsPage.074655f6.chunk.js +0 -79
  205. package/build/Upload_ConfigureTheView.7a1cb9c9.chunk.js +0 -1
  206. package/build/admin-app.3ede71ad.chunk.js +0 -61
  207. package/build/admin-edit-users.78552758.chunk.js +0 -10
  208. package/build/admin-users.c23322fc.chunk.js +0 -11
  209. package/build/api-tokens-create-page.3dd4e921.chunk.js +0 -1
  210. package/build/audit-logs-settings-page.37fe915c.chunk.js +0 -1
  211. package/build/content-manager.08541eeb.chunk.js +0 -1094
  212. package/build/content-type-builder.de22f7c9.chunk.js +0 -166
  213. package/build/main.a8ede50d.js +0 -2927
  214. package/build/review-workflows-settings-create-view.56f61e18.chunk.js +0 -1
  215. package/build/review-workflows-settings-edit-view.912bc9c0.chunk.js +0 -1
  216. package/build/review-workflows-settings-list-view.cf6a08d3.chunk.js +0 -56
  217. package/build/sso-settings-page.0cdb96a6.chunk.js +0 -1
  218. package/build/transfer-tokens-create-page.de14cad4.chunk.js +0 -1
  219. package/build/transfer-tokens-edit-page.4f5e39af.chunk.js +0 -1
  220. package/build/upload-settings.cb6c14c3.chunk.js +0 -14
  221. package/build/upload.7e629643.chunk.js +0 -26
  222. package/build/users-email-settings-page.e9bcd865.chunk.js +0 -9
  223. package/build/users-providers-settings-page.a94253e9.chunk.js +0 -14
  224. package/build/webhook-edit-page.77ef4f1a.chunk.js +0 -33
  225. /package/admin/src/content-manager/components/{DynamicTable → ListViewTable}/CellContent/PublicationState/PublicationState.js +0 -0
  226. /package/admin/src/content-manager/components/{DynamicTable → ListViewTable}/CellContent/PublicationState/index.js +0 -0
@@ -0,0 +1,111 @@
1
+ (self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5895],{10898:function(U,C,t){"use strict";t.r(C),t.d(C,{SettingsPage:function(){return jt},default:function(){return Ie}});var e=t(32735),m=t(96709),i=t(19565),E=t(74758),r=t(67879),p=t(53038),g=t(2160),y=t(9592),T=t(86209),D=t(90700),$=t(78090),R=t(77013),u=t(79318),j=t(66618),M=t(60216),a=t.n(M),S=t(14911),O=t(3704),Z=t.n(O),w=o=>Z()(o,s=>s.links).map(s=>(0,T.ot)(s.Component,s.to,s.exact||!1)),V=o=>o.filter(n=>!n.links.every(s=>s.isDisplayed===!1));const X=({menu:o})=>{const{formatMessage:n}=(0,r.Z)(),{trackUsage:s}=(0,i.rS)(),{pathname:l}=(0,p.TH)(),v=V(o).map(h=>({...h,title:h.intlLabel,links:h.links.map(d=>({...d,title:d.intlLabel,name:d.id}))})),L=n({id:"global.settings",defaultMessage:"Settings"}),f=(h=null)=>{s("willNavigate",{from:l,to:h})};return e.createElement(D.m,{ariaLabel:L},e.createElement($.p,{label:L}),e.createElement(R.Z,null,v.map(h=>e.createElement(u.D,{key:h.id,label:n(h.intlLabel)},h.links.map(d=>e.createElement(j.E,{as:S.OL,withBullet:d.hasNotification,to:d.to,onClick:()=>f(d.to),key:d.id},n(d.intlLabel)))))))};X.propTypes={menu:a().array.isRequired};var st=X;const Q=[{async Component(){return await t.e(3455).then(t.bind(t,32239))},to:"/settings/roles",exact:!0},{async Component(){return await Promise.all([t.e(1387),t.e(2544)]).then(t.bind(t,15570))},to:"/settings/roles/duplicate/:id",exact:!0},{async Component(){return await Promise.all([t.e(1387),t.e(2544)]).then(t.bind(t,15570))},to:"/settings/roles/new",exact:!0},{async Component(){return await Promise.all([t.e(1387),t.e(2544)]).then(t.bind(t,87056))},to:"/settings/roles/:id",exact:!0},{async Component(){return await t.e(5199).then(t.bind(t,25691))},to:"/settings/users",exact:!0},{async Component(){return await t.e(4263).then(t.bind(t,28363))},to:"/settings/users/:id",exact:!0},{async Component(){return await t.e(5162).then(t.bind(t,5722))},to:"/settings/webhooks/create",exact:!0},{async Component(){return await t.e(5162).then(t.bind(t,63939))},to:"/settings/webhooks/:id",exact:!0},{async Component(){return await t.e(4121).then(t.bind(t,93826))},to:"/settings/webhooks",exact:!0},{async Component(){return await t.e(8056).then(t.bind(t,22614))},to:"/settings/api-tokens",exact:!0},{async Component(){return await Promise.all([t.e(1387),t.e(4628),t.e(2225),t.e(4299)]).then(t.bind(t,79494))},to:"/settings/api-tokens/create",exact:!0},{async Component(){return await Promise.all([t.e(1387),t.e(4628),t.e(2225),t.e(92)]).then(t.bind(t,77238))},to:"/settings/api-tokens/:id",exact:!0},{async Component(){return await Promise.all([t.e(1387),t.e(4628),t.e(1049),t.e(4816)]).then(t.bind(t,7360))},to:"/settings/transfer-tokens/create",exact:!0},{async Component(){return await t.e(9600).then(t.bind(t,51318))},to:"/settings/transfer-tokens",exact:!0},{async Component(){return await Promise.all([t.e(1387),t.e(4628),t.e(1049),t.e(2492)]).then(t.bind(t,66523))},to:"/settings/transfer-tokens/:id",exact:!0}];var q=t(27649),nt=t(23866),lt=t(82055),z=t(41415),_=t(17e3),W=t(87933),P=t(49372),ot=t(15335),J=t(5803),K=t(50428),At=t(66456),Mt=t(47361),it=t(20108),zt=t(15062),Bt=t(30305),N=t(72850);const Y=750,tt=100,Ct=["image/jpeg","image/png","image/svg+xml"];var Ut=t(23272),Zt=t(68387),yt=t(50563),Ft=t(98779),$t=t(19406),Wt=t(44647),Kt=t(85025),Nt=t(55225),rt=t(97889);const Lt={localImage:void 0};var Gt=(o=Lt,n)=>(0,rt.ZP)(o,s=>{switch(n.type){case"SET_LOCAL_IMAGE":{s.localImage=n.value;break}default:return s}});const dt=({onChangeLogo:o,customLogo:n,goTo:s,Component:l,modalTitle:c,next:v,prev:L,currentStep:f})=>{const[{localImage:h},d]=(0,e.useReducer)(Gt,Lt),{formatMessage:I}=(0,r.Z)(),x=A=>{d({type:"SET_LOCAL_IMAGE",value:A})},B=()=>{s(null)};return f?e.createElement(Kt.P,{labelledBy:"modal",onClose:B},e.createElement(Nt.x,null,e.createElement(P.Z,{fontWeight:"bold",as:"h2",id:"modal"},I(c))),e.createElement(l,{setLocalImage:x,goTo:s,next:v,prev:L,onClose:B,asset:h||n,onChangeLogo:o})):null};dt.defaultProps={Component:void 0,currentStep:void 0,customLogo:void 0,modalTitle:void 0,next:null,prev:null},dt.propTypes={Component:a().elementType,currentStep:a().string,customLogo:a().shape({name:a().string,url:a().string,width:a().number,height:a().number,ext:a().string}),goTo:a().func.isRequired,modalTitle:a().shape({id:a().string,defaultMessage:a().string}),next:a().string,onChangeLogo:a().func.isRequired,prev:a().string};var Ht=dt;const St={currentStep:void 0};var Vt=(o=St,n)=>(0,rt.ZP)(o,s=>{switch(n.type){case"GO_TO":{s.currentStep=n.to;break}default:return s}}),Qt=t(91215),ct=t(90980),Jt=t(9026),mt=t(3653),Xt=t(98275),Yt=t(87107),bt=t(99140),wt=t(47851),gt=t(11406),kt=t(47284),qt=t(8471);const _t={id:"Settings.application.customization.modal.upload.error-format",defaultMessage:"Wrong format uploaded (accepted formats only: jpeg, jpg, png, svg)."},Rt={id:"Settings.application.customization.modal.upload.error-size",defaultMessage:"The file uploaded is too large (max dimension: {dimension}x{dimension}, max file size: {size}KB)"},te=o=>new Promise(n=>{const s=new FileReader;s.onload=()=>{const l=new Image;l.onload=function(){n({width:l.width,height:l.height})},l.src=s.result},s.readAsDataURL(o)}),ee=(o,n)=>({ext:o.name.split(".").pop(),size:o.size/1e3,name:o.name,url:URL.createObjectURL(o),rawFile:o,width:n.width,height:n.height}),Tt=async o=>{let n;if(!Ct.includes(o.type))throw n=new Error("File format"),n.displayMessage=_t,n;const l=await te(o);if(!(l.width<=Y&&l.height<=Y))throw n=new Error("File sizing"),n.displayMessage=Rt,n;const v=ee(o,l);if(!(v.size<=tt))throw n=new Error("File sizing"),n.displayMessage=Rt,n;return v},ne=(0,qt.ZP)(Xt._)`
2
+ opacity: 0;
3
+ position: absolute;
4
+ top: 0;
5
+ bottom: 0;
6
+ left: 0;
7
+ right: 0;
8
+ z-index: 1;
9
+ `,ut=({setLocalImage:o,goTo:n,next:s,onClose:l})=>{const{formatMessage:c}=(0,r.Z)(),[v,L]=(0,e.useState)(!1),[f,h]=(0,e.useState)(void 0),d=(0,e.useRef)(null),I=()=>L(!0),x=()=>L(!1),B=G=>{G.preventDefault(),d.current.click()},A=async()=>{x();const G=d.current.files[0];if(G)try{const H=await Tt(G);o(H),n(s)}catch(H){if(H.displayMessage)h(c(H.displayMessage,{size:tt,dimension:Y})),d.current.focus();else throw H}},F=()=>v?"primary500":f?"danger600":"neutral300";return e.createElement(e.Fragment,null,e.createElement("form",null,e.createElement(N.x,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(Yt.g,{name:"logo-upload",error:f},e.createElement("label",{htmlFor:"logo-upload"},e.createElement(W.k,{direction:"column",alignItems:"stretch",gap:2},e.createElement(W.k,{paddingTop:9,paddingBottom:7,hasRadius:!0,justifyContent:"center",direction:"column",background:v?"primary100":"neutral100",borderColor:F(),borderStyle:"dashed",borderWidth:"1px",position:"relative",onDragEnter:I,onDragLeave:x},e.createElement(bt.J,{color:"primary600",width:`${60/16}rem`,height:`${60/16}rem`,as:kt.Z,"aria-hidden":!0}),e.createElement(N.x,{paddingTop:3,paddingBottom:5},e.createElement(P.Z,{variant:"delta",as:"span"},c({id:"Settings.application.customization.modal.upload.drag-drop",defaultMessage:"Drag and Drop here or"}))),e.createElement(ne,{accept:Ct,cursor:"pointer",as:"input",type:"file",name:"files",tabIndex:-1,zIndex:1,onChange:A,ref:d,id:"logo-upload"}),e.createElement(z.z,{type:"button",onClick:B},c({id:"Settings.application.customization.modal.upload.cta.browse",defaultMessage:"Browse files"})),e.createElement(N.x,{paddingTop:6},e.createElement(P.Z,{variant:"pi",textColor:"neutral600"},c({id:"Settings.application.customization.modal.upload.file-validation",defaultMessage:"Max dimension: {dimension}x{dimension}, Max size: {size}KB"},{size:tt,dimension:Y})))),e.createElement(wt.c,null)))))),e.createElement(gt.m,{startActions:e.createElement(z.z,{onClick:l,variant:"tertiary"},c({id:"Settings.application.customization.modal.cancel",defaultMessage:"Cancel"}))}))};ut.defaultProps={next:null},ut.propTypes={goTo:a().func.isRequired,next:a().string,onClose:a().func.isRequired,setLocalImage:a().func.isRequired};var oe=ut,ae=t(10369),se=async o=>{try{const{get:n}=(0,i.tg)(),s=await n(o,{responseType:"blob",timeout:8e3});return new File([s.data],s.config.url,{type:s.headers["content-type"]})}catch(n){throw n.displayMessage={id:"Settings.application.customization.modal.upload.error-network",defaultMessage:"Network error"},n}};const pt=({goTo:o,next:n,onClose:s,setLocalImage:l})=>{const{formatMessage:c}=(0,r.Z)(),[v,L]=(0,e.useState)(""),[f,h]=(0,e.useState)(null),d=x=>{L(x.target.value)},I=async()=>{try{const x=await se(v),B=await Tt(x);l(B),o(n)}catch(x){if(x.displayMessage)h(c(x.displayMessage,{size:tt,dimension:Y}));else throw x}};return e.createElement("form",{onSubmit:x=>{x.preventDefault(),I()}},e.createElement(N.x,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(ae.o,{label:c({id:"Settings.application.customization.modal.upload.from-url.input-label",defaultMessage:"URL"}),error:f,onChange:d,value:v,name:"logo-url"})),e.createElement(gt.m,{startActions:e.createElement(z.z,{onClick:s,variant:"tertiary"},c({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(z.z,{type:"submit"},c({id:"Settings.application.customization.modal.upload.next",defaultMessage:"Next"}))}))};pt.defaultProps={next:null},pt.propTypes={goTo:a().func.isRequired,next:a().string,onClose:a().func.isRequired,setLocalImage:a().func.isRequired};var le=pt;const ht=({setLocalImage:o,goTo:n,next:s,onClose:l})=>{const{formatMessage:c}=(0,r.Z)();return e.createElement(Qt.v,{label:c({id:"Settings.application.customization.modal.tab.label",defaultMessage:"How do you want to upload your assets?"}),variant:"simple"},e.createElement(N.x,{paddingLeft:8,paddingRight:8},e.createElement(ct.m,null,e.createElement(ct.O,null,c({id:"Settings.application.customization.modal.upload.from-computer",defaultMessage:"From computer"})),e.createElement(ct.O,null,c({id:"Settings.application.customization.modal.upload.from-url",defaultMessage:"From url"}))),e.createElement(Jt.i,null)),e.createElement(mt.n,null,e.createElement(mt.x,null,e.createElement(oe,{onClose:l,setLocalImage:o,goTo:n,next:s})),e.createElement(mt.x,null,e.createElement(le,{onClose:l,setLocalImage:o,goTo:n,next:s}))))};ht.defaultProps={next:null},ht.propTypes={goTo:a().func.isRequired,next:a().string,onClose:a().func.isRequired,setLocalImage:a().func.isRequired};var ie=ht,re=t(42466),de=t(20853),ce=t(2800),me=t(26835),ge=t(41048),Pt=t(37083),ue=t(11505);const Ot=({asset:o})=>{const{formatMessage:n}=(0,r.Z)();return e.createElement(re.Z,null,e.createElement(de.O,null,e.createElement(ce.H,{size:"S",src:o.url})),e.createElement(me.e,null,e.createElement(ge.a,null,e.createElement(Pt.l,null,o.name),e.createElement(Pt._,null,`${o.ext.toUpperCase()} - ${o.width}\u2715${o.height}`)),e.createElement(ue.E,null,n({id:"Settings.application.customization.modal.pending.card-badge",defaultMessage:"image"}))))};Ot.propTypes={asset:a().shape({name:a().string,url:a().string,width:a().number,height:a().number,ext:a().string}).isRequired};var pe=Ot;const ft=({onClose:o,asset:n,prev:s,next:l,goTo:c,setLocalImage:v,onChangeLogo:L})=>{const{formatMessage:f}=(0,r.Z)(),h=()=>{v(void 0),c(s)},d=()=>{L(n),c(l)};return e.createElement(e.Fragment,null,e.createElement(N.x,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(W.k,{justifyContent:"space-between",paddingBottom:6},e.createElement(W.k,{direction:"column",alignItems:"flex-start"},e.createElement(P.Z,{variant:"pi",fontWeight:"bold"},f({id:"Settings.application.customization.modal.pending.title",defaultMessage:"Logo ready to upload"})),e.createElement(P.Z,{variant:"pi",textColor:"neutral500"},f({id:"Settings.application.customization.modal.pending.subtitle",defaultMessage:"Manage the chosen logo before uploading it"}))),e.createElement(z.z,{onClick:h,variant:"secondary"},f({id:"Settings.application.customization.modal.pending.choose-another",defaultMessage:"Choose another logo"}))),e.createElement(N.x,{maxWidth:(0,i.Q1)(180)},n.url?e.createElement(pe,{asset:n}):null)),e.createElement(gt.m,{startActions:e.createElement(z.z,{onClick:o,variant:"tertiary"},f({id:"Settings.application.customization.modal.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(z.z,{onClick:d},f({id:"Settings.application.customization.modal.pending.upload",defaultMessage:"Upload logo"}))}))};ft.defaultProps={next:null,prev:null},ft.propTypes={goTo:a().func.isRequired,asset:a().shape({name:a().string,url:a().string,width:a().number,height:a().number,ext:a().string}).isRequired,next:a().string,onClose:a().func.isRequired,onChangeLogo:a().func.isRequired,prev:a().string,setLocalImage:a().func.isRequired};var he=ft,fe={upload:{Component:ie,modalTitle:{id:"Settings.application.customization.modal.upload",defaultMessage:"Upload logo"},next:"pending",prev:null},pending:{Component:he,modalTitle:{id:"Settings.application.customization.modal.pending",defaultMessage:"Pending logo"},next:null,prev:"upload"}};const Et=({canUpdate:o,customLogo:n,defaultLogo:s,hint:l,label:c,onChangeLogo:v,onResetLogo:L})=>{const[{currentStep:f},h]=(0,e.useReducer)(Vt,St),{Component:d,next:I,prev:x,modalTitle:B}=fe[f]||{},{formatMessage:A}=(0,r.Z)(),F=G=>{h({type:"GO_TO",to:G})};return e.createElement(e.Fragment,null,e.createElement(Ut.F,{label:c,selectedSlide:0,hint:l,previousLabel:"",nextLabel:"",onNext:()=>{},onPrevious:()=>{},secondaryLabel:n?.name||"logo.png",actions:e.createElement(Zt.b,null,e.createElement(yt.h,{disabled:!o,onClick:()=>F(n?"pending":"upload"),label:A({id:"Settings.application.customization.carousel.change-action",defaultMessage:"Change logo"}),icon:e.createElement($t.Z,null)}),n&&e.createElement(yt.h,{disabled:!o,onClick:L,label:A({id:"Settings.application.customization.carousel.reset-action",defaultMessage:"Reset logo"}),icon:e.createElement(Wt.Z,null)}))},e.createElement(Ft.q,{label:A({id:"Settings.application.customization.carousel-slide.label",defaultMessage:"Logo slide"})},e.createElement(N.x,{maxHeight:"40%",maxWidth:"40%",as:"img",src:n?.url||s,alt:A({id:"Settings.application.customization.carousel.title",defaultMessage:"Logo"})}))),e.createElement(Ht,{Component:d,currentStep:f,onChangeLogo:v,customLogo:n,goTo:F,next:I,prev:x,modalTitle:B}))};Et.defaultProps={canUpdate:!1,customLogo:null,hint:null},Et.propTypes={canUpdate:a().bool,customLogo:a().shape({url:a().string,name:a().string}),label:a().string.isRequired,hint:a().string,defaultLogo:a().string.isRequired,onChangeLogo:a().func.isRequired,onResetLogo:a().func.isRequired};var It=Et,Ee=t(86349),ve=t.n(Ee),xe=(o,n)=>ve()(o,{menuLogo:{display:n.menuLogo},authLogo:{display:n.authLogo}});const vt={menuLogo:{display:null,submit:{rawFile:null,isReset:!1}},authLogo:{display:null,submit:{rawFile:null,isReset:!1}}};var Me=(o=vt,n)=>(0,rt.ZP)(o,s=>{switch(n.type){case"SET_CUSTOM_MENU_LOGO":{s.menuLogo.display=n.value,s.menuLogo.submit.rawFile=n.value.rawFile;break}case"SET_CUSTOM_AUTH_LOGO":{s.authLogo.display=n.value,s.authLogo.submit.rawFile=n.value.rawFile;break}case"RESET_CUSTOM_MENU_LOGO":{s.menuLogo.display=null,s.menuLogo.submit={rawFile:null,isReset:!0};break}case"RESET_CUSTOM_AUTH_LOGO":{s.authLogo.display=null,s.authLogo.submit={rawFile:null,isReset:!0};break}default:return s}});const xt=(0,e.forwardRef)(({canUpdate:o,projectSettingsStored:n},s)=>{const{formatMessage:l}=(0,r.Z)(),{trackUsage:c}=(0,i.rS)(),{logos:{menu:v,auth:L}}=(0,g.um)(),[{menuLogo:f,authLogo:h},d]=(0,e.useReducer)(Me,vt,()=>xe(vt,n)),I=F=>{d({type:"SET_CUSTOM_MENU_LOGO",value:F})},x=()=>{c("didClickResetLogo",{logo:"menu"}),d({type:"RESET_CUSTOM_MENU_LOGO"})},B=F=>{d({type:"SET_CUSTOM_AUTH_LOGO",value:F})},A=()=>{c("didClickResetLogo",{logo:"auth"}),d({type:"RESET_CUSTOM_AUTH_LOGO"})};return(0,e.useImperativeHandle)(s,()=>({getValues:()=>({menuLogo:f.submit,authLogo:h.submit})})),e.createElement(N.x,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",paddingTop:6,paddingBottom:6,paddingRight:7,paddingLeft:7},e.createElement(P.Z,{variant:"delta",as:"h3"},l({id:"Settings.application.customization",defaultMessage:"Customization"})),e.createElement(P.Z,{variant:"pi",textColor:"neutral600"},l({id:"Settings.application.customization.size-details",defaultMessage:"Max dimension: {dimension}\xD7{dimension}, Max file size: {size}KB"},{dimension:Y,size:tt})),e.createElement(ot.r,{paddingTop:4,gap:4},e.createElement(J.P,{col:6,s:12},e.createElement(It,{canUpdate:o,customLogo:f.display,defaultLogo:v.default,hint:l({id:"Settings.application.customization.menu-logo.carousel-hint",defaultMessage:"Replace the logo in the main navigation"}),label:l({id:"Settings.application.customization.carousel.menu-logo.title",defaultMessage:"Menu logo"}),onChangeLogo:I,onResetLogo:x})),e.createElement(J.P,{col:6,s:12},e.createElement(It,{canUpdate:o,customLogo:h.display,defaultLogo:L.default,hint:l({id:"Settings.application.customization.auth-logo.carousel-hint",defaultMessage:"Replace the logo in the authentication pages"}),label:l({id:"Settings.application.customization.carousel.auth-logo.title",defaultMessage:"Auth logo"}),onChangeLogo:B,onResetLogo:A}))))});xt.defaultProps={canUpdate:!1,projectSettingsStored:null},xt.propTypes={canUpdate:a().bool,projectSettingsStored:a().shape({menuLogo:a().shape({url:a().string,name:a().string})})};var Ce=xt,ye=t(48344),Le=t.n(ye),Dt=o=>Le()(o,(n,s,l)=>{s&&s.url?n[l]={...s,url:(0,i.CR)(s.url)}:n[l]=s},{});const Se=async()=>{const{get:o}=(0,i.tg)(),{data:n}=await o("/admin/project-settings");return Dt(n)},Re=async o=>{const{post:n}=(0,i.tg)(),{data:s}=await n("/admin/project-settings",o,{headers:{"Content-Type":"multipart/form-data"}});return Dt(s)};var Te=o=>{const n=new FormData;return Object.entries(o).forEach(([s,l])=>{l&&l.rawFile instanceof File&&n.append(s,l.rawFile),l&&l.isReset&&n.append(s,null)}),n};const Pe=()=>null;var Oe=()=>{const o=(0,e.useRef)(),n=(0,i.lm)(),{trackUsage:s}=(0,i.rS)(),{formatMessage:l}=(0,r.Z)(),c=(0,it.useQueryClient)();(0,i.go)();const{communityEdition:v,latestStrapiReleaseTag:L,nodeVersion:f,shouldUpdateStrapi:h,strapiVersion:d}=(0,i.L7)(),{updateProjectSettings:I}=(0,g.um)(),x=(0,zt.v9)(Bt._),B=(0,y.c)(Pe,async()=>(await t.e(502).then(t.bind(t,50502))).AdminSeatInfoEE),{allowedActions:{canRead:A,canUpdate:F}}=(0,i.ss)(x.settings["project-settings"]),G=A&&F,{data:H,isLoading:De}=(0,it.useQuery)("project-settings",Se,{enabled:A}),je=(0,it.useMutation)(et=>Re(et),{async onSuccess({menuLogo:et,authLogo:at}){await c.invalidateQueries("project-settings",{refetchActive:!0}),I({menuLogo:et?.url,authLogo:at?.url})}}),Ae=et=>{if(et.preventDefault(),!F)return;const at=o.current.getValues(),ze=Te(at);je.mutate(ze,{onSuccess(){const{menuLogo:Be,authLogo:Ue}=at;Be.rawFile&&s("didChangeLogo",{logo:"menu"}),Ue.rawFile&&s("didChangeLogo",{logo:"auth"}),n({type:"success",message:l({id:"app",defaultMessage:"Saved"})})},onError(){n({type:"warning",message:{id:"notification.error",defaultMessage:"An error occurred"}})}})};return B?e.createElement(m.A,null,e.createElement(i.SL,{name:"Application"}),e.createElement(q.o,null,De?e.createElement(nt.a,null,l({id:"Settings.application.isLoading",defaultMessage:"Loading"})):e.createElement("form",{onSubmit:Ae},e.createElement(lt.T,{title:l({id:"Settings.application.title",defaultMessage:"Overview"}),subtitle:l({id:"Settings.application.description",defaultMessage:"Administration panel\u2019s global information"}),primaryAction:G&&e.createElement(z.z,{type:"submit",startIcon:e.createElement(At.Z,null)},l({id:"global.save",defaultMessage:"Save"}))}),e.createElement(_.D,null,e.createElement(W.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(W.k,{direction:"column",alignItems:"stretch",gap:4,hasRadius:!0,background:"neutral0",shadow:"tableShadow",paddingTop:6,paddingBottom:6,paddingRight:7,paddingLeft:7},e.createElement(P.Z,{variant:"delta",as:"h3"},l({id:"global.details",defaultMessage:"Details"})),e.createElement(ot.r,{gap:5,as:"dl"},e.createElement(J.P,{col:6,s:12},e.createElement(P.Z,{variant:"sigma",textColor:"neutral600",as:"dt"},l({id:"Settings.application.strapiVersion",defaultMessage:"strapi version"})),e.createElement(W.k,{gap:3,direction:"column",alignItems:"start",as:"dd"},e.createElement(P.Z,null,"v",d),h&&e.createElement(K.r,{href:`https://github.com/strapi/strapi/releases/tag/${L}`,isExternal:!0,endIcon:e.createElement(Mt.Z,null)},l({id:"Settings.application.link-upgrade",defaultMessage:"Upgrade your admin panel"})))),e.createElement(J.P,{col:6,s:12},e.createElement(P.Z,{variant:"sigma",textColor:"neutral600",as:"dt"},l({id:"Settings.application.edition-title",defaultMessage:"current plan"})),e.createElement(W.k,{gap:3,direction:"column",alignItems:"start",as:"dd"},e.createElement(P.Z,null,l({id:"Settings.application.ee-or-ce",defaultMessage:"{communityEdition, select, true {Community Edition} other {Enterprise Edition}}"},{communityEdition:v})),e.createElement(K.r,{href:"https://strapi.io/pricing-self-hosted",isExternal:!0,endIcon:e.createElement(Mt.Z,null)},l({id:"Settings.application.link-pricing",defaultMessage:"See all pricing plans"})))),e.createElement(J.P,{col:6,s:12},e.createElement(P.Z,{variant:"sigma",textColor:"neutral600",as:"dt"},l({id:"Settings.application.node-version",defaultMessage:"node version"})),e.createElement(P.Z,{as:"dd"},f)),e.createElement(B,null))),A&&H&&e.createElement(Ce,{canUpdate:F,ref:o,projectSettingsStored:H})))))):null};function jt(){const{settingId:o}=(0,p.UO)(),{settings:n}=(0,i.j1)(),{formatMessage:s}=(0,r.Z)(),{isLoading:l,menu:c}=(0,g.Te)(),v=(0,y.c)(Q,async()=>(await t.e(3483).then(t.bind(t,11009))).ROUTES_EE,{combine(d,I){return[...d,...I]},defaultValue:[]}),L=(0,e.useMemo)(()=>(0,T.WW)(v.map(({to:d,Component:I,exact:x})=>(0,T.ot)(I,d,x))),[v]),f=w(n);if(l)return e.createElement(i.dO,null);if(!o)return e.createElement(p.l_,{to:"/settings/application-infos"});const h=s({id:"global.settings",defaultMessage:"Settings"});return e.createElement(m.A,{sideNav:e.createElement(st,{menu:c})},e.createElement(E.q,{title:h}),e.createElement(p.rs,null,e.createElement(p.AW,{path:"/settings/application-infos",component:Oe,exact:!0}),L,f))}var Ie=(0,e.memo)(jt)},3704:function(U,C,t){var e=t(40314),m=t(37213);function i(E,r){return e(m(E,r),1)}U.exports=i},37213:function(U,C,t){var e=t(26460),m=t(88904),i=t(52920),E=t(77236);function r(p,g){var y=E(p)?e:i;return y(p,m(g,3))}U.exports=r},96709:function(U,C,t){"use strict";t.d(C,{A:function(){return p}});var e=t(74512),m=t(8471),i=t(72850);const E=(0,m.ZP)(i.x)`
10
+ display: grid;
11
+ grid-template-columns: ${({hasSideNav:g})=>g?"auto 1fr":"1fr"};
12
+ `,r=(0,m.ZP)(i.x)`
13
+ overflow-x: hidden;
14
+ `,p=({sideNav:g,children:y})=>(0,e.jsxs)(E,{hasSideNav:!!g,children:[g,(0,e.jsx)(r,{paddingBottom:10,children:y})]})},50428:function(U,C,t){"use strict";t.d(C,{r:function(){return $}});var e=t(74512),m=t(32735),i=t(47361),E=t(14911),r=t(8471),p=t(30350),g=t(49372),y=t(72850);const T=r.ZP.a`
15
+ display: inline-flex;
16
+ align-items: center;
17
+ text-decoration: none;
18
+ pointer-events: ${({disabled:R})=>R?"none":void 0};
19
+ color: ${({disabled:R,theme:u})=>R?u.colors.neutral600:u.colors.primary600};
20
+
21
+ svg path {
22
+ transition: fill 150ms ease-out;
23
+ fill: currentColor;
24
+ }
25
+
26
+ svg {
27
+ font-size: ${10/16}rem;
28
+ }
29
+
30
+ ${g.Z} {
31
+ transition: color 150ms ease-out;
32
+ color: currentColor;
33
+ }
34
+
35
+ &:hover {
36
+ color: ${({theme:R})=>R.colors.primary500};
37
+ }
38
+
39
+ &:active {
40
+ color: ${({theme:R})=>R.colors.primary700};
41
+ }
42
+
43
+ ${p.BF};
44
+ `,D=(0,r.ZP)(y.x)`
45
+ display: flex;
46
+ `,$=m.forwardRef(({children:R,href:u,to:j,disabled:M=!1,startIcon:a,endIcon:S,...O},Z)=>(0,e.jsxs)(T,{as:j&&!M?E.OL:"a",target:u?"_blank":void 0,rel:u?"noreferrer noopener":void 0,to:M?void 0:j,href:M?"#":u,disabled:M,ref:Z,...O,children:[a&&(0,e.jsx)(D,{as:"span","aria-hidden":!0,paddingRight:2,children:a}),(0,e.jsx)(g.Z,{children:R}),S&&!u&&(0,e.jsx)(D,{as:"span","aria-hidden":!0,paddingLeft:2,children:S}),u&&(0,e.jsx)(D,{as:"span","aria-hidden":!0,paddingLeft:2,children:(0,e.jsx)(i.Z,{})})]}))},90700:function(U,C,t){"use strict";t.d(C,{m:function(){return p}});var e=t(74512),m=t(8471),i=t(15335);const E=`${232/16}rem`,r=(0,m.ZP)(i.r)`
47
+ width: ${E};
48
+ background: ${({theme:g})=>g.colors.neutral100};
49
+ position: sticky;
50
+ top: 0;
51
+ height: 100vh;
52
+ overflow-y: auto;
53
+ border-right: 1px solid ${({theme:g})=>g.colors.neutral200};
54
+ z-index: 1;
55
+ `,p=({ariaLabel:g,...y})=>(0,e.jsx)(r,{"aria-label":g,as:"nav",...y})},78090:function(U,C,t){"use strict";t.d(C,{p:function(){return a}});var e=t(74512),m=t(32735),i=t(6792),E=t(8471),r=t(94486),p=t(74971);const g=S=>{const O=(0,m.useRef)();return(0,m.useEffect)(()=>{O.current=S}),O.current};var y=t(9026),T=t(72850),D=t(89252),$=t(61774),R=t(87933),u=t(49372),j=t(50563);const M=(0,E.ZP)(y.i)`
56
+ width: ${24/16}rem;
57
+ background-color: ${({theme:S})=>S.colors.neutral200};
58
+ `,a=({as:S="h2",label:O,searchLabel:Z="",searchable:b=!1,onChange:w=()=>{},value:k="",onClear:V=()=>{},onSubmit:X=()=>{},id:st})=>{const[Q,q]=(0,m.useState)(!1),nt=g(Q),lt=(0,p.M)(st),z=(0,m.useRef)(void 0),_=(0,m.useRef)(void 0);(0,m.useEffect)(()=>{Q&&z.current&&z.current.focus(),nt&&!Q&&_.current&&_.current.focus()},[Q,nt]);const W=()=>{q(K=>!K)},P=K=>{V(K),z.current.focus()},ot=K=>{K.relatedTarget?.id!==lt&&q(!1)},J=K=>{K.key===r.y.ESCAPE&&q(!1)};return Q?(0,e.jsxs)(T.x,{paddingLeft:4,paddingTop:5,paddingBottom:2,paddingRight:4,children:[(0,e.jsx)(D.U,{children:(0,e.jsx)($.w,{name:"searchbar",value:k,onChange:w,placeholder:"e.g: strapi-plugin-abcd",onKeyDown:J,ref:z,onBlur:ot,onClear:P,onSubmit:X,clearLabel:"Clear",size:"S",children:Z})}),(0,e.jsx)(T.x,{paddingLeft:2,paddingTop:4,children:(0,e.jsx)(M,{})})]}):(0,e.jsxs)(T.x,{paddingLeft:6,paddingTop:6,paddingBottom:2,paddingRight:4,children:[(0,e.jsxs)(R.k,{justifyContent:"space-between",alignItems:"flex-start",children:[(0,e.jsx)(u.Z,{variant:"beta",as:S,children:O}),b&&(0,e.jsx)(j.h,{ref:_,onClick:W,label:Z,icon:(0,e.jsx)(i.Z,{})})]}),(0,e.jsx)(T.x,{paddingTop:4,children:(0,e.jsx)(M,{})})]})}},66618:function(U,C,t){"use strict";t.d(C,{E:function(){return R}});var e=t(74512),m=t(32735),i=t(56243),E=t(8471),r=t(72850),p=t(49372),g=t(87933),y=t(62499);const T=(0,E.ZP)(r.x)`
59
+ display: flex;
60
+ align-items: center;
61
+ justify-content: space-between;
62
+ text-decoration: none;
63
+ color: ${({theme:u})=>u.colors.neutral800};
64
+ svg > * {
65
+ fill: ${({theme:u})=>u.colors.neutral600};
66
+ }
67
+
68
+ &.active {
69
+ ${({theme:u})=>`
70
+ background-color: ${u.colors.primary100};
71
+ border-right: 2px solid ${u.colors.primary600};
72
+ svg > * {
73
+ fill: ${u.colors.primary700};
74
+ }
75
+ ${p.Z} {
76
+ color: ${u.colors.primary700};
77
+ font-weight: 500;
78
+ }
79
+ `}
80
+ }
81
+
82
+ &:focus-visible {
83
+ outline-offset: -2px;
84
+ }
85
+ `,D=(0,E.ZP)(i.Z)`
86
+ width: ${12/16}rem;
87
+ height: ${4/16}rem;
88
+ * {
89
+ fill: ${({theme:u,$active:j})=>j?u.colors.primary600:u.colors.neutral600};
90
+ }
91
+ `,$=E.ZP.div`
92
+ svg {
93
+ height: ${12/16}rem;
94
+ width: ${12/16}rem;
95
+ }
96
+ `,R=m.forwardRef(({children:u,icon:j=null,withBullet:M=!1,as:a=y.f,isSubSectionChild:S=!1,...O},Z)=>(0,e.jsxs)(T,{as:a,icon:j,background:"neutral100",paddingLeft:S?9:7,paddingBottom:2,paddingTop:2,ref:Z,...O,children:[(0,e.jsxs)(g.k,{children:[j?(0,e.jsx)($,{children:j}):(0,e.jsx)(D,{}),(0,e.jsx)(r.x,{paddingLeft:2,children:(0,e.jsx)(p.Z,{as:"span",children:u})})]}),M&&(0,e.jsx)(r.x,{as:g.k,paddingRight:4,children:(0,e.jsx)(D,{$active:!0})})]}))},79318:function(U,C,t){"use strict";t.d(C,{D:function(){return j}});var e=t(74512),m=t(32735),i=t(8471),E=t(16899),r=t(87933),p=t(72850),g=t(49372);const y=(0,i.ZP)(r.k)`
97
+ border: none;
98
+ padding: 0;
99
+ background: transparent;
100
+ `,T=i.ZP.div`
101
+ display: flex;
102
+ align-items: center;
103
+ transform: rotateX(${({rotated:M})=>M?"0deg":"180deg"});
104
+ `,D=({collapsable:M=!1,label:a,onClick:S=()=>{},ariaExpanded:O,ariaControls:Z})=>M?(0,e.jsxs)(y,{as:"button",onClick:S,"aria-expanded":O,"aria-controls":Z,textAlign:"left",children:[(0,e.jsx)(p.x,{paddingRight:1,children:(0,e.jsx)(g.Z,{variant:"sigma",textColor:"neutral600",children:a})}),M&&(0,e.jsx)(T,{rotated:O,children:(0,e.jsx)(E.Z,{"aria-hidden":!0})})]}):(0,e.jsx)(y,{children:(0,e.jsx)(p.x,{paddingRight:1,children:(0,e.jsx)(g.Z,{variant:"sigma",textColor:"neutral600",children:a})})});var $=t(74971),R=t(6518);const u=(0,i.ZP)(p.x)`
105
+ svg {
106
+ height: ${4/16}rem;
107
+ path {
108
+ fill: ${({theme:M})=>M.colors.neutral500};
109
+ }
110
+ }
111
+ `,j=({collapsable:M=!1,label:a,badgeLabel:S,children:O,id:Z})=>{const[b,w]=(0,m.useState)(!0),k=(0,$.M)(Z);return(0,e.jsxs)(r.k,{direction:"column",alignItems:"stretch",gap:1,children:[(0,e.jsx)(u,{paddingLeft:6,paddingTop:2,paddingBottom:2,paddingRight:4,children:(0,e.jsxs)(p.x,{position:"relative",paddingRight:S?6:0,children:[(0,e.jsx)(D,{onClick:()=>{w(V=>!V)},ariaExpanded:b,ariaControls:k,collapsable:M,label:a}),S&&(0,e.jsx)(R.C,{backgroundColor:"neutral150",textColor:"neutral600",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",children:S})]})}),(!M||b)&&(0,e.jsx)("ol",{id:k,children:m.Children.map(O,(V,X)=>(0,e.jsx)("li",{children:V},X))})]})}},77013:function(U,C,t){"use strict";t.d(C,{Z:function(){return r}});var e=t(74512),m=t(32735),i=t(72850),E=t(87933);const r=({children:p,spacing:g=2,horizontal:y=!1,...T})=>(0,e.jsx)(i.x,{paddingTop:2,paddingBottom:4,children:(0,e.jsx)(E.k,{as:"ol",gap:g,direction:y?"row":"column",alignItems:y?"center":"stretch",...T,children:m.Children.map(p,(D,$)=>(0,e.jsx)("li",{children:D},$))})})},56243:function(U,C,t){"use strict";t.d(C,{Z:function(){return i}});var e=t(74512);const m=E=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"none",viewBox:"0 0 4 4",...E,children:(0,e.jsx)("rect",{width:4,height:4,fill:"#A5A5BA",rx:2})}),i=m}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[9514],{21296:function(st,v,t){t.r(v),t.d(v,{default:function(){return X}});var e=t(32735),B=t(96709),N=t(27649),z=t(82055),I=t(41415),O=t(17e3),r=t(19565),W=t(29439),h=t(66456),P=t(89793),$=t.n(P),G=t(60216),d=t.n(G),y=t(67879),H=t(82924),m=t(59898),o=t(94187),b=t(72850),U=t(15335),E=t(5803),p=t(68465),C=t(84967),D=t(52522);const Z=({sort:s="",pageSize:l=10,onChange:n})=>{const{formatMessage:i}=(0,y.Z)();return e.createElement(b.x,{background:"neutral0",hasRadius:!0,shadow:"tableShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},e.createElement(U.r,{gap:4},e.createElement(E.P,{s:12,col:6},e.createElement(p.P,{label:i({id:(0,o.Z)("config.entries.title"),defaultMessage:"Entries per page"}),hint:i({id:(0,o.Z)("config.entries.note"),defaultMessage:"Number of assets displayed by default in the Media Library"}),onChange:a=>n({target:{name:"pageSize",value:a}}),name:"pageSize",value:l},D.ay.map(a=>e.createElement(C.W,{key:a,value:a},a)))),e.createElement(E.P,{s:12,col:6},e.createElement(p.P,{label:i({id:(0,o.Z)("config.sort.title"),defaultMessage:"Default sort order"}),hint:i({id:(0,o.Z)("config.note"),defaultMessage:"Note: You can override this value in the media library."}),onChange:a=>n({target:{name:"sort",value:a}}),name:"sort",value:s,"test-sort":s,"data-testid":"sort-select"},D.Fo.map(a=>e.createElement(C.W,{"data-testid":`sort-option-${a.value}`,key:a.key,value:a.value},i({id:(0,o.Z)(a.key),defaultMessage:`${a.value}`})))))))};Z.propTypes={sort:d().string.isRequired,pageSize:d().number.isRequired,onChange:d().func.isRequired};const S=`${m.Z}/ON_CHANGE`,M=`${m.Z}/SET_LOADED`,x=({name:s,value:l})=>({type:S,keys:s,value:l}),F=()=>({type:M}),c={initialData:{},modifiedData:{}},L=s=>({...c,initialData:s,modifiedData:s});var V=t(97889),Q=t(33795),Y=t.n(Q),j=t(3040),J=t.n(j),K=(s=c,l)=>(0,V.ZP)(s,n=>{switch(l.type){case S:{J()(n,["modifiedData",...l.keys.split(".")],l.value);break}case M:{const i=L(Y()(n,["modifiedData"],{}));n.initialData=i.initialData,n.modifiedData=i.modifiedData;break}default:return n}});const T=({config:s})=>{const{trackUsage:l}=(0,r.rS)(),{formatMessage:n}=(0,y.Z)(),i=(0,r.lm)(),{mutateConfig:a}=(0,H.Z)(),{isLoading:A}=a,[k,w]=(0,e.useState)(!1),f=()=>w(g=>!g),[q,R]=(0,e.useReducer)(K,c,()=>L(s)),{initialData:_,modifiedData:u}=q,tt=g=>{g.preventDefault(),f()},et=async()=>{l("willEditMediaLibraryConfig"),await a.mutateAsync(u),f(),R(F()),i({type:"success",message:{id:"notification.form.success.fields",defaultMessage:"Changes saved"}})},at=({target:{name:g,value:nt}})=>{R(x({name:g,value:nt}))};return(0,r.go)(),e.createElement(B.A,null,e.createElement(N.o,{"aria-busy":A},e.createElement("form",{onSubmit:tt},e.createElement(z.T,{navigationAction:e.createElement(r.rU,{startIcon:e.createElement(W.Z,null),to:`/plugins/${m.Z}`,id:"go-back"},n({id:(0,o.Z)("config.back"),defaultMessage:"Back"})),primaryAction:e.createElement(I.z,{size:"S",startIcon:e.createElement(h.Z,null),disabled:$()(u,_),type:"submit"},n({id:"global.save",defaultMessage:"Save"})),subtitle:n({id:(0,o.Z)("config.subtitle"),defaultMessage:"Define the view settings of the media library."}),title:n({id:(0,o.Z)("config.title"),defaultMessage:"Configure the view - Media Library"})}),e.createElement(O.D,null,e.createElement(Z,{"data-testid":"settings",pageSize:u.pageSize||"",sort:u.sort||"",onChange:at})),e.createElement(r.QH,{bodyText:{id:(0,o.Z)("config.popUpWarning.warning.updateAllSettings"),defaultMessage:"This will modify all your settings"},iconRightButton:e.createElement(h.Z,null),isConfirmButtonLoading:A,isOpen:k,onToggleDialog:f,onConfirm:et,variantRightButton:"success-light"}))))};T.propTypes={config:d().shape({pageSize:d().number,sort:d().string}).isRequired};var X=T}}]);
@@ -0,0 +1,36 @@
1
+ (self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5538],{58917:function(G,y,t){"use strict";t.r(y),t.d(y,{default:function(){return Ds}});var e=t(32735),E=t(12301),P=t(65810),v=t(56784),m=t.n(v),h=t(93839),N=t.n(h),X=t(86349),O=t.n(X),oe=t(88423),z=t.n(oe),ge=t(74758),V=t(14911),$=t(47750),Ae="strapi-admin-language",i=t(19565),ke=t(60216),a=t.n(ke),pe=t(20108),fe=t(15062),R=t(76402),D=t(97889);const Y={menuLogo:null,authLogo:null};var ye=(o=Y,s)=>(0,D.ZP)(o,n=>{switch(s.type){case"UPDATE_PROJECT_SETTINGS":{Object.assign(n,s.values);break}default:return n}});const ie=({children:o,authLogo:s,menuLogo:n,showReleaseNotification:r,showTutorials:l})=>{const[{menuLogo:p,authLogo:g},f]=(0,e.useReducer)(ye,Y),A=(0,e.useCallback)(({menuLogo:j,authLogo:T})=>f({type:"UPDATE_PROJECT_SETTINGS",values:{menuLogo:j||n,authLogo:T||s}}),[s,n]),M=(0,e.useMemo)(()=>({logos:{menu:{custom:p,default:n},auth:{custom:g,default:s}},updateProjectSettings:A,showReleaseNotification:r,showTutorials:l}),[p,n,g,s,A,r,l]);return e.createElement(R._5.Provider,{value:M},o)};ie.propTypes={authLogo:a().string.isRequired,children:a().element.isRequired,menuLogo:a().string.isRequired,showReleaseNotification:a().bool.isRequired,showTutorials:a().bool.isRequired};var xe=ie,Oe=t(33795),Le=t.n(Oe),Ve=t(3040),je=t.n(Ve);const _e="GUIDED_TOUR_CURRENT_STEP",$e="GUIDED_TOUR_COMPLETED_STEPS",mt="GUIDED_TOUR_SKIPPED",et=JSON.parse,qe=JSON.stringify;var be={clear(){localStorage.removeItem(_e),localStorage.removeItem($e)},addCompletedStep(o){const s=et(localStorage.getItem($e))?.slice()||[];s.includes(o)||(s.push(o),localStorage.setItem($e,qe(s)))},addCurrentStep(o){localStorage.setItem(_e,qe(o))},setSkipped(o){localStorage.setItem(mt,qe(o))},get(o){return et(localStorage.getItem(o))}},gt=o=>{const s={...o},n=be.get($e),r=be.get(_e),l=be.get(mt);if(n&&n.forEach(p=>{const[g,f]=p.split(".");je()(s,["guidedTourState",g,f],!0)}),r){const[p,g]=r.split(".");je()(s,["guidedTourState",p,g],!0),be.addCompletedStep(r),be.addCurrentStep(null)}return l!==null&&je()(s,"isSkipped",l),s};const pt={currentStep:null,guidedTourState:{contentTypeBuilder:{create:!1,success:!1},contentManager:{create:!1,success:!1},apiTokens:{create:!1,success:!1}},isGuidedTourVisible:!1,isSkipped:!0};var tt=(o=pt,s)=>(0,D.ZP)(o,n=>{switch(s.type){case"SET_CURRENT_STEP":{n.currentStep=s.step;break}case"SET_STEP_STATE":{const[r,l]=s.currentStep.split(".");n.guidedTourState[r][l]=s.value;break}case"SET_SKIPPED":{n.isSkipped=s.value;break}case"SET_GUIDED_TOUR_VISIBILITY":{n.isGuidedTourVisible=s.value;break}default:return n}}),ft=(o,s)=>{const n=Object.entries(s),r=n.findIndex(([p])=>p===o);return n.slice(0,r).every(([,p])=>Object.values(p).every(Boolean))},ht=(o,s)=>{const n=o.split("."),r=n[1],l=Object.entries(s[n[0]]),p=l.findIndex(([f])=>f===r);return l.slice(0,p).every(([,f])=>f)};const st=({children:o})=>{const[{currentStep:s,guidedTourState:n,isGuidedTourVisible:r,isSkipped:l},p]=(0,e.useReducer)(tt,pt,gt),g=T=>{if(T!==null){const q=Le()(n,T),_=ht(T,n);if(q||l||!_)return null}return be.addCurrentStep(T),p({type:"SET_CURRENT_STEP",step:T})},f=T=>{p({type:"SET_GUIDED_TOUR_VISIBILITY",value:T})},A=(T,q)=>{be.addCompletedStep(T),p({type:"SET_STEP_STATE",currentStep:T,value:q})},M=T=>{const q=n[T];if(q){const _=ft(T,n),H=Object.keys(q)[0],de=q[H];if(_&&!s&&!de)return g(`${T}.${H}`)}return null},j=T=>{be.setSkipped(T),p({type:"SET_SKIPPED",value:T})};return e.createElement(i.Zc,{guidedTourState:n,currentStep:s,setCurrentStep:g,setGuidedTourVisibility:f,setSkipped:j,setStepState:A,startSection:M,isGuidedTourVisible:r,isSkipped:l},o)};st.propTypes={children:a().element.isRequired};var Et=st,nt=t(58732),Gt=t.n(nt),vt=t(78023),yt=t(33229);const Ze=({changeLocale:o,children:s,localeNames:n})=>e.createElement(yt.Z.Provider,{value:{changeLocale:o,localeNames:n}},s);Ze.propTypes={changeLocale:a().func.isRequired,children:a().element.isRequired,localeNames:a().object.isRequired};var Pt=Ze,Rt=o=>{const s=window.localStorage.getItem(Ae);return{locale:o[s]?s:"en",localeNames:o}};const at={localeNames:{en:"English"},locale:"en"};var St=(o=at,s)=>{switch(s.type){case"CHANGE_LOCALE":{const{locale:n}=s;return o.localeNames[n]?{...o,locale:n}:o}default:return o}};const At=({children:o,localeNames:s,messages:n})=>{const[{locale:r},l]=(0,e.useReducer)(St,at,()=>Rt(s));(0,e.useEffect)(()=>{window.localStorage.setItem(Ae,r),document.documentElement.setAttribute("lang",r)},[r]);const p=f=>{l({type:"CHANGE_LOCALE",locale:f})},g=Gt()(n[r],n.en);return e.createElement(vt.Z,{locale:r,defaultLocale:"en",messages:g,textComponent:"span"},e.createElement(Pt,{changeLocale:p,localeNames:s},o))};At.propTypes={children:a().element.isRequired,localeNames:a().objectOf(a().string).isRequired,messages:a().object.isRequired};var Mt=At,Lt=t(24854),De=t(67879),bt=t(2160),Be=t(8471),Dt=(0,Be.vJ)`
2
+ body {
3
+ background: ${({theme:o})=>o.colors.neutral100};
4
+ }
5
+ `;const It=({children:o})=>{const{currentTheme:s,themes:n}=(0,bt.M1)(),{locale:r}=(0,De.Z)();return e.createElement(Lt.h,{locale:r,theme:n[s]||n.light},o,e.createElement(Dt,null))};It.propTypes={children:a().element.isRequired};var kt=It;const ot="STRAPI_THEME",Ot=()=>{const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",s=localStorage.getItem(ot);return s||localStorage.setItem(ot,o),s||o},wt=({children:o,themes:s})=>{const[n,r]=(0,e.useState)(Ot()),l=(0,e.useCallback)(g=>{r(g),localStorage.setItem(ot,g)},[r]),p=(0,e.useMemo)(()=>({currentTheme:n,onChangeTheme:l,themes:s}),[n,l,s]);return e.createElement(R.Rj.Provider,{value:p},o)};wt.propTypes={children:a().node.isRequired,themes:a().shape({light:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,dark:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,custom:a().object}).isRequired};var jt=wt;const d=new pe.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),c=({authLogo:o,children:s,components:n,customFields:r,fields:l,getAdminInjectedComponents:p,getPlugin:g,localeNames:f,menu:A,menuLogo:M,messages:j,plugins:T,runHookParallel:q,runHookSeries:_,runHookWaterfall:H,settings:de,showReleaseNotification:S,showTutorials:Ke,store:ze,themes:J})=>e.createElement(Mt,{messages:j,localeNames:f},e.createElement(jt,{themes:J},e.createElement(kt,null,e.createElement(pe.QueryClientProvider,{client:d},e.createElement(fe.zt,{store:ze},e.createElement(R.ux.Provider,{value:{getAdminInjectedComponents:p}},e.createElement(xe,{authLogo:o,menuLogo:M,showReleaseNotification:S,showTutorials:Ke},e.createElement(i._Y,{getPlugin:g,menu:A,plugins:T,runHookParallel:q,runHookWaterfall:H,runHookSeries:_,settings:de},e.createElement(i.rt,{components:n,fields:l},e.createElement(i.MG,{customFields:r},e.createElement(i.m$,null,e.createElement(i.w7,null,e.createElement(Et,null,e.createElement(i.N$,null,s))))))))))))));c.propTypes={authLogo:a().oneOfType([a().string,a().any]).isRequired,children:a().element.isRequired,components:a().object.isRequired,customFields:a().object.isRequired,fields:a().object.isRequired,getAdminInjectedComponents:a().func.isRequired,getPlugin:a().func.isRequired,localeNames:a().objectOf(a().string).isRequired,menu:a().arrayOf(a().shape({to:a().string.isRequired,icon:a().func.isRequired,intlLabel:a().shape({id:a().string.isRequired,defaultMessage:a().string.isRequired}).isRequired,permissions:a().array,Component:a().func})).isRequired,menuLogo:a().oneOfType([a().string,a().any]).isRequired,messages:a().object.isRequired,plugins:a().object.isRequired,runHookParallel:a().func.isRequired,runHookWaterfall:a().func.isRequired,runHookSeries:a().func.isRequired,settings:a().object.isRequired,showReleaseNotification:a().bool.isRequired,showTutorials:a().bool.isRequired,store:a().object.isRequired,themes:a().shape({light:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,dark:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,custom:a().object}).isRequired};var u=c,C=t(59883),L=t(6680);const I=(o,s)=>{let n=L.compose;const r=[];o.forEach(p=>{r.push(p())});const l=(0,L.createStore)(U(s,{}),{},n((0,L.applyMiddleware)(...r)));return l.asyncReducers={},l.injectReducer=(p,g)=>{l.asyncReducers[p]=g,l.replaceReducer(U(s,l.asyncReducers))},l},U=(o,s)=>(0,L.combineReducers)({...o,...s});var k=I,K=t(35231),x=()=>{const o=[];return{register(s){o.push(s)},delete(s){o.splice(o.indexOf(s),1)},runWaterfall(s,n){return o.reduce((r,l)=>l(r,n),s)},async runWaterfallAsync(s,n){let r=s;for(const l of o)r=await l(r,n);return r},runSeries(...s){return o.map(n=>n(...s))},async runSeriesAsync(...s){const n=[];for(const r of o)n.push(await r(...s));return n},runParallel(...s){return Promise.all(o.map(n=>n(...s)))}}},W=t(66941),we="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAXVBMVEUAAABIRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9JRf9IRf9IRP5IRP5JRP9JRf////+Vk/+zsv++vf9mY/9taf9/fP+Jh//c3P9RTf/Ibar2AAAAFHRSTlMA/MJX+fPt48cahaff1dMaGqcahSpTPmAAAAEvSURBVFjD7dfNTsMwEATgXcf5cdKEtixtcYH3f0xEibIguba1g8Slc+58iqUedmhNaMbJzX3Xema5G2bfdv3iprE50s80g7Yqw0Oz1Z+cmOL2a38nxuy+BSfmuNv7BUhDRAMCDESBEYCDvsD6hmcMGGnCgIkcBjhaMGCmHgN66jCgoxYDWvIY4IkxgHFAkrmeU7kmfpkG4uUllXMtEE82QPs2QPs2QPs2QPs2QPsAoH0DoH0LoH0QeN3ydtnyXg38ok76MQ/gAfwf8JH8V18LQOljomBAFAyIkga4CGT7XAtEuQf4IpDri6e2BoiZA6OrAGLuxOnLQMweWXMRyPVlwQ/NAwZMNGLACJ/76ODYo5MHHl3o7EOHZ6BbjtbpG/5kfOv8P7ilbv7PX/M/rMVPqrI3XI3nd3sAAAAASUVORK5CYII=",Ye={admin:{tutorials:{links:[]}},contentManager:{editView:{informations:[],"right-links":[]},listView:{actions:[],deleteModalAdditionalInfos:[],publishModalAdditionalInfos:[],unpublishModalAdditionalInfos:[]}}},Ne=t(10728),le=t(53038);const We=({component:o,path:s,...n})=>{const{pathname:r,search:l}=(0,le.TH)();return e.createElement(le.AW,{path:s,render:p=>i.I8.getToken()!==null?e.createElement(o,{...n,...p}):e.createElement(le.l_,{to:{pathname:"/auth/login",search:r!=="/"&&`?redirectTo=${encodeURIComponent(`${r}${l}`)}`}})})};We.propTypes={component:a().any.isRequired,path:a().string.isRequired};var Ue=(0,e.memo)(We);const He={contentManager:{main:[],collectionTypesConfigurations:[{action:"plugin::content-manager.collection-types.configure-view",subject:null}],componentsConfigurations:[{action:"plugin::content-manager.components.configure-layout",subject:null}],singleTypesConfigurations:[{action:"plugin::content-manager.single-types.configure-view",subject:null}]},marketplace:{main:[{action:"admin::marketplace.read",subject:null}],read:[{action:"admin::marketplace.read",subject:null}]},settings:{roles:{main:[{action:"admin::roles.create",subject:null},{action:"admin::roles.update",subject:null},{action:"admin::roles.read",subject:null},{action:"admin::roles.delete",subject:null}],create:[{action:"admin::roles.create",subject:null}],delete:[{action:"admin::roles.delete",subject:null}],read:[{action:"admin::roles.read",subject:null}],update:[{action:"admin::roles.update",subject:null}]},users:{main:[{action:"admin::users.create",subject:null},{action:"admin::users.read",subject:null},{action:"admin::users.update",subject:null},{action:"admin::users.delete",subject:null}],create:[{action:"admin::users.create",subject:null}],delete:[{action:"admin::users.delete",subject:null}],read:[{action:"admin::users.read",subject:null}],update:[{action:"admin::users.update",subject:null}]},webhooks:{main:[{action:"admin::webhooks.create",subject:null},{action:"admin::webhooks.read",subject:null},{action:"admin::webhooks.update",subject:null},{action:"admin::webhooks.delete",subject:null}],create:[{action:"admin::webhooks.create",subject:null}],delete:[{action:"admin::webhooks.delete",subject:null}],read:[{action:"admin::webhooks.read",subject:null},{action:"admin::webhooks.update",subject:null},{action:"admin::webhooks.delete",subject:null}],update:[{action:"admin::webhooks.update",subject:null}]},"api-tokens":{main:[{action:"admin::api-tokens.access",subject:null}],create:[{action:"admin::api-tokens.create",subject:null}],delete:[{action:"admin::api-tokens.delete",subject:null}],read:[{action:"admin::api-tokens.read",subject:null}],update:[{action:"admin::api-tokens.update",subject:null}],regenerate:[{action:"admin::api-tokens.regenerate",subject:null}]},"transfer-tokens":{main:[{action:"admin::transfer.tokens.access",subject:null}],create:[{action:"admin::transfer.tokens.create",subject:null}],delete:[{action:"admin::transfer.tokens.delete",subject:null}],read:[{action:"admin::transfer.tokens.read",subject:null}],update:[{action:"admin::transfer.tokens.update",subject:null}],regenerate:[{action:"admin::transfer.tokens.regenerate",subject:null}]},"project-settings":{read:[{action:"admin::project-settings.read",subject:null}],update:[{action:"admin::project-settings.update",subject:null}]}}};var ue=t(9592),se=t(86209),ne=t(84306),ce=t(39935),Fe=t.n(ce),ns=t(9086),it=t.n(ns),as=t(51399),os=t(5074),ae=t(11060),rs=t(24436);const Ut=o=>e.createElement(ae.ZP,null,e.createElement(rs.Z,{...o}));Ut.defaultProps={onSubmit:o=>o.preventDefault()},Ut.propTypes={onSubmit:a().func};var w=t(24346),Je=t(27649),Ee=t(72850),ve=t(49372),Pe=t(87933),Ge=t(10369),lt=t(41415),xt=t(92802),Qe=t(73678);const Zt=({onSubmit:o,schema:s})=>{const{formatMessage:n}=(0,De.Z)();return e.createElement(ae.ZP,null,e.createElement(Je.o,null,e.createElement(ae.bU,null,e.createElement(xt.J9,{enableReinitialize:!0,initialValues:{email:""},onSubmit:o,validationSchema:s,validateOnChange:!1},({values:r,errors:l,handleChange:p})=>e.createElement(i.l0,{noValidate:!0},e.createElement(ae.sg,null,e.createElement(Qe.Z,null),e.createElement(Ee.x,{paddingTop:6,paddingBottom:7},e.createElement(ve.Z,{as:"h1",variant:"alpha"},n({id:"Auth.form.button.password-recovery",defaultMessage:"Password Recovery"}))),l.errorMessage&&e.createElement(ve.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},n({id:l.errorMessage,defaultMessage:"An error occurred"}))),e.createElement(Pe.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Ge.o,{error:l.email?n({id:l.email,defaultMessage:"This email is invalid."}):"",value:r.email,onChange:p,label:n({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:n({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),e.createElement(lt.z,{type:"submit",fullWidth:!0},n({id:"Auth.form.button.forgot-password",defaultMessage:"Send Email"})))))),e.createElement(Pe.k,{justifyContent:"center"},e.createElement(Ee.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},n({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};Zt.defaultProps={onSubmit:o=>o.preventDefault()},Zt.propTypes={onSubmit:a().func,schema:a().shape({type:a().string.isRequired}).isRequired};var is=Zt,ls=()=>{const{formatMessage:o}=(0,De.Z)();return e.createElement(ae.ZP,null,e.createElement(Je.o,null,e.createElement(ae.bU,null,e.createElement(ae.sg,null,e.createElement(Qe.Z,null),e.createElement(Ee.x,{paddingTop:6,paddingBottom:7},e.createElement(ve.Z,{as:"h1",variant:"alpha"},o({id:"app.containers.AuthPage.ForgotPasswordSuccess.title",defaultMessage:"Email sent"}))),e.createElement(ve.Z,null,o({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.email",defaultMessage:"It can take a few minutes to receive your password recovery link."})),e.createElement(Ee.x,{paddingTop:4},e.createElement(ve.Z,null,o({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.contact-admin",defaultMessage:"If you do not receive this link, please contact your administrator."}))))),e.createElement(Pe.k,{justifyContent:"center"},e.createElement(Ee.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},us=()=>{const{formatMessage:o}=(0,De.Z)(),n=(0,i.aM)().get("info")||o({id:"Auth.components.Oops.text",defaultMessage:"Your account has been suspended."});return e.createElement(ae.ZP,null,e.createElement(Je.o,null,e.createElement(ae.bU,null,e.createElement(ae.sg,null,e.createElement(Qe.Z,null),e.createElement(Ee.x,{paddingTop:6,paddingBottom:7},e.createElement(ve.Z,{as:"h1",variant:"alpha"},o({id:"Auth.components.Oops.title",defaultMessage:"Oops..."}))),e.createElement(ve.Z,null,n),e.createElement(Ee.x,{paddingTop:4},e.createElement(ve.Z,null,o({id:"Auth.components.Oops.text.admin",defaultMessage:"If this is a mistake, please contact your administrator."}))))),e.createElement(Pe.k,{justifyContent:"center"},e.createElement(Ee.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},cs=t(15335),zt=t(5803),ds=t(8284),ut=t(54894),ct=t(60492),dt=t(24018);const Vt=Be.ZP.a`
6
+ color: ${({theme:o})=>o.colors.primary600};
7
+ `,$t=(0,Be.ZP)(Ge.o)`
8
+ ::-ms-reveal {
9
+ display: none;
10
+ }
11
+ `,Bt=({authType:o,fieldsToDisable:s,noSignin:n,onSubmit:r,schema:l})=>{const p=(0,i.lm)(),{push:g}=(0,le.k6)(),[f,A]=(0,e.useState)(!1),[M,j]=(0,e.useState)(!1),[T,q]=(0,e.useState)(0),[_,H]=(0,e.useState)({}),{trackUsage:de}=(0,i.rS)(),{formatMessage:S}=(0,De.Z)(),Ke=(0,i.aM)(),{formatAPIError:ze}=(0,i.So)(),{get:J}=(0,i.kY)(),ee=Ke.get("registrationToken");(0,e.useEffect)(()=>{ee&&(async()=>{try{const{data:{data:b}}=await J("/admin/registration-info",{params:{registrationToken:ee}});b&&H(b)}catch(b){const F=ze(b);p({type:"warning",message:F}),g(`/auth/oops?info=${encodeURIComponent(F)}`)}})()},[ee]);function Te(me){return Object.entries(me).reduce((b,[F,te])=>{let Ce=te;return!["password","confirmPassword"].includes(F)&&typeof te=="string"&&(Ce=Ce.trim()),b[F]=Ce,b},{})}return e.createElement(ae.ZP,null,e.createElement(ae.bU,null,e.createElement(xt.J9,{enableReinitialize:!0,initialValues:{firstname:_.firstname||"",lastname:_.lastname||"",email:_.email||"",password:"",confirmPassword:"",registrationToken:ee||void 0,news:!1},onSubmit:async(me,b)=>{const F=Te(me);try{await l.validate(F,{abortEarly:!1}),T>0&&o==="register-admin"&&de("didSubmitWithErrorsFirstAdmin",{count:T.toString()}),r(ee?{userInfo:it()(F,["registrationToken"]),registrationToken:ee}:F,b)}catch(te){const Ce=(0,i.CJ)(te);q(T+1),b.setErrors(Ce)}},validateOnChange:!1},({values:me,errors:b,handleChange:F})=>e.createElement(i.l0,{noValidate:!0},e.createElement(Je.o,null,e.createElement(Pe.k,{direction:"column",alignItems:"center",gap:3},e.createElement(Qe.Z,null),e.createElement(ve.Z,{as:"h1",variant:"alpha",textAlign:"center"},S({id:"Auth.form.welcome.title",defaultMessage:"Welcome to Strapi!"})),e.createElement(ve.Z,{variant:"epsilon",textColor:"neutral600",textAlign:"center"},S({id:"Auth.form.register.subtitle",defaultMessage:"Credentials are only used to authenticate in Strapi. All saved data will be stored in your database."}))),e.createElement(Pe.k,{direction:"column",alignItems:"stretch",gap:6,marginTop:7},e.createElement(cs.r,{gap:4},e.createElement(zt.P,{col:6},e.createElement(Ge.o,{name:"firstname",required:!0,value:me.firstname,error:b.firstname?S(b.firstname):void 0,onChange:F,label:S({id:"Auth.form.firstname.label",defaultMessage:"Firstname"})})),e.createElement(zt.P,{col:6},e.createElement(Ge.o,{name:"lastname",value:me.lastname,onChange:F,label:S({id:"Auth.form.lastname.label",defaultMessage:"Lastname"})}))),e.createElement(Ge.o,{name:"email",disabled:s.includes("email"),value:me.email,onChange:F,error:b.email?S(b.email):void 0,required:!0,label:S({id:"Auth.form.email.label",defaultMessage:"Email"}),type:"email"}),e.createElement($t,{name:"password",onChange:F,value:me.password,error:b.password?S(b.password):void 0,endAction:e.createElement(dt.Z,{onClick:te=>{te.preventDefault(),A(Ce=>!Ce)},label:S(f?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},f?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),hint:S({id:"Auth.form.password.hint",defaultMessage:"Must be at least 8 characters, 1 uppercase, 1 lowercase & 1 number"}),required:!0,label:S({id:"global.password",defaultMessage:"Password"}),type:f?"text":"password"}),e.createElement($t,{name:"confirmPassword",onChange:F,value:me.confirmPassword,error:b.confirmPassword?S(b.confirmPassword):void 0,endAction:e.createElement(dt.Z,{onClick:te=>{te.preventDefault(),j(Ce=>!Ce)},label:S(M?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},M?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),required:!0,label:S({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirm Password"}),type:M?"text":"password"}),e.createElement(ds.X,{onValueChange:te=>{F({target:{value:te,name:"news"}})},value:me.news,name:"news","aria-label":"news"},S({id:"Auth.form.register.news.label",defaultMessage:"Keep me updated about new features & upcoming improvements (by doing this you accept the {terms} and the {policy})."},{terms:e.createElement(Vt,{target:"_blank",href:"https://strapi.io/terms",rel:"noreferrer"},S({id:"Auth.privacy-policy-agreement.terms",defaultMessage:"terms"})),policy:e.createElement(Vt,{target:"_blank",href:"https://strapi.io/privacy",rel:"noreferrer"},S({id:"Auth.privacy-policy-agreement.policy",defaultMessage:"policy"}))})),e.createElement(lt.z,{fullWidth:!0,size:"L",type:"submit"},S({id:"Auth.form.button.register",defaultMessage:"Let's start"})))))),!n&&e.createElement(Ee.x,{paddingTop:4},e.createElement(Pe.k,{justifyContent:"center"},e.createElement(i.rU,{label:"Auth.link.signin",to:"/auth/login"},S({id:"Auth.link.signin.account",defaultMessage:"Already have an account?"}))))))};Bt.defaultProps={fieldsToDisable:[],noSignin:!1,onSubmit:o=>o.preventDefault()},Bt.propTypes={authType:a().string.isRequired,fieldsToDisable:a().array,noSignin:a().bool,onSubmit:a().func,schema:a().shape({validate:a().func.isRequired,type:a().string.isRequired}).isRequired};var Yt=Bt;const Jt=(0,Be.ZP)(Ge.o)`
12
+ ::-ms-reveal {
13
+ display: none;
14
+ }
15
+ `,Nt=({onSubmit:o,schema:s})=>{const[n,r]=(0,e.useState)(!1),[l,p]=(0,e.useState)(!1),{formatMessage:g}=(0,De.Z)();return e.createElement(ae.ZP,null,e.createElement(Je.o,null,e.createElement(ae.bU,null,e.createElement(xt.J9,{enableReinitialize:!0,initialValues:{password:"",confirmPassword:""},onSubmit:o,validationSchema:s,validateOnChange:!1},({values:f,errors:A,handleChange:M})=>e.createElement(i.l0,{noValidate:!0},e.createElement(ae.sg,null,e.createElement(Qe.Z,null),e.createElement(Ee.x,{paddingTop:6,paddingBottom:7},e.createElement(ve.Z,{as:"h1",variant:"alpha"},g({id:"global.reset-password",defaultMessage:"Reset password"}))),A.errorMessage&&e.createElement(ve.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},g({id:A.errorMessage,defaultMessage:"An error occurred"}))),e.createElement(Pe.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Jt,{name:"password",onChange:M,value:f.password,error:A.password?g({id:A.password,defaultMessage:"This field is required."}):void 0,endAction:e.createElement(dt.Z,{onClick:j=>{j.preventDefault(),r(T=>!T)},label:g(n?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},n?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),hint:g({id:"Auth.form.password.hint",defaultMessage:"Password must contain at least 8 characters, 1 uppercase, 1 lowercase and 1 number"}),required:!0,label:g({id:"global.password",defaultMessage:"Password"}),type:n?"text":"password"}),e.createElement(Jt,{name:"confirmPassword",onChange:M,value:f.confirmPassword,error:A.confirmPassword?g({id:A.confirmPassword,defaultMessage:"This value is required."}):void 0,endAction:e.createElement(dt.Z,{onClick:j=>{j.preventDefault(),p(T=>!T)},label:g(n?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},l?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),required:!0,label:g({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirm Password"}),type:l?"text":"password"}),e.createElement(lt.z,{fullwidth:!0,type:"submit"},g({id:"global.change-password",defaultMessage:"Change password"})))))),e.createElement(Pe.k,{justifyContent:"center"},e.createElement(Ee.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},g({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};Nt.defaultProps={onSubmit:o=>o.preventDefault()},Nt.propTypes={onSubmit:a().func,schema:a().shape({type:a().string.isRequired}).isRequired};var ms=Nt;const Qt={"forgot-password":{Component:is,endPoint:"forgot-password",fieldsToDisable:[],fieldsToOmit:[],schema:w.Ry().shape({email:w.Z_().email(i.I0.email).required(i.I0.required)}),inputsPrefix:""},"forgot-password-success":{Component:ls,endPoint:"",fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},login:{endPoint:"login",fieldsToDisable:[],fieldsToOmit:["rememberMe"],schema:w.Ry().shape({email:w.Z_().email(i.I0.email).required(i.I0.required),password:w.Z_().required(i.I0.required),rememberMe:w.Xg().nullable()}),inputsPrefix:""},oops:{Component:us,endPoint:null,fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},register:{Component:Yt,endPoint:"register",fieldsToDisable:["email"],fieldsToOmit:["userInfo.confirmPassword","userInfo.news","userInfo.email"],schema:w.Ry().shape({firstname:w.Z_().trim().required(i.I0.required),lastname:w.Z_(),password:w.Z_().min(8,i.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(i.I0.required),confirmPassword:w.Z_().oneOf([w.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required),registrationToken:w.Z_().required(i.I0.required)}),inputsPrefix:"userInfo."},"register-admin":{Component:Yt,endPoint:"register-admin",noSignin:!0,fieldsToDisable:[],fieldsToOmit:["confirmPassword","news"],schema:w.Ry().shape({firstname:w.Z_().trim().required(i.I0.required),lastname:w.Z_(),password:w.Z_().min(8,i.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(i.I0.required),email:w.Z_().email(i.I0.email).strict().lowercase(i.I0.lowercase).required(i.I0.required),confirmPassword:w.Z_().oneOf([w.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required)}),inputsPrefix:""},"reset-password":{Component:ms,endPoint:"reset-password",fieldsToDisable:[],fieldsToOmit:["confirmPassword"],schema:w.Ry().shape({password:w.Z_().min(8,i.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(i.I0.required),confirmPassword:w.Z_().oneOf([w.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required)})}};var gs=o=>o;const Xt={formErrors:{},modifiedData:{},requestError:null},ps=(o,s)=>(0,D.ZP)(o,n=>{switch(s.type){case"ON_CHANGE":{je()(n.modifiedData,s.keys.split("."),s.value);break}case"RESET_PROPS":return Xt;case"SET_DATA":{n.modifiedData=s.data;break}case"SET_ERRORS":{n.formErrors=s.errors;break}case"SET_REQUEST_ERROR":{n.requestError={errorMessage:s.errorMessage,errorStatus:s.errorStatus};break}default:return n}}),Wt=({hasAdmin:o,setHasAdmin:s})=>{const{push:n,location:{search:r}}=(0,le.k6)(),{changeLocale:l}=(0,as.Z)(),{setSkipped:p}=(0,i.c1)(),{trackUsage:g}=(0,i.rS)(),{params:{authType:f}}=(0,le.$B)("/auth/:authType"),A=(0,i.aM)(),M=(0,ue.c)(Ut,async()=>(await t.e(2395).then(t.bind(t,82395))).LoginEE),j=(0,ue.c)(Qt,async()=>(await t.e(8276).then(t.bind(t,18276))).FORMS,{combine(Z,Q){return{...Z,...Q}},defaultValue:Qt}),[{formErrors:T,modifiedData:q,requestError:_},H]=(0,e.useReducer)(ps,Xt,gs),S=ne.default.CancelToken.source(),{endPoint:Ke,fieldsToDisable:ze,fieldsToOmit:J,inputsPrefix:ee,schema:Te,...me}=j?.[f]??{};(0,e.useEffect)(()=>()=>{S.cancel("Component unmounted")},[]);const{post:b}=(0,i.kY)();(0,e.useEffect)(()=>{H({type:"RESET_PROPS"})},[f]);const F=({target:{name:Z,value:Q}})=>{H({type:"ON_CHANGE",keys:Z,value:Q})},te=async(Z,{setSubmitting:Q,setErrors:Re})=>{Q(!0);const Ie=it()(Z,J),B=`/admin/${Ke}`;f==="login"&&await Is(Z,B,{setSubmitting:Q,setErrors:Re}),(f==="register"||f==="register-admin")&&await ks(Z,B,{setSubmitting:Q,setErrors:Re}),f==="forgot-password"&&await Ce(Ie,B,{setSubmitting:Q,setErrors:Re}),f==="reset-password"&&await Os(Ie,B,{setSubmitting:Q,setErrors:Re})},Ce=async(Z,Q,{setSubmitting:Re,setErrors:Ie})=>{try{await b(Q,Z,{cancelToken:S.token}),n("/auth/forgot-password-success")}catch(B){console.error(B),Ie({errorMessage:"notification.error"})}finally{Re(!1)}},Is=async(Z,Q,{setSubmitting:Re,setErrors:Ie})=>{try{const{data:{data:{token:B,user:re}}}=await b(Q,it()(Z,J),{cancelToken:S.token});re.preferedLanguage&&l(re.preferedLanguage),i.I8.setToken(B,Z.rememberMe),i.I8.setUserInfo(re,Z.rememberMe),_t()}catch(B){if(B.response){const re=Le()(B,["response","data","error","message"],"Something went wrong");if(Fe()(re).toLowerCase()==="usernotactive"){n("/auth/oops"),H({type:"RESET_PROPS"});return}Ie({errorMessage:re})}}finally{Re(!1)}},ks=async(Z,Q,{setSubmitting:Re,setErrors:Ie})=>{try{g("willCreateFirstAdmin");const{data:{data:{token:B,user:re}}}=await b(Q,it()(Z,J),{cancelToken:S.token});i.I8.setToken(B,!1),i.I8.setUserInfo(re,!1),Re(!1),s(!0);const{roles:Xe}=re;if(Xe&&Xe.find(({code:js})=>js==="strapi-super-admin")&&(be.setSkipped(!1),p(!1),g("didLaunchGuidedtour")),f==="register"&&Z.userInfo.news===!0||f==="register-admin"&&Z.news===!0){n({pathname:"/usecase",search:`?hasAdmin=${o}`});return}_t()}catch(B){if(g("didNotCreateFirstAdmin"),B.response){const{data:re}=B.response,Xe=(0,os.Z)(re);Ie({apiErrors:Xe})}}},Os=async(Z,Q,{setErrors:Re,setSubmitting:Ie})=>{try{const{data:{data:{token:B,user:re}}}=await b(Q,{...Z,resetPasswordToken:A.get("code")},{cancelToken:S.token});i.I8.setToken(B,!1),i.I8.setUserInfo(re,!1),n("/")}catch(B){if(B.response){const re=Le()(B,["response","data","message"],"Something went wrong"),Xe=Le()(B,["response","data","statusCode"],400);H({type:"SET_REQUEST_ERROR",errorMessage:re,errorStatus:Xe}),Re({errorMessage:re})}}finally{Ie(!1)}},_t=()=>{if(f==="login"){const Z=A.get("redirectTo"),Q=Z?decodeURIComponent(Z):"/";n(Q)}else n("/")};if(!j[f]||o&&f==="register-admin"||i.I8.getToken())return e.createElement(le.l_,{to:"/"});if(!o&&f!=="register-admin")return e.createElement(le.l_,{to:{pathname:"/auth/register-admin",search:r}});if(M&&(j.login.Component=M),!M)return null;const{Component:ws}=j?.[f]??{};return e.createElement(ws,{...me,authType:f,fieldsToDisable:ze,formErrors:T,inputsPrefix:ee,modifiedData:q,onChange:F,onSubmit:te,requestError:_,schema:Te})};Wt.defaultProps={hasAdmin:!1},Wt.propTypes={hasAdmin:a().bool,setHasAdmin:a().func.isRequired};var fs=Wt,hs=t(33248),Es=t(68465),vs=t(84967),ys=t(7563),Ps=t(33348);const Ts=[{intlLabel:{id:"Usecase.front-end",defaultMessage:"Front-end developer"},value:"front_end_developer"},{intlLabel:{id:"Usecase.back-end",defaultMessage:"Back-end developer"},value:"back_end_developer"},{intlLabel:{id:"Usecase.full-stack",defaultMessage:"Full-stack developer"},value:"full_stack_developer"},{intlLabel:{id:"global.content-manager",defaultMessage:"Content Manager"},value:"content_manager"},{intlLabel:{id:"Usecase.content-creator",defaultMessage:"Content Creator"},value:"content_creator"},{intlLabel:{id:"Usecase.other",defaultMessage:"Other"},value:"other"}],Rs=(0,Be.ZP)(ve.Z)`
16
+ text-align: center;
17
+ `;var Cs=()=>{const o=(0,i.lm)(),{push:s,location:n}=(0,le.k6)(),{formatMessage:r}=(0,De.Z)(),[l,p]=(0,e.useState)(),[g,f]=(0,e.useState)(""),{post:A}=(0,i.kY)(),{firstname:M,email:j}=i.I8.getUserInfo(),{hasAdmin:T}=(0,Ps.parse)(n?.search,{ignoreQueryPrefix:!0}),q=l==="other",_=async(H,de)=>{H.preventDefault();try{await A("https://analytics.strapi.io/register",{email:j,username:M,firstAdmin:Boolean(!T),persona:{role:de?void 0:l,otherRole:de?void 0:g}}),o({type:"success",message:{id:"Usecase.notification.success.project-created",defaultMessage:"Project has been successfully created"}}),s("/")}catch{}};return e.createElement(ae.ZP,null,e.createElement(Je.o,{labelledBy:"usecase-title"},e.createElement(ae.bU,null,e.createElement("form",{onSubmit:H=>_(H,!1)},e.createElement(Pe.k,{direction:"column",paddingBottom:7},e.createElement(Qe.Z,null),e.createElement(Ee.x,{paddingTop:6,paddingBottom:1,width:(0,i.Q1)(250)},e.createElement(Rs,{variant:"alpha",as:"h1",id:"usecase-title"},r({id:"Usecase.title",defaultMessage:"Tell us a bit more about yourself"})))),e.createElement(Pe.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Es.P,{id:"usecase","data-testid":"usecase",label:r({id:"Usecase.input.work-type",defaultMessage:"What type of work do you do?"}),onChange:p,value:l},Ts.map(({intlLabel:H,value:de})=>e.createElement(vs.W,{key:de,value:de},r(H)))),q&&e.createElement(Ge.o,{name:"other",label:r({id:"Usecase.other",defaultMessage:"Other"}),value:g,onChange:H=>f(H.target.value),"data-testid":"other"}),e.createElement(lt.z,{type:"submit",size:"L",fullWidth:!0,disabled:!l},r({id:"global.finish",defaultMessage:"Finish"}))))),e.createElement(Pe.k,{justifyContent:"center"},e.createElement(Ee.x,{paddingTop:4},e.createElement(ys.A,{onClick:()=>_(!0)},r({id:"Usecase.button.skip",defaultMessage:"Skip this question"}))))))},qt=t(4556);const Ss=(0,e.lazy)(()=>Promise.all([t.e(6691),t.e(801)]).then(t.bind(t,63546)));function As(){const o=(0,ue.c)(He,async()=>(await t.e(3100).then(t.bind(t,73100))).ADMIN_PERMISSIONS_EE,{combine(J,ee){return O()({},J,ee)},defaultValue:He}),s=(0,ue.c)(qt.y3,async()=>(await t.e(1386).then(t.bind(t,31386))).ROUTES_EE,{defaultValue:[]}),n=(0,i.lm)(),{updateProjectSettings:r}=(0,bt.um)(),{formatMessage:l}=(0,De.Z)(),[{isLoading:p,hasAdmin:g,uuid:f,deviceId:A},M]=(0,e.useState)({isLoading:!0,hasAdmin:!1}),j=(0,fe.I0)(),T=(0,i.L7)(),{get:q,post:_}=(0,i.kY)(),H=(0,e.useMemo)(()=>(0,se.WW)(s.map(({to:J,Component:ee,exact:Te})=>(0,se.ot)(ee,J,Te))),[s]),[de,S]=(0,e.useState)(null);(0,e.useEffect)(()=>{j({type:qt.XS,payload:o})},[o,j]),(0,e.useEffect)(()=>{const J=i.I8.getToken();J&&(async()=>{try{const{data:{data:{token:Te}}}=await _("/admin/renew-token",{token:J});i.I8.updateToken(Te)}catch{i.I8.clearAppStorage(),window.location.reload()}})()},[_]),(0,e.useEffect)(()=>{(async()=>{try{const{data:{data:{hasAdmin:ee,uuid:Te,menuLogo:me,authLogo:b}}}=await q("/admin/init");if(r({menuLogo:(0,i.CR)(me),authLogo:(0,i.CR)(b)}),Te){const{data:{data:F}}=await q("/admin/telemetry-properties",{validateStatus:te=>te<500});S(F);try{const te="didInitializeAdministration";await _("https://analytics.strapi.io/api/v2/track",{event:te,userId:"",deviceId:A,eventPropeties:{},userProperties:{environment:T.currentEnvironment},groupProperties:{...F,projectId:Te}},{headers:{"X-Strapi-Event":te}})}catch{}}M({isLoading:!1,hasAdmin:ee,uuid:Te,deviceId:A})}catch{n({type:"warning",message:{id:"app.containers.App.notification.error.init"}})}})()},[n,r]);const Ke=J=>M(ee=>({...ee,hasAdmin:J})),ze=(0,e.useMemo)(()=>({uuid:f,telemetryProperties:de,deviceId:A}),[f,de,A]);return p?e.createElement(i.dO,null):e.createElement(e.Suspense,{fallback:e.createElement(i.dO,null)},e.createElement(Ne.z,null,l({id:"skipToContent"})),e.createElement(i.L8,{value:ze},e.createElement(le.rs,null,H,e.createElement(le.AW,{path:"/auth/:authType",render:J=>e.createElement(fs,{...J,setHasAdmin:Ke,hasAdmin:g}),exact:!0}),e.createElement(Ue,{path:"/usecase",component:Cs}),e.createElement(Ue,{path:"/",component:Ss}),e.createElement(le.AW,{path:"",component:hs.default}))))}var Ms=As,Ls={ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",ca:"Catal\xE0",cs:"\u010Ce\u0161tina",de:"Deutsch",dk:"Dansk",en:"English",es:"Espa\xF1ol",eu:"Euskara",fr:"Fran\xE7ais",gu:"Gujarati",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",hu:"Magyar",id:"Indonesian",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4",ml:"Malayalam",ms:"Melayu",nl:"Nederlands",no:"Norwegian",pl:"Polski","pt-BR":"Portugu\xEAs (Brasil)",pt:"Portugu\xEAs (Portugal)",ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",sk:"Sloven\u010Dina",sv:"Swedish",th:"\u0E44\u0E17\u0E22",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",vi:"Ti\u1EBFng Vi\u1EC7t","zh-Hans":"\u4E2D\u6587 (\u7B80\u4F53)",zh:"\u4E2D\u6587 (\u7E41\u9AD4)",sa:"\u0938\u0902\u0938\u094D\u0915\u0943\u0924",hi:"\u0939\u093F\u0928\u094D\u0926\u0940"};class bs{constructor({adminConfig:s,appPlugins:n,library:r,middlewares:l,reducers:p}){this.customConfigurations=s.config,this.customBootstrapConfiguration=s.bootstrap,this.configurations={authLogo:$,head:{favicon:we},locales:["en"],menuLogo:$,notifications:{releases:!0},themes:{light:E.W,dark:P.$},translations:{},tutorials:!0},this.appPlugins=n||{},this.library=r,this.middlewares=l,this.plugins={},this.reducers=p,this.translations={},this.hooksDict={},this.admin={injectionZones:Ye},this.customFields=C.rh,this.menu=[],this.settings={global:{id:"global",intlLabel:{id:"Settings.global",defaultMessage:"Global Settings"},links:[]}}}addComponents=s=>{Array.isArray(s)?s.map(n=>this.library.components.add(n)):this.library.components.add(s)};addCorePluginMenuLink=s=>{const n=JSON.stringify(s);m()(s.to,`link.to should be defined for ${n}`),m()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),m()(["/plugins/content-type-builder","/plugins/upload"].includes(s.to),"This method is not available for your plugin"),m()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${n}`),this.menu.push(s)};addFields=s=>{Array.isArray(s)?s.map(n=>this.library.fields.add(n)):this.library.fields.add(s)};addMenuLink=s=>{const n=JSON.stringify(s);m()(s.to,`link.to should be defined for ${n}`),m()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),m()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${n}`),m()(s.Component&&typeof s.Component=="function","link.Component should be a valid React Component"),m()(s.icon&&typeof s.icon=="function","link.Icon should be a valid React Component"),this.menu.push(s)};addMiddlewares=s=>{s.forEach(n=>{this.middlewares.add(n)})};addReducers=s=>{Object.keys(s).forEach(n=>{this.reducers.add(n,s[n])})};addSettingsLink=(s,n)=>{m()(this.settings[s],"The section does not exist");const r=JSON.stringify(n);m()(n.id,`link.id should be defined for ${r}`),m()(n.intlLabel?.id&&n.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${r}`),m()(n.to,`link.to should be defined for ${r}`),m()(n.Component&&typeof n.Component=="function","link.Component should be a valid React Component"),this.settings[s].links.push(n)};addSettingsLinks=(s,n)=>{m()(this.settings[s],"The section does not exist"),m()(Array.isArray(n),"TypeError expected links to be an array"),n.forEach(r=>{this.addSettingsLink(s,r)})};async bootstrap(){Object.keys(this.appPlugins).forEach(s=>{const n=this.appPlugins[s].bootstrap;n&&n({addSettingsLink:this.addSettingsLink,addSettingsLinks:this.addSettingsLinks,getPlugin:this.getPlugin,injectContentManagerComponent:this.injectContentManagerComponent,injectAdminComponent:this.injectAdminComponent,registerHook:this.registerHook})}),N()(this.customBootstrapConfiguration)&&this.customBootstrapConfiguration({addComponents:this.addComponents,addFields:this.addFields,addMenuLink:this.addMenuLink,addReducers:this.addReducers,addSettingsLink:this.addSettingsLink,addSettingsLinks:this.addSettingsLinks,getPlugin:this.getPlugin,injectContentManagerComponent:this.injectContentManagerComponent,injectAdminComponent:this.injectAdminComponent,registerHook:this.registerHook})}bootstrapAdmin=async()=>(await this.createCustomConfigurations(),this.createHook(W.No),this.createHook(W.LK),this.createHook(W.dV),this.createHook(W.Eo),Promise.resolve());createCustomConfigurations=async()=>{if(this.customConfigurations?.locales&&(this.configurations.locales=["en",...this.customConfigurations.locales?.filter(s=>s!=="en")||[]]),this.customConfigurations?.auth?.logo&&(this.configurations.authLogo=this.customConfigurations.auth.logo),this.customConfigurations?.menu?.logo&&(this.configurations.menuLogo=this.customConfigurations.menu.logo),this.customConfigurations?.head?.favicon&&(this.configurations.head.favicon=this.customConfigurations.head.favicon),this.customConfigurations?.theme){const s=this.customConfigurations.theme.dark,n=this.customConfigurations.theme.light;!s&&!n&&(console.warn("[deprecated] In future versions, Strapi will stop supporting this theme customization syntax. The theme configuration accepts a light and a dark key to customize each theme separately. See https://docs.strapi.io/developer-docs/latest/development/admin-customization.html#theme-extension."),O()(this.configurations.themes.light,this.customConfigurations.theme)),n&&O()(this.configurations.themes.light,n),s&&O()(this.configurations.themes.dark,s)}this.customConfigurations?.notifications?.releases!==void 0&&(this.configurations.notifications.releases=this.customConfigurations.notifications.releases),this.customConfigurations?.tutorials!==void 0&&(this.configurations.tutorials=this.customConfigurations.tutorials)};createHook=s=>{this.hooksDict[s]=x()};createSettingSection=(s,n)=>{m()(s.id,"section.id should be defined"),m()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,"section.intlLabel should be defined"),m()(Array.isArray(n),"TypeError expected links to be an array"),m()(this.settings[s.id]===void 0,"A similar section already exists"),this.settings[s.id]={...s,links:[]},n.forEach(r=>{this.addSettingsLink(s.id,r)})};createStore=()=>k(this.middlewares.middlewares,this.reducers.reducers);getAdminInjectedComponents=(s,n,r)=>{try{return this.admin.injectionZones[s][n][r]||[]}catch(l){return console.error("Cannot get injected component",l),l}};getPlugin=s=>this.plugins[s];async initialize(){Object.keys(this.appPlugins).forEach(s=>{this.appPlugins[s].register(this)})}injectContentManagerComponent=(s,n,r)=>{m()(this.admin.injectionZones.contentManager[s]?.[n],`The ${s} ${n} zone is not defined in the content manager`),m()(r,"A Component must be provided"),this.admin.injectionZones.contentManager[s][n].push(r)};injectAdminComponent=(s,n,r)=>{m()(this.admin.injectionZones.admin[s]?.[n],`The ${s} ${n} zone is not defined in the admin`),m()(r,"A Component must be provided"),this.admin.injectionZones.admin[s][n].push(r)};async loadAdminTrads(){const s=this.configurations.locales.map(l=>t(48224)(`./${l}.json`).then(({default:p})=>({data:p,locale:l})).catch(()=>({data:null,locale:l})));return(await Promise.all(s)).reduce((l,p)=>(p.data&&(l[p.locale]=p.data),l),{})}async loadTrads(){const s=await this.loadAdminTrads(),n=Object.keys(this.appPlugins).map(g=>{const f=this.appPlugins[g].registerTrads;return f?f({locales:this.configurations.locales}):null}).filter(g=>g),l=(await Promise.all(n)).reduce((g,f)=>{const A=f.reduce((M,j)=>(M[j.locale]=j.data,M),{});return Object.keys(A).forEach(M=>{g[M]={...g[M],...A[M]}}),g},{}),p=this.configurations.locales.reduce((g,f)=>(g[f]={...s[f],...l[f]||{},...this.customConfigurations?.translations?.[f]},g),{});return this.configurations.translations=p,Promise.resolve()}registerHook=(s,n)=>{m()(this.hooksDict[s],`The hook ${s} is not defined. You are trying to register a hook that does not exist in the application.`),this.hooksDict[s].register(n)};registerPlugin=s=>{const n=(0,C.Sy)(s);this.plugins[n.pluginId]=n};runHookSeries=(s,n=!1)=>n?this.hooksDict[s].runSeriesAsync():this.hooksDict[s].runSeries();runHookWaterfall=(s,n,r=!1,l)=>r?this.hooksDict[s].runWaterfallAsync(n,l):this.hooksDict[s].runWaterfall(n,l);runHookParallel=s=>this.hooksDict[s].runParallel();render(){const s=this.createStore(),n=z()(Ls,this.configurations.locales||[]),{components:{components:r},fields:{fields:l}}=this.library;return e.createElement(u,{authLogo:this.configurations.authLogo,components:r,fields:l,customFields:this.customFields,localeNames:n,getAdminInjectedComponents:this.getAdminInjectedComponents,getPlugin:this.getPlugin,messages:this.configurations.translations,menu:this.menu,menuLogo:this.configurations.menuLogo,plugins:this.plugins,runHookParallel:this.runHookParallel,runHookWaterfall:(p,g,f=!1)=>this.runHookWaterfall(p,g,f,s),runHookSeries:this.runHookSeries,themes:this.configurations.themes,settings:this.settings,showTutorials:this.configurations.tutorials,showReleaseNotification:this.configurations.notifications.releases,store:s},e.createElement(e.Fragment,null,e.createElement(ge.q,{link:[{rel:"icon",type:"image/png",href:this.configurations.head.favicon}],htmlAttributes:{lang:localStorage.getItem(Ae)||"en"}}),e.createElement(V.VK,{basename:K.Z},e.createElement(Ms,{store:s}))))}}var Ds=({adminConfig:o={},appPlugins:s,library:n,middlewares:r,reducers:l})=>new bs({adminConfig:o,appPlugins:s,library:n,middlewares:r,reducers:l})},33229:function(G,y,t){"use strict";var e=t(32735);const E=(0,e.createContext)();y.Z=E},51399:function(G,y,t){"use strict";var e=t(32735),E=t(33229);const P=()=>{const{changeLocale:v,localeNames:m,messages:h}=(0,e.useContext)(E.Z);return{changeLocale:v,localeNames:m,messages:h}};y.Z=P},73678:function(G,y,t){"use strict";var e=t(32735),E=t(8471),P=t(2160);const v=E.ZP.img`
18
+ height: ${72/16}rem;
19
+ `,m=()=>{const{logos:{auth:h}}=(0,P.um)();return e.createElement(v,{src:h?.custom??h.default,"aria-hidden":!0,alt:""})};y.Z=m},76402:function(G,y,t){"use strict";t.d(y,{ux:function(){return P},_5:function(){return m},$l:function(){return N},Rj:function(){return O}});var e=t(32735),P=(0,e.createContext)({}),m=(0,e.createContext)({}),N=(0,e.createContext)({}),O=(0,e.createContext)({})},35231:function(G,y){"use strict";const t="/admin/".replace(window.location.origin,"");y.Z=t},66941:function(G,y,t){"use strict";t.d(y,{Eo:function(){return P},LK:function(){return E},No:function(){return e},dV:function(){return v}});const e="Admin/CM/pages/ListView/inject-column-in-table",E="Admin/CM/pages/App/mutate-collection-types-links",P="Admin/CM/pages/EditView/mutate-edit-view-layout",v="Admin/CM/pages/App/mutate-single-types-links"},2160:function(G,y,t){"use strict";t.d(y,{um:function(){return v},U_:function(){return ge},Dq:function(){return i},H9:function(){return je},$_:function(){return $e},rW:function(){return et},bF:function(){return ht},G4:function(){return Mt},Te:function(){return Ot},M1:function(){return jt}});var e=t(32735),E=t(76402),v=()=>(0,e.useContext)(E._5),m=t(90769),h=t(19565),N=t(97889);const X={data:{},error:null,isLoading:!0};var oe=(d,c)=>(0,N.ZP)(d,u=>{switch(c.type){case"GET_DATA":{u.isLoading=!0,u.data={},u.error=null;break}case"GET_DATA_SUCCEEDED":{u.data=c.data,u.isLoading=!1,u.error=null;break}case"GET_DATA_ERROR":{u.isLoading=!1,u.error=c.error;break}default:return u}}),ge=d=>{const[{data:c,error:u,isLoading:C},L]=(0,e.useReducer)(oe,X),{get:I}=(0,h.kY)();return(0,e.useEffect)(()=>{(async()=>{try{L({type:"GET_DATA"});const{data:{data:k}}=await I("/admin/permissions",{params:{role:d}});L({type:"GET_DATA_SUCCEEDED",data:k})}catch{}})()},[d,I]),{data:c,error:u,isLoading:C}};const V={role:{},permissions:{},isLoading:!0};var Se=(d,c)=>(0,N.ZP)(d,u=>{switch(c.type){case"GET_DATA_SUCCEEDED":{u.role=c.role,u.permissions=c.permissions,u.isLoading=!1;break}case"GET_DATA_ERROR":{u.isLoading=!1;break}case"ON_SUBMIT_SUCCEEDED":{u.role.name=c.name,u.role.description=c.description;break}default:return u}}),i=d=>{const c=(0,h.lm)(),[u,C]=(0,e.useReducer)(Se,V),{get:L}=(0,h.kY)();(0,e.useEffect)(()=>{d?(async k=>{try{const[{data:{data:K}},{data:{data:he}}]=await Promise.all([`roles/${k}`,`roles/${k}/permissions`].map(x=>L(`/admin/${x}`)));C({type:"GET_DATA_SUCCEEDED",role:K,permissions:he})}catch(K){console.error(K),C({type:"GET_DATA_ERROR"}),c({type:"warning",message:{id:"notification.error"}})}})(d):C({type:"GET_DATA_SUCCEEDED",role:{},permissions:[]})},[L,d,c]);const I=(0,e.useCallback)(U=>{C({type:"ON_SUBMIT_SUCCEEDED",...U})},[]);return{...u,onSubmitSucceeded:I}},ke=t(2287),a=t(36919),pe=t(45112),fe=t(15062),R=t(30305),D=t(99381),Y=t.n(D),ye=(d,c)=>c.map(({permissions:u})=>(0,h.qX)(d,u)),xe=async(d,c,u)=>{const C=ye(d,c),L=await Promise.all(C),I=c.filter((K,he)=>L[he]),U=I.findIndex(K=>K.to==="/settings");if(U===-1)return[];const k=Y()(I);return k[U].notificationsCount=u?1:0,k},Le=async(d,c)=>{const u=ye(d,c),C=await Promise.all(u);return c.filter((I,U)=>C[U])},je=()=>{const{allPermissions:d}=(0,h.vn)(),{shouldUpdateStrapi:c}=(0,h.L7)(),{menu:u}=(0,h.j1)(),C=(0,fe.v9)(R._),[L,I]=e.useState({generalSectionLinks:[{icon:ke.Z,intlLabel:{id:"global.plugins",defaultMessage:"Plugins"},to:"/list-plugins",permissions:C.marketplace.main},{icon:a.Z,intlLabel:{id:"global.marketplace",defaultMessage:"Marketplace"},to:"/marketplace",permissions:C.marketplace.main},{icon:pe.Z,intlLabel:{id:"global.settings",defaultMessage:"Settings"},to:"/settings",permissions:[],notificationsCount:0}],pluginsSectionLinks:[],isLoading:!0}),U=e.useRef(L.generalSectionLinks);return e.useEffect(()=>{async function k(){const K=await Le(d,u),he=await xe(d,U.current,c);I(x=>({...x,generalSectionLinks:he,pluginsSectionLinks:K,isLoading:!1}))}k()},[I,U,d,u,C,c]),L},$e=()=>(0,e.useContext)(E.$l),et=(d,c,u,C)=>{const[L,I]=(0,e.useState)(!1),U=(0,h.lm)(),{post:k}=(0,h.kY)(),{formatAPIError:K}=(0,h.So)();return{regenerateData:async()=>{try{const{data:{data:{accessKey:x}}}=await k(`${d}${c}/regenerate`);I(!1),u(x)}catch(x){I(!1),C?C(x):U({type:"warning",message:K(x)})}},isLoadingConfirmation:L}};const qe=!JSON.parse(localStorage.getItem("STRAPI_UPDATE_NOTIF")),es=()=>{const{latestStrapiReleaseTag:d,shouldUpdateStrapi:c}=useAppInfo(),u=useNotification();return useEffect(()=>{c&&qe&&u({type:"info",message:{id:"notification.version.update.message"},link:{url:`https://github.com/strapi/strapi/releases/tag/${d}`,label:{id:"global.see-more"}},blockTransition:!0,onClose:()=>localStorage.setItem("STRAPI_UPDATE_NOTIF",!0)})},[d,c,u]),null};var be=null,Ht=t(33795),gt=t.n(Ht),Ft=(d,c)=>({...d,isLoading:c});const tt={roles:[],isLoading:!0};var ft=(d,c)=>(0,N.ZP)(d,u=>{switch(c.type){case"GET_DATA":{u.isLoading=!0,u.roles=[];break}case"GET_DATA_SUCCEEDED":{u.roles=c.data,u.isLoading=!1;break}case"GET_DATA_ERROR":{u.isLoading=!1;break}default:return u}}),ht=(d=!0)=>{const c=(0,h.lm)(),[{roles:u,isLoading:C},L]=(0,e.useReducer)(ft,tt,()=>Ft(tt,d));(0,e.useEffect)(()=>{d&&I()},[d]);const I=(0,e.useCallback)(async()=>{const U=(0,h.tg)();try{L({type:"GET_DATA"});const{data:{data:k}}=await U.get("/admin/roles");L({type:"GET_DATA_SUCCEEDED",data:k})}catch(k){const K=gt()(k,["response","payload","message"],"An error occured");L({type:"GET_DATA_ERROR"}),K!=="Forbidden"&&c({type:"warning",message:K})}},[c]);return{roles:u,isLoading:C,getData:I}},st=t(9086),Et=t.n(st),nt=t(86209),vt=(d,c)=>({...d,fieldsToPick:c}),yt=t(88423),Ze=t.n(yt),Pt=t(3040),Tt=t.n(Pt),Rt=t(56236),at=t.n(Rt);const Ct={fieldsToPick:[],formErrors:{},initialData:{},isLoading:!0,modifiedData:{},showHeaderButtonLoader:!1,showHeaderLoader:!0},St=(d,c)=>(0,N.ZP)(d,u=>{switch(c.type){case"GET_DATA_SUCCEEDED":{u.isLoading=!1,u.showHeaderLoader=!1,u.initialData=Ze()(c.data,d.fieldsToPick),u.modifiedData=Ze()(c.data,d.fieldsToPick);break}case"ON_CANCEL":{u.modifiedData=d.initialData,u.formErrors={};break}case"ON_CHANGE":{c.inputType==="password"&&!c.value?at()(u.modifiedData,c.keys.split(".")):c.keys.includes("username")&&!c.value?Tt()(u.modifiedData,c.keys.split("."),null):Tt()(u.modifiedData,c.keys.split("."),c.value);break}case"ON_SUBMIT":{u.showHeaderButtonLoader=!0;break}case"ON_SUBMIT_SUCCEEDED":{u.initialData=Ze()(c.data,d.fieldsToPick),u.modifiedData=Ze()(c.data,d.fieldsToPick),u.showHeaderButtonLoader=!1;break}case"SET_ERRORS":{u.formErrors=c.errors,u.showHeaderButtonLoader=!1;break}default:return u}});var Mt=(d,c,u,C)=>{const[{formErrors:L,initialData:I,isLoading:U,modifiedData:k,showHeaderButtonLoader:K,showHeaderLoader:he},x]=(0,e.useReducer)(St,Ct,()=>vt(Ct,C)),W=(0,h.lm)(),{lockApp:we,unlockApp:rt}=(0,h.o1)(),{get:Ye,put:Ne}=(0,h.kY)();return(0,e.useEffect)(()=>{d&&(async()=>{try{const{data:{data:se}}=await Ye(d);x({type:"GET_DATA_SUCCEEDED",data:se,fieldsToPick:C})}catch(se){console.error(se.response),W({type:"warning",message:{id:"notification.error"}})}})()},[d]),[{formErrors:L,initialData:I,isLoading:U,modifiedData:k,showHeaderButtonLoader:K,showHeaderLoader:he},x,{handleCancel:()=>{x({type:"ON_CANCEL"})},handleChange:({target:{name:ue,value:se,type:ne}})=>{x({type:"ON_CHANGE",inputType:ne,keys:ue,value:se})},handleSubmit:async ue=>{ue.preventDefault();const se=await(0,nt.R6)(k,c);if(x({type:"SET_ERRORS",errors:se||{}}),!se)try{we(),x({type:"ON_SUBMIT"});const ne=Et()(k,["confirmPassword","registrationToken"]);ne.roles&&(ne.roles=ne.roles.map(Fe=>Fe.id)),ne.ssoLockedRoles&&(ne.ssoLockedRoles=[...new Set(ne.ssoLockedRoles)]);const{data:{data:ce}}=await Ne(d,ne);u(ce),x({type:"ON_SUBMIT_SUCCEEDED",data:ce}),W({type:"success",message:{id:"notification.success.saved"}})}catch(ne){const ce=ne?.response?.payload??{data:{}};ce?.data&&typeof ce.data=="string"?W({type:"warning",message:ce.data}):W({type:"warning",message:ce.message});const Fe=(0,nt.Iz)(ce);x({type:"SET_ERRORS",errors:Fe})}finally{rt()}},setField:(ue,se)=>{x({type:"ON_CHANGE",keys:ue,value:se})}}]},Lt=t(9592);const De={global:[{intlLabel:{id:"Settings.application.title",defaultMessage:"Overview"},to:"/settings/application-infos",id:"000-application-infos",permissions:[]},{intlLabel:{id:"Settings.webhooks.title",defaultMessage:"Webhooks"},to:"/settings/webhooks",id:"webhooks"},{intlLabel:{id:"Settings.apiTokens.title",defaultMessage:"API Tokens"},to:"/settings/api-tokens?sort=name:ASC",id:"api-tokens"},{intlLabel:{id:"Settings.transferTokens.title",defaultMessage:"Transfer Tokens"},to:"/settings/transfer-tokens?sort=name:ASC",id:"transfer-tokens"}],admin:[{intlLabel:{id:"global.roles",defaultMessage:"Roles"},to:"/settings/roles",id:"roles"},{intlLabel:{id:"global.users"},to:"/settings/users?pageSize=10&page=1&sort=firstname",id:"users"}]};var Be=d=>d.map(c=>{const u=c.links.map(C=>({...C,isDisplayed:!1}));return{...c,links:u}}),Kt=t(98978),Dt=t.n(Kt),kt=d=>Dt()(d,c=>c.id),Ot=()=>{const[{isLoading:d,menu:c},u]=(0,e.useState)({isLoading:!0,menu:[]}),{allPermissions:C}=(0,h.vn)(),{shouldUpdateStrapi:L}=(0,h.L7)(),{settings:I}=(0,h.j1)(),U=(0,fe.v9)(R._),{global:k,admin:K}=(0,Lt.c)(De,async()=>(await t.e(918).then(t.bind(t,50918))).LINKS_EE,{combine(W,we){return{admin:[...we.admin,...W.admin],global:[...W.global,...we.global]}},defaultValue:{admin:[],global:[]}}),he=(0,e.useCallback)(W=>{if(!W.id)throw new Error("The settings menu item must have an id attribute.");return{...W,permissions:U.settings?.[W.id]?.main}},[U.settings]);(0,e.useEffect)(()=>{const W=async()=>{const le=await(We=>Promise.all(We.reduce((Ue,He,ue)=>{const se=ne=>ne.map(async(ce,Fe)=>({hasPermission:await(0,h.qX)(C,ce.permissions),sectionIndex:ue,linkIndex:Fe}));return[...Ue,...se(He.links)]},[])))(Ye);u(We=>({...We,isLoading:!1,menu:Ye.map((Ue,He)=>({...Ue,links:Ue.links.map((ue,se)=>{const ne=le.find(ce=>ce.sectionIndex===He&&ce.linkIndex===se);return{...ue,isDisplayed:Boolean(ne.hasPermission)}})}))}))},{global:we,...rt}=I,Ye=Be([{...I.global,links:kt([...I.global.links,...k.map(he)]).map(Ne=>({...Ne,hasNotification:Ne.id==="000-application-infos"&&L}))},{id:"permissions",intlLabel:{id:"Settings.permissions",defaultMessage:"Administration Panel"},links:K.map(he)},...Object.values(rt)]);W()},[K,k,C,I,L,he]);const x=W=>({...W,links:W.links.filter(we=>we.isDisplayed)});return{isLoading:d,menu:c.map(x)}},jt=()=>(0,e.useContext)(E.Rj)},90769:function(G,y,t){"use strict";t.d(y,{G:function(){return P}});var e=t(19565),E=t(20108);function P(){const{get:v}=(0,e.kY)(),{formatAPIError:m}=(0,e.So)(),h=(0,e.lm)(),N=(0,E.useQueries)(["components","content-types"].map(V=>({queryKey:["content-manager",V],async queryFn(){const{data:{data:$}}=await v(`/content-manager/${V}`);return $},onError($){h({type:"warning",message:m($)})}}))),[X,O]=N,oe=X.isLoading||O.isLoading,z=(O?.data??[]).filter(V=>V.kind==="collectionType"&&V.isDisplayed),ge=(O?.data??[]).filter(V=>V.kind!=="collectionType"&&V.isDisplayed);return{isLoading:oe,components:X?.data??[],collectionTypes:z,singleTypes:ge}}},9592:function(G,y,t){"use strict";t.d(y,{c:function(){return v}});var e=t(32735),E=t(19565);function P(){return window.strapi.isEE}function v(m,h,{defaultValue:N=null,combine:X=(oe,z)=>z,enabled:O=!0}={}){const oe=(0,E.W6)(h),z=(0,E.W6)(X),[{data:ge},V]=e.useState({data:P()&&O?N:m});return e.useEffect(()=>{async function $(){const Se=await oe();V({data:z(m,Se)})}P()&&O&&$()},[m,oe,z,O]),ge}},11060:function(G,y,t){"use strict";t.d(y,{sg:function(){return V},bU:function(){return $},ZP:function(){return Ae}});var e=t(32735),E=t(72850),P=t(87933),v=t(60216),m=t.n(v),h=t(8471),N=t(77035),X=t(67879),O=t(51399),z=()=>{const{changeLocale:i,localeNames:ke}=(0,O.Z)(),{locale:a}=(0,X.Z)();return e.createElement(N.q4,{value:a,onChange:pe=>i(pe)},Object.entries(ke).map(([pe,fe])=>e.createElement(N.ag,{key:pe,value:pe},fe)))};const ge=(0,h.ZP)(E.x)`
20
+ margin: 0 auto;
21
+ width: 552px;
22
+ `,V=(0,h.ZP)(P.k)`
23
+ flex-direction: column;
24
+ `,$=({children:i})=>e.createElement(ge,{shadow:"tableShadow",hasRadius:!0,paddingTop:9,paddingBottom:9,paddingLeft:10,paddingRight:10,background:"neutral0",justifyContent:"center"},i);$.propTypes={children:m().node.isRequired};const Se=({children:i})=>e.createElement("div",null,e.createElement(P.k,{as:"header",justifyContent:"flex-end"},e.createElement(E.x,{paddingTop:6,paddingRight:8},e.createElement(z,null))),e.createElement(E.x,{paddingTop:2,paddingBottom:11},i));Se.propTypes={children:m().node.isRequired};var Ae=Se},30305:function(G,y,t){"use strict";t.d(y,{_:function(){return v}});var e=t(98178),E=t(69891);const P=()=>m=>m.admin_app||E.E,v=(0,e.P1)(P(),m=>m.permissions)},24018:function(G,y,t){"use strict";var e=t(63642),E=t(8471);const P=(0,E.ZP)(e.E)`
25
+ svg {
26
+ height: 1rem;
27
+ width: 1rem;
28
+ path {
29
+ fill: ${({theme:v})=>v.colors.neutral600};
30
+ }
31
+ }
32
+ `;y.Z=P},24436:function(G,y,t){"use strict";var e=t(32735),E=t(10369),P=t(27649),v=t(72850),m=t(49372),h=t(87933),N=t(8284),X=t(41415),O=t(19565),oe=t(54894),z=t(60492),ge=t(92802),V=t(60216),$=t.n(V),Se=t(67879),Ae=t(8471),i=t(73678),ke=t(11060),a=t(24018);const pe=(0,Ae.ZP)(E.o)`
33
+ ::-ms-reveal {
34
+ display: none;
35
+ }
36
+ `,fe=({onSubmit:R,schema:D,children:Y})=>{const[Me,ye]=(0,e.useState)(!1),{formatMessage:ie}=(0,Se.Z)();return e.createElement(P.o,null,e.createElement(ke.bU,null,e.createElement(ge.J9,{enableReinitialize:!0,initialValues:{email:"",password:"",rememberMe:!1},onSubmit:R,validationSchema:D,validateOnChange:!1},({values:xe,errors:Oe,handleChange:Le})=>e.createElement(O.l0,{noValidate:!0},e.createElement(ke.sg,null,e.createElement(i.Z,null),e.createElement(v.x,{paddingTop:6,paddingBottom:1},e.createElement(m.Z,{variant:"alpha",as:"h1"},ie({id:"Auth.form.welcome.title",defaultMessage:"Welcome!"}))),e.createElement(v.x,{paddingBottom:7},e.createElement(m.Z,{variant:"epsilon",textColor:"neutral600"},ie({id:"Auth.form.welcome.subtitle",defaultMessage:"Log in to your Strapi account"}))),Oe.errorMessage&&e.createElement(m.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},Oe.errorMessage)),e.createElement(h.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(E.o,{error:Oe.email?ie({id:Oe.email,defaultMessage:"This value is required."}):"",value:xe.email,onChange:Le,label:ie({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:ie({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),e.createElement(pe,{error:Oe.password?ie({id:Oe.password,defaultMessage:"This value is required."}):"",onChange:Le,value:xe.password,label:ie({id:"global.password",defaultMessage:"Password"}),name:"password",type:Me?"text":"password",endAction:e.createElement(a.Z,{onClick:Ve=>{Ve.stopPropagation(),ye(je=>!je)},label:ie(Me?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},Me?e.createElement(oe.Z,null):e.createElement(z.Z,null)),required:!0}),e.createElement(N.X,{onValueChange:Ve=>{Le({target:{value:Ve,name:"rememberMe"}})},value:xe.rememberMe,"aria-label":"rememberMe",name:"rememberMe"},ie({id:"Auth.form.rememberMe.label",defaultMessage:"Remember me"})),e.createElement(X.z,{fullWidth:!0,type:"submit"},ie({id:"Auth.form.button.login",defaultMessage:"Login"}))))),Y),e.createElement(h.k,{justifyContent:"center"},e.createElement(v.x,{paddingTop:4},e.createElement(O.rU,{to:"/auth/forgot-password"},ie({id:"Auth.link.forgot-password",defaultMessage:"Forgot your password?"})))))};fe.defaultProps={children:null,onSubmit(){}},fe.propTypes={children:$().node,onSubmit:$().func,schema:$().shape({type:$().string.isRequired}).isRequired},y.Z=fe},33248:function(G,y,t){"use strict";t.r(y);var e=t(32735),E=t(27649),P=t(82055),v=t(17e3),m=t(9695),h=t(19565),N=t(8482),X=t(25386),O=t(67879);const oe=()=>{const{formatMessage:z}=(0,O.Z)();return(0,h.go)(),e.createElement(E.o,{labelledBy:"title"},e.createElement(P.T,{id:"title",title:z({id:"content-manager.pageNotFound",defaultMessage:"Page not found"})}),e.createElement(v.D,null,e.createElement(m.x,{action:e.createElement(h.Qj,{variant:"secondary",endIcon:e.createElement(N.Z,null),to:"/"},z({id:"app.components.NotFoundPage.back",defaultMessage:"Back to homepage"})),content:z({id:"app.page.not.found",defaultMessage:"Oops! We can't seem to find the page you're looging for..."}),hasRadius:!0,icon:e.createElement(X.Z,{width:"10rem"}),shadow:"tableShadow"})))};y.default=oe},5074:function(G,y){"use strict";const t=({data:e})=>{try{return Object.keys(e).reduce((E,P)=>{const v=e[P][0];return E[P]={id:v,defaultMessage:v},E},{})}catch{return{}}};y.Z=t},86209:function(G,y,t){"use strict";t.d(y,{R6:function(){return P},ot:function(){return oe},Iz:function(){return z.Z},Pp:function(){return ge},IF:function(){return $},Qy:function(){return fe},WW:function(){return Ae}});var e=t(19565),P=async(R,D)=>{let Y=null;try{await D.validate(R,{abortEarly:!1})}catch(Me){Y=(0,e.CJ)(Me)}return Y},v=t(32735),m=t(60216),h=t.n(m),N=t(53038);const X=({loadComponent:R})=>{const[D,Y]=(0,v.useState)(null);return(0,v.useEffect)(()=>{(async()=>{try{const ye=await R();Y(()=>ye.default)}catch(ye){console.log(ye)}})()},[R]),D?v.createElement(D,null):v.createElement(e.dO,null)},O=(R,D,Y)=>v.createElement(N.AW,{render:()=>v.createElement(X,{loadComponent:R}),key:D,path:D,exact:Y||!1});X.propTypes={loadComponent:h().func.isRequired};var oe=O,z=t(5074),ge=(R,D="")=>[R,D].filter(Y=>Y).join(" "),$=R=>`/admin/${R}`,Ae=R=>R.filter((D,Y,Me)=>Me.findIndex(ye=>ye.key===D.key)===Y),i=t(98978);const ke=R=>sortBy(R,D=>D.name);var a=null;const pe={bufferToHex(R){return[...new Uint8Array(R)].map(D=>D.toString(16).padStart(2,"0")).join("")},async digestMessage(R){const D=new TextEncoder().encode(R),Y=await crypto.subtle.digest("SHA-256",D);return this.bufferToHex(Y)}};async function fe(R){if(!R)return null;try{return await pe.digestMessage(R.email)}catch{return null}}},48224:function(G,y,t){var e={"./ar.json":[38677,7958],"./ca.json":[90169,3516],"./cs.json":[43186,7519],"./de.json":[8343,6901],"./dk.json":[65668,7898],"./en.json":[10329,320],"./es.json":[45445,8367],"./eu.json":[69511,8360],"./fr.json":[8399,8006],"./gu.json":[10182,2248],"./he.json":[21757,830],"./hi.json":[43206,6332],"./hu.json":[72320,5894],"./id.json":[74221,8897],"./it.json":[90685,6817],"./ja.json":[21727,1312],"./ko.json":[30986,1377],"./ml.json":[11309,9903],"./ms.json":[75973,3025],"./nl.json":[80381,2671],"./no.json":[82446,562],"./pl.json":[84008,7846],"./pt-BR.json":[91417,9647],"./pt.json":[41830,3340],"./ru.json":[57098,123],"./sa.json":[92900,9726],"./sk.json":[52204,606],"./sv.json":[43211,9303],"./th.json":[49582,749],"./tr.json":[99154,395],"./uk.json":[2987,7403],"./vi.json":[50576,3278],"./zh-Hans.json":[35964,2553],"./zh.json":[91999,1011]};function E(P){if(!t.o(e,P))return Promise.resolve().then(function(){var h=new Error("Cannot find module '"+P+"'");throw h.code="MODULE_NOT_FOUND",h});var v=e[P],m=v[0];return t.e(v[1]).then(function(){return t.t(m,19)})}E.keys=function(){return Object.keys(e)},E.id=48224,G.exports=E},47750:function(G,y,t){"use strict";G.exports=t.p+"70674f63fc3904c20de0.svg"}}]);
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[2544],{92034:function(X,B,r){"use strict";r.r(B),r.d(B,{CreatePage:function(){return Ee},default:function(){return $e}});var e=r(32735),b=r(27649),P=r(82055),R=r(87933),Z=r(41415),O=r(17e3),S=r(72850),x=r(49372),D=r(15335),q=r(5803),a=r(10369),H=r(33475),p=r(19565),A=r(29439),F=r(14723),f=r(92802),C=r(33795),w=r.n(C),ue=r(86834),ae=r.n(ue),ie=r(67879),y=r(15062),le=r(53038),Y=r(8471),G=r(10328),_=r(78125),xe=r(7247),me=r(24346),oe=me.Ry().shape({name:me.Z_().required(p.I0.required),description:me.Z_().required(p.I0.required)});const Pe=Y.ZP.div`
1
+ (self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[2544],{15570:function(X,B,r){"use strict";r.r(B),r.d(B,{CreatePage:function(){return Ee},default:function(){return $e}});var e=r(32735),b=r(27649),P=r(82055),R=r(87933),Z=r(41415),O=r(17e3),S=r(72850),x=r(49372),D=r(15335),q=r(5803),a=r(10369),H=r(33475),p=r(19565),A=r(29439),F=r(14723),f=r(92802),C=r(33795),w=r.n(C),ue=r(86834),ae=r.n(ue),ie=r(67879),y=r(15062),le=r(53038),Y=r(8471),G=r(2160),_=r(30305),xe=r(1283),me=r(24346),oe=me.Ry().shape({name:me.Z_().required(p.I0.required),description:me.Z_().required(p.I0.required)});const Pe=Y.ZP.div`
2
2
  border: 1px solid ${({theme:T})=>T.colors.primary200};
3
3
  background: ${({theme:T})=>T.colors.primary100};
4
4
  padding: ${({theme:T})=>`${T.spaces[2]} ${T.spaces[4]}`};
@@ -6,7 +6,7 @@
6
6
  border-radius: ${({theme:T})=>T.borderRadius};
7
7
  font-size: ${12/16}rem;
8
8
  font-weight: bold;
9
- `,Ee=()=>{const T=(0,p.lm)(),{lockApp:ne,unlockApp:z}=(0,p.o1)(),{formatMessage:k}=(0,ie.Z)(),[Q,pe]=(0,e.useState)(!1),{replace:de}=(0,le.k6)(),ee=(0,e.useRef)(),{trackUsage:ce}=(0,p.rS)(),Ze=(0,le.$B)("/settings/roles/duplicate/:id"),Ae=w()(Ze,"params.id",null),{isLoading:Be,data:he}=(0,G.U_)(),{permissions:Oe,isLoading:De}=(0,G.Dq)(Ae),{post:Fe,put:je}=(0,p.kY)(),He=re=>{ne(),pe(!0),ce(Ae?"willDuplicateRole":"willCreateNewRole"),Promise.resolve(Fe("/admin/roles",re)).then(async({data:W})=>{const{permissionsToSend:U}=ee.current.getPermissions();return ce(Ae?"didDuplicateRole":"didCreateNewRole"),W.data.id&&!ae()(U)&&await je(`/admin/roles/${W.data.id}/permissions`,{permissions:U}),W}).then(W=>{pe(!1),T({type:"success",message:{id:"Settings.roles.created",defaultMessage:"created"}}),de(`/settings/roles/${W.data.id}`)}).catch(W=>{console.error(W),pe(!1),T({type:"warning",message:{id:"notification.error"}})}).finally(()=>{z()})},Le=`${k({id:"Settings.roles.form.created",defaultMessage:"Created"})} ${(0,F.Z)(new Date,"PPP")}`;return e.createElement(b.o,null,e.createElement(p.SL,{name:"Roles"}),e.createElement(f.J9,{initialValues:{name:"",description:Le},onSubmit:He,validationSchema:oe,validateOnChange:!1},({handleSubmit:re,values:W,errors:U,handleReset:ye,handleChange:Ce})=>e.createElement(p.l0,{noValidate:!0},e.createElement(e.Fragment,null,e.createElement(P.T,{primaryAction:e.createElement(R.k,{gap:2},e.createElement(Z.z,{variant:"secondary",onClick:()=>{ye(),ee.current.resetForm()},size:"L"},k({id:"app.components.Button.reset",defaultMessage:"Reset"})),e.createElement(Z.z,{onClick:re,loading:Q,size:"L"},k({id:"global.save",defaultMessage:"Save"}))),title:k({id:"Settings.roles.create.title",defaultMessage:"Create a role"}),subtitle:k({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(p.rU,{startIcon:e.createElement(A.Z,null),to:"/settings/roles"},k({id:"global.back",defaultMessage:"Back"}))}),e.createElement(O.D,null,e.createElement(R.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(S.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(R.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(R.k,{justifyContent:"space-between"},e.createElement(S.x,null,e.createElement(S.x,null,e.createElement(x.Z,{fontWeight:"bold"},k({id:"global.details",defaultMessage:"Details"}))),e.createElement(S.x,null,e.createElement(x.Z,{variant:"pi",textColor:"neutral600"},k({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(Pe,null,k({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:0}))),e.createElement(D.r,{gap:4},e.createElement(q.P,{col:6},e.createElement(a.o,{name:"name",error:U.name&&k({id:U.name}),label:k({id:"global.name",defaultMessage:"Name"}),onChange:Ce,value:W.name})),e.createElement(q.P,{col:6},e.createElement(H.g,{label:k({id:"global.description",defaultMessage:"Description"}),id:"description",error:U.description&&k({id:U.description}),onChange:Ce},W.description))))),!Be&&!De?e.createElement(S.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(xe.Z,{isFormDisabled:!1,ref:ee,permissions:Oe,layout:he})):e.createElement(S.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(p.dO,null))))))))};function $e(){const T=(0,y.v9)(_._);return e.createElement(p.O4,{permissions:T.settings.roles.create},e.createElement(Ee,null))}},7247:function(X,B,r){"use strict";r.d(B,{Z:function(){return es}});var e=r(32735),b=r(91215),P=r(90980),R=r(3653),Z=r(19565),O=r(23973),S=r.n(O),x=r(86834),D=r.n(x),q=r(60216),a=r.n(q),H=r(67879),p=r(72850),A=r(98978),F=r.n(A),f=r(8471),C=r(87933),w=r(82884),ue=r(15974),ae=r(96441),ie=r(33795),y=r.n(ie),le=r(9086),Y=r.n(le),G=r(10328),_=r(41415),xe=r(45112);const me=f.ZP.div`
9
+ `,Ee=()=>{const T=(0,p.lm)(),{lockApp:ne,unlockApp:z}=(0,p.o1)(),{formatMessage:k}=(0,ie.Z)(),[Q,pe]=(0,e.useState)(!1),{replace:de}=(0,le.k6)(),ee=(0,e.useRef)(),{trackUsage:ce}=(0,p.rS)(),Ze=(0,le.$B)("/settings/roles/duplicate/:id"),Ae=w()(Ze,"params.id",null),{isLoading:Be,data:he}=(0,G.U_)(),{permissions:Oe,isLoading:De}=(0,G.Dq)(Ae),{post:Fe,put:je}=(0,p.kY)(),He=re=>{ne(),pe(!0),ce(Ae?"willDuplicateRole":"willCreateNewRole"),Promise.resolve(Fe("/admin/roles",re)).then(async({data:W})=>{const{permissionsToSend:U}=ee.current.getPermissions();return ce(Ae?"didDuplicateRole":"didCreateNewRole"),W.data.id&&!ae()(U)&&await je(`/admin/roles/${W.data.id}/permissions`,{permissions:U}),W}).then(W=>{pe(!1),T({type:"success",message:{id:"Settings.roles.created",defaultMessage:"created"}}),de(`/settings/roles/${W.data.id}`)}).catch(W=>{console.error(W),pe(!1),T({type:"warning",message:{id:"notification.error"}})}).finally(()=>{z()})},Le=`${k({id:"Settings.roles.form.created",defaultMessage:"Created"})} ${(0,F.Z)(new Date,"PPP")}`;return e.createElement(b.o,null,e.createElement(p.SL,{name:"Roles"}),e.createElement(f.J9,{initialValues:{name:"",description:Le},onSubmit:He,validationSchema:oe,validateOnChange:!1},({handleSubmit:re,values:W,errors:U,handleReset:ye,handleChange:Ce})=>e.createElement(p.l0,{noValidate:!0},e.createElement(e.Fragment,null,e.createElement(P.T,{primaryAction:e.createElement(R.k,{gap:2},e.createElement(Z.z,{variant:"secondary",onClick:()=>{ye(),ee.current.resetForm()},size:"L"},k({id:"app.components.Button.reset",defaultMessage:"Reset"})),e.createElement(Z.z,{onClick:re,loading:Q,size:"L"},k({id:"global.save",defaultMessage:"Save"}))),title:k({id:"Settings.roles.create.title",defaultMessage:"Create a role"}),subtitle:k({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(p.rU,{startIcon:e.createElement(A.Z,null),to:"/settings/roles"},k({id:"global.back",defaultMessage:"Back"}))}),e.createElement(O.D,null,e.createElement(R.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(S.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(R.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(R.k,{justifyContent:"space-between"},e.createElement(S.x,null,e.createElement(S.x,null,e.createElement(x.Z,{fontWeight:"bold"},k({id:"global.details",defaultMessage:"Details"}))),e.createElement(S.x,null,e.createElement(x.Z,{variant:"pi",textColor:"neutral600"},k({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(Pe,null,k({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:0}))),e.createElement(D.r,{gap:4},e.createElement(q.P,{col:6},e.createElement(a.o,{name:"name",error:U.name&&k({id:U.name}),label:k({id:"global.name",defaultMessage:"Name"}),onChange:Ce,value:W.name})),e.createElement(q.P,{col:6},e.createElement(H.g,{label:k({id:"global.description",defaultMessage:"Description"}),id:"description",error:U.description&&k({id:U.description}),onChange:Ce},W.description))))),!Be&&!De?e.createElement(S.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(xe.Z,{isFormDisabled:!1,ref:ee,permissions:Oe,layout:he})):e.createElement(S.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(p.dO,null))))))))};function $e(){const T=(0,y.v9)(_._);return e.createElement(p.O4,{permissions:T.settings.roles.create},e.createElement(Ee,null))}},1283:function(X,B,r){"use strict";r.d(B,{Z:function(){return es}});var e=r(32735),b=r(91215),P=r(90980),R=r(3653),Z=r(19565),O=r(23973),S=r.n(O),x=r(86834),D=r.n(x),q=r(60216),a=r.n(q),H=r(67879),p=r(72850),A=r(98978),F=r.n(A),f=r(8471),C=r(87933),w=r(82884),ue=r(15974),ae=r(96441),ie=r(33795),y=r.n(ie),le=r(9086),Y=r.n(le),G=r(2160),_=r(41415),xe=r(45112);const me=f.ZP.div`
10
10
  position: relative;
11
11
 
12
12
  ${({hasConditions:t,disabled:n,theme:o})=>t&&`
@@ -194,7 +194,7 @@
194
194
  flex-shrink: 0;
195
195
  `,qe=({actions:t,isFormDisabled:n,kind:o})=>{const{formatMessage:s}=(0,H.Z)(),{modifiedData:i,onChangeCollectionTypeGlobalActionCheckbox:l}=(0,G.$_)(),d=(0,e.useMemo)(()=>hn(t),[t]),c=(0,e.useMemo)(()=>vn(d,i[o]),[i,d,o]);return e.createElement(p.x,{paddingBottom:4,paddingTop:6,style:{paddingLeft:ye}},e.createElement(C.k,{gap:0},d.map(({label:m,actionId:u})=>e.createElement(En,{direction:"column",alignItems:"center",justifyContent:"center",key:u,gap:3},e.createElement(T.Z,{variant:"sigma",textColor:"neutral500"},s({id:`Settings.roles.form.permissions.${m.toLowerCase()}`,defaultMessage:m})),e.createElement(w.C,{disabled:n,onValueChange:g=>{l(o,u,g)},name:u,"aria-label":s({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:s({id:`Settings.roles.form.permissions.${m.toLowerCase()}`,defaultMessage:m})}),value:y()(c,[u,"hasAllActionsSelected"],!1),indeterminate:y()(c,[u,"hasSomeActionsSelected"],!1)})))))};qe.defaultProps={actions:[]},qe.propTypes={actions:a().arrayOf(a().shape({label:a().string.isRequired,actionId:a().string.isRequired,subjects:a().array.isRequired})),isFormDisabled:a().bool.isRequired,kind:a().string.isRequired};var bn=(0,e.memo)(qe);const xn=(0,f.ZP)(p.x)`
196
196
  overflow-x: auto;
197
- `,vt=({isFormDisabled:t,kind:n,layout:{actions:o,subjects:s}})=>{const i=F()([...s],"label");return e.createElement(xn,{background:"neutral0"},e.createElement(bn,{actions:o,kind:n,isFormDisabled:t}),e.createElement(fn,{actions:o,isFormDisabled:t,pathToData:n,subjects:i}))};vt.propTypes={isFormDisabled:a().bool.isRequired,kind:a().string.isRequired,layout:a().shape({actions:a().array,subjects:a().arrayOf(a().shape({uid:a().string.isRequired,label:a().string.isRequired,properties:a().array.isRequired}))}).isRequired};var Et=(0,e.memo)(vt),Rn=r(66694);const bt=({children:t,value:n})=>e.createElement(Rn.$l.Provider,{value:n},t);bt.propTypes={children:a().node.isRequired,value:a().exact({availableConditions:a().array.isRequired,modifiedData:a().object.isRequired,onChangeCollectionTypeLeftActionRowCheckbox:a().func.isRequired,onChangeConditions:a().func.isRequired,onChangeSimpleCheckbox:a().func.isRequired,onChangeParentCheckbox:a().func.isRequired,onChangeCollectionTypeGlobalActionCheckbox:a().func.isRequired}).isRequired};var Pn=bt,An=r(83828),Tn=r(61762),Sn=r(89966),xt=r(8284),Mn=r(15335),$n=r(5803),On=(t,n,o)=>t.map(s=>{const i=[...o,s.action,"properties","enabled"],l=y()(n,i,!1),d=y()(n,[...o,s.action,"conditions"],{}),c=ke(d).some(m=>m);return{...s,isDisplayed:l,checkboxName:i.join(".."),hasSomeActionsSelected:l,value:l,hasConditions:c,label:s.displayName,actionId:s.action,pathToConditionsObject:[...o,s.action]}}),Dn=t=>{const n=Object.entries(t).reduce((s,i)=>{const[l,{conditions:d}]=i;return s[l]=d,s},{});return ke(n).some(s=>s)};const jn=f.ZP.div`
197
+ `,vt=({isFormDisabled:t,kind:n,layout:{actions:o,subjects:s}})=>{const i=F()([...s],"label");return e.createElement(xn,{background:"neutral0"},e.createElement(bn,{actions:o,kind:n,isFormDisabled:t}),e.createElement(fn,{actions:o,isFormDisabled:t,pathToData:n,subjects:i}))};vt.propTypes={isFormDisabled:a().bool.isRequired,kind:a().string.isRequired,layout:a().shape({actions:a().array,subjects:a().arrayOf(a().shape({uid:a().string.isRequired,label:a().string.isRequired,properties:a().array.isRequired}))}).isRequired};var Et=(0,e.memo)(vt),Rn=r(76402);const bt=({children:t,value:n})=>e.createElement(Rn.$l.Provider,{value:n},t);bt.propTypes={children:a().node.isRequired,value:a().exact({availableConditions:a().array.isRequired,modifiedData:a().object.isRequired,onChangeCollectionTypeLeftActionRowCheckbox:a().func.isRequired,onChangeConditions:a().func.isRequired,onChangeSimpleCheckbox:a().func.isRequired,onChangeParentCheckbox:a().func.isRequired,onChangeCollectionTypeGlobalActionCheckbox:a().func.isRequired}).isRequired};var Pn=bt,An=r(83828),Tn=r(61762),Sn=r(89966),xt=r(8284),Mn=r(15335),$n=r(5803),On=(t,n,o)=>t.map(s=>{const i=[...o,s.action,"properties","enabled"],l=y()(n,i,!1),d=y()(n,[...o,s.action,"conditions"],{}),c=ke(d).some(m=>m);return{...s,isDisplayed:l,checkboxName:i.join(".."),hasSomeActionsSelected:l,value:l,hasConditions:c,label:s.displayName,actionId:s.action,pathToConditionsObject:[...o,s.action]}}),Dn=t=>{const n=Object.entries(t).reduce((s,i)=>{const[l,{conditions:d}]=i;return s[l]=d,s},{});return ke(n).some(s=>s)};const jn=f.ZP.div`
198
198
  flex: 1;
199
199
  align-self: center;
200
200
  border-top: 1px solid ${({theme:t})=>t.colors.neutral150};
@@ -213,7 +213,7 @@
213
213
  background: ${n?o.colors.neutral100:o.colors.primary600};
214
214
  }
215
215
  `}
216
- `,Rt=({categoryName:t,isFormDisabled:n,subCategoryName:o,actions:s,pathToData:i})=>{const[l,d]=(0,e.useState)(!1),{modifiedData:c,onChangeParentCheckbox:m,onChangeSimpleCheckbox:u}=(0,G.$_)(),{formatMessage:g}=(0,H.Z)(),v=y()(c,i,{}),M=(0,e.useMemo)(()=>Object.keys(v).reduce((I,te)=>(I[te]=ze(v[te]),I),{}),[v]),{hasAllActionsSelected:N,hasSomeActionsSelected:j}=Te(M),E=()=>{d(I=>!I)},h=()=>{d(!1)},L=On(s,c,i),$=Dn(y()(c,[...i],{}));return e.createElement(e.Fragment,null,e.createElement(p.x,null,e.createElement(C.k,{justifyContent:"space-between",alignItems:"center"},e.createElement(p.x,{paddingRight:4},e.createElement(T.Z,{variant:"sigma",textColor:"neutral600"},o)),e.createElement(jn,null),e.createElement(p.x,{paddingLeft:4},e.createElement(xt.X,{name:i.join(".."),disabled:n,onValueChange:I=>{m({target:{name:i.join(".."),value:I}})},indeterminate:j,value:N},g({id:"app.utils.select-all",defaultMessage:"Select all"})))),e.createElement(C.k,{paddingTop:6,paddingBottom:6},e.createElement(Mn.r,{gap:2,style:{flex:1}},L.map(({checkboxName:I,value:te,action:K,displayName:J,hasConditions:V})=>e.createElement($n.P,{col:3,key:K},e.createElement(Ln,{disabled:n,hasConditions:V},e.createElement(xt.X,{name:I,disabled:n,onValueChange:fe=>{u({target:{name:I,value:fe}})},value:te},J))))),e.createElement(oe,{hasConditions:$,onClick:E}))),l&&e.createElement(W,{headerBreadCrumbs:[t,o],actions:L,isFormDisabled:n,onClosed:h,onToggle:E}))};Rt.propTypes={actions:a().array.isRequired,categoryName:a().string.isRequired,isFormDisabled:a().bool.isRequired,subCategoryName:a().string.isRequired,pathToData:a().array.isRequired};var kn=Rt;const _e=({childrenForm:t,kind:n,name:o,isOpen:s,isFormDisabled:i,isWhite:l,onOpenCategory:d,pathToData:c})=>{const{formatMessage:m}=(0,H.Z)(),u=()=>{d(o)},g=(0,e.useMemo)(()=>o.split("::").pop(),[o]);return e.createElement(An.U,{expanded:s,onToggle:u,id:`accordion-${o}`,variant:l?"primary":"secondary"},e.createElement(Tn.B,{title:ce()(g),description:`${m({id:"Settings.permissions.category"},{category:g})} ${n==="plugins"?"plugin":n}`}),e.createElement(Sn.v,null,e.createElement(p.x,{padding:6},t.map(({actions:v,subCategoryName:M,subCategoryId:N})=>e.createElement(kn,{key:M,actions:v,categoryName:g,isFormDisabled:i,subCategoryName:M,pathToData:[...c,N]})))))};_e.defaultProps={},_e.propTypes={childrenForm:a().array.isRequired,isOpen:a().bool.isRequired,isFormDisabled:a().bool.isRequired,isWhite:a().bool.isRequired,kind:a().string.isRequired,name:a().string.isRequired,onOpenCategory:a().func.isRequired,pathToData:a().array.isRequired};var In=_e;const Pt=({isFormDisabled:t,kind:n,layout:o})=>{const[s,i]=(0,e.useState)(null),l=d=>{i(d===s?null:d)};return e.createElement(p.x,{padding:6,background:"neutral0"},o.map(({category:d,categoryId:c,childrenForm:m},u)=>e.createElement(In,{key:d,childrenForm:m,kind:n,isFormDisabled:t,isOpen:s===d,isWhite:u%2===1,name:d,onOpenCategory:l,pathToData:[n,c]})))};Pt.propTypes={isFormDisabled:a().bool.isRequired,kind:a().string.isRequired,layout:a().arrayOf(a().shape({category:a().string.isRequired,categoryId:a().string.isRequired,childrenForm:a().arrayOf(a().shape({actions:a().array.isRequired})).isRequired}).isRequired).isRequired};var At=Pt,Zn=r(86349),Bn=r.n(Zn),Fn=r(3040),ge=r.n(Fn),Tt=(t,n,o)=>t.find(s=>s.action===n&&s.subject===o);const St=(t,n=[])=>t.reduce((o,s)=>(o[s.id]=n.indexOf(s.id)!==-1,o),{}),Mt=({children:t},n,o="")=>t.reduce((s,i)=>{if(i.children)return{...s,[i.value]:Mt(i,n,`${o}${i.value}.`)};const l=n.indexOf(`${o}${i.value}`)!==-1;return s[i.value]=l,s},{}),Nn=(t,n,o)=>t.reduce((s,i)=>{const l=n.properties.find(({value:d})=>d===i);if(l){const d=y()(o,["properties",l.value],[]),c=Mt(l,d);s.properties[i]=c}return s},{properties:{}}),Wn=(t,n)=>n.reduce((o,s)=>{const i=t.find(({uid:l})=>l===s)||null;return i&&(o[s]=i),o},{});var $t=({subjects:t},n,o,s=[])=>n.reduce((i,l)=>{const d=l.subjects,c=Wn(t,d);if(D()(c))return i;const m=Object.keys(c).reduce((u,g)=>{const{actionId:v,applyToProperties:M}=l,E=c[g].properties.map(({value:I})=>I).every(I=>(M||[]).indexOf(I)===-1),h=Tt(s,v,g),L=St(o,y()(h,"conditions",[]));if(D()(M)||E)return ge()(u,[g,v],{properties:{enabled:h!==void 0},conditions:L}),u;const $=Nn(M,c[g],h);return ge()(u,[g,v],{...$,conditions:L}),u},{});return Bn()(i,m)},{});const Vn=(t,n,o)=>t.reduce((s,i)=>{const l=Tt(o,i.action,null);return s[i.action]={properties:{enabled:l!==void 0},conditions:St(n,l?.conditions??[])},s},{}),Hn=(t,n,o)=>t.reduce((s,i)=>(s[i.subCategoryId]=Vn(i.actions,n,o),s),{});var Ot=(t,n,o=[])=>t.reduce((s,{categoryId:i,childrenForm:l})=>{const d=Hn(l,n,o);return s[i]=d,s},{});const Dt=t=>t.split(" ").join("-");var jt=(t,n)=>Object.entries(de()(t,n)).map(([o,s])=>({category:o,categoryId:Dt(o),childrenForm:Object.entries(de()(s,"subCategory")).map(([i,l])=>({subCategoryName:i,subCategoryId:Dt(i),actions:l}))})),Gn=(t,n)=>{const{conditions:o,sections:{collectionTypes:s,singleTypes:i,plugins:l,settings:d}}=t,c={collectionTypes:s,singleTypes:i,plugins:jt(l,"plugin"),settings:jt(d,"category")},m={collectionTypes:$t(s,s.actions||[],o,n),singleTypes:$t(i,i.actions||[],o,n),plugins:Ot(c.plugins,o,n),settings:Ot(c.settings,o,n)};return{initialData:m,modifiedData:m,layouts:c}},Un=r(99381),et=r.n(Un);const Lt=t=>Object.keys(t).reduce((n,o)=>{const s=t[o];if(be()(s)&&!S()(s,"conditions"))return{...n,[o]:Lt(s)};if(be()(s)&&S()(s,"conditions")&&!ke(Y()(s,"conditions")).some(l=>l)){const l=Object.keys(s.conditions).reduce((d,c)=>(d[c]=!1,d),{});return{...n,[o]:{...s,conditions:l}}}return n[o]=s,n},{});var tt=Lt;const kt=(t,n,o=!1)=>Object.keys(t).reduce((s,i)=>{const l=t[i];return i==="conditions"&&!o?(s[i]=l,s):be()(l)?{...s,[i]:kt(l,n,i==="fields")}:(s[i]=n,s)},{});var Ge=kt;const Kn={initialData:{},modifiedData:{},layouts:{}};var zn=(t,n)=>(0,Q.ZP)(t,o=>{switch(n.type){case"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX":{const{collectionTypeKind:s,actionId:i,value:l}=n,d=["modifiedData",s];Object.keys(y()(t,d)).forEach(c=>{const m=y()(t,[...d,c,i],void 0);if(m){let u=Ge(m,l);if(!l&&u.conditions){const g=Ge(u.conditions,!1);u={...u,conditions:g}}ge()(o,[...d,c,i],u)}});break}case"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX":{const{pathToCollectionType:s,propertyName:i,rowName:l,value:d}=n;let c=et()(t.modifiedData);const m=s.split(".."),u=y()(c,m,{});Object.keys(u).forEach(g=>{if(S()(u[g],`properties.${i}`)){const v=y()(u,[g,"properties",i,l]),M=[...m,g,"properties",i,l];if(!be()(v))ge()(c,M,d);else{const N=Ge(v,d);ge()(c,M,N)}}}),d||(c=tt(c)),ge()(o,"modifiedData",c);break}case"ON_CHANGE_CONDITIONS":{Object.entries(n.conditions).forEach(s=>{const[i,l]=s;ge()(o,["modifiedData",...i.split(".."),"conditions"],l)});break}case"ON_CHANGE_SIMPLE_CHECKBOX":{let s=et()(t.modifiedData);ge()(s,[...n.keys.split("..")],n.value),n.value||(s=tt(s)),ge()(o,"modifiedData",s);break}case"ON_CHANGE_TOGGLE_PARENT_CHECKBOX":{const{keys:s,value:i}=n,l=[...s.split("..")];let d=et()(t.modifiedData);const c=y()(d,l,{}),m=Ge(c,i);ge()(d,l,m),i||(d=tt(d)),ge()(o,["modifiedData"],d);break}case"RESET_FORM":{o.modifiedData=t.initialData;break}case"SET_FORM_AFTER_SUBMIT":{o.initialData=t.modifiedData;break}default:return o}});const nt=t=>Object.entries(t).filter(([,n])=>n).map(([n])=>n),Xn=t=>{const[n,{conditions:o}]=t;return{action:n,subject:null,conditions:nt(o),properties:{}}},wn=t=>Object.values(t).reduce((n,o)=>{const s=Object.entries(o).reduce((i,l)=>{const[,{properties:{enabled:d}}]=l;if(!d)return i;const c=Xn(l);return i.push(c),i},[]);return[...n,...s]},[]);var It=t=>Object.values(t).reduce((n,o)=>{const s=wn(o);return[...n,...s]},[]);const Zt=(t,n="")=>Object.entries(t).reduce((o,s)=>{const[i,l]=s;return be()(l)?[...o,...Zt(l,`${n}${i}.`)]:(l&&!be()(l)&&o.push(`${n}${i}`),o)},[]),Yn=(t,n,{conditions:o,properties:s})=>Object.entries(s).reduce((i,l)=>{const[d,c]=l;return i.properties[d]=Zt(c),i},{action:t,subject:n,conditions:nt(o),properties:{}}),Jn=(t,n,{conditions:o})=>({action:t,subject:n,properties:{},conditions:nt(o)}),Qn=(t,n)=>Object.entries(n).reduce((s,i)=>{const[l,d]=i;if(!ke(d).some(u=>u))return s;if(!d?.properties?.enabled){const u=Yn(l,t,d);return[...s,u]}if(!d.properties.enabled)return s;const m=Jn(l,t,d);return s.push(m),s},[]);var Bt=t=>Object.entries(t).reduce((o,s)=>{const[i,l]=s,d=Qn(i,l);return[...o,...d]},[]),qn=t=>{const n=It(t.plugins),o=It(t.settings),s=Bt(t.collectionTypes),i=Bt(t.singleTypes);return[...n,...o,...s,...i]},_n=[{labelId:"app.components.LeftMenuLinkContainer.collectionTypes",defaultMessage:"Collection Types",id:"collectionTypes"},{labelId:"app.components.LeftMenuLinkContainer.singleTypes",id:"singleTypes",defaultMessage:"Single Types"},{labelId:"app.components.LeftMenuLinkContainer.plugins",defaultMessage:"Plugins",id:"plugins"},{labelId:"app.components.LeftMenuLinkContainer.settings",defaultMessage:"Settings",id:"settings"}];const st=(0,e.forwardRef)(({layout:t,isFormDisabled:n,permissions:o},s)=>{const[{initialData:i,layouts:l,modifiedData:d},c]=(0,e.useReducer)(zn,Kn,()=>Gn(t,o)),{formatMessage:m}=(0,H.Z)();(0,e.useImperativeHandle)(s,()=>({getPermissions(){const j=(0,Z.e5)(i.collectionTypes,d.collectionTypes),E=(0,Z.e5)(i.singleTypes,d.singleTypes),h={...j,...E};let L;return D()(h)?L=!1:L=Object.values(h).some($=>Object.values($).some(I=>S()(I,"conditions"))),{permissionsToSend:qn(d),didUpdateConditions:L}},resetForm(){c({type:"RESET_FORM"})},setFormAfterSubmit(){c({type:"SET_FORM_AFTER_SUBMIT"})}}));const u=(j,E,h,L)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX",pathToCollectionType:j,propertyName:E,rowName:h,value:L})},g=(j,E,h)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX",collectionTypeKind:j,actionId:E,value:h})},v=j=>{c({type:"ON_CHANGE_CONDITIONS",conditions:j})},M=(0,e.useCallback)(({target:{name:j,value:E}})=>{c({type:"ON_CHANGE_SIMPLE_CHECKBOX",keys:j,value:E})},[]),N=(0,e.useCallback)(({target:{name:j,value:E}})=>{c({type:"ON_CHANGE_TOGGLE_PARENT_CHECKBOX",keys:j,value:E})},[]);return e.createElement(Pn,{value:{availableConditions:t.conditions,modifiedData:d,onChangeConditions:v,onChangeSimpleCheckbox:M,onChangeParentCheckbox:N,onChangeCollectionTypeLeftActionRowCheckbox:u,onChangeCollectionTypeGlobalActionCheckbox:g}},e.createElement(b.v,{id:"tabs",label:m({id:"Settings.permissions.users.tabs.label",defaultMessage:"Tabs Permissions"})},e.createElement(P.m,null,_n.map(j=>e.createElement(P.O,{key:j.id},m({id:j.labelId,defaultMessage:j.defaultMessage})))),e.createElement(R.n,{style:{position:"relative"}},e.createElement(R.x,null,e.createElement(Et,{layout:l.collectionTypes,kind:"collectionTypes",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(Et,{layout:l.singleTypes,kind:"singleTypes",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(At,{layout:l.plugins,kind:"plugins",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(At,{layout:l.settings,kind:"settings",isFormDisabled:n})))))});st.defaultProps={permissions:[],layout:{conditions:[],sections:{collectionTypes:{},singleTypes:{actions:[]},settings:[],plugins:[]}}},st.propTypes={layout:a().object,isFormDisabled:a().bool.isRequired,permissions:a().array};var es=(0,e.memo)(st)},33778:function(X,B,r){"use strict";r.r(B),r.d(B,{default:function(){return T}});var e=r(32735),b=r(19565),P=r(15062),R=r(53038),Z=r(78125),O=r(27649),S=r(82055),x=r(87933),D=r(41415),q=r(17e3),a=r(72850),H=r(29439),p=r(92802),A=r(33795),F=r.n(A),f=r(67879),C=r(10328),w=r(7247),ue=r(49372),ae=r(15335),ie=r(5803),y=r(10369),le=r(33475),Y=r(60216),G=r.n(Y);const _=({disabled:ne,role:z,values:k,errors:Q,onChange:pe,onBlur:de})=>{const{formatMessage:ee}=(0,f.Z)();return e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(x.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(x.k,{justifyContent:"space-between"},e.createElement(a.x,null,e.createElement(a.x,null,e.createElement(ue.Z,{fontWeight:"bold"},z?z.name:ee({id:"global.details",defaultMessage:"Details"}))),e.createElement(a.x,null,e.createElement(ue.Z,{textColor:"neutral500",variant:"pi"},z?z.description:ee({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(D.z,{disabled:!0,variant:"secondary"},ee({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:z.usersCount}))),e.createElement(ae.r,{gap:4},e.createElement(ie.P,{col:6},e.createElement(y.o,{disabled:ne,name:"name",error:Q.name&&ee({id:Q.name}),label:ee({id:"global.name",defaultMessage:"Name"}),onChange:pe,onBlur:de,value:k.name||""})),e.createElement(ie.P,{col:6},e.createElement(le.g,{disabled:ne,label:ee({id:"global.description",defaultMessage:"Description"}),id:"description",error:Q.name&&ee({id:Q.name}),onChange:pe,onBlur:de},k.description||"")))))};_.defaultProps={disabled:!1,role:null,values:{name:"",description:""}},_.propTypes={disabled:G().bool,errors:G().object.isRequired,onBlur:G().func.isRequired,onChange:G().func.isRequired,role:G().object,values:G().object};var xe=_,me=r(24346),oe=me.Ry().shape({name:me.Z_().required(b.I0.required)}),Ee=()=>{const ne=(0,b.lm)(),{formatMessage:z}=(0,f.Z)(),{params:{id:k}}=(0,R.$B)("/settings/roles/:id"),[Q,pe]=(0,e.useState)(!1),de=(0,e.useRef)(),{lockApp:ee,unlockApp:ce}=(0,b.o1)(),{trackUsage:Ze}=(0,b.rS)(),{isLoading:Ae,data:Be}=(0,C.U_)(k),{role:he,permissions:Oe,isLoading:De,onSubmitSucceeded:Fe}=(0,C.Dq)(k),{put:je}=(0,b.kY)(),He=async re=>{try{ee(),pe(!0);const{permissionsToSend:W,didUpdateConditions:U}=de.current.getPermissions();await je(`/admin/roles/${k}`,re),he.code!=="strapi-super-admin"&&(await je(`/admin/roles/${k}/permissions`,{permissions:W}),U&&Ze("didUpdateConditions")),de.current.setFormAfterSubmit(),Fe({name:re.name,description:re.description}),ne({type:"success",message:{id:"notification.success.saved"}})}catch(W){console.error(W.response);const U=F()(W,"response.payload.message","An error occured"),ye=F()(W,"response.payload.data.permissions[0]",U);ne({type:"warning",message:ye})}finally{pe(!1),ce()}},Le=he.code==="strapi-super-admin";return e.createElement(O.o,null,e.createElement(b.SL,{name:"Roles"}),e.createElement(p.J9,{enableReinitialize:!0,initialValues:{name:he.name,description:he.description},onSubmit:He,validationSchema:oe,validateOnChange:!1},({handleSubmit:re,values:W,errors:U,handleChange:ye,handleBlur:Ce})=>e.createElement("form",{onSubmit:re},e.createElement(S.T,{primaryAction:e.createElement(x.k,{gap:2},e.createElement(D.z,{disabled:he.code==="strapi-super-admin",onClick:re,loading:Q,size:"L"},z({id:"global.save",defaultMessage:"Save"}))),title:z({id:"Settings.roles.edit.title",defaultMessage:"Edit a role"}),subtitle:z({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(b.rU,{startIcon:e.createElement(H.Z,null),to:"/settings/roles"},z({id:"global.back",defaultMessage:"Back"}))}),e.createElement(q.D,null,e.createElement(x.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(xe,{isLoading:De,disabled:Le,errors:U,values:W,onChange:ye,onBlur:Ce,role:he}),!Ae&&!De?e.createElement(a.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(w.Z,{isFormDisabled:Le,permissions:Oe,ref:de,layout:Be})):e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(b.dO,null)))))))},T=()=>{const ne=(0,P.v9)(Z._),{isLoading:z,allowedActions:{canRead:k,canUpdate:Q}}=(0,b.ss)({read:ne.settings.roles.read,update:ne.settings.roles.update});return z?e.createElement(b.dO,null):!k&&!Q?e.createElement(R.l_,{to:"/"}):e.createElement(Ee,null)}},84802:function(X){function B(r,e,b,P){for(var R=-1,Z=r==null?0:r.length;++R<Z;){var O=r[R];e(P,O,b(O),r)}return P}X.exports=B},62435:function(X,B,r){var e=r(56671);function b(P,R,Z,O){return e(P,function(S,x,D){R(O,S,Z(S),D)}),O}X.exports=b},85580:function(X,B,r){var e=r(84802),b=r(62435),P=r(88904),R=r(77236);function Z(O,S){return function(x,D){var q=R(x)?e:b,a=S?S():{};return q(x,O,P(D,2),a)}}X.exports=Z},72091:function(X,B,r){var e=r(40314),b=1/0;function P(R){var Z=R==null?0:R.length;return Z?e(R,b):[]}X.exports=P},81346:function(X,B,r){var e=r(40999),b=r(85580),P=Object.prototype,R=P.hasOwnProperty,Z=b(function(O,S,x){R.call(O,x)?O[x].push(S):e(O,x,[S])});X.exports=Z},83828:function(X,B,r){"use strict";r.d(B,{U:function(){return H},y:function(){return q}});var e=r(74512),b=r(32735),P=r(8471),R=r(91045),Z=r(74971),O=r(49372),S=r(87933),x=r(72850);const D=({theme:p,expanded:A,variant:F,disabled:f,error:C})=>C?`1px solid ${p.colors.danger600} !important`:f?`1px solid ${p.colors.neutral150}`:A?`1px solid ${p.colors.primary600}`:F==="primary"?`1px solid ${p.colors.neutral0}`:`1px solid ${p.colors.neutral100}`,q=(0,P.ZP)(O.Z)``,a=(0,P.ZP)(x.x)`
216
+ `,Rt=({categoryName:t,isFormDisabled:n,subCategoryName:o,actions:s,pathToData:i})=>{const[l,d]=(0,e.useState)(!1),{modifiedData:c,onChangeParentCheckbox:m,onChangeSimpleCheckbox:u}=(0,G.$_)(),{formatMessage:g}=(0,H.Z)(),v=y()(c,i,{}),M=(0,e.useMemo)(()=>Object.keys(v).reduce((I,te)=>(I[te]=ze(v[te]),I),{}),[v]),{hasAllActionsSelected:N,hasSomeActionsSelected:j}=Te(M),E=()=>{d(I=>!I)},h=()=>{d(!1)},L=On(s,c,i),$=Dn(y()(c,[...i],{}));return e.createElement(e.Fragment,null,e.createElement(p.x,null,e.createElement(C.k,{justifyContent:"space-between",alignItems:"center"},e.createElement(p.x,{paddingRight:4},e.createElement(T.Z,{variant:"sigma",textColor:"neutral600"},o)),e.createElement(jn,null),e.createElement(p.x,{paddingLeft:4},e.createElement(xt.X,{name:i.join(".."),disabled:n,onValueChange:I=>{m({target:{name:i.join(".."),value:I}})},indeterminate:j,value:N},g({id:"app.utils.select-all",defaultMessage:"Select all"})))),e.createElement(C.k,{paddingTop:6,paddingBottom:6},e.createElement(Mn.r,{gap:2,style:{flex:1}},L.map(({checkboxName:I,value:te,action:K,displayName:J,hasConditions:V})=>e.createElement($n.P,{col:3,key:K},e.createElement(Ln,{disabled:n,hasConditions:V},e.createElement(xt.X,{name:I,disabled:n,onValueChange:fe=>{u({target:{name:I,value:fe}})},value:te},J))))),e.createElement(oe,{hasConditions:$,onClick:E}))),l&&e.createElement(W,{headerBreadCrumbs:[t,o],actions:L,isFormDisabled:n,onClosed:h,onToggle:E}))};Rt.propTypes={actions:a().array.isRequired,categoryName:a().string.isRequired,isFormDisabled:a().bool.isRequired,subCategoryName:a().string.isRequired,pathToData:a().array.isRequired};var kn=Rt;const _e=({childrenForm:t,kind:n,name:o,isOpen:s,isFormDisabled:i,isWhite:l,onOpenCategory:d,pathToData:c})=>{const{formatMessage:m}=(0,H.Z)(),u=()=>{d(o)},g=(0,e.useMemo)(()=>o.split("::").pop(),[o]);return e.createElement(An.U,{expanded:s,onToggle:u,id:`accordion-${o}`,variant:l?"primary":"secondary"},e.createElement(Tn.B,{title:ce()(g),description:`${m({id:"Settings.permissions.category"},{category:g})} ${n==="plugins"?"plugin":n}`}),e.createElement(Sn.v,null,e.createElement(p.x,{padding:6},t.map(({actions:v,subCategoryName:M,subCategoryId:N})=>e.createElement(kn,{key:M,actions:v,categoryName:g,isFormDisabled:i,subCategoryName:M,pathToData:[...c,N]})))))};_e.defaultProps={},_e.propTypes={childrenForm:a().array.isRequired,isOpen:a().bool.isRequired,isFormDisabled:a().bool.isRequired,isWhite:a().bool.isRequired,kind:a().string.isRequired,name:a().string.isRequired,onOpenCategory:a().func.isRequired,pathToData:a().array.isRequired};var In=_e;const Pt=({isFormDisabled:t,kind:n,layout:o})=>{const[s,i]=(0,e.useState)(null),l=d=>{i(d===s?null:d)};return e.createElement(p.x,{padding:6,background:"neutral0"},o.map(({category:d,categoryId:c,childrenForm:m},u)=>e.createElement(In,{key:d,childrenForm:m,kind:n,isFormDisabled:t,isOpen:s===d,isWhite:u%2===1,name:d,onOpenCategory:l,pathToData:[n,c]})))};Pt.propTypes={isFormDisabled:a().bool.isRequired,kind:a().string.isRequired,layout:a().arrayOf(a().shape({category:a().string.isRequired,categoryId:a().string.isRequired,childrenForm:a().arrayOf(a().shape({actions:a().array.isRequired})).isRequired}).isRequired).isRequired};var At=Pt,Zn=r(86349),Bn=r.n(Zn),Fn=r(3040),ge=r.n(Fn),Tt=(t,n,o)=>t.find(s=>s.action===n&&s.subject===o);const St=(t,n=[])=>t.reduce((o,s)=>(o[s.id]=n.indexOf(s.id)!==-1,o),{}),Mt=({children:t},n,o="")=>t.reduce((s,i)=>{if(i.children)return{...s,[i.value]:Mt(i,n,`${o}${i.value}.`)};const l=n.indexOf(`${o}${i.value}`)!==-1;return s[i.value]=l,s},{}),Nn=(t,n,o)=>t.reduce((s,i)=>{const l=n.properties.find(({value:d})=>d===i);if(l){const d=y()(o,["properties",l.value],[]),c=Mt(l,d);s.properties[i]=c}return s},{properties:{}}),Wn=(t,n)=>n.reduce((o,s)=>{const i=t.find(({uid:l})=>l===s)||null;return i&&(o[s]=i),o},{});var $t=({subjects:t},n,o,s=[])=>n.reduce((i,l)=>{const d=l.subjects,c=Wn(t,d);if(D()(c))return i;const m=Object.keys(c).reduce((u,g)=>{const{actionId:v,applyToProperties:M}=l,E=c[g].properties.map(({value:I})=>I).every(I=>(M||[]).indexOf(I)===-1),h=Tt(s,v,g),L=St(o,y()(h,"conditions",[]));if(D()(M)||E)return ge()(u,[g,v],{properties:{enabled:h!==void 0},conditions:L}),u;const $=Nn(M,c[g],h);return ge()(u,[g,v],{...$,conditions:L}),u},{});return Bn()(i,m)},{});const Vn=(t,n,o)=>t.reduce((s,i)=>{const l=Tt(o,i.action,null);return s[i.action]={properties:{enabled:l!==void 0},conditions:St(n,l?.conditions??[])},s},{}),Hn=(t,n,o)=>t.reduce((s,i)=>(s[i.subCategoryId]=Vn(i.actions,n,o),s),{});var Ot=(t,n,o=[])=>t.reduce((s,{categoryId:i,childrenForm:l})=>{const d=Hn(l,n,o);return s[i]=d,s},{});const Dt=t=>t.split(" ").join("-");var jt=(t,n)=>Object.entries(de()(t,n)).map(([o,s])=>({category:o,categoryId:Dt(o),childrenForm:Object.entries(de()(s,"subCategory")).map(([i,l])=>({subCategoryName:i,subCategoryId:Dt(i),actions:l}))})),Gn=(t,n)=>{const{conditions:o,sections:{collectionTypes:s,singleTypes:i,plugins:l,settings:d}}=t,c={collectionTypes:s,singleTypes:i,plugins:jt(l,"plugin"),settings:jt(d,"category")},m={collectionTypes:$t(s,s.actions||[],o,n),singleTypes:$t(i,i.actions||[],o,n),plugins:Ot(c.plugins,o,n),settings:Ot(c.settings,o,n)};return{initialData:m,modifiedData:m,layouts:c}},Un=r(99381),et=r.n(Un);const Lt=t=>Object.keys(t).reduce((n,o)=>{const s=t[o];if(be()(s)&&!S()(s,"conditions"))return{...n,[o]:Lt(s)};if(be()(s)&&S()(s,"conditions")&&!ke(Y()(s,"conditions")).some(l=>l)){const l=Object.keys(s.conditions).reduce((d,c)=>(d[c]=!1,d),{});return{...n,[o]:{...s,conditions:l}}}return n[o]=s,n},{});var tt=Lt;const kt=(t,n,o=!1)=>Object.keys(t).reduce((s,i)=>{const l=t[i];return i==="conditions"&&!o?(s[i]=l,s):be()(l)?{...s,[i]:kt(l,n,i==="fields")}:(s[i]=n,s)},{});var Ge=kt;const Kn={initialData:{},modifiedData:{},layouts:{}};var zn=(t,n)=>(0,Q.ZP)(t,o=>{switch(n.type){case"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX":{const{collectionTypeKind:s,actionId:i,value:l}=n,d=["modifiedData",s];Object.keys(y()(t,d)).forEach(c=>{const m=y()(t,[...d,c,i],void 0);if(m){let u=Ge(m,l);if(!l&&u.conditions){const g=Ge(u.conditions,!1);u={...u,conditions:g}}ge()(o,[...d,c,i],u)}});break}case"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX":{const{pathToCollectionType:s,propertyName:i,rowName:l,value:d}=n;let c=et()(t.modifiedData);const m=s.split(".."),u=y()(c,m,{});Object.keys(u).forEach(g=>{if(S()(u[g],`properties.${i}`)){const v=y()(u,[g,"properties",i,l]),M=[...m,g,"properties",i,l];if(!be()(v))ge()(c,M,d);else{const N=Ge(v,d);ge()(c,M,N)}}}),d||(c=tt(c)),ge()(o,"modifiedData",c);break}case"ON_CHANGE_CONDITIONS":{Object.entries(n.conditions).forEach(s=>{const[i,l]=s;ge()(o,["modifiedData",...i.split(".."),"conditions"],l)});break}case"ON_CHANGE_SIMPLE_CHECKBOX":{let s=et()(t.modifiedData);ge()(s,[...n.keys.split("..")],n.value),n.value||(s=tt(s)),ge()(o,"modifiedData",s);break}case"ON_CHANGE_TOGGLE_PARENT_CHECKBOX":{const{keys:s,value:i}=n,l=[...s.split("..")];let d=et()(t.modifiedData);const c=y()(d,l,{}),m=Ge(c,i);ge()(d,l,m),i||(d=tt(d)),ge()(o,["modifiedData"],d);break}case"RESET_FORM":{o.modifiedData=t.initialData;break}case"SET_FORM_AFTER_SUBMIT":{o.initialData=t.modifiedData;break}default:return o}});const nt=t=>Object.entries(t).filter(([,n])=>n).map(([n])=>n),Xn=t=>{const[n,{conditions:o}]=t;return{action:n,subject:null,conditions:nt(o),properties:{}}},wn=t=>Object.values(t).reduce((n,o)=>{const s=Object.entries(o).reduce((i,l)=>{const[,{properties:{enabled:d}}]=l;if(!d)return i;const c=Xn(l);return i.push(c),i},[]);return[...n,...s]},[]);var It=t=>Object.values(t).reduce((n,o)=>{const s=wn(o);return[...n,...s]},[]);const Zt=(t,n="")=>Object.entries(t).reduce((o,s)=>{const[i,l]=s;return be()(l)?[...o,...Zt(l,`${n}${i}.`)]:(l&&!be()(l)&&o.push(`${n}${i}`),o)},[]),Yn=(t,n,{conditions:o,properties:s})=>Object.entries(s).reduce((i,l)=>{const[d,c]=l;return i.properties[d]=Zt(c),i},{action:t,subject:n,conditions:nt(o),properties:{}}),Jn=(t,n,{conditions:o})=>({action:t,subject:n,properties:{},conditions:nt(o)}),Qn=(t,n)=>Object.entries(n).reduce((s,i)=>{const[l,d]=i;if(!ke(d).some(u=>u))return s;if(!d?.properties?.enabled){const u=Yn(l,t,d);return[...s,u]}if(!d.properties.enabled)return s;const m=Jn(l,t,d);return s.push(m),s},[]);var Bt=t=>Object.entries(t).reduce((o,s)=>{const[i,l]=s,d=Qn(i,l);return[...o,...d]},[]),qn=t=>{const n=It(t.plugins),o=It(t.settings),s=Bt(t.collectionTypes),i=Bt(t.singleTypes);return[...n,...o,...s,...i]},_n=[{labelId:"app.components.LeftMenuLinkContainer.collectionTypes",defaultMessage:"Collection Types",id:"collectionTypes"},{labelId:"app.components.LeftMenuLinkContainer.singleTypes",id:"singleTypes",defaultMessage:"Single Types"},{labelId:"app.components.LeftMenuLinkContainer.plugins",defaultMessage:"Plugins",id:"plugins"},{labelId:"app.components.LeftMenuLinkContainer.settings",defaultMessage:"Settings",id:"settings"}];const st=(0,e.forwardRef)(({layout:t,isFormDisabled:n,permissions:o},s)=>{const[{initialData:i,layouts:l,modifiedData:d},c]=(0,e.useReducer)(zn,Kn,()=>Gn(t,o)),{formatMessage:m}=(0,H.Z)();(0,e.useImperativeHandle)(s,()=>({getPermissions(){const j=(0,Z.e5)(i.collectionTypes,d.collectionTypes),E=(0,Z.e5)(i.singleTypes,d.singleTypes),h={...j,...E};let L;return D()(h)?L=!1:L=Object.values(h).some($=>Object.values($).some(I=>S()(I,"conditions"))),{permissionsToSend:qn(d),didUpdateConditions:L}},resetForm(){c({type:"RESET_FORM"})},setFormAfterSubmit(){c({type:"SET_FORM_AFTER_SUBMIT"})}}));const u=(j,E,h,L)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX",pathToCollectionType:j,propertyName:E,rowName:h,value:L})},g=(j,E,h)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX",collectionTypeKind:j,actionId:E,value:h})},v=j=>{c({type:"ON_CHANGE_CONDITIONS",conditions:j})},M=(0,e.useCallback)(({target:{name:j,value:E}})=>{c({type:"ON_CHANGE_SIMPLE_CHECKBOX",keys:j,value:E})},[]),N=(0,e.useCallback)(({target:{name:j,value:E}})=>{c({type:"ON_CHANGE_TOGGLE_PARENT_CHECKBOX",keys:j,value:E})},[]);return e.createElement(Pn,{value:{availableConditions:t.conditions,modifiedData:d,onChangeConditions:v,onChangeSimpleCheckbox:M,onChangeParentCheckbox:N,onChangeCollectionTypeLeftActionRowCheckbox:u,onChangeCollectionTypeGlobalActionCheckbox:g}},e.createElement(b.v,{id:"tabs",label:m({id:"Settings.permissions.users.tabs.label",defaultMessage:"Tabs Permissions"})},e.createElement(P.m,null,_n.map(j=>e.createElement(P.O,{key:j.id},m({id:j.labelId,defaultMessage:j.defaultMessage})))),e.createElement(R.n,{style:{position:"relative"}},e.createElement(R.x,null,e.createElement(Et,{layout:l.collectionTypes,kind:"collectionTypes",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(Et,{layout:l.singleTypes,kind:"singleTypes",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(At,{layout:l.plugins,kind:"plugins",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(At,{layout:l.settings,kind:"settings",isFormDisabled:n})))))});st.defaultProps={permissions:[],layout:{conditions:[],sections:{collectionTypes:{},singleTypes:{actions:[]},settings:[],plugins:[]}}},st.propTypes={layout:a().object,isFormDisabled:a().bool.isRequired,permissions:a().array};var es=(0,e.memo)(st)},87056:function(X,B,r){"use strict";r.r(B),r.d(B,{default:function(){return T}});var e=r(32735),b=r(19565),P=r(15062),R=r(53038),Z=r(30305),O=r(27649),S=r(82055),x=r(87933),D=r(41415),q=r(17e3),a=r(72850),H=r(29439),p=r(92802),A=r(33795),F=r.n(A),f=r(67879),C=r(2160),w=r(1283),ue=r(49372),ae=r(15335),ie=r(5803),y=r(10369),le=r(33475),Y=r(60216),G=r.n(Y);const _=({disabled:ne,role:z,values:k,errors:Q,onChange:pe,onBlur:de})=>{const{formatMessage:ee}=(0,f.Z)();return e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(x.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(x.k,{justifyContent:"space-between"},e.createElement(a.x,null,e.createElement(a.x,null,e.createElement(ue.Z,{fontWeight:"bold"},z?z.name:ee({id:"global.details",defaultMessage:"Details"}))),e.createElement(a.x,null,e.createElement(ue.Z,{textColor:"neutral500",variant:"pi"},z?z.description:ee({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(D.z,{disabled:!0,variant:"secondary"},ee({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:z.usersCount}))),e.createElement(ae.r,{gap:4},e.createElement(ie.P,{col:6},e.createElement(y.o,{disabled:ne,name:"name",error:Q.name&&ee({id:Q.name}),label:ee({id:"global.name",defaultMessage:"Name"}),onChange:pe,onBlur:de,value:k.name||""})),e.createElement(ie.P,{col:6},e.createElement(le.g,{disabled:ne,label:ee({id:"global.description",defaultMessage:"Description"}),id:"description",error:Q.name&&ee({id:Q.name}),onChange:pe,onBlur:de},k.description||"")))))};_.defaultProps={disabled:!1,role:null,values:{name:"",description:""}},_.propTypes={disabled:G().bool,errors:G().object.isRequired,onBlur:G().func.isRequired,onChange:G().func.isRequired,role:G().object,values:G().object};var xe=_,me=r(24346),oe=me.Ry().shape({name:me.Z_().required(b.I0.required)}),Ee=()=>{const ne=(0,b.lm)(),{formatMessage:z}=(0,f.Z)(),{params:{id:k}}=(0,R.$B)("/settings/roles/:id"),[Q,pe]=(0,e.useState)(!1),de=(0,e.useRef)(),{lockApp:ee,unlockApp:ce}=(0,b.o1)(),{trackUsage:Ze}=(0,b.rS)(),{isLoading:Ae,data:Be}=(0,C.U_)(k),{role:he,permissions:Oe,isLoading:De,onSubmitSucceeded:Fe}=(0,C.Dq)(k),{put:je}=(0,b.kY)(),He=async re=>{try{ee(),pe(!0);const{permissionsToSend:W,didUpdateConditions:U}=de.current.getPermissions();await je(`/admin/roles/${k}`,re),he.code!=="strapi-super-admin"&&(await je(`/admin/roles/${k}/permissions`,{permissions:W}),U&&Ze("didUpdateConditions")),de.current.setFormAfterSubmit(),Fe({name:re.name,description:re.description}),ne({type:"success",message:{id:"notification.success.saved"}})}catch(W){console.error(W.response);const U=F()(W,"response.payload.message","An error occured"),ye=F()(W,"response.payload.data.permissions[0]",U);ne({type:"warning",message:ye})}finally{pe(!1),ce()}},Le=he.code==="strapi-super-admin";return e.createElement(O.o,null,e.createElement(b.SL,{name:"Roles"}),e.createElement(p.J9,{enableReinitialize:!0,initialValues:{name:he.name,description:he.description},onSubmit:He,validationSchema:oe,validateOnChange:!1},({handleSubmit:re,values:W,errors:U,handleChange:ye,handleBlur:Ce})=>e.createElement("form",{onSubmit:re},e.createElement(S.T,{primaryAction:e.createElement(x.k,{gap:2},e.createElement(D.z,{disabled:he.code==="strapi-super-admin",onClick:re,loading:Q,size:"L"},z({id:"global.save",defaultMessage:"Save"}))),title:z({id:"Settings.roles.edit.title",defaultMessage:"Edit a role"}),subtitle:z({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(b.rU,{startIcon:e.createElement(H.Z,null),to:"/settings/roles"},z({id:"global.back",defaultMessage:"Back"}))}),e.createElement(q.D,null,e.createElement(x.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(xe,{isLoading:De,disabled:Le,errors:U,values:W,onChange:ye,onBlur:Ce,role:he}),!Ae&&!De?e.createElement(a.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(w.Z,{isFormDisabled:Le,permissions:Oe,ref:de,layout:Be})):e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(b.dO,null)))))))},T=()=>{const ne=(0,P.v9)(Z._),{isLoading:z,allowedActions:{canRead:k,canUpdate:Q}}=(0,b.ss)({read:ne.settings.roles.read,update:ne.settings.roles.update});return z?e.createElement(b.dO,null):!k&&!Q?e.createElement(R.l_,{to:"/"}):e.createElement(Ee,null)}},84802:function(X){function B(r,e,b,P){for(var R=-1,Z=r==null?0:r.length;++R<Z;){var O=r[R];e(P,O,b(O),r)}return P}X.exports=B},62435:function(X,B,r){var e=r(56671);function b(P,R,Z,O){return e(P,function(S,x,D){R(O,S,Z(S),D)}),O}X.exports=b},85580:function(X,B,r){var e=r(84802),b=r(62435),P=r(88904),R=r(77236);function Z(O,S){return function(x,D){var q=R(x)?e:b,a=S?S():{};return q(x,O,P(D,2),a)}}X.exports=Z},72091:function(X,B,r){var e=r(40314),b=1/0;function P(R){var Z=R==null?0:R.length;return Z?e(R,b):[]}X.exports=P},81346:function(X,B,r){var e=r(40999),b=r(85580),P=Object.prototype,R=P.hasOwnProperty,Z=b(function(O,S,x){R.call(O,x)?O[x].push(S):e(O,x,[S])});X.exports=Z},83828:function(X,B,r){"use strict";r.d(B,{U:function(){return H},y:function(){return q}});var e=r(74512),b=r(32735),P=r(8471),R=r(91045),Z=r(74971),O=r(49372),S=r(87933),x=r(72850);const D=({theme:p,expanded:A,variant:F,disabled:f,error:C})=>C?`1px solid ${p.colors.danger600} !important`:f?`1px solid ${p.colors.neutral150}`:A?`1px solid ${p.colors.primary600}`:F==="primary"?`1px solid ${p.colors.neutral0}`:`1px solid ${p.colors.neutral100}`,q=(0,P.ZP)(O.Z)``,a=(0,P.ZP)(x.x)`
217
217
  border: ${D};
218
218
 
219
219
  &:hover:not([aria-disabled='true']) {
@@ -0,0 +1,10 @@
1
+ "use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[4263],{97108:function(B,c,e){e.d(c,{R:function(){return o}});var t=e(19565),a=e(20108);function o(i={},E={}){const{id:r="",...s}=i,{get:g}=(0,t.kY)(),{data:l,isError:n,isLoading:m,refetch:f}=(0,a.useQuery)(["users",r,s],async()=>{const{data:{data:y}}=await g(`/admin/users/${r}`,{params:s});return y},E);let v=[];return r&&l?v=[l]:Array.isArray(l?.results)&&(v=l.results),{users:v,pagination:l?.pagination??null,isLoading:m,isError:n,refetch:f}}},28363:function(B,c,e){e.r(c),e.d(c,{default:function(){return re}});var t=e(32735),a=e(19565),o=e(15062),i=e(53038),E=e(30305),r=e(27649),s=e(82055),g=e(41415),l=e(17e3),n=e(72850),m=e(87933),f=e(49372),v=e(15335),y=e(5803),L=e(66456),O=e(29439),I=e(92802),j=e(33795),x=e.n(j),N=e(9086),Y=e.n(N),U=e(88423),S=e.n(U),F=e(60216),H=e.n(F),V=e(67879),G=e(97108),M=e(9592),Q=e(86209),ee=e(47577),te=e(18703),ae=e(32720);const se=async(A,u)=>{const{put:C}=(0,a.tg)(),{data:T}=await C(`/admin/users/${A}`,u);return T.data};var ne=[[{intlLabel:{id:"Auth.form.firstname.label",defaultMessage:"First name"},name:"firstname",placeholder:{id:"Auth.form.firstname.placeholder",defaultMessage:"e.g. Kai"},type:"text",size:{col:6,xs:12},required:!0},{intlLabel:{id:"Auth.form.lastname.label",defaultMessage:"Last name"},name:"lastname",placeholder:{id:"Auth.form.lastname.placeholder",defaultMessage:"e.g. Doe"},type:"text",size:{col:6,xs:12}}],[{intlLabel:{id:"Auth.form.email.label",defaultMessage:"Email"},name:"email",placeholder:{id:"Auth.form.email.placeholder",defaultMessage:"e.g. kai.doe@strapi.io"},type:"email",size:{col:6,xs:12},required:!0},{intlLabel:{id:"Auth.form.username.label",defaultMessage:"Username"},name:"username",placeholder:{id:"Auth.form.username.placeholder",defaultMessage:"e.g. Kai_Doe"},type:"text",size:{col:6,xs:12}}],[{intlLabel:{id:"global.password",defaultMessage:"Password"},name:"password",type:"password",size:{col:6,xs:12},autoComplete:"new-password"},{intlLabel:{id:"Auth.form.confirmPassword.label",defaultMessage:"Password confirmation"},name:"confirmPassword",type:"password",size:{col:6,xs:12},autoComplete:"new-password"}],[{intlLabel:{id:"Auth.form.active.label",defaultMessage:"Active"},name:"isActive",type:"bool",size:{col:6,xs:12}}]];const J=["email","firstname","lastname","username","isActive","roles"],w=({canUpdate:A})=>{const{formatMessage:u}=(0,V.Z)(),{params:{id:C}}=(0,i.$B)("/settings/users/:id"),{push:T}=(0,i.k6)(),{setUserDisplayName:Z}=(0,a.L7)(),h=(0,a.lm)(),{lockApp:X,unlockApp:b}=(0,a.o1)(),k=(0,M.c)(ee.A,async()=>(await e.e(1727).then(e.bind(e,81727))).MagicLinkEE);(0,a.go)();const{users:[W],isLoading:le}=(0,G.R)({id:C},{onError(d){const{status:p}=d.response;p===403?(h({type:"info",message:{id:"notification.permission.not-allowed-read",defaultMessage:"You are not allowed to see this document"}}),T("/")):h({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}}),ie=async(d,p)=>{X();try{const P=await se(C,Y()(d,"confirmPassword"));h({type:"success",message:u({id:"notification.success.saved",defaultMessage:"Saved"})});const R=a.I8.getUserInfo();if(C.toString()===R.id.toString()){a.I8.setUserInfo(P);const K=x()(d,"username")||(0,Q.Pp)(d.firstname,d.lastname);Z(K)}p.setValues(S()(d,J))}catch(P){const R=(0,Q.Iz)(P.response.data),K=Object.keys(R).reduce(($,D)=>($[D]=R[D].id,$),{});p.setErrors(K),h({type:"warning",message:x()(P,"response.data.error.message","notification.error")})}b()},_=le||!k,de=_?{id:"app.containers.Users.EditPage.header.label-loading",defaultMessage:"Edit user"}:{id:"app.containers.Users.EditPage.header.label",defaultMessage:"Edit {name}"},z=Object.keys(S()(W,J)).reduce((d,p)=>p==="roles"?(d[p]=(W?.roles||[]).map(({id:P})=>P),d):(d[p]=W?.[p],d),{}),ce=z.username||(0,Q.Pp)(z.firstname,z.lastname),q=u(de,{name:ce});return _?t.createElement(r.o,{"aria-busy":"true"},t.createElement(a.SL,{name:"Users"}),t.createElement(s.T,{primaryAction:t.createElement(g.z,{disabled:!0,startIcon:t.createElement(L.Z,null),type:"button",size:"L"},u({id:"global.save",defaultMessage:"Save"})),title:q,navigationAction:t.createElement(a.rU,{startIcon:t.createElement(O.Z,null),to:"/settings/users?pageSize=10&page=1&sort=firstname"},u({id:"global.back",defaultMessage:"Back"}))}),t.createElement(l.D,null,t.createElement(a.dO,null))):t.createElement(r.o,null,t.createElement(a.SL,{name:"Users"}),t.createElement(I.J9,{onSubmit:ie,initialValues:z,validateOnChange:!1,validationSchema:ae.YM},({errors:d,values:p,handleChange:P,isSubmitting:R,dirty:K})=>t.createElement(a.l0,null,t.createElement(s.T,{primaryAction:t.createElement(g.z,{disabled:R||!A?!0:!K,startIcon:t.createElement(L.Z,null),loading:R,type:"submit",size:"L"},u({id:"global.save",defaultMessage:"Save"})),title:q,navigationAction:t.createElement(a.rU,{startIcon:t.createElement(O.Z,null),to:"/settings/users?pageSize=10&page=1&sort=firstname"},u({id:"global.back",defaultMessage:"Back"}))}),t.createElement(l.D,null,W?.registrationToken&&t.createElement(n.x,{paddingBottom:6},t.createElement(k,{registrationToken:W.registrationToken})),t.createElement(m.k,{direction:"column",alignItems:"stretch",gap:7},t.createElement(n.x,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},t.createElement(m.k,{direction:"column",alignItems:"stretch",gap:4},t.createElement(f.Z,{variant:"delta",as:"h2"},u({id:"app.components.Users.ModalCreateBody.block-title.details",defaultMessage:"Details"})),t.createElement(v.r,{gap:5},ne.map($=>$.map(D=>t.createElement(y.P,{key:D.name,...D.size},t.createElement(a.jm,{...D,disabled:!A,error:d[D.name],onChange:P,value:p[D.name]||""}))))))),t.createElement(n.x,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},t.createElement(m.k,{direction:"column",alignItems:"stretch",gap:4},t.createElement(f.Z,{variant:"delta",as:"h2"},u({id:"global.roles",defaultMessage:"User's role"})),t.createElement(v.r,{gap:5},t.createElement(y.P,{col:6,xs:12},t.createElement(te.Z,{disabled:!A,error:d.roles,onChange:P,value:p.roles}))))))))))};w.propTypes={canUpdate:H().bool.isRequired};var oe=w,re=()=>{const A=(0,a.lm)(),u=(0,o.v9)(E._),C=t.useMemo(()=>({read:u.settings.users.read,update:u.settings.users.update}),[u.settings.users]),{isLoading:T,allowedActions:{canRead:Z,canUpdate:h}}=(0,a.ss)(C),{state:X}=(0,i.TH)(),b=X?.from??"/";return(0,t.useEffect)(()=>{T||!Z&&!h&&A({type:"info",message:{id:"notification.permission.not-allowed-read",defaultMessage:"You are not allowed to see this document"}})},[T,Z,h,A]),T?t.createElement(a.dO,null):!Z&&!h?t.createElement(i.l_,{to:b}):t.createElement(oe,{canUpdate:h})}},84024:function(B,c,e){var t=e(32735),a=e(50563),o=e(19565),i=e(47765),E=e(60216),r=e.n(E),s=e(67879);const g=({children:l,target:n})=>{const m=(0,o.lm)(),{formatMessage:f}=(0,s.Z)(),{copy:v}=(0,o.VP)(),y=f({id:"app.component.CopyToClipboard.label",defaultMessage:"Copy to clipboard"}),L=async()=>{await v(n)&&m({type:"info",message:{id:"notification.link-copied"}})};return t.createElement(o.Y_,{endAction:t.createElement(a.h,{label:y,noBorder:!0,icon:t.createElement(i.Z,null),onClick:L}),title:n,titleEllipsis:!0,subtitle:l,icon:t.createElement("span",{style:{fontSize:32}},"\u2709\uFE0F"),iconBackground:"neutral100"})};g.propTypes={children:r().oneOfType([r().element,r().string]).isRequired,target:r().string.isRequired},c.Z=g},47577:function(B,c,e){e.d(c,{A:function(){return s}});var t=e(32735),a=e(60216),o=e.n(a),i=e(67879),E=e(35231),r=e(84024);const s=({registrationToken:g})=>{const{formatMessage:l}=(0,i.Z)(),n=`${window.location.origin}${E.Z}auth/register?registrationToken=${g}`;return t.createElement(r.Z,{target:n},l({id:"app.components.Users.MagicLink.connect",defaultMessage:"Copy and share this link to give access to this user"}))};s.defaultProps={registrationToken:""},s.propTypes={registrationToken:o().string}},18703:function(B,c,e){var t=e(32735),a=e(68465),o=e(84967),i=e(19565),E=e(27169),r=e(60216),s=e.n(r),g=e(67879),l=e(20108),n=e(8471);const m=(0,n.F4)`
2
+ from {
3
+ transform: rotate(0deg);
4
+ }
5
+ to {
6
+ transform: rotate(359deg);
7
+ }
8
+ `,f=n.ZP.div`
9
+ animation: ${m} 2s infinite linear;
10
+ `,v=()=>t.createElement(f,null,t.createElement(E.Z,null)),y=async()=>{const{get:O}=(0,i.tg)(),{data:I}=await O("/admin/roles");return I.data},L=({disabled:O,error:I,onChange:j,value:x})=>{const{status:N,data:Y}=(0,l.useQuery)(["roles"],y,{staleTime:5e4}),{formatMessage:U}=(0,g.Z)(),S=I?U({id:I,defaultMessage:I}):"",F=U({id:"app.components.Users.ModalCreateBody.block-title.roles",defaultMessage:"User's roles"}),H=U({id:"app.components.Users.ModalCreateBody.block-title.roles.description",defaultMessage:"A user can have one or several roles"}),V=U({id:"app.components.Select.placeholder",defaultMessage:"Select"}),G=N==="loading"?t.createElement(v,null):void 0;return t.createElement(a.P,{id:"roles",disabled:O,error:S,hint:H,label:F,name:"roles",onChange:M=>{j({target:{name:"roles",value:M}})},placeholder:V,multi:!0,startIcon:G,value:x.map(M=>M.toString()),withTags:!0,required:!0},(Y||[]).map(M=>t.createElement(o.W,{key:M.id,value:M.id.toString()},U({id:`global.${M.code}`,defaultMessage:M.name}))))};L.defaultProps={disabled:!1,error:void 0},L.propTypes={disabled:s().bool,error:s().string,onChange:s().func.isRequired,value:s().array.isRequired},c.Z=L},32720:function(B,c,e){e.d(c,{YM:function(){return l},Rw:function(){return E}});var t=e(24346),a=e(19565);const o={firstname:t.Z_().trim().required(a.I0.required),lastname:t.Z_(),email:t.Z_().email(a.I0.email).lowercase().required(a.I0.required),username:t.Z_().nullable(),password:t.Z_().min(8,a.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number"),confirmPassword:t.Z_().min(8,a.I0.minLength).oneOf([t.iH("password"),null],"components.Input.error.password.noMatch").when("password",(n,m)=>n?m.required(a.I0.required):m)};var E={...o,currentPassword:t.Z_().when(["password","confirmPassword"],(n,m,f)=>n||m?f.required(a.I0.required):f),preferedLanguage:t.Z_().nullable()},s={roles:t.IX().min(1,a.I0.required).required(a.I0.required)},l=t.Ry().shape({...o,isActive:t.Xg(),...s})},29439:function(B,c,e){e.d(c,{Z:function(){return o}});var t=e(74512);const a=i=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"none",viewBox:"0 0 24 24",...i,children:(0,t.jsx)("path",{fill:"#212134",d:"M24 13.3a.2.2 0 0 1-.2.2H5.74l8.239 8.239a.2.2 0 0 1 0 .282L12.14 23.86a.2.2 0 0 1-.282 0L.14 12.14a.2.2 0 0 1 0-.282L11.86.14a.2.2 0 0 1 .282 0L13.98 1.98a.2.2 0 0 1 0 .282L5.74 10.5H23.8c.11 0 .2.09.2.2v2.6Z"})}),o=a}}]);
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[3455],{67249:function(N,x,t){t.r(x),t.d(x,{default:function(){return ge}});var e=t(32735),n=t(19565),f=t(15062),T=t(78125),y=t(27649),b=t(82055),W=t(41415),U=t(99223),S=t(17e3),E=t(56755),F=t(73269),K=t(33827),V=t(94547),v=t(19786),O=t(49372),z=t(3685),X=t(35658),G=t(47765),J=t(68625),Y=t(4038),k=t(19406),w=t(33795),q=t.n(w),Z=t(67879),_=t(53038),ee=t(10328),te=()=>"todo empty role",ne=t(87933),le=t(72850),se=t(50563),ae=t(60216),L=t.n(ae);const $=({id:s,name:d,description:l,usersCount:h,icons:c,rowIndex:o,canUpdate:M})=>{const{formatMessage:p}=(0,Z.Z)(),[,r]=c,C=p({id:"Roles.RoleRow.user-count",defaultMessage:"{number, plural, =0 {# user} one {# user} other {# users}}"},{number:h});return e.createElement(V.Tr,{"aria-rowindex":o,key:s,...M?(0,n.X7)({fn:r.onClick}):{}},e.createElement(v.Td,{maxWidth:(0,n.Q1)(130)},e.createElement(O.Z,{ellipsis:!0,textColor:"neutral800"},d)),e.createElement(v.Td,{maxWidth:(0,n.Q1)(250)},e.createElement(O.Z,{ellipsis:!0,textColor:"neutral800"},l)),e.createElement(v.Td,null,e.createElement(O.Z,{textColor:"neutral800"},C)),e.createElement(v.Td,null,e.createElement(ne.k,{justifyContent:"flex-end",...n.UW},c.map((u,R)=>u?e.createElement(le.x,{key:u.label,paddingLeft:R===0?0:1},e.createElement(se.h,{onClick:u.onClick,label:u.label,noBorder:!0,icon:u.icon})):null))))};$.propTypes={id:L().number.isRequired,name:L().string.isRequired,description:L().string.isRequired,usersCount:L().number.isRequired,icons:L().array.isRequired,rowIndex:L().number.isRequired,canUpdate:L().bool},$.defaultProps={canUpdate:!1};var oe=$,re=t(97889);const ie={roleToDelete:null,showModalConfirmButtonLoading:!1,shouldRefetchData:!1};var de=(s,d)=>(0,re.ZP)(s,l=>{switch(d.type){case"ON_REMOVE_ROLES":{l.showModalConfirmButtonLoading=!0;break}case"ON_REMOVE_ROLES_SUCCEEDED":{l.shouldRefetchData=!0,l.roleToDelete=null;break}case"RESET_DATA_TO_DELETE":{l.shouldRefetchData=!1,l.roleToDelete=null,l.showModalConfirmButtonLoading=!1;break}case"SET_ROLE_TO_DELETE":{l.roleToDelete=d.id;break}default:return l}});const ce=()=>{(0,n.go)();const{locale:s}=(0,Z.Z)(),d=(0,f.v9)(T._),{isLoading:l,allowedActions:{canCreate:h,canDelete:c,canRead:o,canUpdate:M}}=(0,n.ss)(d.settings.roles),{getData:p,roles:r,isLoading:C}=(0,ee.bF)(!1),[{query:u}]=(0,n.Kx)(),R=u?._q||"",{includes:D}=(0,n.L0)(s,{sensitivity:"base"}),P=(0,n.Xe)(s,{sensitivity:"base"}),j=(r||[]).filter(m=>D(m.name,R)||D(m.description,R)).sort((m,A)=>P.compare(m.name,A.name)||P.compare(m.description,A.description));return(0,e.useEffect)(()=>{!l&&o&&p()},[l,o,p]),{isLoadingForPermissions:l,canCreate:h,canDelete:c,canRead:o,canUpdate:M,isLoading:C,getData:p,sortedRoles:j,roles:r}},ue=({getData:s,canCreate:d,canDelete:l,canUpdate:h})=>{const{formatMessage:c}=(0,Z.Z)(),o=(0,n.lm)(),[M,p]=(0,e.useState)(!1),{push:r}=(0,_.k6)(),[{selectedRoles:C,showModalConfirmButtonLoading:u,roleToDelete:R},D]=(0,e.useReducer)(de,ie),{post:P}=(0,n.tg)(),j=async()=>{try{D({type:"ON_REMOVE_ROLES"}),await P("/admin/roles/batch-delete",{ids:[R]}),await s(),D({type:"RESET_DATA_TO_DELETE"})}catch(a){const i=q()(a,["response","payload","data","ids"],null);if(i&&Array.isArray(i)){const he=i.join(`
1
+ "use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[3455],{32239:function(N,x,t){t.r(x),t.d(x,{default:function(){return ge}});var e=t(32735),n=t(19565),f=t(15062),T=t(30305),y=t(27649),b=t(82055),W=t(41415),U=t(99223),S=t(17e3),E=t(56755),F=t(73269),K=t(33827),V=t(94547),v=t(19786),O=t(49372),z=t(3685),X=t(35658),G=t(47765),J=t(68625),Y=t(4038),k=t(19406),w=t(33795),q=t.n(w),Z=t(67879),_=t(53038),ee=t(2160),te=()=>"todo empty role",ne=t(87933),le=t(72850),se=t(50563),ae=t(60216),L=t.n(ae);const $=({id:s,name:d,description:l,usersCount:h,icons:c,rowIndex:o,canUpdate:M})=>{const{formatMessage:p}=(0,Z.Z)(),[,r]=c,C=p({id:"Roles.RoleRow.user-count",defaultMessage:"{number, plural, =0 {# user} one {# user} other {# users}}"},{number:h});return e.createElement(V.Tr,{"aria-rowindex":o,key:s,...M?(0,n.X7)({fn:r.onClick}):{}},e.createElement(v.Td,{maxWidth:(0,n.Q1)(130)},e.createElement(O.Z,{ellipsis:!0,textColor:"neutral800"},d)),e.createElement(v.Td,{maxWidth:(0,n.Q1)(250)},e.createElement(O.Z,{ellipsis:!0,textColor:"neutral800"},l)),e.createElement(v.Td,null,e.createElement(O.Z,{textColor:"neutral800"},C)),e.createElement(v.Td,null,e.createElement(ne.k,{justifyContent:"flex-end",...n.UW},c.map((u,R)=>u?e.createElement(le.x,{key:u.label,paddingLeft:R===0?0:1},e.createElement(se.h,{onClick:u.onClick,label:u.label,noBorder:!0,icon:u.icon})):null))))};$.propTypes={id:L().number.isRequired,name:L().string.isRequired,description:L().string.isRequired,usersCount:L().number.isRequired,icons:L().array.isRequired,rowIndex:L().number.isRequired,canUpdate:L().bool},$.defaultProps={canUpdate:!1};var oe=$,re=t(97889);const ie={roleToDelete:null,showModalConfirmButtonLoading:!1,shouldRefetchData:!1};var de=(s,d)=>(0,re.ZP)(s,l=>{switch(d.type){case"ON_REMOVE_ROLES":{l.showModalConfirmButtonLoading=!0;break}case"ON_REMOVE_ROLES_SUCCEEDED":{l.shouldRefetchData=!0,l.roleToDelete=null;break}case"RESET_DATA_TO_DELETE":{l.shouldRefetchData=!1,l.roleToDelete=null,l.showModalConfirmButtonLoading=!1;break}case"SET_ROLE_TO_DELETE":{l.roleToDelete=d.id;break}default:return l}});const ce=()=>{(0,n.go)();const{locale:s}=(0,Z.Z)(),d=(0,f.v9)(T._),{isLoading:l,allowedActions:{canCreate:h,canDelete:c,canRead:o,canUpdate:M}}=(0,n.ss)(d.settings.roles),{getData:p,roles:r,isLoading:C}=(0,ee.bF)(!1),[{query:u}]=(0,n.Kx)(),R=u?._q||"",{includes:D}=(0,n.L0)(s,{sensitivity:"base"}),P=(0,n.Xe)(s,{sensitivity:"base"}),j=(r||[]).filter(m=>D(m.name,R)||D(m.description,R)).sort((m,A)=>P.compare(m.name,A.name)||P.compare(m.description,A.description));return(0,e.useEffect)(()=>{!l&&o&&p()},[l,o,p]),{isLoadingForPermissions:l,canCreate:h,canDelete:c,canRead:o,canUpdate:M,isLoading:C,getData:p,sortedRoles:j,roles:r}},ue=({getData:s,canCreate:d,canDelete:l,canUpdate:h})=>{const{formatMessage:c}=(0,Z.Z)(),o=(0,n.lm)(),[M,p]=(0,e.useState)(!1),{push:r}=(0,_.k6)(),[{selectedRoles:C,showModalConfirmButtonLoading:u,roleToDelete:R},D]=(0,e.useReducer)(de,ie),{post:P}=(0,n.tg)(),j=async()=>{try{D({type:"ON_REMOVE_ROLES"}),await P("/admin/roles/batch-delete",{ids:[R]}),await s(),D({type:"RESET_DATA_TO_DELETE"})}catch(a){const i=q()(a,["response","payload","data","ids"],null);if(i&&Array.isArray(i)){const he=i.join(`
2
2
  `);o({type:"warning",message:he})}else o({type:"warning",message:{id:"notification.error"}})}g()},m=(0,e.useCallback)(a=>{r(`/settings/roles/duplicate/${a}`)},[r]),A=()=>r("/settings/roles/new"),B=(0,e.useCallback)(a=>{D({type:"SET_ROLE_TO_DELETE",id:a}),g()},[]),g=()=>p(a=>!a),I=(0,e.useCallback)(a=>{r(`/settings/roles/${a}`)},[r]),H=(0,e.useCallback)((a,i)=>{a.preventDefault(),a.stopPropagation(),i.usersCount?o({type:"info",message:{id:"Roles.ListPage.notification.delete-not-allowed"}}):B(i.id)},[o,B]),Q=(0,e.useCallback)((a,i)=>{a.preventDefault(),a.stopPropagation(),m(i.id)},[m]),Ee=(0,e.useCallback)(a=>[...d?[{onClick:i=>Q(i,a),label:c({id:"app.utils.duplicate",defaultMessage:"Duplicate"}),icon:e.createElement(G.Z,null)}]:[],...h?[{onClick:()=>I(a.id),label:c({id:"app.utils.edit",defaultMessage:"Edit"}),icon:e.createElement(J.Z,null)}]:[],...l?[{onClick:i=>H(i,a),label:c({id:"global.delete",defaultMessage:"Delete"}),icon:e.createElement(Y.Z,null)}]:[]],[c,H,Q,I,d,h,l]);return{handleNewRoleClick:A,getIcons:Ee,selectedRoles:C,isWarningDeleteAllOpened:M,showModalConfirmButtonLoading:u,handleToggleModal:g,handleDeleteData:j}};var me=()=>{const{formatMessage:s}=(0,Z.Z)(),{isLoadingForPermissions:d,canCreate:l,canRead:h,canDelete:c,canUpdate:o,isLoading:M,getData:p,sortedRoles:r}=ce(),{handleNewRoleClick:C,getIcons:u,isWarningDeleteAllOpened:R,showModalConfirmButtonLoading:D,handleToggleModal:P,handleDeleteData:j}=ue({getData:p,canCreate:l,canDelete:c,canUpdate:o}),m=r.length+1,A=6;if(d)return e.createElement(y.o,null,e.createElement(n.dO,null));const B=s({id:"global.roles",defaultMessage:"roles"});return e.createElement(y.o,null,e.createElement(n.SL,{name:"Roles"}),e.createElement(b.T,{primaryAction:l?e.createElement(W.z,{onClick:C,startIcon:e.createElement(k.Z,null),size:"S"},s({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null,title:B,subtitle:s({id:"Settings.roles.list.description",defaultMessage:"List of roles"}),as:"h2"}),h&&e.createElement(U.Z,{startActions:e.createElement(n.m,{label:s({id:"app.component.search.label",defaultMessage:"Search for {target}"},{target:B})})}),h&&e.createElement(S.D,null,e.createElement(E.i,{colCount:A,rowCount:m,footer:l?e.createElement(F.c,{onClick:C,icon:e.createElement(k.Z,null)},s({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null},e.createElement(K.h,null,e.createElement(V.Tr,{"aria-rowindex":1},e.createElement(v.Th,null,e.createElement(O.Z,{variant:"sigma",textColor:"neutral600"},s({id:"global.name",defaultMessage:"Name"}))),e.createElement(v.Th,null,e.createElement(O.Z,{variant:"sigma",textColor:"neutral600"},s({id:"global.description",defaultMessage:"Description"}))),e.createElement(v.Th,null,e.createElement(O.Z,{variant:"sigma",textColor:"neutral600"},s({id:"global.users",defaultMessage:"Users"}))),e.createElement(v.Th,null,e.createElement(z.T,null,s({id:"global.actions",defaultMessage:"Actions"}))))),e.createElement(X.p,null,r?.map((g,I)=>e.createElement(oe,{key:g.id,id:g.id,name:g.name,description:g.description,usersCount:g.usersCount,icons:u(g),rowIndex:I+2,canUpdate:o})))),!m&&!M&&e.createElement(te,null)),e.createElement(n.QH,{isOpen:R,onConfirm:j,isConfirmButtonLoading:D,onToggleDialog:P}))},ge=()=>{const s=(0,f.v9)(T._);return e.createElement(n.O4,{permissions:s.settings.roles.main},e.createElement(me,null))}},99223:function(N,x,t){t.d(x,{Z:function(){return f}});var e=t(74512),n=t(87933);const f=({startActions:T,endActions:y})=>!T&&!y?null:(0,e.jsxs)(n.k,{justifyContent:"space-between",alignItems:"flex-start",paddingBottom:4,paddingLeft:10,paddingRight:10,children:[(0,e.jsx)(n.k,{gap:2,wrap:"wrap",children:T}),(0,e.jsx)(n.k,{gap:2,shrink:0,wrap:"wrap",children:y})]})},73269:function(N,x,t){t.d(x,{c:function(){return S}});var e=t(74512),n=t(8471),f=t(72850),T=t(9026),y=t(87933),b=t(49372);const W=(0,n.ZP)(f.x)`
3
3
  height: ${24/16}rem;
4
4
  width: ${24/16}rem;