@strapi/admin 4.12.1 → 4.12.2

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 (66) hide show
  1. package/admin/src/content-manager/pages/EditSettingsView/index.js +1 -1
  2. package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/SelectedEntriesModal/index.js +7 -2
  3. package/admin/src/content-manager/pages/ListView/index.js +7 -1
  4. package/admin/src/hooks/index.js +0 -3
  5. package/admin/src/hooks/useAdminRolePermissions/__mocks__/index.js +5 -0
  6. package/admin/src/hooks/useAdminRolePermissions/index.js +34 -0
  7. package/admin/src/hooks/useAdminRoles/__mocks__/index.js +5 -0
  8. package/admin/src/hooks/useAdminRoles/index.js +40 -0
  9. package/admin/src/pages/InstalledPluginsPage/Plugins.js +2 -2
  10. package/admin/src/pages/InstalledPluginsPage/hooks/usePlugins/index.js +29 -0
  11. package/admin/src/pages/MarketplacePage/hooks/useFetchMarketplacePlugins/index.js +44 -0
  12. package/admin/src/pages/MarketplacePage/hooks/useFetchMarketplaceProviders/index.js +44 -0
  13. package/admin/src/pages/MarketplacePage/utils/useMarketplaceData.js +2 -2
  14. package/admin/src/pages/SettingsPage/pages/Roles/CreatePage/index.js +24 -9
  15. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RoleForm/index.js +1 -0
  16. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/index.js +34 -20
  17. package/admin/src/pages/SettingsPage/pages/Roles/ListPage/index.js +31 -84
  18. package/admin/src/pages/SettingsPage/pages/Roles/hooks/useAdminRolePermissionLayout/index.js +23 -0
  19. package/admin/src/translations/en.json +1 -1
  20. package/build/1049.f76cb14b.chunk.js +1 -0
  21. package/build/{2225.0e4f8c77.chunk.js → 2225.c6244756.chunk.js} +1 -1
  22. package/build/{Admin-authenticatedApp.8dfbc48d.chunk.js → Admin-authenticatedApp.3c585a0d.chunk.js} +2 -2
  23. package/build/{Admin_marketplace.f0b87fce.chunk.js → Admin_marketplace.dde9c148.chunk.js} +6 -6
  24. package/build/Admin_pluginsPage.bbe79434.chunk.js +6 -0
  25. package/build/{Admin_profilePage.ca82c67b.chunk.js → Admin_profilePage.192edc52.chunk.js} +1 -1
  26. package/build/{Admin_settingsPage.50c867bf.chunk.js → Admin_settingsPage.97cb9d41.chunk.js} +1 -1
  27. package/build/admin-app.91898385.chunk.js +36 -0
  28. package/build/admin-edit-roles-page.6d567273.chunk.js +267 -0
  29. package/build/admin-roles-list.23ddff26.chunk.js +22 -0
  30. package/build/content-manager.2af15f57.chunk.js +1099 -0
  31. package/build/content-type-builder.40534de5.chunk.js +170 -0
  32. package/build/{en-json.01456e61.chunk.js → en-json.08c05fcf.chunk.js} +1 -1
  33. package/build/index.html +1 -1
  34. package/build/{main.1f8cc299.js → main.f13fc96c.js} +204 -204
  35. package/build/{runtime~main.80a43c16.js → runtime~main.2902859a.js} +2 -2
  36. package/build/sso-settings-page.12b6d8ae.chunk.js +1 -0
  37. package/build/transfer-tokens-list-page.22147d2c.chunk.js +16 -0
  38. package/build/{upload.77d8a64c.chunk.js → upload.37488080.chunk.js} +3 -3
  39. package/ee/admin/pages/SettingsPage/pages/SingleSignOn/index.js +15 -24
  40. package/index.js +2 -0
  41. package/package.json +8 -8
  42. package/scripts/build.js +1 -0
  43. package/server/controllers/role.js +9 -1
  44. package/server/services/role.js +3 -2
  45. package/webpack.config.js +2 -1
  46. package/admin/src/hooks/marketplace/useFetchMarketplacePlugins/index.js +0 -44
  47. package/admin/src/hooks/marketplace/useFetchMarketplaceProviders/index.js +0 -44
  48. package/admin/src/hooks/useFetchEnabledPlugins/index.js +0 -24
  49. package/admin/src/hooks/useFetchEnabledPlugins/utils/api.js +0 -10
  50. package/admin/src/hooks/useFetchPermissionsLayout/index.js +0 -42
  51. package/admin/src/hooks/useFetchPermissionsLayout/reducer.js +0 -35
  52. package/admin/src/hooks/useFetchRole/index.js +0 -68
  53. package/admin/src/hooks/useFetchRole/reducer.js +0 -33
  54. package/admin/src/hooks/useRolesList/index.js +0 -58
  55. package/admin/src/hooks/useRolesList/init.js +0 -5
  56. package/admin/src/hooks/useRolesList/reducer.js +0 -31
  57. package/build/1049.c3d082e9.chunk.js +0 -1
  58. package/build/Admin_pluginsPage.8728ff6e.chunk.js +0 -6
  59. package/build/admin-app.041dcd81.chunk.js +0 -36
  60. package/build/admin-edit-roles-page.a49b9f4f.chunk.js +0 -267
  61. package/build/admin-roles-list.0c129e98.chunk.js +0 -23
  62. package/build/content-manager.098eb004.chunk.js +0 -1099
  63. package/build/content-type-builder.64f4d6ac.chunk.js +0 -170
  64. package/build/sso-settings-page.81152e62.chunk.js +0 -1
  65. package/build/transfer-tokens-list-page.692eee77.chunk.js +0 -16
  66. /package/admin/src/{hooks/marketplace → pages/MarketplacePage}/constants.js +0 -0
@@ -1,4 +1,4 @@
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(24388),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._)`
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(79652),y=t(9592),T=t(24388),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
2
  opacity: 0;
3
3
  position: absolute;
4
4
  top: 0;
@@ -0,0 +1,36 @@
1
+ (self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5538],{58917:function(Z,v,t){"use strict";t.r(v),t.d(v,{default:function(){return Ls}});var e=t(32735),p=t(12301),P=t(65810),h=t(56784),u=t.n(h),f=t(93839),V=t.n(f),$=t(86349),b=t.n($),ee=t(88423),U=t.n(ee),de=t(74758),N=t(14911),W=t(47750),be="strapi-admin-language",i=t(19565),Ie=t(60216),a=t.n(Ie),S=t(20108),R=t(15062),H=t(76402),Ee=t(97889);const Ce={menuLogo:null,authLogo:null};var Ye=(o=Ce,s)=>(0,Ee.ZP)(o,n=>{switch(s.type){case"UPDATE_PROJECT_SETTINGS":{Object.assign(n,s.values);break}default:return n}});const re=({children:o,authLogo:s,menuLogo:n,showReleaseNotification:r,showTutorials:l})=>{const[{menuLogo:d,authLogo:c},m]=(0,e.useReducer)(Ye,Ce),M=(0,e.useCallback)(({menuLogo:k,authLogo:T})=>m({type:"UPDATE_PROJECT_SETTINGS",values:{menuLogo:k||n,authLogo:T||s}}),[s,n]),A=(0,e.useMemo)(()=>({logos:{menu:{custom:d,default:n},auth:{custom:c,default:s}},updateProjectSettings:M,showReleaseNotification:r,showTutorials:l}),[d,n,c,s,M,r,l]);return e.createElement(H._5.Provider,{value:A},o)};re.propTypes={authLogo:a().string.isRequired,children:a().element.isRequired,menuLogo:a().string.isRequired,showReleaseNotification:a().bool.isRequired,showTutorials:a().bool.isRequired};var Fe=re,Me=t(33795),Ae=t.n(Me),Oe=t(3040),we=t.n(Oe);const Xe="GUIDED_TOUR_CURRENT_STEP",Ke="GUIDED_TOUR_COMPLETED_STEPS",_e="GUIDED_TOUR_SKIPPED",je=JSON.parse,qe=JSON.stringify;var Re={clear(){localStorage.removeItem(Xe),localStorage.removeItem(Ke)},addCompletedStep(o){const s=je(localStorage.getItem(Ke))?.slice()||[];s.includes(o)||(s.push(o),localStorage.setItem(Ke,qe(s)))},addCurrentStep(o){localStorage.setItem(Xe,qe(o))},setSkipped(o){localStorage.setItem(_e,qe(o))},get(o){return je(localStorage.getItem(o))}},et=o=>{const s={...o},n=Re.get(Ke),r=Re.get(Xe),l=Re.get(_e);if(n&&n.forEach(d=>{const[c,m]=d.split(".");we()(s,["guidedTourState",c,m],!0)}),r){const[d,c]=r.split(".");we()(s,["guidedTourState",d,c],!0),Re.addCompletedStep(r),Re.addCurrentStep(null)}return l!==null&&we()(s,"isSkipped",l),s};const tt={currentStep:null,guidedTourState:{contentTypeBuilder:{create:!1,success:!1},contentManager:{create:!1,success:!1},apiTokens:{create:!1,success:!1}},isGuidedTourVisible:!1,isSkipped:!0};var mt=(o=tt,s)=>(0,Ee.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}}),gt=(o,s)=>{const n=Object.entries(s),r=n.findIndex(([d])=>d===o);return n.slice(0,r).every(([,d])=>Object.values(d).every(Boolean))},pt=(o,s)=>{const n=o.split("."),r=n[1],l=Object.entries(s[n[0]]),d=l.findIndex(([m])=>m===r);return l.slice(0,d).every(([,m])=>m)};const st=({children:o})=>{const[{currentStep:s,guidedTourState:n,isGuidedTourVisible:r,isSkipped:l},d]=(0,e.useReducer)(mt,tt,et),c=T=>{if(T!==null){const Y=Ae()(n,T),X=pt(T,n);if(Y||l||!X)return null}return Re.addCurrentStep(T),d({type:"SET_CURRENT_STEP",step:T})},m=T=>{d({type:"SET_GUIDED_TOUR_VISIBILITY",value:T})},M=(T,Y)=>{Re.addCompletedStep(T),d({type:"SET_STEP_STATE",currentStep:T,value:Y})},A=T=>{const Y=n[T];if(Y){const X=gt(T,n),x=Object.keys(Y)[0],le=Y[x];if(X&&!s&&!le)return c(`${T}.${x}`)}return null},k=T=>{Re.setSkipped(T),d({type:"SET_SKIPPED",value:T})};return e.createElement(i.Zc,{guidedTourState:n,currentStep:s,setCurrentStep:c,setGuidedTourVisibility:m,setSkipped:k,setStepState:M,startSection:A,isGuidedTourVisible:r,isSkipped:l},o)};st.propTypes={children:a().element.isRequired};var ft=st,bt=t(58732),ht=t.n(bt),It=t(78023),Et=t(33229);const vt=({changeLocale:o,children:s,localeNames:n})=>e.createElement(Et.Z.Provider,{value:{changeLocale:o,localeNames:n}},s);vt.propTypes={changeLocale:a().func.isRequired,children:a().element.isRequired,localeNames:a().object.isRequired};var yt=vt,g=o=>{const s=window.localStorage.getItem(be);return{locale:o[s]?s:"en",localeNames:o}};const E={localeNames:{en:"English"},locale:"en"};var ce=(o=E,s)=>{switch(s.type){case"CHANGE_LOCALE":{const{locale:n}=s;return o.localeNames[n]?{...o,locale:n}:o}default:return o}};const K=({children:o,localeNames:s,messages:n})=>{const[{locale:r},l]=(0,e.useReducer)(ce,E,()=>g(s));(0,e.useEffect)(()=>{window.localStorage.setItem(be,r),document.documentElement.setAttribute("lang",r)},[r]);const d=m=>{l({type:"CHANGE_LOCALE",locale:m})},c=ht()(n[r],n.en);return e.createElement(It.Z,{locale:r,defaultLocale:"en",messages:c,textComponent:"span"},e.createElement(yt,{changeLocale:d,localeNames:s},o))};K.propTypes={children:a().element.isRequired,localeNames:a().objectOf(a().string).isRequired,messages:a().object.isRequired};var ne=K,ie=t(24854),B=t(67879),me=t(79652),I=t(8471),De=(0,I.vJ)`
2
+ body {
3
+ background: ${({theme:o})=>o.colors.neutral100};
4
+ }
5
+ `;const ze=({children:o})=>{const{currentTheme:s,themes:n}=(0,me.M1)(),{locale:r}=(0,B.Z)();return e.createElement(ie.h,{locale:r,theme:n[s]||n.light},o,e.createElement(De,null))};ze.propTypes={children:a().element.isRequired};var Ge=ze;const ke="STRAPI_THEME",nt=()=>{const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",s=localStorage.getItem(ke);return s||localStorage.setItem(ke,o),s||o},Ue=({children:o,themes:s})=>{const[n,r]=(0,e.useState)(nt()),l=(0,e.useCallback)(c=>{r(c),localStorage.setItem(ke,c)},[r]),d=(0,e.useMemo)(()=>({currentTheme:n,onChangeTheme:l,themes:s}),[n,l,s]);return e.createElement(H.Rj.Provider,{value:d},o)};Ue.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 xe=Ue;const Ve=new S.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),ge=({authLogo:o,children:s,components:n,customFields:r,fields:l,getAdminInjectedComponents:d,getPlugin:c,localeNames:m,menu:M,menuLogo:A,messages:k,plugins:T,runHookParallel:Y,runHookSeries:X,runHookWaterfall:x,settings:le,showReleaseNotification:C,showTutorials:Ne,store:We,themes:z})=>e.createElement(ne,{messages:k,localeNames:m},e.createElement(xe,{themes:z},e.createElement(Ge,null,e.createElement(S.QueryClientProvider,{client:Ve},e.createElement(R.zt,{store:We},e.createElement(H.ux.Provider,{value:{getAdminInjectedComponents:d}},e.createElement(Fe,{authLogo:o,menuLogo:A,showReleaseNotification:C,showTutorials:Ne},e.createElement(i._Y,{getPlugin:c,menu:M,plugins:T,runHookParallel:Y,runHookWaterfall:x,runHookSeries:X,settings:le},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(ft,null,e.createElement(i.N$,null,s))))))))))))));ge.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 ae=ge,J=t(59883),Q=t(6680);const Ze=(o,s)=>{let n=Q.compose;const r=[];o.forEach(d=>{r.push(d())});const l=(0,Q.createStore)(Dt(s,{}),{},n((0,Q.applyMiddleware)(...r)));return l.asyncReducers={},l.injectReducer=(d,c)=>{l.asyncReducers[d]=c,l.replaceReducer(Dt(s,l.asyncReducers))},l},Dt=(o,s)=>(0,Q.combineReducers)({...o,...s});var Vt=Ze,$t=t(35231),Jt=()=>{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)))}}},at=t(66941),Qt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAXVBMVEUAAABIRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9JRf9IRf9IRP5IRP5JRP9JRf////+Vk/+zsv++vf9mY/9taf9/fP+Jh//c3P9RTf/Ibar2AAAAFHRSTlMA/MJX+fPt48cahaff1dMaGqcahSpTPmAAAAEvSURBVFjD7dfNTsMwEATgXcf5cdKEtixtcYH3f0xEibIguba1g8Slc+58iqUedmhNaMbJzX3Xema5G2bfdv3iprE50s80g7Yqw0Oz1Z+cmOL2a38nxuy+BSfmuNv7BUhDRAMCDESBEYCDvsD6hmcMGGnCgIkcBjhaMGCmHgN66jCgoxYDWvIY4IkxgHFAkrmeU7kmfpkG4uUllXMtEE82QPs2QPs2QPs2QPs2QPsAoH0DoH0LoH0QeN3ydtnyXg38ok76MQ/gAfwf8JH8V18LQOljomBAFAyIkga4CGT7XAtEuQf4IpDri6e2BoiZA6OrAGLuxOnLQMweWXMRyPVlwQ/NAwZMNGLACJ/76ODYo5MHHl3o7EOHZ6BbjtbpG/5kfOv8P7ilbv7PX/M/rMVPqrI3XI3nd3sAAAAASUVORK5CYII=",Yt={admin:{tutorials:{links:[]}},contentManager:{editView:{informations:[],"right-links":[]},listView:{actions:[],deleteModalAdditionalInfos:[],publishModalAdditionalInfos:[],unpublishModalAdditionalInfos:[]}}},Xt=t(10728),ve=t(53038);const kt=({component:o,path:s,...n})=>{const{pathname:r,search:l}=(0,ve.TH)();return e.createElement(ve.AW,{path:s,render:d=>i.I8.getToken()!==null?e.createElement(o,{...n,...d}):e.createElement(ve.l_,{to:{pathname:"/auth/login",search:r!=="/"&&`?redirectTo=${encodeURIComponent(`${r}${l}`)}`}})})};kt.propTypes={component:a().any.isRequired,path:a().string.isRequired};var Ot=(0,e.memo)(kt);const wt={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 ot=t(9592),jt=t(24388),qt=t(84306),_t=t(39935),es=t.n(_t),ts=t(9086),rt=t.n(ts),ss=t(51399),ns=t(5074),se=t(11060),as=t(24436);const Pt=o=>e.createElement(se.ZP,null,e.createElement(as.Z,{...o}));Pt.defaultProps={onSubmit:o=>o.preventDefault()},Pt.propTypes={onSubmit:a().func};var D=t(24346),$e=t(27649),pe=t(72850),fe=t(49372),ye=t(87933),Be=t(10369),it=t(41415),Tt=t(92802),Je=t(73678);const St=({onSubmit:o,schema:s})=>{const{formatMessage:n}=(0,B.Z)();return e.createElement(se.ZP,null,e.createElement($e.o,null,e.createElement(se.bU,null,e.createElement(Tt.J9,{enableReinitialize:!0,initialValues:{email:""},onSubmit:o,validationSchema:s,validateOnChange:!1},({values:r,errors:l,handleChange:d})=>e.createElement(i.l0,{noValidate:!0},e.createElement(se.sg,null,e.createElement(Je.Z,null),e.createElement(pe.x,{paddingTop:6,paddingBottom:7},e.createElement(fe.Z,{as:"h1",variant:"alpha"},n({id:"Auth.form.button.password-recovery",defaultMessage:"Password Recovery"}))),l.errorMessage&&e.createElement(fe.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},n({id:l.errorMessage,defaultMessage:"An error occurred"}))),e.createElement(ye.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Be.o,{error:l.email?n({id:l.email,defaultMessage:"This email is invalid."}):"",value:r.email,onChange:d,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(it.z,{type:"submit",fullWidth:!0},n({id:"Auth.form.button.forgot-password",defaultMessage:"Send Email"})))))),e.createElement(ye.k,{justifyContent:"center"},e.createElement(pe.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},n({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};St.defaultProps={onSubmit:o=>o.preventDefault()},St.propTypes={onSubmit:a().func,schema:a().shape({type:a().string.isRequired}).isRequired};var os=St,rs=()=>{const{formatMessage:o}=(0,B.Z)();return e.createElement(se.ZP,null,e.createElement($e.o,null,e.createElement(se.bU,null,e.createElement(se.sg,null,e.createElement(Je.Z,null),e.createElement(pe.x,{paddingTop:6,paddingBottom:7},e.createElement(fe.Z,{as:"h1",variant:"alpha"},o({id:"app.containers.AuthPage.ForgotPasswordSuccess.title",defaultMessage:"Email sent"}))),e.createElement(fe.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(pe.x,{paddingTop:4},e.createElement(fe.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(ye.k,{justifyContent:"center"},e.createElement(pe.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},is=()=>{const{formatMessage:o}=(0,B.Z)(),n=(0,i.aM)().get("info")||o({id:"Auth.components.Oops.text",defaultMessage:"Your account has been suspended."});return e.createElement(se.ZP,null,e.createElement($e.o,null,e.createElement(se.bU,null,e.createElement(se.sg,null,e.createElement(Je.Z,null),e.createElement(pe.x,{paddingTop:6,paddingBottom:7},e.createElement(fe.Z,{as:"h1",variant:"alpha"},o({id:"Auth.components.Oops.title",defaultMessage:"Oops..."}))),e.createElement(fe.Z,null,n),e.createElement(pe.x,{paddingTop:4},e.createElement(fe.Z,null,o({id:"Auth.components.Oops.text.admin",defaultMessage:"If this is a mistake, please contact your administrator."}))))),e.createElement(ye.k,{justifyContent:"center"},e.createElement(pe.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},ls=t(15335),Ut=t(5803),us=t(8284),lt=t(54894),ut=t(60492),ct=t(24018);const xt=I.ZP.a`
6
+ color: ${({theme:o})=>o.colors.primary600};
7
+ `,Zt=(0,I.ZP)(Be.o)`
8
+ ::-ms-reveal {
9
+ display: none;
10
+ }
11
+ `,Ct=({authType:o,fieldsToDisable:s,noSignin:n,onSubmit:r,schema:l})=>{const d=(0,i.lm)(),{push:c}=(0,ve.k6)(),[m,M]=(0,e.useState)(!1),[A,k]=(0,e.useState)(!1),[T,Y]=(0,e.useState)(0),[X,x]=(0,e.useState)({}),{trackUsage:le}=(0,i.rS)(),{formatMessage:C}=(0,B.Z)(),Ne=(0,i.aM)(),{formatAPIError:We}=(0,i.So)(),{get:z}=(0,i.kY)(),q=Ne.get("registrationToken");(0,e.useEffect)(()=>{q&&(async()=>{try{const{data:{data:L}}=await z("/admin/registration-info",{params:{registrationToken:q}});L&&x(L)}catch(L){const O=We(L);d({type:"warning",message:O}),c(`/auth/oops?info=${encodeURIComponent(O)}`)}})()},[q]);function Pe(ue){return Object.entries(ue).reduce((L,[O,_])=>{let he=_;return!["password","confirmPassword"].includes(O)&&typeof _=="string"&&(he=he.trim(),O==="lastname"&&(he=he||null)),L[O]=he,L},{})}return e.createElement(se.ZP,null,e.createElement(se.bU,null,e.createElement(Tt.J9,{enableReinitialize:!0,initialValues:{firstname:X.firstname||"",lastname:X.lastname||"",email:X.email||"",password:"",confirmPassword:"",registrationToken:q||void 0,news:!1},onSubmit:async(ue,L)=>{const O=Pe(ue);try{await l.validate(O,{abortEarly:!1}),T>0&&o==="register-admin"&&le("didSubmitWithErrorsFirstAdmin",{count:T.toString()}),r(q?{userInfo:rt()(O,["registrationToken"]),registrationToken:q}:O,L)}catch(_){const he=(0,i.CJ)(_);Y(T+1),L.setErrors(he)}},validateOnChange:!1},({values:ue,errors:L,handleChange:O})=>e.createElement(i.l0,{noValidate:!0},e.createElement($e.o,null,e.createElement(ye.k,{direction:"column",alignItems:"center",gap:3},e.createElement(Je.Z,null),e.createElement(fe.Z,{as:"h1",variant:"alpha",textAlign:"center"},C({id:"Auth.form.welcome.title",defaultMessage:"Welcome to Strapi!"})),e.createElement(fe.Z,{variant:"epsilon",textColor:"neutral600",textAlign:"center"},C({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(ye.k,{direction:"column",alignItems:"stretch",gap:6,marginTop:7},e.createElement(ls.r,{gap:4},e.createElement(Ut.P,{col:6},e.createElement(Be.o,{name:"firstname",required:!0,value:ue.firstname,error:L.firstname?C(L.firstname):void 0,onChange:O,label:C({id:"Auth.form.firstname.label",defaultMessage:"Firstname"})})),e.createElement(Ut.P,{col:6},e.createElement(Be.o,{name:"lastname",value:ue.lastname,onChange:O,label:C({id:"Auth.form.lastname.label",defaultMessage:"Lastname"})}))),e.createElement(Be.o,{name:"email",disabled:s.includes("email"),value:ue.email,onChange:O,error:L.email?C(L.email):void 0,required:!0,label:C({id:"Auth.form.email.label",defaultMessage:"Email"}),type:"email"}),e.createElement(Zt,{name:"password",onChange:O,value:ue.password,error:L.password?C(L.password):void 0,endAction:e.createElement(ct.Z,{onClick:_=>{_.preventDefault(),M(he=>!he)},label:C(m?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},m?e.createElement(lt.Z,null):e.createElement(ut.Z,null)),hint:C({id:"Auth.form.password.hint",defaultMessage:"Must be at least 8 characters, 1 uppercase, 1 lowercase & 1 number"}),required:!0,label:C({id:"global.password",defaultMessage:"Password"}),type:m?"text":"password"}),e.createElement(Zt,{name:"confirmPassword",onChange:O,value:ue.confirmPassword,error:L.confirmPassword?C(L.confirmPassword):void 0,endAction:e.createElement(ct.Z,{onClick:_=>{_.preventDefault(),k(he=>!he)},label:C(A?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},A?e.createElement(lt.Z,null):e.createElement(ut.Z,null)),required:!0,label:C({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirm Password"}),type:A?"text":"password"}),e.createElement(us.X,{onValueChange:_=>{O({target:{value:_,name:"news"}})},value:ue.news,name:"news","aria-label":"news"},C({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(xt,{target:"_blank",href:"https://strapi.io/terms",rel:"noreferrer"},C({id:"Auth.privacy-policy-agreement.terms",defaultMessage:"terms"})),policy:e.createElement(xt,{target:"_blank",href:"https://strapi.io/privacy",rel:"noreferrer"},C({id:"Auth.privacy-policy-agreement.policy",defaultMessage:"policy"}))})),e.createElement(it.z,{fullWidth:!0,size:"L",type:"submit"},C({id:"Auth.form.button.register",defaultMessage:"Let's start"})))))),!n&&e.createElement(pe.x,{paddingTop:4},e.createElement(ye.k,{justifyContent:"center"},e.createElement(i.rU,{label:"Auth.link.signin",to:"/auth/login"},C({id:"Auth.link.signin.account",defaultMessage:"Already have an account?"}))))))};Ct.defaultProps={fieldsToDisable:[],noSignin:!1,onSubmit:o=>o.preventDefault()},Ct.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 Bt=Ct;const Nt=(0,I.ZP)(Be.o)`
12
+ ::-ms-reveal {
13
+ display: none;
14
+ }
15
+ `,Rt=({onSubmit:o,schema:s})=>{const[n,r]=(0,e.useState)(!1),[l,d]=(0,e.useState)(!1),{formatMessage:c}=(0,B.Z)();return e.createElement(se.ZP,null,e.createElement($e.o,null,e.createElement(se.bU,null,e.createElement(Tt.J9,{enableReinitialize:!0,initialValues:{password:"",confirmPassword:""},onSubmit:o,validationSchema:s,validateOnChange:!1},({values:m,errors:M,handleChange:A})=>e.createElement(i.l0,{noValidate:!0},e.createElement(se.sg,null,e.createElement(Je.Z,null),e.createElement(pe.x,{paddingTop:6,paddingBottom:7},e.createElement(fe.Z,{as:"h1",variant:"alpha"},c({id:"global.reset-password",defaultMessage:"Reset password"}))),M.errorMessage&&e.createElement(fe.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},c({id:M.errorMessage,defaultMessage:"An error occurred"}))),e.createElement(ye.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Nt,{name:"password",onChange:A,value:m.password,error:M.password?c({id:M.password,defaultMessage:"This field is required."}):void 0,endAction:e.createElement(ct.Z,{onClick:k=>{k.preventDefault(),r(T=>!T)},label:c(n?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},n?e.createElement(lt.Z,null):e.createElement(ut.Z,null)),hint:c({id:"Auth.form.password.hint",defaultMessage:"Password must contain at least 8 characters, 1 uppercase, 1 lowercase and 1 number"}),required:!0,label:c({id:"global.password",defaultMessage:"Password"}),type:n?"text":"password"}),e.createElement(Nt,{name:"confirmPassword",onChange:A,value:m.confirmPassword,error:M.confirmPassword?c({id:M.confirmPassword,defaultMessage:"This value is required."}):void 0,endAction:e.createElement(ct.Z,{onClick:k=>{k.preventDefault(),d(T=>!T)},label:c(n?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},l?e.createElement(lt.Z,null):e.createElement(ut.Z,null)),required:!0,label:c({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirm Password"}),type:l?"text":"password"}),e.createElement(it.z,{fullwidth:!0,type:"submit"},c({id:"global.change-password",defaultMessage:"Change password"})))))),e.createElement(ye.k,{justifyContent:"center"},e.createElement(pe.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},c({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};Rt.defaultProps={onSubmit:o=>o.preventDefault()},Rt.propTypes={onSubmit:a().func,schema:a().shape({type:a().string.isRequired}).isRequired};var cs=Rt;const Wt={"forgot-password":{Component:os,endPoint:"forgot-password",fieldsToDisable:[],fieldsToOmit:[],schema:D.Ry().shape({email:D.Z_().email(i.I0.email).required(i.I0.required)}),inputsPrefix:""},"forgot-password-success":{Component:rs,endPoint:"",fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},login:{endPoint:"login",fieldsToDisable:[],fieldsToOmit:["rememberMe"],schema:D.Ry().shape({email:D.Z_().email(i.I0.email).required(i.I0.required),password:D.Z_().required(i.I0.required),rememberMe:D.Xg().nullable()}),inputsPrefix:""},oops:{Component:is,endPoint:null,fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},register:{Component:Bt,endPoint:"register",fieldsToDisable:["email"],fieldsToOmit:["userInfo.confirmPassword","userInfo.news","userInfo.email"],schema:D.Ry().shape({firstname:D.Z_().trim().required(i.I0.required),lastname:D.Z_().nullable(),password:D.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:D.Z_().oneOf([D.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required),registrationToken:D.Z_().required(i.I0.required)}),inputsPrefix:"userInfo."},"register-admin":{Component:Bt,endPoint:"register-admin",noSignin:!0,fieldsToDisable:[],fieldsToOmit:["confirmPassword","news"],schema:D.Ry().shape({firstname:D.Z_().trim().required(i.I0.required),lastname:D.Z_().nullable(),password:D.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:D.Z_().email(i.I0.email).strict().lowercase(i.I0.lowercase).required(i.I0.required),confirmPassword:D.Z_().oneOf([D.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required)}),inputsPrefix:""},"reset-password":{Component:cs,endPoint:"reset-password",fieldsToDisable:[],fieldsToOmit:["confirmPassword"],schema:D.Ry().shape({password:D.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:D.Z_().oneOf([D.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required)})}};var ds=o=>o;const Ht={formErrors:{},modifiedData:{},requestError:null},ms=(o,s)=>(0,Ee.ZP)(o,n=>{switch(s.type){case"ON_CHANGE":{we()(n.modifiedData,s.keys.split("."),s.value);break}case"RESET_PROPS":return Ht;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}}),Mt=({hasAdmin:o,setHasAdmin:s})=>{const{push:n,location:{search:r}}=(0,ve.k6)(),{changeLocale:l}=(0,ss.Z)(),{setSkipped:d}=(0,i.c1)(),{trackUsage:c}=(0,i.rS)(),{params:{authType:m}}=(0,ve.$B)("/auth/:authType"),M=(0,i.aM)(),A=(0,ot.c)(Pt,async()=>(await t.e(2395).then(t.bind(t,82395))).LoginEE),k=(0,ot.c)(Wt,async()=>(await t.e(8276).then(t.bind(t,18276))).FORMS,{combine(w,G){return{...w,...G}},defaultValue:Wt}),[{formErrors:T,modifiedData:Y,requestError:X},x]=(0,e.useReducer)(ms,Ht,ds),C=qt.default.CancelToken.source(),{endPoint:Ne,fieldsToDisable:We,fieldsToOmit:z,inputsPrefix:q,schema:Pe,...ue}=k?.[m]??{};(0,e.useEffect)(()=>()=>{C.cancel("Component unmounted")},[]);const{post:L}=(0,i.kY)();(0,e.useEffect)(()=>{x({type:"RESET_PROPS"})},[m]);const O=({target:{name:w,value:G}})=>{x({type:"ON_CHANGE",keys:w,value:G})},_=async(w,{setSubmitting:G,setErrors:Te})=>{G(!0);const Le=rt()(w,z),j=`/admin/${Ne}`;m==="login"&&await bs(w,j,{setSubmitting:G,setErrors:Te}),(m==="register"||m==="register-admin")&&await Is(w,j,{setSubmitting:G,setErrors:Te}),m==="forgot-password"&&await he(Le,j,{setSubmitting:G,setErrors:Te}),m==="reset-password"&&await Ds(Le,j,{setSubmitting:G,setErrors:Te})},he=async(w,G,{setSubmitting:Te,setErrors:Le})=>{try{await L(G,w,{cancelToken:C.token}),n("/auth/forgot-password-success")}catch(j){console.error(j),Le({errorMessage:"notification.error"})}finally{Te(!1)}},bs=async(w,G,{setSubmitting:Te,setErrors:Le})=>{try{const{data:{data:{token:j,user:oe}}}=await L(G,rt()(w,z),{cancelToken:C.token});oe.preferedLanguage&&l(oe.preferedLanguage),i.I8.setToken(j,w.rememberMe),i.I8.setUserInfo(oe,w.rememberMe),Kt()}catch(j){if(j.response){const oe=Ae()(j,["response","data","error","message"],"Something went wrong");if(es()(oe).toLowerCase()==="usernotactive"){n("/auth/oops"),x({type:"RESET_PROPS"});return}Le({errorMessage:oe})}}finally{Te(!1)}},Is=async(w,G,{setSubmitting:Te,setErrors:Le})=>{try{c("willCreateFirstAdmin");const{data:{data:{token:j,user:oe}}}=await L(G,rt()(w,z),{cancelToken:C.token});i.I8.setToken(j,!1),i.I8.setUserInfo(oe,!1),Te(!1),s(!0);const{roles:Qe}=oe;if(Qe&&Qe.find(({code:Os})=>Os==="strapi-super-admin")&&(Re.setSkipped(!1),d(!1),c("didLaunchGuidedtour")),m==="register"&&w.userInfo.news===!0||m==="register-admin"&&w.news===!0){n({pathname:"/usecase",search:`?hasAdmin=${o}`});return}Kt()}catch(j){if(c("didNotCreateFirstAdmin"),j.response){const{data:oe}=j.response,Qe=(0,ns.Z)(oe);Le({apiErrors:Qe})}}},Ds=async(w,G,{setErrors:Te,setSubmitting:Le})=>{try{const{data:{data:{token:j,user:oe}}}=await L(G,{...w,resetPasswordToken:M.get("code")},{cancelToken:C.token});i.I8.setToken(j,!1),i.I8.setUserInfo(oe,!1),n("/")}catch(j){if(j.response){const oe=Ae()(j,["response","data","message"],"Something went wrong"),Qe=Ae()(j,["response","data","statusCode"],400);x({type:"SET_REQUEST_ERROR",errorMessage:oe,errorStatus:Qe}),Te({errorMessage:oe})}}finally{Le(!1)}},Kt=()=>{if(m==="login"){const w=M.get("redirectTo"),G=w?decodeURIComponent(w):"/";n(G)}else n("/")};if(!k[m]||o&&m==="register-admin"||i.I8.getToken())return e.createElement(ve.l_,{to:"/"});if(!o&&m!=="register-admin")return e.createElement(ve.l_,{to:{pathname:"/auth/register-admin",search:r}});if(A&&(k.login.Component=A),!A)return null;const{Component:ks}=k?.[m]??{};return e.createElement(ks,{...ue,authType:m,fieldsToDisable:We,formErrors:T,inputsPrefix:q,modifiedData:Y,onChange:O,onSubmit:_,requestError:X,schema:Pe})};Mt.defaultProps={hasAdmin:!1},Mt.propTypes={hasAdmin:a().bool,setHasAdmin:a().func.isRequired};var gs=Mt,ps=t(33248),fs=t(68465),hs=t(84967),Es=t(7563),vs=t(33348);const ys=[{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"}],Ps=(0,I.ZP)(fe.Z)`
16
+ text-align: center;
17
+ `;var Ts=()=>{const o=(0,i.lm)(),{push:s,location:n}=(0,ve.k6)(),{formatMessage:r}=(0,B.Z)(),[l,d]=(0,e.useState)(),[c,m]=(0,e.useState)(""),{post:M}=(0,i.kY)(),{firstname:A,email:k}=i.I8.getUserInfo(),{hasAdmin:T}=(0,vs.parse)(n?.search,{ignoreQueryPrefix:!0}),Y=l==="other",X=async(x,le)=>{x.preventDefault();try{await M("https://analytics.strapi.io/register",{email:k,username:A,firstAdmin:Boolean(!T),persona:{role:le?void 0:l,otherRole:le?void 0:c}}),o({type:"success",message:{id:"Usecase.notification.success.project-created",defaultMessage:"Project has been successfully created"}}),s("/")}catch{}};return e.createElement(se.ZP,null,e.createElement($e.o,{labelledBy:"usecase-title"},e.createElement(se.bU,null,e.createElement("form",{onSubmit:x=>X(x,!1)},e.createElement(ye.k,{direction:"column",paddingBottom:7},e.createElement(Je.Z,null),e.createElement(pe.x,{paddingTop:6,paddingBottom:1,width:(0,i.Q1)(250)},e.createElement(Ps,{variant:"alpha",as:"h1",id:"usecase-title"},r({id:"Usecase.title",defaultMessage:"Tell us a bit more about yourself"})))),e.createElement(ye.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(fs.P,{id:"usecase","data-testid":"usecase",label:r({id:"Usecase.input.work-type",defaultMessage:"What type of work do you do?"}),onChange:d,value:l},ys.map(({intlLabel:x,value:le})=>e.createElement(hs.W,{key:le,value:le},r(x)))),Y&&e.createElement(Be.o,{name:"other",label:r({id:"Usecase.other",defaultMessage:"Other"}),value:c,onChange:x=>m(x.target.value),"data-testid":"other"}),e.createElement(it.z,{type:"submit",size:"L",fullWidth:!0,disabled:!l},r({id:"global.finish",defaultMessage:"Finish"}))))),e.createElement(ye.k,{justifyContent:"center"},e.createElement(pe.x,{paddingTop:4},e.createElement(Es.A,{onClick:()=>X(!0)},r({id:"Usecase.button.skip",defaultMessage:"Skip this question"}))))))},Ft=t(4556);const Ss=(0,e.lazy)(()=>Promise.all([t.e(6691),t.e(801)]).then(t.bind(t,63546)));function Cs(){const o=(0,ot.c)(wt,async()=>(await t.e(3100).then(t.bind(t,73100))).ADMIN_PERMISSIONS_EE,{combine(z,q){return b()({},z,q)},defaultValue:wt}),s=(0,ot.c)(Ft.y3,async()=>(await t.e(1386).then(t.bind(t,31386))).ROUTES_EE,{defaultValue:[]}),n=(0,i.lm)(),{updateProjectSettings:r}=(0,me.um)(),{formatMessage:l}=(0,B.Z)(),[{isLoading:d,hasAdmin:c,uuid:m,deviceId:M},A]=(0,e.useState)({isLoading:!0,hasAdmin:!1}),k=(0,R.I0)(),T=(0,i.L7)(),{get:Y,post:X}=(0,i.kY)(),x=(0,e.useMemo)(()=>(0,jt.WW)(s.map(({to:z,Component:q,exact:Pe})=>(0,jt.ot)(q,z,Pe))),[s]),[le,C]=(0,e.useState)(null);(0,e.useEffect)(()=>{k({type:Ft.XS,payload:o})},[o,k]),(0,e.useEffect)(()=>{const z=i.I8.getToken();z&&(async()=>{try{const{data:{data:{token:Pe}}}=await X("/admin/renew-token",{token:z});i.I8.updateToken(Pe)}catch{i.I8.clearAppStorage(),window.location.reload()}})()},[X]),(0,e.useEffect)(()=>{(async()=>{try{const{data:{data:{hasAdmin:q,uuid:Pe,menuLogo:ue,authLogo:L}}}=await Y("/admin/init");if(r({menuLogo:(0,i.CR)(ue),authLogo:(0,i.CR)(L)}),Pe){const{data:{data:O}}=await Y("/admin/telemetry-properties",{validateStatus:_=>_<500});C(O);try{const _="didInitializeAdministration";await X("https://analytics.strapi.io/api/v2/track",{event:_,userId:"",deviceId:M,eventPropeties:{},userProperties:{environment:T.currentEnvironment},groupProperties:{...O,projectId:Pe}},{headers:{"X-Strapi-Event":_}})}catch{}}A({isLoading:!1,hasAdmin:q,uuid:Pe,deviceId:M})}catch{n({type:"warning",message:{id:"app.containers.App.notification.error.init"}})}})()},[n,r]);const Ne=z=>A(q=>({...q,hasAdmin:z})),We=(0,e.useMemo)(()=>({uuid:m,telemetryProperties:le,deviceId:M}),[m,le,M]);return d?e.createElement(i.dO,null):e.createElement(e.Suspense,{fallback:e.createElement(i.dO,null)},e.createElement(Xt.z,null,l({id:"skipToContent"})),e.createElement(i.L8,{value:We},e.createElement(ve.rs,null,x,e.createElement(ve.AW,{path:"/auth/:authType",render:z=>e.createElement(gs,{...z,setHasAdmin:Ne,hasAdmin:c}),exact:!0}),e.createElement(Ot,{path:"/usecase",component:Ts}),e.createElement(Ot,{path:"/",component:Ss}),e.createElement(ve.AW,{path:"",component:ps.default}))))}var Rs=Cs,Ms={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 As{constructor({adminConfig:s,appPlugins:n,library:r,middlewares:l,reducers:d}){this.customConfigurations=s.config,this.customBootstrapConfiguration=s.bootstrap,this.configurations={authLogo:W,head:{favicon:Qt},locales:["en"],menuLogo:W,notifications:{releases:!0},themes:{light:p.W,dark:P.$},translations:{},tutorials:!0},this.appPlugins=n||{},this.library=r,this.middlewares=l,this.plugins={},this.reducers=d,this.translations={},this.hooksDict={},this.admin={injectionZones:Yt},this.customFields=J.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);u()(s.to,`link.to should be defined for ${n}`),u()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),u()(["/plugins/content-type-builder","/plugins/upload"].includes(s.to),"This method is not available for your plugin"),u()(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);u()(s.to,`link.to should be defined for ${n}`),u()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),u()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${n}`),u()(s.Component&&typeof s.Component=="function","link.Component should be a valid React Component"),u()(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)=>{u()(this.settings[s],"The section does not exist");const r=JSON.stringify(n);u()(n.id,`link.id should be defined for ${r}`),u()(n.intlLabel?.id&&n.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${r}`),u()(n.to,`link.to should be defined for ${r}`),u()(n.Component&&typeof n.Component=="function","link.Component should be a valid React Component"),this.settings[s].links.push(n)};addSettingsLinks=(s,n)=>{u()(this.settings[s],"The section does not exist"),u()(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})}),V()(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(at.No),this.createHook(at.LK),this.createHook(at.dV),this.createHook(at.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."),b()(this.configurations.themes.light,this.customConfigurations.theme)),n&&b()(this.configurations.themes.light,n),s&&b()(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]=Jt()};createSettingSection=(s,n)=>{u()(s.id,"section.id should be defined"),u()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,"section.intlLabel should be defined"),u()(Array.isArray(n),"TypeError expected links to be an array"),u()(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=()=>Vt(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)=>{u()(this.admin.injectionZones.contentManager[s]?.[n],`The ${s} ${n} zone is not defined in the content manager`),u()(r,"A Component must be provided"),this.admin.injectionZones.contentManager[s][n].push(r)};injectAdminComponent=(s,n,r)=>{u()(this.admin.injectionZones.admin[s]?.[n],`The ${s} ${n} zone is not defined in the admin`),u()(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:d})=>({data:d,locale:l})).catch(()=>({data:null,locale:l})));return(await Promise.all(s)).reduce((l,d)=>(d.data&&(l[d.locale]=d.data),l),{})}async loadTrads(){const s=await this.loadAdminTrads(),n=Object.keys(this.appPlugins).map(c=>{const m=this.appPlugins[c].registerTrads;return m?m({locales:this.configurations.locales}):null}).filter(c=>c),l=(await Promise.all(n)).reduce((c,m)=>{const M=m.reduce((A,k)=>(A[k.locale]=k.data,A),{});return Object.keys(M).forEach(A=>{c[A]={...c[A],...M[A]}}),c},{}),d=this.configurations.locales.reduce((c,m)=>(c[m]={...s[m],...l[m]||{},...this.customConfigurations?.translations?.[m]},c),{});return this.configurations.translations=d,Promise.resolve()}registerHook=(s,n)=>{u()(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,J.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=U()(Ms,this.configurations.locales||[]),{components:{components:r},fields:{fields:l}}=this.library;return e.createElement(ae,{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:(d,c,m=!1)=>this.runHookWaterfall(d,c,m,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(de.q,{link:[{rel:"icon",type:"image/png",href:this.configurations.head.favicon}],htmlAttributes:{lang:localStorage.getItem(be)||"en"}}),e.createElement(N.VK,{basename:$t.Z},e.createElement(Rs,{store:s}))))}}var Ls=({adminConfig:o={},appPlugins:s,library:n,middlewares:r,reducers:l})=>new As({adminConfig:o,appPlugins:s,library:n,middlewares:r,reducers:l})},33229:function(Z,v,t){"use strict";var e=t(32735);const p=(0,e.createContext)();v.Z=p},51399:function(Z,v,t){"use strict";var e=t(32735),p=t(33229);const P=()=>{const{changeLocale:h,localeNames:u,messages:f}=(0,e.useContext)(p.Z);return{changeLocale:h,localeNames:u,messages:f}};v.Z=P},73678:function(Z,v,t){"use strict";var e=t(32735),p=t(8471),P=t(79652);const h=p.ZP.img`
18
+ height: ${72/16}rem;
19
+ `,u=()=>{const{logos:{auth:f}}=(0,P.um)();return e.createElement(h,{src:f?.custom??f.default,"aria-hidden":!0,alt:""})};v.Z=u},76402:function(Z,v,t){"use strict";t.d(v,{ux:function(){return P},_5:function(){return u},$l:function(){return V},Rj:function(){return b}});var e=t(32735),P=(0,e.createContext)({}),u=(0,e.createContext)({}),V=(0,e.createContext)({}),b=(0,e.createContext)({})},35231:function(Z,v){"use strict";const t="/admin/".replace(window.location.origin,"");v.Z=t},66941:function(Z,v,t){"use strict";t.d(v,{Eo:function(){return P},LK:function(){return p},No:function(){return e},dV:function(){return h}});const e="Admin/CM/pages/ListView/inject-column-in-table",p="Admin/CM/pages/App/mutate-collection-types-links",P="Admin/CM/pages/EditView/mutate-edit-view-layout",h="Admin/CM/pages/App/mutate-single-types-links"},79652:function(Z,v,t){"use strict";t.d(v,{um:function(){return h},H9:function(){return R},$_:function(){return Ee},rW:function(){return He},G4:function(){return mt},Te:function(){return Et},M1:function(){return yt}});var e=t(32735),p=t(76402),h=()=>(0,e.useContext)(p._5),u=t(90769),f=t(19565),V=t(2287),$=t(36919),b=t(45112),ee=t(15062),U=t(30305),de=t(99381),N=t.n(de),Se=(y,g)=>g.map(({permissions:E})=>(0,f.qX)(y,E)),i=async(y,g,E)=>{const F=Se(y,g),ce=await Promise.all(F),K=g.filter((B,me)=>ce[me]),ne=K.findIndex(B=>B.to==="/settings");if(ne===-1)return[];const ie=N()(K);return ie[ne].notificationsCount=E?1:0,ie},a=async(y,g)=>{const E=Se(y,g),F=await Promise.all(E);return g.filter((K,ne)=>F[ne])},R=()=>{const{allPermissions:y}=(0,f.vn)(),{shouldUpdateStrapi:g}=(0,f.L7)(),{menu:E}=(0,f.j1)(),F=(0,ee.v9)(U._),[ce,K]=e.useState({generalSectionLinks:[{icon:V.Z,intlLabel:{id:"global.plugins",defaultMessage:"Plugins"},to:"/list-plugins",permissions:F.marketplace.main},{icon:$.Z,intlLabel:{id:"global.marketplace",defaultMessage:"Marketplace"},to:"/marketplace",permissions:F.marketplace.main},{icon:b.Z,intlLabel:{id:"global.settings",defaultMessage:"Settings"},to:"/settings",permissions:[],notificationsCount:0}],pluginsSectionLinks:[],isLoading:!0}),ne=e.useRef(ce.generalSectionLinks);return e.useEffect(()=>{async function ie(){const B=await a(y,E),me=await i(y,ne.current,g);K(I=>({...I,generalSectionLinks:me,pluginsSectionLinks:B,isLoading:!1}))}ie()},[K,ne,y,E,F,g]),ce},Ee=()=>(0,e.useContext)(p.$l),He=(y,g,E,F)=>{const[ce,K]=(0,e.useState)(!1),ne=(0,f.lm)(),{post:ie}=(0,f.kY)(),{formatAPIError:B}=(0,f.So)();return{regenerateData:async()=>{try{const{data:{data:{accessKey:I}}}=await ie(`${y}${g}/regenerate`);K(!1),E(I)}catch(I){K(!1),F?F(I):ne({type:"warning",message:B(I)})}},isLoadingConfirmation:ce}};const Ye=!JSON.parse(localStorage.getItem("STRAPI_UPDATE_NOTIF")),re=()=>{const{latestStrapiReleaseTag:y,shouldUpdateStrapi:g}=useAppInfo(),E=useNotification();return useEffect(()=>{g&&Ye&&E({type:"info",message:{id:"notification.version.update.message"},link:{url:`https://github.com/strapi/strapi/releases/tag/${y}`,label:{id:"global.see-more"}},blockTransition:!0,onClose:()=>localStorage.setItem("STRAPI_UPDATE_NOTIF",!0)})},[y,g,E]),null};var Fe=null,Me=t(9086),Ae=t.n(Me),Oe=t(24388),Xe=(y,g)=>({...y,fieldsToPick:g}),Ke=t(97889),_e=t(88423),je=t.n(_e),qe=t(3040),dt=t.n(qe),Re=t(56236),At=t.n(Re);const et={fieldsToPick:[],formErrors:{},initialData:{},isLoading:!0,modifiedData:{},showHeaderButtonLoader:!1,showHeaderLoader:!0},tt=(y,g)=>(0,Ke.ZP)(y,E=>{switch(g.type){case"GET_DATA_SUCCEEDED":{E.isLoading=!1,E.showHeaderLoader=!1,E.initialData=je()(g.data,y.fieldsToPick),E.modifiedData=je()(g.data,y.fieldsToPick);break}case"ON_CANCEL":{E.modifiedData=y.initialData,E.formErrors={};break}case"ON_CHANGE":{g.inputType==="password"&&!g.value?At()(E.modifiedData,g.keys.split(".")):g.keys.includes("username")&&!g.value?dt()(E.modifiedData,g.keys.split("."),null):dt()(E.modifiedData,g.keys.split("."),g.value);break}case"ON_SUBMIT":{E.showHeaderButtonLoader=!0;break}case"ON_SUBMIT_SUCCEEDED":{E.initialData=je()(g.data,y.fieldsToPick),E.modifiedData=je()(g.data,y.fieldsToPick),E.showHeaderButtonLoader=!1;break}case"SET_ERRORS":{E.formErrors=g.errors,E.showHeaderButtonLoader=!1;break}default:return E}});var mt=(y,g,E,F)=>{const[{formErrors:ce,initialData:K,isLoading:ne,modifiedData:ie,showHeaderButtonLoader:B,showHeaderLoader:me},I]=(0,e.useReducer)(tt,et,()=>Xe(et,F)),te=(0,f.lm)(),{lockApp:De,unlockApp:ze}=(0,f.o1)(),{get:Ge,put:ke}=(0,f.kY)();return(0,e.useEffect)(()=>{y&&(async()=>{try{const{data:{data:ae}}=await Ge(y);I({type:"GET_DATA_SUCCEEDED",data:ae,fieldsToPick:F})}catch(ae){console.error(ae.response),te({type:"warning",message:{id:"notification.error"}})}})()},[y]),[{formErrors:ce,initialData:K,isLoading:ne,modifiedData:ie,showHeaderButtonLoader:B,showHeaderLoader:me},I,{handleCancel:()=>{I({type:"ON_CANCEL"})},handleChange:({target:{name:ge,value:ae,type:J}})=>{I({type:"ON_CHANGE",inputType:J,keys:ge,value:ae})},handleSubmit:async ge=>{ge.preventDefault();const ae=await(0,Oe.R6)(ie,g);if(I({type:"SET_ERRORS",errors:ae||{}}),!ae)try{De(),I({type:"ON_SUBMIT"});const J=Ae()(ie,["confirmPassword","registrationToken"]);J.roles&&(J.roles=J.roles.map(Ze=>Ze.id)),J.ssoLockedRoles&&(J.ssoLockedRoles=[...new Set(J.ssoLockedRoles)]);const{data:{data:Q}}=await ke(y,J);E(Q),I({type:"ON_SUBMIT_SUCCEEDED",data:Q}),te({type:"success",message:{id:"notification.success.saved"}})}catch(J){const Q=J?.response?.payload??{data:{}};Q?.data&&typeof Q.data=="string"?te({type:"warning",message:Q.data}):te({type:"warning",message:Q.message});const Ze=(0,Oe.Iz)(Q);I({type:"SET_ERRORS",errors:Ze})}finally{ze()}},setField:(ge,ae)=>{I({type:"ON_CHANGE",keys:ge,value:ae})}}]},Lt=t(9592);const gt={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 pt=y=>y.map(g=>{const E=g.links.map(F=>({...F,isDisplayed:!1}));return{...g,links:E}}),st=t(98978),ft=t.n(st),ht=y=>ft()(y,g=>g.id),Et=()=>{const[{isLoading:y,menu:g},E]=(0,e.useState)({isLoading:!0,menu:[]}),{allPermissions:F}=(0,f.vn)(),{shouldUpdateStrapi:ce}=(0,f.L7)(),{settings:K}=(0,f.j1)(),ne=(0,ee.v9)(U._),{global:ie,admin:B}=(0,Lt.c)(gt,async()=>(await t.e(918).then(t.bind(t,50918))).LINKS_EE,{combine(te,De){return{admin:[...De.admin,...te.admin],global:[...te.global,...De.global]}},defaultValue:{admin:[],global:[]}}),me=(0,e.useCallback)(te=>{if(!te.id)throw new Error("The settings menu item must have an id attribute.");return{...te,permissions:ne.settings?.[te.id]?.main}},[ne.settings]);(0,e.useEffect)(()=>{const te=async()=>{const nt=await(Ue=>Promise.all(Ue.reduce((xe,Ve,ge)=>{const ae=J=>J.map(async(Q,Ze)=>({hasPermission:await(0,f.qX)(F,Q.permissions),sectionIndex:ge,linkIndex:Ze}));return[...xe,...ae(Ve.links)]},[])))(Ge);E(Ue=>({...Ue,isLoading:!1,menu:Ge.map((xe,Ve)=>({...xe,links:xe.links.map((ge,ae)=>{const J=nt.find(Q=>Q.sectionIndex===Ve&&Q.linkIndex===ae);return{...ge,isDisplayed:Boolean(J.hasPermission)}})}))}))},{global:De,...ze}=K,Ge=pt([{...K.global,links:ht([...K.global.links,...ie.map(me)]).map(ke=>({...ke,hasNotification:ke.id==="000-application-infos"&&ce}))},{id:"permissions",intlLabel:{id:"Settings.permissions",defaultMessage:"Administration Panel"},links:B.map(me)},...Object.values(ze)]);te()},[B,ie,F,K,ce,me]);const I=te=>({...te,links:te.links.filter(De=>De.isDisplayed)});return{isLoading:y,menu:g.map(I)}},yt=()=>(0,e.useContext)(p.Rj)},90769:function(Z,v,t){"use strict";t.d(v,{G:function(){return P}});var e=t(19565),p=t(20108);function P(){const{get:h}=(0,e.kY)(),{formatAPIError:u}=(0,e.So)(),f=(0,e.lm)(),V=(0,p.useQueries)(["components","content-types"].map(N=>({queryKey:["content-manager",N],async queryFn(){const{data:{data:W}}=await h(`/content-manager/${N}`);return W},onError(W){f({type:"warning",message:u(W)})}}))),[$,b]=V,ee=$.isLoading||b.isLoading,U=(b?.data??[]).filter(N=>N.kind==="collectionType"&&N.isDisplayed),de=(b?.data??[]).filter(N=>N.kind!=="collectionType"&&N.isDisplayed);return{isLoading:ee,components:$?.data??[],collectionTypes:U,singleTypes:de}}},9592:function(Z,v,t){"use strict";t.d(v,{c:function(){return h}});var e=t(32735),p=t(19565);function P(){return window.strapi.isEE}function h(u,f,{defaultValue:V=null,combine:$=(ee,U)=>U,enabled:b=!0}={}){const ee=(0,p.W6)(f),U=(0,p.W6)($),[{data:de},N]=e.useState({data:P()&&b?V:u});return e.useEffect(()=>{async function W(){const Se=await ee();N({data:U(u,Se)})}P()&&b&&W()},[u,ee,U,b]),de}},11060:function(Z,v,t){"use strict";t.d(v,{sg:function(){return N},bU:function(){return W},ZP:function(){return be}});var e=t(32735),p=t(72850),P=t(87933),h=t(60216),u=t.n(h),f=t(8471),V=t(77035),$=t(67879),b=t(51399),U=()=>{const{changeLocale:i,localeNames:Ie}=(0,b.Z)(),{locale:a}=(0,$.Z)();return e.createElement(V.q4,{value:a,onChange:S=>i(S)},Object.entries(Ie).map(([S,R])=>e.createElement(V.ag,{key:S,value:S},R)))};const de=(0,f.ZP)(p.x)`
20
+ margin: 0 auto;
21
+ width: 552px;
22
+ `,N=(0,f.ZP)(P.k)`
23
+ flex-direction: column;
24
+ `,W=({children:i})=>e.createElement(de,{shadow:"tableShadow",hasRadius:!0,paddingTop:9,paddingBottom:9,paddingLeft:10,paddingRight:10,background:"neutral0",justifyContent:"center"},i);W.propTypes={children:u().node.isRequired};const Se=({children:i})=>e.createElement("div",null,e.createElement(P.k,{as:"header",justifyContent:"flex-end"},e.createElement(p.x,{paddingTop:6,paddingRight:8},e.createElement(U,null))),e.createElement(p.x,{paddingTop:2,paddingBottom:11},i));Se.propTypes={children:u().node.isRequired};var be=Se},30305:function(Z,v,t){"use strict";t.d(v,{_:function(){return h}});var e=t(98178),p=t(69891);const P=()=>u=>u.admin_app||p.E,h=(0,e.P1)(P(),u=>u.permissions)},24018:function(Z,v,t){"use strict";var e=t(63642),p=t(8471);const P=(0,p.ZP)(e.E)`
25
+ svg {
26
+ height: 1rem;
27
+ width: 1rem;
28
+ path {
29
+ fill: ${({theme:h})=>h.colors.neutral600};
30
+ }
31
+ }
32
+ `;v.Z=P},24436:function(Z,v,t){"use strict";var e=t(32735),p=t(10369),P=t(27649),h=t(72850),u=t(49372),f=t(87933),V=t(8284),$=t(41415),b=t(19565),ee=t(54894),U=t(60492),de=t(92802),N=t(60216),W=t.n(N),Se=t(67879),be=t(8471),i=t(73678),Ie=t(11060),a=t(24018);const S=(0,be.ZP)(p.o)`
33
+ ::-ms-reveal {
34
+ display: none;
35
+ }
36
+ `,R=({onSubmit:H,schema:Ee,children:Ce})=>{const[He,Ye]=(0,e.useState)(!1),{formatMessage:re}=(0,Se.Z)();return e.createElement(P.o,null,e.createElement(Ie.bU,null,e.createElement(de.J9,{enableReinitialize:!0,initialValues:{email:"",password:"",rememberMe:!1},onSubmit:H,validationSchema:Ee,validateOnChange:!1},({values:Fe,errors:Me,handleChange:Ae})=>e.createElement(b.l0,{noValidate:!0},e.createElement(Ie.sg,null,e.createElement(i.Z,null),e.createElement(h.x,{paddingTop:6,paddingBottom:1},e.createElement(u.Z,{variant:"alpha",as:"h1"},re({id:"Auth.form.welcome.title",defaultMessage:"Welcome!"}))),e.createElement(h.x,{paddingBottom:7},e.createElement(u.Z,{variant:"epsilon",textColor:"neutral600"},re({id:"Auth.form.welcome.subtitle",defaultMessage:"Log in to your Strapi account"}))),Me.errorMessage&&e.createElement(u.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},Me.errorMessage)),e.createElement(f.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(p.o,{error:Me.email?re({id:Me.email,defaultMessage:"This value is required."}):"",value:Fe.email,onChange:Ae,label:re({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:re({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),e.createElement(S,{error:Me.password?re({id:Me.password,defaultMessage:"This value is required."}):"",onChange:Ae,value:Fe.password,label:re({id:"global.password",defaultMessage:"Password"}),name:"password",type:He?"text":"password",endAction:e.createElement(a.Z,{onClick:Oe=>{Oe.stopPropagation(),Ye(we=>!we)},label:re(He?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},He?e.createElement(ee.Z,null):e.createElement(U.Z,null)),required:!0}),e.createElement(V.X,{onValueChange:Oe=>{Ae({target:{value:Oe,name:"rememberMe"}})},value:Fe.rememberMe,"aria-label":"rememberMe",name:"rememberMe"},re({id:"Auth.form.rememberMe.label",defaultMessage:"Remember me"})),e.createElement($.z,{fullWidth:!0,type:"submit"},re({id:"Auth.form.button.login",defaultMessage:"Login"}))))),Ce),e.createElement(f.k,{justifyContent:"center"},e.createElement(h.x,{paddingTop:4},e.createElement(b.rU,{to:"/auth/forgot-password"},re({id:"Auth.link.forgot-password",defaultMessage:"Forgot your password?"})))))};R.defaultProps={children:null,onSubmit(){}},R.propTypes={children:W().node,onSubmit:W().func,schema:W().shape({type:W().string.isRequired}).isRequired},v.Z=R},33248:function(Z,v,t){"use strict";t.r(v);var e=t(32735),p=t(27649),P=t(82055),h=t(17e3),u=t(9695),f=t(19565),V=t(8482),$=t(25386),b=t(67879);const ee=()=>{const{formatMessage:U}=(0,b.Z)();return(0,f.go)(),e.createElement(p.o,{labelledBy:"title"},e.createElement(P.T,{id:"title",title:U({id:"content-manager.pageNotFound",defaultMessage:"Page not found"})}),e.createElement(h.D,null,e.createElement(u.x,{action:e.createElement(f.Qj,{variant:"secondary",endIcon:e.createElement(V.Z,null),to:"/"},U({id:"app.components.NotFoundPage.back",defaultMessage:"Back to homepage"})),content:U({id:"app.page.not.found",defaultMessage:"Oops! We can't seem to find the page you're looging for..."}),hasRadius:!0,icon:e.createElement($.Z,{width:"10rem"}),shadow:"tableShadow"})))};v.default=ee},5074:function(Z,v){"use strict";const t=({data:e})=>{try{return Object.keys(e).reduce((p,P)=>{const h=e[P][0];return p[P]={id:h,defaultMessage:h},p},{})}catch{return{}}};v.Z=t},24388:function(Z,v,t){"use strict";t.d(v,{R6:function(){return P},ot:function(){return ee},Iz:function(){return U.Z},Pp:function(){return de},Qy:function(){return a},WW:function(){return W}});var e=t(19565),P=async(S,R)=>{let H=null;try{await R.validate(S,{abortEarly:!1})}catch(Ee){H=(0,e.CJ)(Ee)}return H},h=t(32735),u=t(60216),f=t.n(u),V=t(53038);const $=({loadComponent:S})=>{const[R,H]=(0,h.useState)(null);return(0,h.useEffect)(()=>{(async()=>{try{const Ce=await S();H(()=>Ce.default)}catch(Ce){console.log(Ce)}})()},[S]),R?h.createElement(R,null):h.createElement(e.dO,null)},b=(S,R,H)=>h.createElement(V.AW,{render:()=>h.createElement($,{loadComponent:S}),key:R,path:R,exact:H||!1});$.propTypes={loadComponent:f().func.isRequired};var ee=b,U=t(5074),de=(S,R="")=>[S,R].filter(H=>H).join(" "),W=S=>S.filter((R,H,Ee)=>Ee.findIndex(Ce=>Ce.key===R.key)===H),Se=t(98978);const be=S=>sortBy(S,R=>R.name);var i=null;const Ie={bufferToHex(S){return[...new Uint8Array(S)].map(R=>R.toString(16).padStart(2,"0")).join("")},async digestMessage(S){const R=new TextEncoder().encode(S),H=await crypto.subtle.digest("SHA-256",R);return this.bufferToHex(H)}};async function a(S){if(!S)return null;try{return await Ie.digestMessage(S.email)}catch{return null}}},48224:function(Z,v,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 p(P){if(!t.o(e,P))return Promise.resolve().then(function(){var f=new Error("Cannot find module '"+P+"'");throw f.code="MODULE_NOT_FOUND",f});var h=e[P],u=h[0];return t.e(h[1]).then(function(){return t.t(u,19)})}p.keys=function(){return Object.keys(e)},p.id=48224,Z.exports=p},47750:function(Z,v,t){"use strict";Z.exports=t.p+"70674f63fc3904c20de0.svg"}}]);
@@ -0,0 +1,267 @@
1
+ (self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[2544],{64499:function(H,L,o){"use strict";o.d(L,{V:function(){return P}});var e=o(19565),v=o(20108);const P=(b={},O={})=>{const{id:A,...x}=b,{get:E}=(0,e.kY)();if(!A&&(O?.enabled===void 0||O?.enabled))throw new Error('"id" is a required argument');const{data:M,error:W,isError:a,isLoading:B,refetch:p}=(0,v.useQuery)(["roles",A,"permissions",x],async()=>{const{data:{data:S}}=await E(`/admin/roles/${A}/permissions`,{params:x});return S},O);return{permissions:M,error:W,isError:a,isLoading:B,refetch:p}}},86409:function(H,L,o){"use strict";o.d(L,{F:function(){return b}});var e=o(19565),v=o(67879),P=o(20108);const b=(O={},A={})=>{const{id:x="",...E}=O,{get:M}=(0,e.kY)(),{locale:W}=(0,v.Z)(),a=(0,e.Xe)(W,{sensitivity:"base"}),{data:B,error:p,isError:S,isLoading:F,refetch:g}=(0,P.useQuery)(["roles",x,E],async()=>{const{data:V}=await M(`/admin/roles/${x??""}`,{params:E});return V},A);let y=[];return x&&B?y=[B.data]:Array.isArray(B?.data)&&(y=B.data),{roles:y.sort((V,oe)=>a.compare(V.name,oe.name)),error:p,isError:S,isLoading:F,refetch:g}}},15570:function(H,L,o){"use strict";o.r(L),o.d(L,{CreatePage:function(){return Re},default:function(){return Se}});var e=o(32735),v=o(27649),P=o(82055),b=o(87933),O=o(41415),A=o(17e3),x=o(72850),E=o(49372),M=o(15335),W=o(5803),a=o(10369),B=o(33475),p=o(19565),S=o(29439),F=o(14723),g=o(92802),y=o(86834),V=o.n(y),oe=o(67879),de=o(15062),re=o(53038),C=o(8471),me=o(64499),X=o(30305),G=o(1283),_=o(91720),Ce=o(24346),xe=Ce.Ry().shape({name:Ce.Z_().required(p.I0.required),description:Ce.Z_().required(p.I0.required)});const ae=C.ZP.div`
2
+ border: 1px solid ${({theme:z})=>z.colors.primary200};
3
+ background: ${({theme:z})=>z.colors.primary100};
4
+ padding: ${({theme:z})=>`${z.spaces[2]} ${z.spaces[4]}`};
5
+ color: ${({theme:z})=>z.colors.primary600};
6
+ border-radius: ${({theme:z})=>z.borderRadius};
7
+ font-size: ${12/16}rem;
8
+ font-weight: bold;
9
+ `,Re=()=>{const z=(0,re.$B)("/settings/roles/duplicate/:id"),Y=(0,p.lm)(),{lockApp:ne,unlockApp:w}=(0,p.o1)(),{formatMessage:j}=(0,oe.Z)(),[Q,he]=(0,e.useState)(!1),{replace:pe}=(0,re.k6)(),J=(0,e.useRef)(),{trackUsage:ce}=(0,p.rS)(),{post:Ie,put:Be}=(0,p.kY)(),{params:ve}=z??{},{isLoading:Ze,data:Le}=(0,_.d)(ve?.id,{cacheTime:0}),{permissions:ye,isLoading:Me}=(0,me.V)({id:ve?.id},{cacheTime:0,enabled:!!ve?.id}),Fe=Pe=>{ne(),he(!0),ve?.id?ce("willDuplicateRole"):ce("willCreateNewRole"),Promise.resolve(Ie("/admin/roles",Pe)).then(async({data:ee})=>{const{permissionsToSend:ie}=J.current.getPermissions();return ve?.id?ce("didDuplicateRole"):ce("didCreateNewRole"),ee.data.id&&!V()(ie)&&await Be(`/admin/roles/${ee.data.id}/permissions`,{permissions:ie}),ee}).then(ee=>{he(!1),Y({type:"success",message:{id:"Settings.roles.created",defaultMessage:"created"}}),pe(`/settings/roles/${ee.data.id}`)}).catch(ee=>{console.error(ee),he(!1),Y({type:"warning",message:{id:"notification.error"}})}).finally(()=>{w()})},He=`${j({id:"Settings.roles.form.created",defaultMessage:"Created"})} ${(0,F.Z)(new Date,"PPP")}`;return e.createElement(v.o,null,e.createElement(p.SL,{name:"Roles"}),e.createElement(g.J9,{initialValues:{name:"",description:He},onSubmit:Fe,validationSchema:xe,validateOnChange:!1},({handleSubmit:Pe,values:ee,errors:ie,handleReset:le,handleChange:ue})=>e.createElement(p.l0,{noValidate:!0},e.createElement(e.Fragment,null,e.createElement(P.T,{primaryAction:e.createElement(b.k,{gap:2},e.createElement(O.z,{variant:"secondary",onClick:()=>{le(),J.current.resetForm()},size:"L"},j({id:"app.components.Button.reset",defaultMessage:"Reset"})),e.createElement(O.z,{onClick:Pe,loading:Q,size:"L"},j({id:"global.save",defaultMessage:"Save"}))),title:j({id:"Settings.roles.create.title",defaultMessage:"Create a role"}),subtitle:j({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(p.rU,{startIcon:e.createElement(S.Z,null),to:"/settings/roles"},j({id:"global.back",defaultMessage:"Back"}))}),e.createElement(A.D,null,e.createElement(b.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(x.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(b.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(b.k,{justifyContent:"space-between"},e.createElement(x.x,null,e.createElement(x.x,null,e.createElement(E.Z,{fontWeight:"bold"},j({id:"global.details",defaultMessage:"Details"}))),e.createElement(x.x,null,e.createElement(E.Z,{variant:"pi",textColor:"neutral600"},j({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(ae,null,j({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:0}))),e.createElement(M.r,{gap:4},e.createElement(W.P,{col:6},e.createElement(a.o,{name:"name",error:ie.name&&j({id:ie.name}),label:j({id:"global.name",defaultMessage:"Name"}),onChange:ue,required:!0,value:ee.name})),e.createElement(W.P,{col:6},e.createElement(B.g,{label:j({id:"global.description",defaultMessage:"Description"}),id:"description",error:ie.description&&j({id:ie.description}),onChange:ue},ee.description))))),!Ze&&!Me?e.createElement(x.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(G.Z,{isFormDisabled:!1,ref:J,permissions:ye,layout:Le})):e.createElement(x.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(p.dO,null))))))))};function Se(){const z=(0,de.v9)(X._);return e.createElement(p.O4,{permissions:z.settings.roles.create},e.createElement(Re,null))}},1283:function(H,L,o){"use strict";o.d(L,{Z:function(){return ts}});var e=o(32735),v=o(91215),P=o(90980),b=o(3653),O=o(19565),A=o(23973),x=o.n(A),E=o(86834),M=o.n(E),W=o(60216),a=o.n(W),B=o(67879),p=o(72850),S=o(98978),F=o.n(S),g=o(8471),y=o(87933),V=o(82884),oe=o(15974),de=o(96441),re=o(33795),C=o.n(re),me=o(9086),X=o.n(me),G=o(79652),_=o(41415),Ce=o(45112);const be=g.ZP.div`
10
+ position: relative;
11
+
12
+ ${({hasConditions:t,disabled:n,theme:r})=>t&&`
13
+ &:before {
14
+ content: '';
15
+ position: absolute;
16
+ top: -3px;
17
+ left: -10px;
18
+ width: 6px;
19
+ height: 6px;
20
+ border-radius: ${20/16}rem;;
21
+ background: ${n?r.colors.neutral100:r.colors.primary600};
22
+ }
23
+ `}
24
+ `,xe=({onClick:t,className:n,hasConditions:r,variant:s})=>{const{formatMessage:i}=(0,B.Z)();return e.createElement(be,{hasConditions:r,className:n},e.createElement(_.z,{variant:s,startIcon:e.createElement(Ce.Z,null),onClick:t},i({id:"global.settings",defaultMessage:"Settings"})))};xe.defaultProps={className:null,hasConditions:!1,variant:"tertiary"},xe.propTypes={onClick:a().func.isRequired,className:a().string,hasConditions:a().bool,variant:a().string};var ae=(0,g.ZP)(xe)``,Re=o(85025),Se=o(55225),z=o(31600),Y=o(49372),ne=o(11406),w=o(26858),j=o(51654),Q=o(97889),he=o(81346),pe=o.n(he),J=o(23940),ce=o.n(J),Ie=o(27799);const Be=t=>Object.values(t).map(n=>Object.entries(n).filter(([,r])=>r).map(([r])=>r)).flat(),ve=t=>t.reduce((n,[r,s])=>(n.push({label:ce()(r),children:s.map(i=>({label:i.displayName,value:i.id}))}),n),[]),Ze=(t,n)=>t.map(([,r])=>r).flat().reduce((r,s)=>({[s.id]:n.includes(s.id),...r}),{}),Le=({arrayOfOptionsGroupedByCategory:t,isFormDisabled:n,isGrey:r,label:s,name:i,onChange:l,value:d})=>{const{formatMessage:c}=(0,B.Z)(),m=u=>{l(i,Ze(t,u))};return e.createElement(y.k,{as:"li",background:r?"neutral100":"neutral0",paddingBottom:3,paddingTop:3},e.createElement(y.k,{paddingLeft:6,style:{width:180}},e.createElement(Y.Z,{variant:"sigma",textColor:"neutral600"},c({id:"Settings.permissions.conditions.can",defaultMessage:"Can"}),"\xA0"),e.createElement(Y.Z,{variant:"sigma",title:s,textColor:"primary600",ellipsis:!0},c({id:`Settings.roles.form.permissions.${s.toLowerCase()}`,defaultMessage:s})),e.createElement(Y.Z,{variant:"sigma",textColor:"neutral600"},"\xA0",c({id:"Settings.permissions.conditions.when",defaultMessage:"When"}))),e.createElement(p.x,{style:{maxWidth:430,width:"100%"}},e.createElement(Ie.Q,{id:i,customizeContent:u=>`${u.length} currently selected`,onChange:m,value:Be(d),options:ve(t),disabled:n})))};Le.propTypes={arrayOfOptionsGroupedByCategory:a().array.isRequired,isFormDisabled:a().bool.isRequired,isGrey:a().bool.isRequired,label:a().string.isRequired,name:a().string.isRequired,value:a().object.isRequired,onChange:a().func.isRequired};var ye=Le;const Me=(t,n)=>t.reduce((r,s)=>(r[s.id]=C()(n,s.id,!1),r),{}),Fe=(t,n)=>t.reduce((r,s)=>{const[i,l]=s,d=Me(l,n);return r[i]=d,r},{});var Pe=(t,n,r)=>t.reduce((s,i)=>{const l=C()(n,[...i.pathToConditionsObject,"conditions"],{}),d=Fe(r,l);return s[i.pathToConditionsObject.join("..")]=d,s},{});const ee=({actions:t,headerBreadCrumbs:n,isFormDisabled:r,onClosed:s,onToggle:i})=>{const{formatMessage:l}=(0,B.Z)(),{availableConditions:d,modifiedData:c,onChangeConditions:m}=(0,G.$_)(),u=(0,e.useMemo)(()=>Object.entries(pe()(d,"category")),[d]),f=t.filter(({isDisplayed:h,hasSomeActionsSelected:I,hasAllActionsSelected:D})=>h&&(I||D)),R=(0,e.useMemo)(()=>Pe(f,c,u),[f,c,u]),[$,N]=(0,e.useState)(R),k=(h,I)=>{N((0,Q.ZP)(D=>{D[h]||(D[h]={}),D[h].default||(D[h].default={}),D[h].default=I}))},T=()=>{const h=Object.entries($).reduce((I,D)=>{const[Z,te]=D,U=Object.values(te).reduce((q,K)=>({...q,...K}),{});return I[Z]=U,I},{});m(h),i()};return e.createElement(Re.P,{labelledBy:"condition-modal-breadcrumbs",onClose:s},e.createElement(Se.x,null,e.createElement(w.O,{id:"condition-modal-breadcrumbs",label:n.join(", ")},n.map((h,I,D)=>e.createElement(j.$,{isCurrent:I===D.length-1,key:h},ce()(l({id:h,defaultMessage:h})))))),e.createElement(z.f,null,f.length===0&&e.createElement(Y.Z,null,l({id:"Settings.permissions.conditions.no-actions",defaultMessage:"You first need to select actions (create, read, update, ...) before defining conditions on them."})),e.createElement("ul",null,f.map(({actionId:h,label:I,pathToConditionsObject:D},Z)=>{const te=D.join("..");return e.createElement(ye,{key:h,arrayOfOptionsGroupedByCategory:u,label:I,isFormDisabled:r,isGrey:Z%2===0,name:te,onChange:k,value:C()($,te,{})})}))),e.createElement(ne.m,{startActions:e.createElement(_.z,{variant:"tertiary",onClick:i},l({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(_.z,{onClick:T},l({id:"Settings.permissions.conditions.apply",defaultMessage:"Apply"}))}))};ee.propTypes={actions:a().arrayOf(a().shape({actionId:a().string.isRequired,checkboxName:a().string,hasSomeActionsSelected:a().bool.isRequired,hasAllActionsSelected:a().bool,isDisplayed:a().bool.isRequired,label:a().string})).isRequired,headerBreadCrumbs:a().arrayOf(a().string).isRequired,isFormDisabled:a().bool.isRequired,onClosed:a().func.isRequired,onToggle:a().func.isRequired};var ie=ee;const le=`${120/16}rem`,ue=`${200/16}rem`,Ae=`${53/16}rem`;var Ne=g.ZP.div`
25
+ width: ${le};
26
+ `,rt=(0,g.ZP)(y.k)`
27
+ padding-right: ${({theme:t})=>t.spaces[2]};
28
+ overflow: hidden;
29
+ flex: 1;
30
+ ${({isCollapsable:t})=>t&&"cursor: pointer;"}
31
+ `;const Ge=({children:t,isCollapsable:n,isActive:r,isFormDisabled:s,label:i,onChange:l,onClick:d,checkboxName:c,someChecked:m,value:u})=>{const{formatMessage:f}=(0,B.Z)();return e.createElement(y.k,{alignItems:"center",paddingLeft:6,style:{width:ue,flexShrink:0}},e.createElement(p.x,{paddingRight:2},e.createElement(V.C,{name:c,"aria-label":f({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:i}),disabled:s,onValueChange:R=>l({target:{name:c,value:R}}),indeterminate:m,value:u})),e.createElement(rt,{title:i,alignItems:"center",isCollapsable:n,...n&&{onClick:d,"aria-expanded":r,onKeyDown:({key:R})=>(R==="Enter"||R===" ")&&d(),tabIndex:0,role:"button"}},e.createElement(Y.Z,{fontWeight:r?"bold":"",textColor:r?"primary600":"neutral800",ellipsis:!0},ce()(i)),t))};Ge.defaultProps={children:null,checkboxName:"",onChange(){},value:!1,someChecked:!1,isCollapsable:!1},Ge.propTypes={checkboxName:a().string,children:a().node,label:a().string.isRequired,isCollapsable:a().bool,isFormDisabled:a().bool.isRequired,onChange:a().func,onClick:a().func.isRequired,someChecked:a().bool,value:a().bool,isActive:a().bool.isRequired};var at=(0,e.memo)(Ge),Nt=o(72091),Wt=o.n(Nt),Vt=o(85973),Te=o.n(Vt);const it=t=>Te()(t)?Wt()(Object.values(t).map(n=>Te()(n)?it(n):n)):[];var je=it,ze=t=>t?Object.keys(t).reduce((n,r)=>(r!=="conditions"&&(n[r]=t[r]),n),{}):null,Oe=t=>{const n=ze(t),r=je(n);if(!r.length)return{hasAllActionsSelected:!1,hasSomeActionsSelected:!1};const s=r.every(l=>l),i=r.some(l=>l)&&!s;return{hasAllActionsSelected:s,hasSomeActionsSelected:i}},Kt=o(16899),We=(0,g.ZP)(Kt.Z)`
32
+ display: none;
33
+ width: ${10/16}rem;
34
+ transform: rotate(${({$isActive:t})=>t?"180":"0"}deg);
35
+ margin-left: ${({theme:t})=>t.spaces[2]};
36
+ `,Ve=t=>`
37
+ ${Y.Z} {
38
+ color: ${t.colors.primary600};
39
+ font-weight: ${t.fontWeights.bold}
40
+ }
41
+ ${We} {
42
+ display: block;
43
+ path {
44
+ fill: ${t.colors.primary600}
45
+ };
46
+ }
47
+ `,Ht=(t,n,r)=>t.map(({actionId:s,isDisplayed:i,applyToProperties:l,label:d})=>{if(!i)return{actionId:s,hasSomeActionsSelected:!1,isDisplayed:i};const c=[...r.split(".."),s],m=M()(l)?[...c,"properties","enabled"]:c,u=m.join(".."),f=C()(n,[...c,"conditions"],null),R=je(f).some(T=>T);if(M()(l)){const T=C()(n,m,!1);return{actionId:s,checkboxName:u,hasAllActionsSelected:T,hasConditions:R,hasSomeActionsSelected:T,isDisplayed:i,isParentCheckbox:!1,label:d,pathToConditionsObject:c}}const $=C()(n,m,null),{hasAllActionsSelected:N,hasSomeActionsSelected:k}=Oe($);return{actionId:s,checkboxName:u,hasAllActionsSelected:N,hasConditions:R,hasSomeActionsSelected:k,isDisplayed:i,isParentCheckbox:!0,label:d,pathToConditionsObject:c}});const we=(t,n)=>`
48
+ ${lt} {
49
+ background-color: ${t.colors.primary100};
50
+ color: ${t.colors.primary600};
51
+ border-radius: ${n?"2px 2px 0 0":"2px"};
52
+ }
53
+ ${ct} {
54
+ display: flex;
55
+ }
56
+ ${ae} {
57
+ display: block;
58
+ }
59
+ &:hover {
60
+ ${Ve(t)}
61
+ }
62
+
63
+ &:focus-within {
64
+ ${({theme:r,isActive:s})=>we(r,s)}
65
+ }
66
+
67
+ `,lt=g.ZP.div`
68
+ flex: 1;
69
+ display: flex;
70
+ align-items: center;
71
+ height: ${Ae};
72
+ background-color: ${({isGrey:t,theme:n})=>t?n.colors.neutral100:n.colors.neutral0};
73
+ border: 1px solid transparent;
74
+ `,Ut=g.ZP.div`
75
+ display: inline-flex;
76
+ min-width: 100%;
77
+
78
+ ${ae} {
79
+ display: none;
80
+ }
81
+ ${({isActive:t,theme:n})=>t&&we(n,t)}
82
+ &:hover {
83
+ ${({theme:t,isActive:n})=>we(t,n)}
84
+ }
85
+ `,dt=(0,g.ZP)(y.k)`
86
+ width: ${le};
87
+ position: relative;
88
+ `,ct=(0,g.ZP)(p.x)`
89
+ display: none;
90
+ svg {
91
+ width: 11px;
92
+ }
93
+ * {
94
+ fill: ${({theme:t})=>t.colors.primary600};
95
+ }
96
+ `,ut=g.ZP.span`
97
+ position: absolute;
98
+ top: -6px;
99
+ left: 37px;
100
+ width: 6px;
101
+ height: 6px;
102
+ border-radius: 20px;
103
+ background: ${({theme:t})=>t.colors.primary600};
104
+ `,Gt=(0,g.ZP)(p.x)`
105
+ position: absolute;
106
+ right: 9px;
107
+ transform: translateY(10px);
108
+ `,mt=({availableActions:t,isActive:n,isGrey:r,isFormDisabled:s,label:i,onClickToggle:l,pathToData:d})=>{const[c,m]=(0,e.useState)(!1),{formatMessage:u}=(0,B.Z)(),{modifiedData:f,onChangeParentCheckbox:R,onChangeSimpleCheckbox:$}=(0,G.$_)(),N=()=>{m(U=>!U)},k=()=>{m(!1)},T=C()(f,d.split(".."),{}),h=(0,e.useMemo)(()=>Object.keys(T).reduce((U,q)=>(U[q]=X()(T[q],"conditions"),U),{}),[T]),{hasAllActionsSelected:I,hasSomeActionsSelected:D}=Oe(h),Z=(0,e.useMemo)(()=>Ht(t,f,d),[t,f,d]),te=Z.some(({hasConditions:U})=>U);return e.createElement(Ut,{isActive:n},e.createElement(lt,{isGrey:r},e.createElement(at,{isCollapsable:!0,isFormDisabled:s,label:i,checkboxName:d,onChange:R,onClick:l,someChecked:D,value:I,isActive:n},e.createElement(ct,{paddingLeft:2},n?e.createElement(oe.Z,null):e.createElement(de.Z,null))),e.createElement(y.k,{style:{flex:1}},Z.map(({actionId:U,hasConditions:q,hasAllActionsSelected:K,hasSomeActionsSelected:fe,isDisplayed:ke,isParentCheckbox:se,checkboxName:Ee,label:Ke})=>ke?se?e.createElement(dt,{key:U,justifyContent:"center",alignItems:"center"},q&&e.createElement(ut,null),e.createElement(V.C,{disabled:s,name:Ee,"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${Ke} ${i}`}),onValueChange:$e=>{R({target:{name:Ee,value:$e}})},indeterminate:fe,value:K})):e.createElement(dt,{key:U,justifyContent:"center",alignItems:"center"},q&&e.createElement(ut,null),e.createElement(V.C,{disabled:s,indeterminate:q,name:Ee,onValueChange:$e=>{$({target:{name:Ee,value:$e}})},value:K})):e.createElement(Ne,{key:U}))),c&&e.createElement(ie,{headerBreadCrumbs:[i,"Settings.permissions.conditions.conditions"],actions:Z,isFormDisabled:s,onClosed:k,onToggle:N})),e.createElement(Gt,null,e.createElement(ae,{onClick:N,hasConditions:te})))};mt.propTypes={availableActions:a().array.isRequired,isActive:a().bool.isRequired,isGrey:a().bool.isRequired,isFormDisabled:a().bool.isRequired,label:a().string.isRequired,onClickToggle:a().func.isRequired,pathToData:a().string.isRequired};var zt=mt;const wt=g.ZP.span`
109
+ color: ${({theme:t})=>t.colors.danger700};
110
+ padding-left: ${({theme:t})=>t.spaces[1]}px;
111
+ `;var pt=()=>e.createElement(wt,null,"*"),Yt=(t,n)=>t.map(r=>{const s=Array.isArray(r.subjects)&&r.subjects.indexOf(n)!==-1;return{...r,isDisplayed:s}});const Xt=(0,g.ZP)(p.x)`
112
+ transform: translate(-4px, -12px);
113
+
114
+ &:before {
115
+ content: '';
116
+ width: ${4/16}rem;
117
+ height: ${12/16}rem;
118
+ background: ${({theme:t})=>t.colors.primary200};
119
+ display: block;
120
+ }
121
+ `,Qt=g.ZP.svg`
122
+ position: relative;
123
+ flex-shrink: 0;
124
+ transform: translate(-0.5px, -1px);
125
+
126
+ * {
127
+ fill: ${({theme:t,color:n})=>t.colors[n]};
128
+ }
129
+ `,Ye=t=>e.createElement(Xt,null,e.createElement(Qt,{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.02477 14.7513C8.65865 17.0594 11.6046 18.6059 17.5596 18.8856C18.6836 18.9384 19.5976 19.8435 19.5976 20.9688V20.9688C19.5976 22.0941 18.6841 23.0125 17.5599 22.9643C10.9409 22.6805 6.454 20.9387 3.75496 17.1258C0.937988 13.1464 0.486328 7.39309 0.486328 0.593262H4.50974C4.50974 7.54693 5.06394 11.9813 7.02477 14.7513Z",fill:"#D9D8FF"})));Ye.defaultProps={fill:"primary200"},Ye.propTypes={fill:a().string};var Jt=(0,e.memo)(Ye);const gt=(0,g.ZP)(y.k)`
130
+ width: ${le};
131
+ position: relative;
132
+ `,qt=(0,g.ZP)(y.k)`
133
+ height: ${Ae};
134
+ `,_t=(0,g.ZP)(p.x)`
135
+ padding-left: ${31/16}rem;
136
+ `,en=(0,g.ZP)(p.x)`
137
+ border-left: ${({isVisible:t,theme:n})=>t?`4px solid ${n.colors.primary200}`:"4px solid transparent"};
138
+ `,tn=(0,g.ZP)(y.k)`
139
+ padding-left: ${({theme:t})=>t.spaces[4]};
140
+ width: ${({level:t})=>145-t*36}px;
141
+
142
+ ${({isCollapsable:t,theme:n})=>t&&`
143
+ ${We} {
144
+ display: block;
145
+ color: ${n.colors.neutral100};
146
+ }
147
+ &:hover {
148
+ ${Ve(n)}
149
+ }
150
+ `}
151
+ ${({isActive:t,theme:n})=>t&&Ve(n)};
152
+ `,nn=g.ZP.div`
153
+ padding-top: ${({theme:t})=>t.spaces[2]};
154
+ margin-top: ${({theme:t})=>t.spaces[2]};
155
+ width: ${4/16}rem;
156
+ background-color: ${({theme:t})=>t.colors.primary200};
157
+ border-top-left-radius: 2px;
158
+ border-top-right-radius: 2px;
159
+ `,Xe=({childrenForm:t,isFormDisabled:n,recursiveLevel:r,pathToDataFromActionRow:s,propertyActions:i,parentName:l,propertyName:d})=>{const{formatMessage:c}=(0,B.Z)(),{modifiedData:m,onChangeParentCheckbox:u,onChangeSimpleCheckbox:f}=(0,G.$_)(),[R,$]=(0,e.useState)(null),N=T=>{$(h=>h===T?null:T)},k=(0,e.useMemo)(()=>R?t.find(({value:T})=>T===R):null,[R,t]);return e.createElement(_t,null,e.createElement(nn,null),t.map(({label:T,value:h,required:I,children:D},Z)=>{const te=Z+1<t.length,U=Array.isArray(D),q=R===h;return e.createElement(en,{key:h,isVisible:te},e.createElement(qt,null,e.createElement(Jt,{color:"primary200"}),e.createElement(y.k,{style:{flex:1}},e.createElement(tn,{level:r,isActive:q,isCollapsable:U},e.createElement(rt,{alignItems:"center",isCollapsable:U,...U&&{onClick:()=>N(h),"aria-expanded":q,onKeyDown:({key:K})=>(K==="Enter"||K===" ")&&N(h),tabIndex:0,role:"button"},title:T},e.createElement(Y.Z,{ellipsis:!0},ce()(T)),I&&e.createElement(pt,null),e.createElement(We,{$isActive:q}))),e.createElement(y.k,{style:{flex:1}},i.map(({actionId:K,label:fe,isActionRelatedToCurrentProperty:ke})=>{if(!ke)return e.createElement(Ne,{key:K});const se=[...s.split(".."),K,"properties",d,...l.split(".."),h],Ee=C()(m,se,!1);if(!D)return e.createElement(gt,{key:fe,justifyContent:"center",alignItems:"center"},e.createElement(V.C,{disabled:n,name:se.join(".."),"aria-label":c({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${l} ${T} ${fe}`}),onValueChange:De=>{f({target:{name:se.join(".."),value:De}})},value:Ee}));const{hasAllActionsSelected:Ke,hasSomeActionsSelected:$e}=Oe(Ee);return e.createElement(gt,{key:fe,justifyContent:"center",alignItems:"center"},e.createElement(V.C,{key:fe,disabled:n,name:se.join(".."),"aria-label":c({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${l} ${T} ${fe}`}),onValueChange:De=>{u({target:{name:se.join(".."),value:De}})},value:Ke,indeterminate:$e}))})))),k&&q&&e.createElement(p.x,{paddingBottom:2},e.createElement(Xe,{isFormDisabled:n,parentName:`${l}..${h}`,pathToDataFromActionRow:s,propertyActions:i,propertyName:d,recursiveLevel:r+1,childrenForm:k.children})))}))};Xe.propTypes={childrenForm:a().array.isRequired,isFormDisabled:a().bool.isRequired,parentName:a().string.isRequired,pathToDataFromActionRow:a().string.isRequired,propertyActions:a().array.isRequired,propertyName:a().string.isRequired,recursiveLevel:a().number.isRequired};var sn=(0,e.memo)(Xe);const on=t=>t.reduce((r,s)=>(s.isActionRelatedToCurrentProperty&&r.push(s.actionId),r),[]);var rn=(t,n,r,s,i)=>{const d=on(t).reduce((c,m)=>{const u=[...r.split(".."),m,"properties",s,i],f=C()(n,u,!1);return c[m]=f,c},{});return Oe(d)};const ft=(0,g.ZP)(y.k)`
160
+ width: ${le};
161
+ position: relative;
162
+ `,an=(0,g.ZP)(y.k)`
163
+ height: ${Ae};
164
+ flex: 1;
165
+
166
+ ${({isCollapsable:t,theme:n})=>t&&`
167
+ ${We} {
168
+ display: block;
169
+ color: ${n.colors.neutral100};
170
+ }
171
+ &:hover {
172
+ ${Ve(n)}
173
+ }
174
+ `}
175
+ ${({isActive:t,theme:n})=>t&&Ve(n)};
176
+ `,Qe=({childrenForm:t,label:n,isFormDisabled:r,name:s,required:i,pathToData:l,propertyActions:d,propertyName:c,isOdd:m})=>{const{formatMessage:u}=(0,B.Z)(),[f,R]=(0,e.useState)(null),{modifiedData:$,onChangeCollectionTypeLeftActionRowCheckbox:N,onChangeParentCheckbox:k,onChangeSimpleCheckbox:T}=(0,G.$_)(),h=f===s,I=(0,e.useMemo)(()=>Array.isArray(t)?t:[],[t]),D=I.length>0,Z=(0,e.useCallback)(()=>{D&&R(K=>K===s?null:s)},[D,s]),te=({target:{value:K}})=>{N(l,c,s,K)},{hasAllActionsSelected:U,hasSomeActionsSelected:q}=(0,e.useMemo)(()=>rn(d,$,l,c,s),[d,$,l,c,s]);return e.createElement(e.Fragment,null,e.createElement(an,{alignItems:"center",isCollapsable:D,isActive:h,background:m?"neutral100":"neutral0"},e.createElement(y.k,null,e.createElement(at,{onChange:te,onClick:Z,isCollapsable:D,isFormDisabled:r,label:n,someChecked:q,value:U,isActive:h},i&&e.createElement(pt,null),e.createElement(We,{$isActive:h})),e.createElement(y.k,null,d.map(({label:K,isActionRelatedToCurrentProperty:fe,actionId:ke})=>{if(!fe)return e.createElement(Ne,{key:K});const se=[...l.split(".."),ke,"properties",c,s];if(!D){const De=C()($,se,!1);return e.createElement(ft,{key:ke,justifyContent:"center",alignItems:"center"},e.createElement(V.C,{disabled:r,name:se.join(".."),"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${s} ${K}`}),onValueChange:ns=>{T({target:{name:se.join(".."),value:ns}})},value:De}))}const Ee=C()($,se,{}),{hasAllActionsSelected:Ke,hasSomeActionsSelected:$e}=Oe(Ee);return e.createElement(ft,{key:K,justifyContent:"center",alignItems:"center"},e.createElement(V.C,{disabled:r,name:se.join(".."),onValueChange:De=>{k({target:{name:se.join(".."),value:De}})},"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${s} ${K}`}),value:Ke,indeterminate:$e}))})))),h&&e.createElement(sn,{childrenForm:I,isFormDisabled:r,parentName:s,pathToDataFromActionRow:l,propertyName:c,propertyActions:d,recursiveLevel:0}))};Qe.defaultProps={childrenForm:[],required:!1},Qe.propTypes={childrenForm:a().array,label:a().string.isRequired,isFormDisabled:a().bool.isRequired,name:a().string.isRequired,pathToData:a().string.isRequired,propertyActions:a().array.isRequired,propertyName:a().string.isRequired,required:a().bool,isOdd:a().bool.isRequired};var ln=(0,e.memo)(Qe);const ht=(0,g.ZP)(y.k)`
177
+ width: ${le};
178
+ flex-shrink: 0;
179
+ `,dn=(0,g.ZP)(y.k)`
180
+ width: ${ue};
181
+ height: ${Ae};
182
+ flex-shrink: 0;
183
+ `,yt=({headers:t,label:n})=>{const{formatMessage:r}=(0,B.Z)(),s=r({id:"Settings.roles.form.permission.property-label",defaultMessage:"{label} permissions"},{label:n});return e.createElement(y.k,null,e.createElement(dn,{alignItems:"center",paddingLeft:6},e.createElement(Y.Z,{variant:"sigma",textColor:"neutral500"},s)),t.map(i=>i.isActionRelatedToCurrentProperty?e.createElement(ht,{justifyContent:"center",key:i.label},e.createElement(Y.Z,{variant:"sigma",textColor:"neutral500"},r({id:`Settings.roles.form.permissions.${i.label.toLowerCase()}`,defaultMessage:i.label}))):e.createElement(ht,{key:i.label})))};yt.propTypes={headers:a().arrayOf(a().shape({label:a().string.isRequired,isActionRelatedToCurrentProperty:a().bool.isRequired})).isRequired,label:a().string.isRequired};var cn=yt,un=(t,n)=>t.map(r=>{const s=Array.isArray(r.applyToProperties)&&r.applyToProperties.indexOf(n)!==-1&&r.isDisplayed;return{label:r.label,actionId:r.actionId,isActionRelatedToCurrentProperty:s}});const mn=g.ZP.div`
184
+ display: inline-flex;
185
+ flex-direction: column;
186
+ min-width: 0;
187
+ `,Ct=({availableActions:t,childrenForm:n,isFormDisabled:r,label:s,pathToData:i,propertyName:l})=>{const d=(0,e.useMemo)(()=>un(t,l),[t,l]);return e.createElement(mn,null,e.createElement(cn,{label:s,headers:d}),e.createElement(p.x,null,n.map(({children:c,label:m,value:u,required:f},R)=>e.createElement(ln,{childrenForm:c,key:u,label:m,isFormDisabled:r,name:u,required:f,propertyActions:d,pathToData:i,propertyName:l,isOdd:R%2===0}))))};Ct.propTypes={childrenForm:a().array.isRequired,availableActions:a().array.isRequired,isFormDisabled:a().bool.isRequired,label:a().string.isRequired,pathToData:a().string.isRequired,propertyName:a().string.isRequired};var pn=Ct;const gn=g.ZP.div`
188
+ flex-direction: column;
189
+ display: inline-flex;
190
+ min-width: 100%;
191
+ ${({theme:t,isActive:n})=>n&&`border: 1px solid ${t.colors.primary600};`}
192
+ `,vt=({allActions:t,contentTypeName:n,label:r,index:s,isActive:i,isFormDisabled:l,onClickToggleCollapse:d,pathToData:c,properties:m})=>{const u=(0,e.useCallback)(()=>{d(n)},[n,d]),f=(0,e.useMemo)(()=>Yt(t,n),[t,n]);return e.createElement(gn,{isActive:i},e.createElement(zt,{availableActions:f,isActive:i,isGrey:s%2===0,isFormDisabled:l,label:r,onClickToggle:u,pathToData:c}),i&&m.map(({label:R,value:$,children:N})=>e.createElement(pn,{availableActions:f,childrenForm:N,isFormDisabled:l,label:R,pathToData:c,propertyName:$,key:$})))};vt.propTypes={allActions:a().array.isRequired,contentTypeName:a().string.isRequired,index:a().number.isRequired,isActive:a().bool.isRequired,isFormDisabled:a().bool.isRequired,label:a().string.isRequired,onClickToggleCollapse:a().func.isRequired,pathToData:a().string.isRequired,properties:a().array.isRequired};var fn=vt;const Je=({actions:t,isFormDisabled:n,pathToData:r,subjects:s})=>{const[i,l]=(0,e.useState)(null),d=c=>{l(i===c?null:c)};return s.map(({uid:c,label:m,properties:u},f)=>e.createElement(fn,{allActions:t,key:c,contentTypeName:c,label:m,isActive:i===c,isFormDisabled:n,index:f,onClickToggleCollapse:d,pathToData:`${r}..${c}`,properties:u}))};Je.defaultProps={actions:[],subjects:[]},Je.propTypes={actions:a().array.isRequired,isFormDisabled:a().bool.isRequired,pathToData:a().string.isRequired,subjects:a().arrayOf(a().shape({uid:a().string.isRequired,label:a().string.isRequired,properties:a().array.isRequired}))};var hn=(0,e.memo)(Je),yn=t=>t.filter(({subjects:n})=>n&&n.length);const Cn=t=>t.map(({actionId:n})=>n),vn=(t,n)=>t.reduce((r,s)=>(Object.keys(n).forEach(i=>{const l=C()(n,[i,s],{}),d={[i]:ze(l)};r[s]?r[s]={...r[s],...d}:r[s]=d}),r),{});var En=(t,n)=>{const r=Cn(t),s=vn(r,n);return Object.keys(s).reduce((l,d)=>(l[d]=Oe(s[d]),l),{})};const bn=(0,g.ZP)(y.k)`
193
+ width: ${le};
194
+ flex-shrink: 0;
195
+ `,qe=({actions:t,isFormDisabled:n,kind:r})=>{const{formatMessage:s}=(0,B.Z)(),{modifiedData:i,onChangeCollectionTypeGlobalActionCheckbox:l}=(0,G.$_)(),d=(0,e.useMemo)(()=>yn(t),[t]),c=(0,e.useMemo)(()=>En(d,i[r]),[i,d,r]);return e.createElement(p.x,{paddingBottom:4,paddingTop:6,style:{paddingLeft:ue}},e.createElement(y.k,{gap:0},d.map(({label:m,actionId:u})=>e.createElement(bn,{direction:"column",alignItems:"center",justifyContent:"center",key:u,gap:3},e.createElement(Y.Z,{variant:"sigma",textColor:"neutral500"},s({id:`Settings.roles.form.permissions.${m.toLowerCase()}`,defaultMessage:m})),e.createElement(V.C,{disabled:n,onValueChange:f=>{l(r,u,f)},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:C()(c,[u,"hasAllActionsSelected"],!1),indeterminate:C()(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 xn=(0,e.memo)(qe);const Rn=(0,g.ZP)(p.x)`
196
+ overflow-x: auto;
197
+ `,Et=({isFormDisabled:t,kind:n,layout:{actions:r,subjects:s}})=>{const i=F()([...s],"label");return e.createElement(Rn,{background:"neutral0"},e.createElement(xn,{actions:r,kind:n,isFormDisabled:t}),e.createElement(hn,{actions:r,isFormDisabled:t,pathToData:n,subjects:i}))};Et.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 bt=(0,e.memo)(Et),Pn=o(76402);const xt=({children:t,value:n})=>e.createElement(Pn.$l.Provider,{value:n},t);xt.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 An=xt,Tn=o(83828),Sn=o(61762),Mn=o(89966),Rt=o(8284),On=o(15335),$n=o(5803),Dn=(t,n,r)=>t.map(s=>{const i=[...r,s.action,"properties","enabled"],l=C()(n,i,!1),d=C()(n,[...r,s.action,"conditions"],{}),c=je(d).some(m=>m);return{...s,isDisplayed:l,checkboxName:i.join(".."),hasSomeActionsSelected:l,value:l,hasConditions:c,label:s.displayName,actionId:s.action,pathToConditionsObject:[...r,s.action]}}),Ln=t=>{const n=Object.entries(t).reduce((s,i)=>{const[l,{conditions:d}]=i;return s[l]=d,s},{});return je(n).some(s=>s)};const jn=g.ZP.div`
198
+ flex: 1;
199
+ align-self: center;
200
+ border-top: 1px solid ${({theme:t})=>t.colors.neutral150};
201
+ `,kn=g.ZP.div`
202
+ position: relative;
203
+ word-break: keep-all;
204
+ ${({hasConditions:t,disabled:n,theme:r})=>t&&`
205
+ &:before {
206
+ content: '';
207
+ position: absolute;
208
+ top: ${-4/16}rem;
209
+ left: ${-8/16}rem;
210
+ width: ${6/16}rem;
211
+ height: ${6/16}rem;
212
+ border-radius: ${20/16}rem;
213
+ background: ${n?r.colors.neutral100:r.colors.primary600};
214
+ }
215
+ `}
216
+ `,Pt=({categoryName:t,isFormDisabled:n,subCategoryName:r,actions:s,pathToData:i})=>{const[l,d]=(0,e.useState)(!1),{modifiedData:c,onChangeParentCheckbox:m,onChangeSimpleCheckbox:u}=(0,G.$_)(),{formatMessage:f}=(0,B.Z)(),R=C()(c,i,{}),$=(0,e.useMemo)(()=>Object.keys(R).reduce((Z,te)=>(Z[te]=ze(R[te]),Z),{}),[R]),{hasAllActionsSelected:N,hasSomeActionsSelected:k}=Oe($),T=()=>{d(Z=>!Z)},h=()=>{d(!1)},I=Dn(s,c,i),D=Ln(C()(c,[...i],{}));return e.createElement(e.Fragment,null,e.createElement(p.x,null,e.createElement(y.k,{justifyContent:"space-between",alignItems:"center"},e.createElement(p.x,{paddingRight:4},e.createElement(Y.Z,{variant:"sigma",textColor:"neutral600"},r)),e.createElement(jn,null),e.createElement(p.x,{paddingLeft:4},e.createElement(Rt.X,{name:i.join(".."),disabled:n,onValueChange:Z=>{m({target:{name:i.join(".."),value:Z}})},indeterminate:k,value:N},f({id:"app.utils.select-all",defaultMessage:"Select all"})))),e.createElement(y.k,{paddingTop:6,paddingBottom:6},e.createElement(On.r,{gap:2,style:{flex:1}},I.map(({checkboxName:Z,value:te,action:U,displayName:q,hasConditions:K})=>e.createElement($n.P,{col:3,key:U},e.createElement(kn,{disabled:n,hasConditions:K},e.createElement(Rt.X,{name:Z,disabled:n,onValueChange:fe=>{u({target:{name:Z,value:fe}})},value:te},q))))),e.createElement(ae,{hasConditions:D,onClick:T}))),l&&e.createElement(ie,{headerBreadCrumbs:[t,r],actions:I,isFormDisabled:n,onClosed:h,onToggle:T}))};Pt.propTypes={actions:a().array.isRequired,categoryName:a().string.isRequired,isFormDisabled:a().bool.isRequired,subCategoryName:a().string.isRequired,pathToData:a().array.isRequired};var In=Pt;const _e=({childrenForm:t,kind:n,name:r,isOpen:s,isFormDisabled:i,isWhite:l,onOpenCategory:d,pathToData:c})=>{const{formatMessage:m}=(0,B.Z)(),u=()=>{d(r)},f=(0,e.useMemo)(()=>r.split("::").pop(),[r]);return e.createElement(Tn.U,{expanded:s,onToggle:u,id:`accordion-${r}`,variant:l?"primary":"secondary"},e.createElement(Sn.B,{title:ce()(f),description:`${m({id:"Settings.permissions.category"},{category:f})} ${n==="plugins"?"plugin":n}`}),e.createElement(Mn.v,null,e.createElement(p.x,{padding:6},t.map(({actions:R,subCategoryName:$,subCategoryId:N})=>e.createElement(In,{key:$,actions:R,categoryName:f,isFormDisabled:i,subCategoryName:$,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 Bn=_e;const At=({isFormDisabled:t,kind:n,layout:r})=>{const[s,i]=(0,e.useState)(null),l=d=>{i(d===s?null:d)};return e.createElement(p.x,{padding:6,background:"neutral0"},r.map(({category:d,categoryId:c,childrenForm:m},u)=>e.createElement(Bn,{key:d,childrenForm:m,kind:n,isFormDisabled:t,isOpen:s===d,isWhite:u%2===1,name:d,onOpenCategory:l,pathToData:[n,c]})))};At.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 Tt=At,Zn=o(86349),Fn=o.n(Zn),Nn=o(3040),ge=o.n(Nn),St=(t,n,r)=>t.find(s=>s.action===n&&s.subject===r);const Mt=(t,n=[])=>t.reduce((r,s)=>(r[s.id]=n.indexOf(s.id)!==-1,r),{}),Ot=({children:t},n,r="")=>t.reduce((s,i)=>{if(i.children)return{...s,[i.value]:Ot(i,n,`${r}${i.value}.`)};const l=n.indexOf(`${r}${i.value}`)!==-1;return s[i.value]=l,s},{}),Wn=(t,n,r)=>t.reduce((s,i)=>{const l=n.properties.find(({value:d})=>d===i);if(l){const d=C()(r,["properties",l.value],[]),c=Ot(l,d);s.properties[i]=c}return s},{properties:{}}),Vn=(t,n)=>n.reduce((r,s)=>{const i=t.find(({uid:l})=>l===s)||null;return i&&(r[s]=i),r},{});var $t=({subjects:t},n,r,s=[])=>n.reduce((i,l)=>{const d=l.subjects,c=Vn(t,d);if(M()(c))return i;const m=Object.keys(c).reduce((u,f)=>{const{actionId:R,applyToProperties:$}=l,T=c[f].properties.map(({value:Z})=>Z).every(Z=>($||[]).indexOf(Z)===-1),h=St(s,R,f),I=Mt(r,C()(h,"conditions",[]));if(M()($)||T)return ge()(u,[f,R],{properties:{enabled:h!==void 0},conditions:I}),u;const D=Wn($,c[f],h);return ge()(u,[f,R],{...D,conditions:I}),u},{});return Fn()(i,m)},{});const Kn=(t,n,r)=>t.reduce((s,i)=>{const l=St(r,i.action,null);return s[i.action]={properties:{enabled:l!==void 0},conditions:Mt(n,l?.conditions??[])},s},{}),Hn=(t,n,r)=>t.reduce((s,i)=>(s[i.subCategoryId]=Kn(i.actions,n,r),s),{});var Dt=(t,n,r=[])=>t.reduce((s,{categoryId:i,childrenForm:l})=>{const d=Hn(l,n,r);return s[i]=d,s},{});const Lt=t=>t.split(" ").join("-");var jt=(t,n)=>Object.entries(pe()(t,n)).map(([r,s])=>({category:r,categoryId:Lt(r),childrenForm:Object.entries(pe()(s,"subCategory")).map(([i,l])=>({subCategoryName:i,subCategoryId:Lt(i),actions:l}))})),Un=(t,n)=>{const{conditions:r,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||[],r,n),singleTypes:$t(i,i.actions||[],r,n),plugins:Dt(c.plugins,r,n),settings:Dt(c.settings,r,n)};return{initialData:m,modifiedData:m,layouts:c}},Gn=o(99381),et=o.n(Gn);const kt=t=>Object.keys(t).reduce((n,r)=>{const s=t[r];if(Te()(s)&&!x()(s,"conditions"))return{...n,[r]:kt(s)};if(Te()(s)&&x()(s,"conditions")&&!je(X()(s,"conditions")).some(l=>l)){const l=Object.keys(s.conditions).reduce((d,c)=>(d[c]=!1,d),{});return{...n,[r]:{...s,conditions:l}}}return n[r]=s,n},{});var tt=kt;const It=(t,n,r=!1)=>Object.keys(t).reduce((s,i)=>{const l=t[i];return i==="conditions"&&!r?(s[i]=l,s):Te()(l)?{...s,[i]:It(l,n,i==="fields")}:(s[i]=n,s)},{});var Ue=It;const zn={initialData:{},modifiedData:{},layouts:{}};var wn=(t,n)=>(0,Q.ZP)(t,r=>{switch(n.type){case"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX":{const{collectionTypeKind:s,actionId:i,value:l}=n,d=["modifiedData",s];Object.keys(C()(t,d)).forEach(c=>{const m=C()(t,[...d,c,i],void 0);if(m){let u=Ue(m,l);if(!l&&u.conditions){const f=Ue(u.conditions,!1);u={...u,conditions:f}}ge()(r,[...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=C()(c,m,{});Object.keys(u).forEach(f=>{if(x()(u[f],`properties.${i}`)){const R=C()(u,[f,"properties",i,l]),$=[...m,f,"properties",i,l];if(!Te()(R))ge()(c,$,d);else{const N=Ue(R,d);ge()(c,$,N)}}}),d||(c=tt(c)),ge()(r,"modifiedData",c);break}case"ON_CHANGE_CONDITIONS":{Object.entries(n.conditions).forEach(s=>{const[i,l]=s;ge()(r,["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()(r,"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=C()(d,l,{}),m=Ue(c,i);ge()(d,l,m),i||(d=tt(d)),ge()(r,["modifiedData"],d);break}case"RESET_FORM":{r.modifiedData=t.initialData;break}case"SET_FORM_AFTER_SUBMIT":{r.initialData=t.modifiedData;break}default:return r}});const nt=t=>Object.entries(t).filter(([,n])=>n).map(([n])=>n),Yn=t=>{const[n,{conditions:r}]=t;return{action:n,subject:null,conditions:nt(r),properties:{}}},Xn=t=>Object.values(t).reduce((n,r)=>{const s=Object.entries(r).reduce((i,l)=>{const[,{properties:{enabled:d}}]=l;if(!d)return i;const c=Yn(l);return i.push(c),i},[]);return[...n,...s]},[]);var Bt=t=>Object.values(t).reduce((n,r)=>{const s=Xn(r);return[...n,...s]},[]);const Zt=(t,n="")=>Object.entries(t).reduce((r,s)=>{const[i,l]=s;return Te()(l)?[...r,...Zt(l,`${n}${i}.`)]:(l&&!Te()(l)&&r.push(`${n}${i}`),r)},[]),Qn=(t,n,{conditions:r,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(r),properties:{}}),Jn=(t,n,{conditions:r})=>({action:t,subject:n,properties:{},conditions:nt(r)}),qn=(t,n)=>Object.entries(n).reduce((s,i)=>{const[l,d]=i;if(!je(d).some(u=>u))return s;if(!d?.properties?.enabled){const u=Qn(l,t,d);return[...s,u]}if(!d.properties.enabled)return s;const m=Jn(l,t,d);return s.push(m),s},[]);var Ft=t=>Object.entries(t).reduce((r,s)=>{const[i,l]=s,d=qn(i,l);return[...r,...d]},[]),_n=t=>{const n=Bt(t.plugins),r=Bt(t.settings),s=Ft(t.collectionTypes),i=Ft(t.singleTypes);return[...n,...r,...s,...i]},es=[{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:r},s)=>{const[{initialData:i,layouts:l,modifiedData:d},c]=(0,e.useReducer)(wn,zn,()=>Un(t,r)),{formatMessage:m}=(0,B.Z)();(0,e.useImperativeHandle)(s,()=>({getPermissions(){const k=(0,O.e5)(i.collectionTypes,d.collectionTypes),T=(0,O.e5)(i.singleTypes,d.singleTypes),h={...k,...T};let I;return M()(h)?I=!1:I=Object.values(h).some(D=>Object.values(D).some(Z=>x()(Z,"conditions"))),{permissionsToSend:_n(d),didUpdateConditions:I}},resetForm(){c({type:"RESET_FORM"})},setFormAfterSubmit(){c({type:"SET_FORM_AFTER_SUBMIT"})}}));const u=(k,T,h,I)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX",pathToCollectionType:k,propertyName:T,rowName:h,value:I})},f=(k,T,h)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX",collectionTypeKind:k,actionId:T,value:h})},R=k=>{c({type:"ON_CHANGE_CONDITIONS",conditions:k})},$=(0,e.useCallback)(({target:{name:k,value:T}})=>{c({type:"ON_CHANGE_SIMPLE_CHECKBOX",keys:k,value:T})},[]),N=(0,e.useCallback)(({target:{name:k,value:T}})=>{c({type:"ON_CHANGE_TOGGLE_PARENT_CHECKBOX",keys:k,value:T})},[]);return e.createElement(An,{value:{availableConditions:t.conditions,modifiedData:d,onChangeConditions:R,onChangeSimpleCheckbox:$,onChangeParentCheckbox:N,onChangeCollectionTypeLeftActionRowCheckbox:u,onChangeCollectionTypeGlobalActionCheckbox:f}},e.createElement(v.v,{id:"tabs",label:m({id:"Settings.permissions.users.tabs.label",defaultMessage:"Tabs Permissions"})},e.createElement(P.m,null,es.map(k=>e.createElement(P.O,{key:k.id},m({id:k.labelId,defaultMessage:k.defaultMessage})))),e.createElement(b.n,{style:{position:"relative"}},e.createElement(b.x,null,e.createElement(bt,{layout:l.collectionTypes,kind:"collectionTypes",isFormDisabled:n})),e.createElement(b.x,null,e.createElement(bt,{layout:l.singleTypes,kind:"singleTypes",isFormDisabled:n})),e.createElement(b.x,null,e.createElement(Tt,{layout:l.plugins,kind:"plugins",isFormDisabled:n})),e.createElement(b.x,null,e.createElement(Tt,{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 ts=(0,e.memo)(st)},87056:function(H,L,o){"use strict";o.r(L),o.d(L,{default:function(){return Y}});var e=o(32735),v=o(19565),P=o(15062),b=o(53038),O=o(30305),A=o(27649),x=o(82055),E=o(87933),M=o(41415),W=o(17e3),a=o(72850),B=o(29439),p=o(92802),S=o(67879),F=o(64499),g=o(86409),y=o(91720),V=o(1283),oe=o(49372),de=o(15335),re=o(5803),C=o(10369),me=o(33475),X=o(60216),G=o.n(X);const _=({disabled:ne,role:w,values:j,errors:Q,onChange:he,onBlur:pe})=>{const{formatMessage:J}=(0,S.Z)();return e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(E.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(E.k,{justifyContent:"space-between"},e.createElement(a.x,null,e.createElement(a.x,null,e.createElement(oe.Z,{fontWeight:"bold"},w?w.name:J({id:"global.details",defaultMessage:"Details"}))),e.createElement(a.x,null,e.createElement(oe.Z,{textColor:"neutral500",variant:"pi"},w?w.description:J({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(M.z,{disabled:!0,variant:"secondary"},J({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:w.usersCount}))),e.createElement(de.r,{gap:4},e.createElement(re.P,{col:6},e.createElement(C.o,{disabled:ne,name:"name",error:Q.name&&J({id:Q.name}),label:J({id:"global.name",defaultMessage:"Name"}),onChange:he,onBlur:pe,required:!0,value:j.name||""})),e.createElement(re.P,{col:6},e.createElement(me.g,{disabled:ne,label:J({id:"global.description",defaultMessage:"Description"}),id:"description",error:Q.name&&J({id:Q.name}),onChange:he,onBlur:pe},j.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 Ce=_,be=o(24346),ae=be.Ry().shape({name:be.Z_().required(v.I0.required)}),Se=()=>{const ne=(0,v.lm)(),{formatMessage:w}=(0,S.Z)(),{params:{id:j}}=(0,b.$B)("/settings/roles/:id"),{put:Q}=(0,v.kY)(),[he,pe]=(0,e.useState)(!1),J=(0,e.useRef)(),{lockApp:ce,unlockApp:Ie}=(0,v.o1)(),{trackUsage:Be}=(0,v.rS)(),{formatAPIError:ve}=(0,v.So)(),{isLoading:Ze,data:Le}=(0,y.d)(j,{cacheTime:0}),{roles:[ye={}],isLoading:Me,refetch:Fe}=(0,g.F)({id:j},{cacheTime:0}),{permissions:He,isLoading:Pe}=(0,F.V)({id:j},{cacheTime:0}),ee=async le=>{try{ce(),pe(!0);const{permissionsToSend:ue,didUpdateConditions:Ae}=J.current.getPermissions();await Q(`/admin/roles/${j}`,le),ye.code!=="strapi-super-admin"&&(await Q(`/admin/roles/${j}/permissions`,{permissions:ue}),Ae&&Be("didUpdateConditions")),J.current.setFormAfterSubmit(),await Fe(),ne({type:"success",message:{id:"notification.success.saved"}})}catch(ue){ne({type:"warning",message:ve(ue)})}finally{pe(!1),Ie()}},ie=!Me&&ye.code==="strapi-super-admin";return e.createElement(A.o,null,e.createElement(v.SL,{name:"Roles"}),e.createElement(p.J9,{enableReinitialize:!0,initialValues:{name:ye.name,description:ye.description},onSubmit:ee,validationSchema:ae,validateOnChange:!1},({handleSubmit:le,values:ue,errors:Ae,handleChange:ot,handleBlur:Ne})=>e.createElement("form",{onSubmit:le},e.createElement(x.T,{primaryAction:e.createElement(E.k,{gap:2},e.createElement(M.z,{disabled:ye.code==="strapi-super-admin",onClick:le,loading:he,size:"L"},w({id:"global.save",defaultMessage:"Save"}))),title:w({id:"Settings.roles.edit.title",defaultMessage:"Edit a role"}),subtitle:w({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(v.rU,{startIcon:e.createElement(B.Z,null),to:"/settings/roles"},w({id:"global.back",defaultMessage:"Back"}))}),e.createElement(W.D,null,e.createElement(E.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Ce,{isLoading:Me||Pe,disabled:ie,errors:Ae,values:ue,onChange:ot,onBlur:Ne,role:ye}),!Ze&&!Me&&!Pe?e.createElement(a.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(V.Z,{isFormDisabled:ie,permissions:He,ref:J,layout:Le})):e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(v.dO,null)))))))},Y=()=>{const ne=(0,P.v9)(O._),{isLoading:w,allowedActions:{canRead:j,canUpdate:Q}}=(0,v.ss)({read:ne.settings.roles.read,update:ne.settings.roles.update});return w?e.createElement(v.dO,null):!j&&!Q?e.createElement(b.l_,{to:"/"}):e.createElement(Se,null)}},91720:function(H,L,o){"use strict";o.d(L,{d:function(){return P}});var e=o(19565),v=o(20108);const P=(b,O={})=>{const{get:A}=(0,e.kY)(),{data:x,error:E,isError:M,isLoading:W}=(0,v.useQuery)(["permissions",b],async()=>{const{data:{data:a}}=await A("/admin/permissions",{params:{role:b}});return a},O);return{data:x,error:E,isError:M,isLoading:W}}},84802:function(H){function L(o,e,v,P){for(var b=-1,O=o==null?0:o.length;++b<O;){var A=o[b];e(P,A,v(A),o)}return P}H.exports=L},62435:function(H,L,o){var e=o(56671);function v(P,b,O,A){return e(P,function(x,E,M){b(A,x,O(x),M)}),A}H.exports=v},85580:function(H,L,o){var e=o(84802),v=o(62435),P=o(88904),b=o(77236);function O(A,x){return function(E,M){var W=b(E)?e:v,a=x?x():{};return W(E,A,P(M,2),a)}}H.exports=O},72091:function(H,L,o){var e=o(40314),v=1/0;function P(b){var O=b==null?0:b.length;return O?e(b,v):[]}H.exports=P},81346:function(H,L,o){var e=o(40999),v=o(85580),P=Object.prototype,b=P.hasOwnProperty,O=v(function(A,x,E){b.call(A,E)?A[E].push(x):e(A,E,[x])});H.exports=O},83828:function(H,L,o){"use strict";o.d(L,{U:function(){return B},y:function(){return W}});var e=o(74512),v=o(32735),P=o(8471),b=o(91045),O=o(74971),A=o(49372),x=o(87933),E=o(72850);const M=({theme:p,expanded:S,variant:F,disabled:g,error:y})=>y?`1px solid ${p.colors.danger600} !important`:g?`1px solid ${p.colors.neutral150}`:S?`1px solid ${p.colors.primary600}`:F==="primary"?`1px solid ${p.colors.neutral0}`:`1px solid ${p.colors.neutral100}`,W=(0,P.ZP)(A.Z)``,a=(0,P.ZP)(E.x)`
217
+ border: ${M};
218
+
219
+ &:hover:not([aria-disabled='true']) {
220
+ border: 1px solid ${({theme:p})=>p.colors.primary600};
221
+
222
+ ${W} {
223
+ color: ${({theme:p,expanded:S})=>S?void 0:p.colors.primary700};
224
+ }
225
+
226
+ ${A.Z} {
227
+ color: ${({theme:p,expanded:S})=>S?void 0:p.colors.primary600};
228
+ }
229
+
230
+ & > ${x.k} {
231
+ background: ${({theme:p})=>p.colors.primary100};
232
+ }
233
+
234
+ [data-strapi-dropdown='true'] {
235
+ background: ${({theme:p})=>p.colors.primary200};
236
+ }
237
+ }
238
+ `,B=({children:p,disabled:S=!1,error:F,expanded:g=!1,hasErrorMessage:y=!0,id:V,onToggle:oe,toggle:de,size:re="M",variant:C="primary",shadow:me})=>{const X=(0,O.M)(V),G=v.useMemo(()=>({expanded:g,onToggle:oe,toggle:de,id:X,size:re,variant:C,disabled:S}),[S,g,X,oe,re,de,C]);return(0,e.jsxs)(b.S.Provider,{value:G,children:[(0,e.jsx)(a,{"data-strapi-expanded":g,disabled:S,"aria-disabled":S,expanded:g,hasRadius:!0,variant:C,error:F,shadow:me,children:p}),F&&y&&(0,e.jsx)(E.x,{paddingTop:1,children:(0,e.jsx)(A.Z,{variant:"pi",textColor:"danger600",children:F})})]})}},89966:function(H,L,o){"use strict";o.d(L,{v:function(){return b}});var e=o(74512),v=o(91045),P=o(72850);const b=({children:O,...A})=>{const{expanded:x,id:E}=(0,v.A)();if(!x)return null;const M=`accordion-content-${E}`,W=`accordion-label-${E}`,a=`accordion-desc-${E}`;return(0,e.jsx)(P.x,{role:"region",id:M,"aria-labelledby":W,"aria-describedby":a,...A,children:O})}},91045:function(H,L,o){"use strict";o.d(L,{A:function(){return P},S:function(){return v}});var e=o(32735);const v=(0,e.createContext)({disabled:!1,expanded:!1,id:"",size:"M",variant:"primary"}),P=()=>(0,e.useContext)(v)},61762:function(H,L,o){"use strict";o.d(L,{B:function(){return p}});var e=o(74512),v=o(16899),P=o(8471),b=o(83828),O=o(91045);const A=({expanded:S,disabled:F,variant:g})=>{let y="neutral100";return S?y="primary100":F?y="neutral150":g==="primary"&&(y="neutral0"),y};var x=o(7563),E=o(99140),M=o(87933),W=o(49372);const a=(0,P.ZP)(x.A)`
239
+ text-align: left;
240
+
241
+ // necessary to make the ellipsis prop work on the title
242
+ > span {
243
+ max-width: 100%;
244
+ }
245
+
246
+ svg {
247
+ width: ${14/16}rem;
248
+ height: ${14/16}rem;
249
+
250
+ path {
251
+ fill: ${({theme:S,expanded:F})=>F?S.colors.primary600:S.colors.neutral500};
252
+ }
253
+ }
254
+ `,B=(0,P.ZP)(M.k)`
255
+ min-height: ${({theme:S,size:F})=>S.sizes.accordions[F]};
256
+ border-radius: ${({theme:S,expanded:F})=>F?`${S.borderRadius} ${S.borderRadius} 0 0`:S.borderRadius};
257
+
258
+ &:hover {
259
+ svg {
260
+ path {
261
+ fill: ${({theme:S})=>S.colors.primary600};
262
+ }
263
+ }
264
+ }
265
+ `,p=({title:S,description:F,as:g="span",togglePosition:y="right",action:V,...oe})=>{const{onToggle:de,toggle:re,expanded:C,id:me,size:X,variant:G,disabled:_}=(0,O.A)(),Ce=`accordion-content-${me}`,be=`accordion-label-${me}`,xe=`accordion-desc-${me}`,ae=X==="M"?6:4,Re=X==="M"?ae:ae-2,Se=A({expanded:C,disabled:_,variant:G}),z={as:g,fontWeight:X==="S"?"bold":void 0,id:be,textColor:C?"primary600":"neutral700",ellipsis:!0,variant:X==="M"?"delta":void 0},Y=C?"primary600":"neutral600",ne=C?"primary200":"neutral200",w=X==="M"?`${32/16}rem`:`${24/16}rem`,j=()=>{_||(re&&!de?(console.warn('Deprecation warning: Usage of "toggle" prop in Accordion component is deprecated. This is discouraged and will be removed in the next major release. Please use "onToggle" instead'),re()):de&&de())},Q=(0,e.jsx)(M.k,{justifyContent:"center",borderRadius:"50%",height:w,width:w,transform:C?"rotate(180deg)":void 0,"data-strapi-dropdown":!0,"aria-hidden":!0,as:"span",background:ne,cursor:_?"not-allowed":"pointer",onClick:j,shrink:0,children:(0,e.jsx)(E.J,{as:v.Z,width:X==="M"?`${11/16}rem`:`${8/16}rem`,color:C?"primary600":"neutral600"})});return(0,e.jsx)(B,{paddingBottom:Re,paddingLeft:ae,paddingRight:ae,paddingTop:Re,background:Se,expanded:C,size:X,justifyContent:"space-between",cursor:_?"not-allowed":"",children:(0,e.jsxs)(M.k,{gap:3,flex:1,maxWidth:"100%",children:[y==="left"&&Q,(0,e.jsx)(a,{onClick:j,"aria-disabled":_,"aria-expanded":C,"aria-controls":Ce,"aria-labelledby":be,"data-strapi-accordion-toggle":!0,expanded:C,type:"button",flex:1,minWidth:0,...oe,children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(b.y,{...z,children:S}),F&&(0,e.jsx)(W.Z,{as:"p",id:xe,textColor:Y,children:F})]})}),y==="right"&&(0,e.jsxs)(M.k,{gap:3,children:[Q,V]}),y==="left"&&V]})})}},27799:function(H,L,o){"use strict";o.d(L,{Q:function(){return b}});var e=o(74512),v=o(8471),P=o(6407);const b=({options:A,...x})=>(0,e.jsx)(P.NU,{...x,children:A.map(E=>"children"in E?(0,e.jsx)(P.Ab,{label:E.label,values:E.children.map(M=>M.value.toString()),children:E.children.map(M=>(0,e.jsx)(O,{value:M.value,children:M.label},M.value))},E.label):(0,e.jsx)(P.ML,{value:E.value,children:E.label},E.value))}),O=(0,v.ZP)(P.ML)`
266
+ padding-left: ${({theme:A})=>A.spaces[7]};
267
+ `}}]);