@beinformed/react 1.0.0-beta.1 → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/chunk-4IDEBSD5.js +2 -0
  3. package/dist/chunk-4IDEBSD5.js.map +1 -0
  4. package/dist/chunk-6AKWSGWH.js +2 -0
  5. package/dist/chunk-6AKWSGWH.js.map +1 -0
  6. package/dist/{chunk-LYHN5GC6.js → chunk-6EK3TAMN.js} +2 -2
  7. package/dist/{chunk-3UHZ6GBP.js → chunk-BV77KA4Y.js} +2 -2
  8. package/dist/{chunk-GHKA2XFO.js → chunk-ITSZQHGD.js} +2 -2
  9. package/dist/chunk-ITSZQHGD.js.map +1 -0
  10. package/dist/chunk-JWOBKHOJ.js +2 -0
  11. package/dist/chunk-JWOBKHOJ.js.map +1 -0
  12. package/dist/{chunk-X6L6BWD4.js → chunk-KZB56W7Q.js} +2 -2
  13. package/dist/chunk-KZB56W7Q.js.map +1 -0
  14. package/dist/{chunk-LJM2ADG6.js → chunk-KZLW2NHD.js} +2 -2
  15. package/dist/{chunk-7LGDJBGK.js → chunk-OQK6SSUD.js} +2 -2
  16. package/dist/{chunk-ALGSLJJI.js → chunk-SPV6MD7J.js} +2 -2
  17. package/dist/{chunk-ZNJONDQ6.js → chunk-TAWZ2VIM.js} +2 -2
  18. package/dist/chunk-VXOYOMNN.js +2 -0
  19. package/dist/chunk-VXOYOMNN.js.map +1 -0
  20. package/dist/chunk-WEJGEXAP.js +2 -0
  21. package/dist/chunk-WEJGEXAP.js.map +1 -0
  22. package/dist/client/index.cjs +1 -1
  23. package/dist/client/index.cjs.map +1 -1
  24. package/dist/client/index.js +1 -1
  25. package/dist/hooks/index.cjs +1 -1
  26. package/dist/hooks/index.cjs.map +1 -1
  27. package/dist/hooks/index.d.cts +79 -8
  28. package/dist/hooks/index.d.ts +79 -8
  29. package/dist/hooks/index.js +1 -1
  30. package/dist/i18n/index.cjs +1 -1
  31. package/dist/i18n/index.cjs.map +1 -1
  32. package/dist/i18n/index.d.cts +20 -2
  33. package/dist/i18n/index.d.ts +20 -2
  34. package/dist/i18n/index.js +1 -1
  35. package/dist/index.cjs +6 -6
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.cts +4 -4
  38. package/dist/index.d.ts +4 -4
  39. package/dist/index.js +1 -1
  40. package/dist/index.js.map +1 -1
  41. package/dist/redux/index.cjs +1 -1
  42. package/dist/redux/index.cjs.map +1 -1
  43. package/dist/redux/index.d.cts +3 -3
  44. package/dist/redux/index.d.ts +3 -3
  45. package/dist/redux/index.js +1 -1
  46. package/dist/server/index.cjs +1 -1
  47. package/dist/server/index.cjs.map +1 -1
  48. package/dist/server/index.js +1 -1
  49. package/dist/theme/index.cjs +1 -1
  50. package/dist/theme/index.cjs.map +1 -1
  51. package/dist/theme/index.js +1 -1
  52. package/dist/utils/index.cjs +1 -1
  53. package/dist/utils/index.cjs.map +1 -1
  54. package/dist/utils/index.d.cts +6 -1
  55. package/dist/utils/index.d.ts +6 -1
  56. package/dist/utils/index.js +1 -1
  57. package/package.json +8 -8
  58. package/dist/chunk-5MOCT43G.js +0 -2
  59. package/dist/chunk-5MOCT43G.js.map +0 -1
  60. package/dist/chunk-AMFWIR2R.js +0 -2
  61. package/dist/chunk-AMFWIR2R.js.map +0 -1
  62. package/dist/chunk-GHKA2XFO.js.map +0 -1
  63. package/dist/chunk-JYAETKRB.js +0 -2
  64. package/dist/chunk-JYAETKRB.js.map +0 -1
  65. package/dist/chunk-LUXTQYD2.js +0 -2
  66. package/dist/chunk-LUXTQYD2.js.map +0 -1
  67. package/dist/chunk-TRPPQFNA.js +0 -2
  68. package/dist/chunk-TRPPQFNA.js.map +0 -1
  69. package/dist/chunk-TYEAR2B7.js +0 -2
  70. package/dist/chunk-TYEAR2B7.js.map +0 -1
  71. package/dist/chunk-X6L6BWD4.js.map +0 -1
  72. /package/dist/{chunk-LYHN5GC6.js.map → chunk-6EK3TAMN.js.map} +0 -0
  73. /package/dist/{chunk-3UHZ6GBP.js.map → chunk-BV77KA4Y.js.map} +0 -0
  74. /package/dist/{chunk-LJM2ADG6.js.map → chunk-KZLW2NHD.js.map} +0 -0
  75. /package/dist/{chunk-7LGDJBGK.js.map → chunk-OQK6SSUD.js.map} +0 -0
  76. /package/dist/{chunk-ALGSLJJI.js.map → chunk-SPV6MD7J.js.map} +0 -0
  77. /package/dist/{chunk-ZNJONDQ6.js.map → chunk-TAWZ2VIM.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @beinformed/react
2
2
 
3
+ ## 1.0.0-beta.3
4
+
5
+ ### Patch Changes
6
+
7
+ - a2b569d: update dependencies and add missing exports to codemod
8
+ - Updated dependencies [a2b569d]
9
+ - @beinformed/ui@2.0.0-beta.3
10
+
11
+ ## 1.0.0-beta.2
12
+
13
+ ### Patch Changes
14
+
15
+ - 6270090: Update hooks and codemod
16
+ - Updated dependencies [6270090]
17
+ - @beinformed/ui@2.0.0-beta.2
18
+
3
19
  ## 1.0.0-beta.1
4
20
 
5
21
  ### Patch Changes
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-JWOBKHOJ.js";import{hideVisually as i}from"polished";import{jsx as s}from"react/jsx-runtime";var d=({className:e,id:o,defaultMessage:t,children:n,data:p,screenreaderOnly:l=!1,allowHTML:m=!1})=>{let r=a(o,t||n,p);if(l){let f={...i()};return s("span",{className:e,style:f,children:r})}return m?s("span",{className:e,dangerouslySetInnerHTML:{__html:r}}):s("span",{className:e,children:r})};d.displayName="BI.Message";export{d as a};
2
+ //# sourceMappingURL=chunk-4IDEBSD5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/i18n/react/Message.tsx"],"sourcesContent":["import { hideVisually } from \"polished\";\n\nimport { useMessage } from \"../../hooks/useI18n\";\n\nimport type { MessageParameters } from \"@beinformed/ui/types\";\n\ninterface Props {\n className?: string;\n id: string;\n defaultMessage?: string | null;\n children?: string;\n data?: MessageParameters | undefined;\n screenreaderOnly?: boolean;\n allowHTML?: boolean;\n}\n\n/**\n * Message React component\n */\nexport const Message = ({\n className,\n id,\n defaultMessage,\n children,\n data,\n screenreaderOnly = false,\n allowHTML = false,\n}: Props) => {\n const translatedMessage = useMessage(id, defaultMessage || children, data);\n\n if (screenreaderOnly) {\n const styles = {\n ...hideVisually(),\n };\n\n return (\n <span className={className} style={styles}>\n {translatedMessage}\n </span>\n );\n }\n\n if (allowHTML) {\n return (\n <span\n className={className}\n dangerouslySetInnerHTML={{\n __html: translatedMessage,\n }}\n />\n );\n }\n\n return <span className={className}>{translatedMessage}</span>;\n};\n\nMessage.displayName = \"BI.Message\";\n"],"mappings":"mCAAA,OAAS,gBAAAA,MAAoB,WAoCvB,cAAAC,MAAA,oBAjBC,IAAMC,EAAU,CAAC,CACtB,UAAAC,EACA,GAAAC,EACA,eAAAC,EACA,SAAAC,EACA,KAAAC,EACA,iBAAAC,EAAmB,GACnB,UAAAC,EAAY,EACd,IAAa,CACX,IAAMC,EAAoBC,EAAWP,EAAIC,GAAkBC,EAAUC,CAAI,EAEzE,GAAIC,EAAkB,CACpB,IAAMI,EAAS,CACb,GAAGC,EAAa,CAClB,EAEA,OACEZ,EAAC,QAAK,UAAWE,EAAW,MAAOS,EAChC,SAAAF,EACH,CAEJ,CAEA,OAAID,EAEAR,EAAC,QACC,UAAWE,EACX,wBAAyB,CACvB,OAAQO,CACV,EACF,EAIGT,EAAC,QAAK,UAAWE,EAAY,SAAAO,EAAkB,CACxD,EAEAR,EAAQ,YAAc","names":["hideVisually","jsx","Message","className","id","defaultMessage","children","data","screenreaderOnly","allowHTML","translatedMessage","useMessage","styles","hideVisually"]}
@@ -0,0 +1,2 @@
1
+ import{f as r}from"./chunk-FBCZEJSD.js";var c=i=>{let e=preferencesProvider.getLayoutConfigFileLocation();if(typeof e=="string"){let o=e.startsWith("/")?`/resource${e}`:`/resource/${e}`,t=dataFetcher.fetch(o);if(t)i.dispatch(r(t));else throw new Error(`Could not read theme configuration file from: ${o}`)}};export{c as a};
2
+ //# sourceMappingURL=chunk-6AKWSGWH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/theme/serverTheme.ts"],"sourcesContent":["import { setThemePreference } from \"../redux/preferences/preferencesActions\";\n\nimport type { BEIStore } from \"../redux/store\";\n\nexport const setConfigurationTheme = (store: BEIStore) => {\n const configFileLocation = preferencesProvider.getLayoutConfigFileLocation();\n if (typeof configFileLocation === \"string\") {\n const configFilePath = configFileLocation.startsWith(\"/\")\n ? `/resource${configFileLocation}`\n : `/resource/${configFileLocation}`;\n\n const configTheme = dataFetcher.fetch(configFilePath);\n\n if (configTheme) {\n store.dispatch(setThemePreference(configTheme));\n } else {\n throw new Error(\n `Could not read theme configuration file from: ${configFilePath}`,\n );\n }\n }\n};\n"],"mappings":"wCAIO,IAAMA,EAAyBC,GAAoB,CACxD,IAAMC,EAAqB,oBAAoB,4BAA4B,EAC3E,GAAI,OAAOA,GAAuB,SAAU,CAC1C,IAAMC,EAAiBD,EAAmB,WAAW,GAAG,EACpD,YAAYA,CAAkB,GAC9B,aAAaA,CAAkB,GAE7BE,EAAc,YAAY,MAAMD,CAAc,EAEpD,GAAIC,EACFH,EAAM,SAASI,EAAmBD,CAAW,CAAC,MAE9C,OAAM,IAAI,MACR,iDAAiDD,CAAc,EACjE,CAEJ,CACF","names":["setConfigurationTheme","store","configFileLocation","configFilePath","configTheme","setThemePreference"]}
@@ -1,2 +1,2 @@
1
- import{b as P}from"./chunk-MT7D3AJU.js";import{b as u}from"./chunk-LJM2ADG6.js";import{a as f,c as l,d as S,i as b}from"./chunk-ALGSLJJI.js";import{a as c,i as d,t as y,v as T}from"./chunk-GHKA2XFO.js";import{a as _,b as x}from"./chunk-GD4NSZBN.js";import{g,h as E,i as R}from"./chunk-FBCZEJSD.js";import{createRoot as k,hydrateRoot as B}from"react-dom/client";import{getContextPathModularUI as F,getStringSetting as H,setSetting as D,setSettings as M}from"@beinformed/ui/settings";import{Cache as a,xhr as A}from"@beinformed/ui/utils";import{HelmetProvider as w}from"@dr.pogodin/react-helmet";import{Provider as C}from"react-redux";import{Router as I}from"react-router";import{jsx as p}from"react/jsx-runtime";var h=({store:o,routerHistory:e,theme:t,children:r,ErrorFallbackComponent:i})=>p(C,{store:o,children:p(x,{theme:t,children:p(w,{children:p(P,{FallbackComponent:i,children:p(I,{history:e,children:r})})})})});h.displayName="BEI.Init";import{jsx as q}from"react/jsx-runtime";var L=o=>{globalThis.onunhandledrejection=e=>e.reason?queueMicrotask(()=>{let t=e.reason.message.toString()||String(e.reason);throw o.dispatch(y(t)),e.reason}):e},N=(o,e)=>{let t=o.preferences.theme;_(t,e)},v=o=>{let t=new URLSearchParams(globalThis.location.search).get("redirectURI");t&&A({url:`${F()}${t}`}).catch(r=>{if(r.id==="UnauthorizedException"||r.id==="Error.NotAuthorized"||r.id==="Error.Authentication.Required"||r.id==="Error.Authentication.InvalidCredentials"){let i=H("LOGIN_PATH","/signin");o.dispatch(T(i,{from:{pathname:t},modal:!1}))}})},U=o=>{if(globalThis!==void 0){let e=new URLSearchParams(globalThis.location?.search).get("entryDate");if(e)o.dispatch(d(e));else if(a.hasItem("ModelCatalogEntryDate")){let t=a.getItem("ModelCatalogEntryDate");o.dispatch(d(t))}}},W=(o,e,t,r)=>{let i=globalThis.window.contextPath;if(i===void 0)throw new Error("Missing contextPath on window object");D("CONTEXT_PATH",i),r&&M(r),a.clear("^res:");let n=b(u(),o);return N(n.getState(),t),v(n),U(n),g(n.getState()),R(n.getState()),E(n.getState()),a.loadOtherBrowserTabs(()=>{a.getItem("auth")&&n.dispatch(c())}),a.getItem("auth")&&n.dispatch(c()),l().listen((m,s)=>{n.dispatch(S(m,s))}),L(n),document.body&&(document.body.className="js"),e&&f(e,{store:n}),{store:n}},j=(o,e,t,r,i)=>{globalThis.addEventListener("DOMContentLoaded",()=>{let n=document.querySelector("#application");if(!n)throw new Error("No DOM element with id application found to attach client to");t(n,q(h,{store:o,routerHistory:l(),theme:r,ErrorFallbackComponent:i,children:e()}))})},O=(o,e)=>{o.querySelector(".application")?B(o,e):k(o).render(e)},le=({customReducers:o,theme:e,settings:t,render:r,beforeRenderHooks:i,ErrorFallbackComponent:n,mount:m})=>{let{store:s}=W(o,i,t);j(s,r,m??O,e,n)};(function(){let e=document.querySelector('script[type="application/json"][data-app-state="app-json"]');if(!e)throw new Error("Error finding script with attribute app-json to retrieve context path in html");let t=e.getAttribute("data-app-contextpath");if(t&&(window.contextPath=t),typeof __webpack_public_path__<"u"){let i=e.getAttribute("data-app-filepath");i&&i!=="{FILEPATH}"?__webpack_public_path__=`${i}/`:t&&(__webpack_public_path__=`${t}/`)}let r=e.getAttribute("data-app-nonce");r&&(__webpack_nonce__=r)})();export{h as a,L as b,U as c,W as d,j as e,le as f};
2
- //# sourceMappingURL=chunk-LYHN5GC6.js.map
1
+ import{b as P}from"./chunk-MT7D3AJU.js";import{b as u}from"./chunk-KZLW2NHD.js";import{a as f,c as l,d as S,i as b}from"./chunk-SPV6MD7J.js";import{a as c,i as d,t as y,v as T}from"./chunk-ITSZQHGD.js";import{a as _,b as x}from"./chunk-GD4NSZBN.js";import{g,h as E,i as R}from"./chunk-FBCZEJSD.js";import{createRoot as k,hydrateRoot as B}from"react-dom/client";import{getContextPathModularUI as F,getStringSetting as H,setSetting as D,setSettings as M}from"@beinformed/ui/settings";import{Cache as a,xhr as A}from"@beinformed/ui/utils";import{HelmetProvider as w}from"@dr.pogodin/react-helmet";import{Provider as C}from"react-redux";import{Router as I}from"react-router";import{jsx as p}from"react/jsx-runtime";var h=({store:o,routerHistory:e,theme:t,children:r,ErrorFallbackComponent:i})=>p(C,{store:o,children:p(x,{theme:t,children:p(w,{children:p(P,{FallbackComponent:i,children:p(I,{history:e,children:r})})})})});h.displayName="BEI.Init";import{jsx as q}from"react/jsx-runtime";var L=o=>{globalThis.onunhandledrejection=e=>e.reason?queueMicrotask(()=>{let t=e.reason.message.toString()||String(e.reason);throw o.dispatch(y(t)),e.reason}):e},N=(o,e)=>{let t=o.preferences.theme;_(t,e)},v=o=>{let t=new URLSearchParams(globalThis.location.search).get("redirectURI");t&&A({url:`${F()}${t}`}).catch(r=>{if(r.id==="UnauthorizedException"||r.id==="Error.NotAuthorized"||r.id==="Error.Authentication.Required"||r.id==="Error.Authentication.InvalidCredentials"){let i=H("LOGIN_PATH","/signin");o.dispatch(T(i,{from:{pathname:t},modal:!1}))}})},U=o=>{if(globalThis!==void 0){let e=new URLSearchParams(globalThis.location?.search).get("entryDate");if(e)o.dispatch(d(e));else if(a.hasItem("ModelCatalogEntryDate")){let t=a.getItem("ModelCatalogEntryDate");o.dispatch(d(t))}}},W=(o,e,t,r)=>{let i=globalThis.window.contextPath;if(i===void 0)throw new Error("Missing contextPath on window object");D("CONTEXT_PATH",i),r&&M(r),a.clear("^res:");let n=b(u(),o);return N(n.getState(),t),v(n),U(n),g(n.getState()),R(n.getState()),E(n.getState()),a.loadOtherBrowserTabs(()=>{a.getItem("auth")&&n.dispatch(c())}),a.getItem("auth")&&n.dispatch(c()),l().listen((m,s)=>{n.dispatch(S(m,s))}),L(n),document.body&&(document.body.className="js"),e&&f(e,{store:n}),{store:n}},j=(o,e,t,r,i)=>{globalThis.addEventListener("DOMContentLoaded",()=>{let n=document.querySelector("#application");if(!n)throw new Error("No DOM element with id application found to attach client to");t(n,q(h,{store:o,routerHistory:l(),theme:r,ErrorFallbackComponent:i,children:e()}))})},O=(o,e)=>{o.querySelector(".application")?B(o,e):k(o).render(e)},le=({customReducers:o,theme:e,settings:t,render:r,beforeRenderHooks:i,ErrorFallbackComponent:n,mount:m})=>{let{store:s}=W(o,i,t);j(s,r,m??O,e,n)};(function(){let e=document.querySelector('script[type="application/json"][data-app-state="app-json"]');if(!e)throw new Error("Error finding script with attribute app-json to retrieve context path in html");let t=e.getAttribute("data-app-contextpath");if(t&&(window.contextPath=t),typeof __webpack_public_path__<"u"){let i=e.getAttribute("data-app-filepath");i&&i!=="{FILEPATH}"?__webpack_public_path__=`${i}/`:t&&(__webpack_public_path__=`${t}/`)}let r=e.getAttribute("data-app-nonce");r&&(__webpack_nonce__=r)})();export{h as a,L as b,U as c,W as d,j as e,le as f};
2
+ //# sourceMappingURL=chunk-6EK3TAMN.js.map
@@ -1,2 +1,2 @@
1
- import{c as p,e as l,h as u}from"./chunk-X6L6BWD4.js";var L=t=>{if(!t)return"";let e=[];return t.split("&").forEach(r=>{let[o,a]=r.split("=");o&&a?e.push(`${encodeURIComponent(o)}=${encodeURIComponent(a)}`):o&&e.push(encodeURIComponent(o))}),e.join("&")},h=t=>{let e=t.getPathInfo()||"/",r=t.getQueryString();return e=e.split("/").map(o=>encodeURIComponent(o)).join("/"),r?`${e}?${L(r)}`:e},C=t=>({pathname:t.getPathInfo()||"/",search:t.getQueryString()||"",state:{},hash:""}),v=(t,e)=>t.getCookieByName(e),m=(t,e)=>{let o=v(t,"locale")||t.getHeader("Accept-Language");return o===null?e.availableLocaleCodes[0]:e.getPreferredLocale(o)};import y from"deepmerge";import{IllegalArgumentException as g}from"@beinformed/ui/exceptions";import{getEnabledLocales as R}from"@beinformed/ui/settings";var E=(t,e=[],r)=>{if(!Array.isArray(e))throw new g("locales must be an array of objects");if(!r)throw new g("missing request argument");let o=p.map(n=>{let s=n.code,c=e.find(d=>d.code===s);return c?y(n,c):n});e.forEach(n=>{o.some(s=>s.code===n.code)||o.push(n)});let a=o.filter(n=>R().includes(n.code)),i=new l(a),f=m(r,i);t.dispatch(u(i,f??"en"))};export{h as a,C as b,v as c,m as d,E as e};
2
- //# sourceMappingURL=chunk-3UHZ6GBP.js.map
1
+ import{c as p,e as l,h as u}from"./chunk-KZB56W7Q.js";var L=t=>{if(!t)return"";let e=[];return t.split("&").forEach(r=>{let[o,a]=r.split("=");o&&a?e.push(`${encodeURIComponent(o)}=${encodeURIComponent(a)}`):o&&e.push(encodeURIComponent(o))}),e.join("&")},h=t=>{let e=t.getPathInfo()||"/",r=t.getQueryString();return e=e.split("/").map(o=>encodeURIComponent(o)).join("/"),r?`${e}?${L(r)}`:e},C=t=>({pathname:t.getPathInfo()||"/",search:t.getQueryString()||"",state:{},hash:""}),v=(t,e)=>t.getCookieByName(e),m=(t,e)=>{let o=v(t,"locale")||t.getHeader("Accept-Language");return o===null?e.availableLocaleCodes[0]:e.getPreferredLocale(o)};import y from"deepmerge";import{IllegalArgumentException as g}from"@beinformed/ui/exceptions";import{getEnabledLocales as R}from"@beinformed/ui/settings";var E=(t,e=[],r)=>{if(!Array.isArray(e))throw new g("locales must be an array of objects");if(!r)throw new g("missing request argument");let o=p.map(n=>{let s=n.code,c=e.find(d=>d.code===s);return c?y(n,c):n});e.forEach(n=>{o.some(s=>s.code===n.code)||o.push(n)});let a=o.filter(n=>R().includes(n.code)),i=new l(a),f=m(r,i);t.dispatch(u(i,f??"en"))};export{h as a,C as b,v as c,m as d,E as e};
2
+ //# sourceMappingURL=chunk-BV77KA4Y.js.map
@@ -1,2 +1,2 @@
1
- import{a as C}from"./chunk-JYAETKRB.js";import{a as ae,d as se,e as ie,f as le}from"./chunk-L7DO7AZT.js";import{a as E}from"./chunk-FW4363Y4.js";var Z=E((Vo,Y)=>{"use strict";var Ye=9007199254740991,Ze=/^(?:0|[1-9]\d*)$/;function Je(e,t){var o=typeof e;return t=t??Ye,!!t&&(o=="number"||o!="symbol"&&Ze.test(e))&&e>-1&&e%1==0&&e<t}Y.exports=Je});var Q=E((Xo,J)=>{"use strict";var Qe=9007199254740991;function et(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Qe}J.exports=et});var lt=E((Yo,ee)=>{"use strict";var tt=se(),ot=ie(),rt=ae(),nt=Z(),at=Q(),st=le();function it(e,t,o){t=tt(t,e);for(var n=-1,r=t.length,a=!1;++n<r;){var s=st(t[n]);if(!(a=e!=null&&o(e,s)))break;e=e[s]}return a||++n!=r?a:(r=e==null?0:e.length,!!r&&at(r)&&nt(s,r)&&(rt(e)||ot(e)))}ee.exports=it});import{createAction as f,createReducer as de}from"@reduxjs/toolkit";var ce={authenticated:!1,mustChangePassword:!1,error:null},ue=f("AUTHENTICATION_SUCCESS"),h=f("AUTHENTICATION_LOGOUT"),S=f("AUTHENTICATION_ERROR",e=>({payload:e})),me=f("AUTHENTICATION_RESET_ERRORS"),M=f("CHANGE_PASSWORD"),ct=de(ce,e=>{e.addCase(ue,t=>{t.authenticated=!0,t.error=null,t.mustChangePassword=!1}).addCase(S,(t,o)=>{t.authenticated=!1,t.error=o.payload,t.mustChangePassword=!1}).addCase(me,t=>{t.error=null}).addCase(h,t=>{t.authenticated=!1,t.error=null,t.mustChangePassword=!1}).addCase(M,t=>{t.authenticated=!0,t.error=null,t.mustChangePassword=!0})});import{createAction as fe,createReducer as pe}from"@reduxjs/toolkit";import{Cache as Re}from"@beinformed/ui/utils";var ge=fe("UPDATE_ENTRYDATE",e=>({payload:e})),ye={entryDate:new Date().toISOString().split("T")[0]},pt=pe(ye,e=>{e.addCase(ge,(t,o)=>{Re.addItem("ModelCatalogEntryDate",o.payload),t.entryDate=o.payload})});import{createAction as N,createAsyncThunk as Ee,createReducer as he}from"@reduxjs/toolkit";var P=(r=>(r.SUCCESS="SUCCESS",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r))(P||{}),H=N("SHOW_NOTIFICATION",(e,t,o)=>({payload:{type:e,message:t,error:o}})),I=Ee("notifications/show",({type:e,message:t,error:o,timeout:n},{dispatch:r})=>{n&&setTimeout(()=>{r(R())},n),r(H(e,t,o))}),R=N("DISMISS_NOTIFICATION"),Se={render:!1,messageType:void 0,message:void 0,error:void 0},yt=he(Se,e=>{e.addCase(H,(t,o)=>({...t,render:!0,messageType:o.payload.type,message:o.payload.message,error:o.payload.error})).addCase(R,t=>({...t,render:!1,messageType:void 0,message:void 0,error:void 0}))});import{createAsyncThunk as Me}from"@reduxjs/toolkit";import{getNumberSetting as Ie}from"@beinformed/ui/settings";import{createAction as g}from"@reduxjs/toolkit";var U=g("START_PROGRESS"),w=g("FINISH_PROGRESS"),St=g("RESET_PROGRESS"),Mt=g("UPDATE_PROGRESS",e=>({payload:{percentComplete:e}}));var Ae=e=>e.actiontype==="create"?"Notification.Msg.Create":e.actiontype==="update"?"Notification.Msg.Update":e.actiontype==="delete"?"Notification.Msg.Delete":"Notification.Msg.Generic",Ct=Me("notification/show_form",async(e,{dispatch:t})=>(t(U()),t(I({type:"SUCCESS",message:{id:Ae(e)}})),setTimeout(()=>{t(R())},Ie("HIDE_NOTIFICATION_TIMEOUT")),t(w()))),D=e=>I({type:"ERROR",message:{id:e.id,defaultMessage:e.message,parameters:e.properties},error:e});import{createAction as p}from"@reduxjs/toolkit";var k=p("ROUTER/PUSH",(e,t)=>({payload:{location:e,state:t}})),L=p("ROUTER/REPLACE",(e,t)=>({payload:{location:e,state:t}})),Ht=p("ROUTER/GO",e=>({payload:{delta:e}})),Ut=p("ROUTER/GOBACK"),wt=p("ROUTER/GOFORWARD");import{createAction as xe,createReducer as Te}from"@reduxjs/toolkit";var A=xe("SAVE_ERROR",e=>({payload:e})),Oe=null,Lt=Te(Oe,e=>{e.addCase(A,(t,o)=>o.payload)});import{createAction as _,createReducer as Ce}from"@reduxjs/toolkit";var Ne=_("SHOW_MODAL",e=>({payload:e})),Pe=_("CLOSE_MODAL",e=>({payload:e})),He={modals:[]},bt=Ce(He,e=>{e.addCase(Ne,(t,o)=>{let n=o.payload;t.modals.forEach(a=>{a.visible=!1});let r=t.modals.find(a=>a.key===n);r?r.visible=!0:t.modals.push({key:n,visible:!0})}).addCase(Pe,(t,o)=>{let n=o.payload;t.modals=t.modals.filter(a=>a.key!==n);let r=t.modals[t.modals.length-1];r&&(r.visible=!0)})});var x=(r=>(r.IDLE="IDLE",r.LOADING="LOADING",r.FINISHED="FINISHED",r.ERROR="ERROR",r))(x||{});import{createAction as c}from"@reduxjs/toolkit";var v=c("MODULARUI/ERROR_STATUS",(e,t)=>({payload:{key:e,error:t}})),qt=c("MODULARUI/SET",(e,t)=>(t.connectKey=e,{payload:{key:e,model:t}})),Kt=c("MODULARUI/INIT",e=>({payload:e})),Wt=c("MODULARUI/UPDATE",e=>({payload:e})),jt=c("MODULARUI/UPDATE_FORM",e=>({payload:e})),m=c("MODULARUI/REMOVE_KEY",e=>({payload:e})),$t=c("MODULARUI/RESET");import{createSelector as T}from"reselect";import{ContentModel as Ue,ContentTOCModel as we,Href as u}from"@beinformed/ui/models";var b=e=>e?.router?.location?.pathname,Zt=(e,t)=>{let o=e?.i18n?.locale||"en",n=e?.modularui;return n?Object.keys(n).filter(r=>{let a=n[r];return a?.model?a.model instanceof t&&a.model.locale===o:!1}).map(r=>n[r].model):[]},Jt=(e,t)=>{let o=e?.modularui;if(o){let n=e.i18n.locale||"en",r=Object.keys(o).find(a=>{let s=o[a];return s?.model?s.model instanceof t&&s.model.locale===n:!1});if(r){let a=o[r];if(a?.model instanceof t)return a.model}}},Qt=(e,t)=>{let o=b(e),n=e?.i18n?.locale||"en",r=e?.modularui;if(r){let a=Object.keys(r).find(s=>{let i=r[s];return i?.model?i.model instanceof t&&i.model.locale===n&&o?.startsWith(i.model.selfhref?.path||""):!1});if(a){let s=r[a];if(s?.model instanceof t)return s.model}}},eo=(e,t)=>{if(e?.modularui){let o=t instanceof u?t:new u(t),n=Object.keys(e.modularui).find(r=>e.modularui[r].model?.selfhref?.equals(o));if(n)return e.modularui[n].model}},to=(e,t)=>{if(e?.modularui){let o=t instanceof u?t:new u(t);return Object.keys(e.modularui).find(n=>{let{model:r}=e.modularui[n];return r?.selfhref?.equals(o)})}},F=(e,t)=>{if(e?.modularui){let o=t instanceof u?t:new u(t);return Object.keys(e.modularui).filter(n=>{let r=e.modularui[n];if(r)return r.model?.selfhref?.equals(o)})}return[]},De=T([e=>e.modularui],e=>{let t=[];return e&&Object.keys(e).forEach(o=>{let n=e[o];if(n&&"model"in n){let{key:r,selfhref:a,label:s,type:i}=n.model,l={key:r,selfhref:a,label:s,type:i,selfContentLink:null};n.model instanceof Ue||n.model instanceof we?t.push({...l,selfContentLink:n.model.selfContentLink}):t.push(l)}}),t}),oo=T([b,De],(e,t)=>{if(!e||!t.length)return[];let o=new Map(t.filter(s=>s.selfhref).map(s=>[s.selfhref?.toString(),s])),n=[],r=e.split("/"),a="";return r.forEach(s=>{a=a==="/"?`/${s}`:`${a}/${s}`;let i=decodeURIComponent(a).replace("/modelcatalog/","/"),l=o.get(i);if(l){let{key:d,label:te,type:oe,selfhref:re,selfContentLink:O}=l,ne=a.startsWith("/modelcatalog/")&&O?new u(`/modelcatalog${O.encodedHref.toString()}`):re;n.push({key:d,href:ne,label:te,type:oe})}}),n}),ro=T(e=>e.modularui,e=>e?Object.keys(e).filter(t=>e[t]&&e[t].status==="FINISHED").map(t=>e[t].model):[]);import{ApplicationModel as ke}from"@beinformed/ui/models";var y=e=>{let t=e.i18n.locale||"en",o=e.modularui;if(o){let n=Object.keys(o).find(r=>{let a=o[r];return a?.model?a.model instanceof ke&&a.model.locale===t:!1});if(n)return o[n]}};import{createAsyncThunk as ze}from"@reduxjs/toolkit";import{ApplicationModel as Ve,Href as Xe}from"@beinformed/ui/models";import{createAsyncThunk as qe}from"@reduxjs/toolkit";import{HTTP_METHODS as Ke}from"@beinformed/ui/constants";import{ErrorResponse as We,Href as V}from"@beinformed/ui/models";import{ModularUIRequest as je}from"@beinformed/ui/modularui";import{IS_SERVER as Fe}from"@beinformed/ui/constants";import{ErrorResponse as W}from"@beinformed/ui/models";import{logoutPath as Be}from"@beinformed/ui/settings";import{createAsyncThunk as Le}from"@reduxjs/toolkit";import{getBooleanSetting as _e,getStringSetting as ve}from"@beinformed/ui/settings";import{Cache as B}from"@beinformed/ui/utils";var q=Le("auth/unauthorized",(e,{dispatch:t,getState:o})=>{if(e.connectKey&&t(m(e.connectKey)),_e("PAGE_RELOAD_ON_UNAUTHORIZED_ERROR",!1)&&e.response){window.location.reload();return}let n=y(o());(B.getItem("auth")||n?.isLoggedIn)&&t(G()),t(h()),B.removeItem("auth"),e.isInvalidUsername&&t(S(e.message||""));let r=o().router.location,a=ve("LOGIN_PATH","/signin");if(r?.pathname!==a){let s=r?.state?.from;t(L(a,{from:s||o().router.location,modal:!1}))}});import{createAction as be}from"@reduxjs/toolkit";var K=be("NO_ACTION");var Ge=e=>t=>{if(e.isResourceNotFoundAfterReload||e.isRemoteServiceException)return t(K());if(e.isUnauthorized)return t(q(e));if(e.isBlocked||e.isConcurrentUser||e.isInvalidUsername){t(k(Be()));return}return e.isChangePassword?t(M()):Fe?t(A(e)):(setTimeout(()=>{throw e.error||e}),t(D(e)))},j=(e,t)=>o=>o(t(e)),No=e=>{j=e},$=e=>{let t=e instanceof W?e:new W(e);return j(t,Ge)};var z=(e,t)=>e||typeof navigator<"u"&&navigator?.language&&navigator.language.split("-")[0]||t;var $e=async({key:e,href:t,options:o},{dispatch:n,getState:r,rejectWithValue:a})=>{try{let s=z(o?.locale,r().i18n.locale),i=t instanceof V?t:new V(t,"",{origin:o?.origin,contextPath:o?.contextPath}),d=await new je(i,{method:o?.method||Ke.GET,params:o?.params||"",data:o?.data||null,locale:s,childmodels:o?.childmodels??!0,isReload:o?.isReload,cache:o?.cache,headers:o?.headers,events:o?.events,onProgress:o?.onProgress,origin:o?.origin,contextPath:o?.contextPath,targetModel:o?.targetModel,forceTargetModel:o?.forceTargetModel??!1,timeout:o?.timeout}).fetch();return d&&(d.connectKey=e),{key:e,model:d,updateHandler:o?.updateHandler}}catch(s){let i=new We(s,e,{origin:o?.origin,contextPath:o?.contextPath});throw i.isChangePassword||i.isResourceNotFoundAfterReload?n(m(e)):n(v(e,i)),n($(s)),a(i)}},X=qe("modularui/fetchModel",$e,{condition:({key:e},{getState:t})=>{if(t().modularui[e]?.status==="LOADING")return!1}});var G=ze("application/reload",async(e,{dispatch:t,getState:o})=>{let n=o(),r=new Xe("/","Application"),a=y(n);a&&(a.contextPath&&(r.contextPath=a.contextPath),a.origin&&(r.origin=a.origin));let s=F(n,r);for(let d of s)t(m(d));let l=`application(/)(${C(n)}`;await t(X({key:l,href:r,options:{targetModel:Ve}}))});export{ue as a,h as b,S as c,me as d,M as e,ct as f,Z as g,lt as h,ge as i,pt as j,U as k,w as l,St as m,Mt as n,P as o,I as p,R as q,yt as r,Ct as s,D as t,k as u,L as v,Ht as w,Ut as x,wt as y,A as z,Lt as A,Ne as B,Pe as C,bt as D,x as E,v as F,qt as G,Kt as H,Wt as I,jt as J,m as K,$t as L,Zt as M,Jt as N,Qt as O,eo as P,to as Q,F as R,oo as S,ro as T,y as U,G as V,q as W,K as X,No as Y,$ as Z,z as _,X as $};
2
- //# sourceMappingURL=chunk-GHKA2XFO.js.map
1
+ import{j as C}from"./chunk-KZB56W7Q.js";import{a as ae,d as se,e as ie,f as le}from"./chunk-L7DO7AZT.js";import{a as E}from"./chunk-FW4363Y4.js";var Z=E((Vo,Y)=>{"use strict";var Ye=9007199254740991,Ze=/^(?:0|[1-9]\d*)$/;function Je(e,t){var o=typeof e;return t=t??Ye,!!t&&(o=="number"||o!="symbol"&&Ze.test(e))&&e>-1&&e%1==0&&e<t}Y.exports=Je});var Q=E((Xo,J)=>{"use strict";var Qe=9007199254740991;function et(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Qe}J.exports=et});var lt=E((Yo,ee)=>{"use strict";var tt=se(),ot=ie(),rt=ae(),nt=Z(),at=Q(),st=le();function it(e,t,o){t=tt(t,e);for(var n=-1,r=t.length,a=!1;++n<r;){var s=st(t[n]);if(!(a=e!=null&&o(e,s)))break;e=e[s]}return a||++n!=r?a:(r=e==null?0:e.length,!!r&&at(r)&&nt(s,r)&&(rt(e)||ot(e)))}ee.exports=it});import{createAction as f,createReducer as de}from"@reduxjs/toolkit";var ce={authenticated:!1,mustChangePassword:!1,error:null},ue=f("AUTHENTICATION_SUCCESS"),h=f("AUTHENTICATION_LOGOUT"),S=f("AUTHENTICATION_ERROR",e=>({payload:e})),me=f("AUTHENTICATION_RESET_ERRORS"),M=f("CHANGE_PASSWORD"),ct=de(ce,e=>{e.addCase(ue,t=>{t.authenticated=!0,t.error=null,t.mustChangePassword=!1}).addCase(S,(t,o)=>{t.authenticated=!1,t.error=o.payload,t.mustChangePassword=!1}).addCase(me,t=>{t.error=null}).addCase(h,t=>{t.authenticated=!1,t.error=null,t.mustChangePassword=!1}).addCase(M,t=>{t.authenticated=!0,t.error=null,t.mustChangePassword=!0})});import{createAction as fe,createReducer as pe}from"@reduxjs/toolkit";import{Cache as Re}from"@beinformed/ui/utils";var ge=fe("UPDATE_ENTRYDATE",e=>({payload:e})),ye={entryDate:new Date().toISOString().split("T")[0]},pt=pe(ye,e=>{e.addCase(ge,(t,o)=>{Re.addItem("ModelCatalogEntryDate",o.payload),t.entryDate=o.payload})});import{createAction as N,createAsyncThunk as Ee,createReducer as he}from"@reduxjs/toolkit";var P=(r=>(r.SUCCESS="SUCCESS",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r))(P||{}),H=N("SHOW_NOTIFICATION",(e,t,o)=>({payload:{type:e,message:t,error:o}})),I=Ee("notifications/show",({type:e,message:t,error:o,timeout:n},{dispatch:r})=>{n&&setTimeout(()=>{r(R())},n),r(H(e,t,o))}),R=N("DISMISS_NOTIFICATION"),Se={render:!1,messageType:void 0,message:void 0,error:void 0},yt=he(Se,e=>{e.addCase(H,(t,o)=>({...t,render:!0,messageType:o.payload.type,message:o.payload.message,error:o.payload.error})).addCase(R,t=>({...t,render:!1,messageType:void 0,message:void 0,error:void 0}))});import{createAsyncThunk as Me}from"@reduxjs/toolkit";import{getNumberSetting as Ie}from"@beinformed/ui/settings";import{createAction as g}from"@reduxjs/toolkit";var U=g("START_PROGRESS"),w=g("FINISH_PROGRESS"),St=g("RESET_PROGRESS"),Mt=g("UPDATE_PROGRESS",e=>({payload:{percentComplete:e}}));var Ae=e=>e.actiontype==="create"?"Notification.Msg.Create":e.actiontype==="update"?"Notification.Msg.Update":e.actiontype==="delete"?"Notification.Msg.Delete":"Notification.Msg.Generic",Ct=Me("notification/show_form",async(e,{dispatch:t})=>(t(U()),t(I({type:"SUCCESS",message:{id:Ae(e)}})),setTimeout(()=>{t(R())},Ie("HIDE_NOTIFICATION_TIMEOUT")),t(w()))),D=e=>I({type:"ERROR",message:{id:e.id,defaultMessage:e.message,parameters:e.properties},error:e});import{createAction as p}from"@reduxjs/toolkit";var k=p("ROUTER/PUSH",(e,t)=>({payload:{location:e,state:t}})),L=p("ROUTER/REPLACE",(e,t)=>({payload:{location:e,state:t}})),Ht=p("ROUTER/GO",e=>({payload:{delta:e}})),Ut=p("ROUTER/GOBACK"),wt=p("ROUTER/GOFORWARD");import{createAction as xe,createReducer as Te}from"@reduxjs/toolkit";var A=xe("SAVE_ERROR",e=>({payload:e})),Oe=null,Lt=Te(Oe,e=>{e.addCase(A,(t,o)=>o.payload)});import{createAction as _,createReducer as Ce}from"@reduxjs/toolkit";var Ne=_("SHOW_MODAL",e=>({payload:e})),Pe=_("CLOSE_MODAL",e=>({payload:e})),He={modals:[]},bt=Ce(He,e=>{e.addCase(Ne,(t,o)=>{let n=o.payload;t.modals.forEach(a=>{a.visible=!1});let r=t.modals.find(a=>a.key===n);r?r.visible=!0:t.modals.push({key:n,visible:!0})}).addCase(Pe,(t,o)=>{let n=o.payload;t.modals=t.modals.filter(a=>a.key!==n);let r=t.modals[t.modals.length-1];r&&(r.visible=!0)})});var x=(r=>(r.IDLE="IDLE",r.LOADING="LOADING",r.FINISHED="FINISHED",r.ERROR="ERROR",r))(x||{});import{createAction as c}from"@reduxjs/toolkit";var v=c("MODULARUI/ERROR_STATUS",(e,t)=>({payload:{key:e,error:t}})),qt=c("MODULARUI/SET",(e,t)=>(t.connectKey=e,{payload:{key:e,model:t}})),Kt=c("MODULARUI/INIT",e=>({payload:e})),Wt=c("MODULARUI/UPDATE",e=>({payload:e})),jt=c("MODULARUI/UPDATE_FORM",e=>({payload:e})),m=c("MODULARUI/REMOVE_KEY",e=>({payload:e})),$t=c("MODULARUI/RESET");import{createSelector as T}from"reselect";import{ContentModel as Ue,ContentTOCModel as we,Href as u}from"@beinformed/ui/models";var b=e=>e?.router?.location?.pathname,Zt=(e,t)=>{let o=e?.i18n?.locale||"en",n=e?.modularui;return n?Object.keys(n).filter(r=>{let a=n[r];return a?.model?a.model instanceof t&&a.model.locale===o:!1}).map(r=>n[r].model):[]},Jt=(e,t)=>{let o=e?.modularui;if(o){let n=e.i18n.locale||"en",r=Object.keys(o).find(a=>{let s=o[a];return s?.model?s.model instanceof t&&s.model.locale===n:!1});if(r){let a=o[r];if(a?.model instanceof t)return a.model}}},Qt=(e,t)=>{let o=b(e),n=e?.i18n?.locale||"en",r=e?.modularui;if(r){let a=Object.keys(r).find(s=>{let i=r[s];return i?.model?i.model instanceof t&&i.model.locale===n&&o?.startsWith(i.model.selfhref?.path||""):!1});if(a){let s=r[a];if(s?.model instanceof t)return s.model}}},eo=(e,t)=>{if(e?.modularui){let o=t instanceof u?t:new u(t),n=Object.keys(e.modularui).find(r=>e.modularui[r].model?.selfhref?.equals(o));if(n)return e.modularui[n].model}},to=(e,t)=>{if(e?.modularui){let o=t instanceof u?t:new u(t);return Object.keys(e.modularui).find(n=>{let{model:r}=e.modularui[n];return r?.selfhref?.equals(o)})}},F=(e,t)=>{if(e?.modularui){let o=t instanceof u?t:new u(t);return Object.keys(e.modularui).filter(n=>{let r=e.modularui[n];if(r)return r.model?.selfhref?.equals(o)})}return[]},De=T([e=>e.modularui],e=>{let t=[];return e&&Object.keys(e).forEach(o=>{let n=e[o];if(n&&"model"in n){let{key:r,selfhref:a,label:s,type:i}=n.model,l={key:r,selfhref:a,label:s,type:i,selfContentLink:null};n.model instanceof Ue||n.model instanceof we?t.push({...l,selfContentLink:n.model.selfContentLink}):t.push(l)}}),t}),oo=T([b,De],(e,t)=>{if(!e||!t.length)return[];let o=new Map(t.filter(s=>s.selfhref).map(s=>[s.selfhref?.toString(),s])),n=[],r=e.split("/"),a="";return r.forEach(s=>{a=a==="/"?`/${s}`:`${a}/${s}`;let i=decodeURIComponent(a).replace("/modelcatalog/","/"),l=o.get(i);if(l){let{key:d,label:te,type:oe,selfhref:re,selfContentLink:O}=l,ne=a.startsWith("/modelcatalog/")&&O?new u(`/modelcatalog${O.encodedHref.toString()}`):re;n.push({key:d,href:ne,label:te,type:oe})}}),n}),ro=T([e=>e.modularui,e=>e.i18n.locale],(e,t)=>e?Object.keys(e).filter(o=>{if(e[o]){let n=e[o];return n.status==="FINISHED"&&n.model?.locale===t}return!1}).map(o=>e[o].model):[]);import{ApplicationModel as ke}from"@beinformed/ui/models";var y=e=>{let t=e.i18n.locale||"en",o=e.modularui;if(o){let n=Object.keys(o).find(r=>{let a=o[r];return a?.model?a.model instanceof ke&&a.model.locale===t:!1});if(n)return o[n]}};import{createAsyncThunk as ze}from"@reduxjs/toolkit";import{ApplicationModel as Ve,Href as Xe}from"@beinformed/ui/models";import{createAsyncThunk as qe}from"@reduxjs/toolkit";import{HTTP_METHODS as Ke}from"@beinformed/ui/constants";import{ErrorResponse as We,Href as V}from"@beinformed/ui/models";import{ModularUIRequest as je}from"@beinformed/ui/modularui";import{IS_SERVER as Fe}from"@beinformed/ui/constants";import{ErrorResponse as W}from"@beinformed/ui/models";import{logoutPath as Be}from"@beinformed/ui/settings";import{createAsyncThunk as Le}from"@reduxjs/toolkit";import{getBooleanSetting as _e,getStringSetting as ve}from"@beinformed/ui/settings";import{Cache as B}from"@beinformed/ui/utils";var q=Le("auth/unauthorized",(e,{dispatch:t,getState:o})=>{if(e.connectKey&&t(m(e.connectKey)),_e("PAGE_RELOAD_ON_UNAUTHORIZED_ERROR",!1)&&e.response){window.location.reload();return}let n=y(o());(B.getItem("auth")||n?.isLoggedIn)&&t(G()),t(h()),B.removeItem("auth"),e.isInvalidUsername&&t(S(e.message||""));let r=o().router.location,a=ve("LOGIN_PATH","/signin");if(r?.pathname!==a){let s=r?.state?.from;t(L(a,{from:s||o().router.location,modal:!1}))}});import{createAction as be}from"@reduxjs/toolkit";var K=be("NO_ACTION");var Ge=e=>t=>{if(e.isResourceNotFoundAfterReload||e.isRemoteServiceException)return t(K());if(e.isUnauthorized)return t(q(e));if(e.isBlocked||e.isConcurrentUser||e.isInvalidUsername){t(k(Be()));return}return e.isChangePassword?t(M()):Fe?t(A(e)):(setTimeout(()=>{throw e.error||e}),t(D(e)))},j=(e,t)=>o=>o(t(e)),No=e=>{j=e},$=e=>{let t=e instanceof W?e:new W(e);return j(t,Ge)};var z=(e,t)=>e||typeof navigator<"u"&&navigator?.language&&navigator.language.split("-")[0]||t;var $e=async({key:e,href:t,options:o},{dispatch:n,getState:r,rejectWithValue:a})=>{try{let s=z(o?.locale,r().i18n.locale),i=t instanceof V?t:new V(t,"",{origin:o?.origin,contextPath:o?.contextPath}),d=await new je(i,{method:o?.method||Ke.GET,params:o?.params||"",data:o?.data||null,locale:s,childmodels:o?.childmodels??!0,isReload:o?.isReload,cache:o?.cache,headers:o?.headers,events:o?.events,onProgress:o?.onProgress,origin:o?.origin,contextPath:o?.contextPath,targetModel:o?.targetModel,forceTargetModel:o?.forceTargetModel??!1,timeout:o?.timeout}).fetch();return d&&(d.connectKey=e),{key:e,model:d,updateHandler:o?.updateHandler}}catch(s){let i=new We(s,e,{origin:o?.origin,contextPath:o?.contextPath});throw i.isChangePassword||i.isResourceNotFoundAfterReload?n(m(e)):n(v(e,i)),n($(s)),a(i)}},X=qe("modularui/fetchModel",$e,{condition:({key:e},{getState:t})=>{if(t().modularui[e]?.status==="LOADING")return!1}});var G=ze("application/reload",async(e,{dispatch:t,getState:o})=>{let n=o(),r=new Xe("/","Application"),a=y(n);a&&(a.contextPath&&(r.contextPath=a.contextPath),a.origin&&(r.origin=a.origin));let s=F(n,r);for(let d of s)t(m(d));let l=`application(/)(${C(n)}`;await t(X({key:l,href:r,options:{targetModel:Ve}}))});export{ue as a,h as b,S as c,me as d,M as e,ct as f,Z as g,lt as h,ge as i,pt as j,U as k,w as l,St as m,Mt as n,P as o,I as p,R as q,yt as r,Ct as s,D as t,k as u,L as v,Ht as w,Ut as x,wt as y,A as z,Lt as A,Ne as B,Pe as C,bt as D,x as E,v as F,qt as G,Kt as H,Wt as I,jt as J,m as K,$t as L,Zt as M,Jt as N,Qt as O,eo as P,to as Q,F as R,oo as S,ro as T,y as U,G as V,q as W,K as X,No as Y,$ as Z,z as _,X as $};
2
+ //# sourceMappingURL=chunk-ITSZQHGD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_isIndex.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isLength.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_hasPath.js","../src/redux/auth/authReducer.ts","../src/redux/modelcatalog/modelCatalogReducer.ts","../src/redux/notifications/notificationReducer.ts","../src/redux/notifications/notificationActions.ts","../src/redux/progressindicator/progressIndicatorActions.ts","../src/redux/router/routerActions.ts","../src/redux/error/errorReducer.ts","../src/redux/modals/modalsReducer.ts","../src/redux/modularui/constants.ts","../src/redux/modularui/modelActions.ts","../src/redux/shared/selectors.ts","../src/redux/application/applicationSelectors.ts","../src/redux/application/applicationActions.ts","../src/redux/modularui/fetchModel.ts","../src/redux/error/errorActions.ts","../src/redux/auth/unauthorizedActions.ts","../src/redux/shared/actions.ts","../src/redux/modularui/utils.ts"],"sourcesContent":["/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","import { createAction, createReducer } from \"@reduxjs/toolkit\";\n\nexport interface AuthState {\n authenticated: boolean;\n mustChangePassword: boolean;\n error: string | null;\n}\n\nconst initalState: AuthState = {\n authenticated: false,\n mustChangePassword: false,\n error: null,\n};\n\nexport const loginSuccess = createAction(\"AUTHENTICATION_SUCCESS\");\n\nexport const logoutSuccess = createAction(\"AUTHENTICATION_LOGOUT\");\n\nexport const sendAuthenticationError = createAction(\n \"AUTHENTICATION_ERROR\",\n (errorMessage: string) => {\n return {\n payload: errorMessage,\n };\n },\n);\n\nexport const resetAuthErrors = createAction(\"AUTHENTICATION_RESET_ERRORS\");\n\nexport const saveChangePassword = createAction(\"CHANGE_PASSWORD\");\n\nexport const authReducer = createReducer(initalState, (builder) => {\n builder\n .addCase(loginSuccess, (state) => {\n state.authenticated = true;\n state.error = null;\n state.mustChangePassword = false;\n })\n .addCase(sendAuthenticationError, (state, action) => {\n state.authenticated = false;\n state.error = action.payload;\n state.mustChangePassword = false;\n })\n .addCase(resetAuthErrors, (state) => {\n state.error = null;\n })\n .addCase(logoutSuccess, (state) => {\n state.authenticated = false;\n state.error = null;\n state.mustChangePassword = false;\n })\n .addCase(saveChangePassword, (state) => {\n state.authenticated = true;\n state.error = null;\n state.mustChangePassword = true;\n });\n});\n","import { createAction, createReducer } from \"@reduxjs/toolkit\";\n\nimport { Cache } from \"@beinformed/ui/utils\";\n\nexport interface ModelCatalogState {\n entryDate: string | undefined;\n}\n\nexport const updateEntryDate = createAction(\n \"UPDATE_ENTRYDATE\",\n (entryDate: string) => {\n return {\n payload: entryDate,\n };\n },\n);\n\nconst initialState: ModelCatalogState = {\n entryDate: new Date().toISOString().split(\"T\")[0],\n};\n\n/**\n * Keep track of the entry date for the modelcatalog\n */\nexport const modelCatalogReducer = createReducer<ModelCatalogState>(\n initialState,\n (builder) => {\n builder.addCase(updateEntryDate, (state, action) => {\n Cache.addItem(\"ModelCatalogEntryDate\", action.payload);\n\n state.entryDate = action.payload;\n });\n },\n);\n","import {\n createAction,\n createAsyncThunk,\n createReducer,\n} from \"@reduxjs/toolkit\";\n\nimport type { ErrorResponse } from \"@beinformed/ui/models\";\nimport type { MessageObject } from \"../../i18n/types\";\n\nexport interface NotificationState {\n render: boolean;\n messageType: string | undefined;\n message: MessageObject | undefined;\n error: ErrorResponse | undefined;\n}\n\nexport interface ShowNotificationArguments {\n type: NOTIFICATION_TYPES | undefined;\n message: MessageObject | undefined;\n error?: ErrorResponse | undefined;\n timeout?: number;\n}\n\nexport enum NOTIFICATION_TYPES {\n SUCCESS = \"SUCCESS\",\n INFO = \"INFO\",\n WARNING = \"WARNING\",\n ERROR = \"ERROR\",\n}\n\nconst saveNotification = createAction(\n \"SHOW_NOTIFICATION\",\n (\n type: NOTIFICATION_TYPES | undefined,\n message: MessageObject | undefined,\n error?: ErrorResponse | undefined,\n ) => {\n return {\n payload: {\n type,\n message,\n error,\n },\n };\n },\n);\n\nexport const showNotification = createAsyncThunk(\n \"notifications/show\",\n (\n { type, message, error, timeout }: ShowNotificationArguments,\n { dispatch },\n ) => {\n if (timeout) {\n setTimeout(() => {\n dispatch(dismissNotification());\n }, timeout);\n }\n\n dispatch(saveNotification(type, message, error));\n },\n);\n\nexport const dismissNotification = createAction(\"DISMISS_NOTIFICATION\");\n\nconst initialState: NotificationState = {\n render: false,\n messageType: undefined,\n message: undefined,\n error: undefined,\n};\n\nexport const notificationReducer = createReducer<NotificationState>(\n initialState,\n (builder) => {\n builder\n .addCase(saveNotification, (state, action) => {\n return {\n ...state,\n render: true,\n messageType: action.payload.type,\n message: action.payload.message,\n error: action.payload.error,\n };\n })\n .addCase(dismissNotification, (state) => {\n return {\n ...state,\n render: false,\n messageType: undefined,\n message: undefined,\n error: undefined,\n };\n });\n },\n);\n","import { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport { getNumberSetting } from \"@beinformed/ui/settings\";\n\nimport {\n finishProgress,\n startProgress,\n} from \"../progressindicator/progressIndicatorActions\";\n\nimport {\n dismissNotification,\n NOTIFICATION_TYPES,\n showNotification,\n} from \"./notificationReducer\";\n\nimport type { ErrorResponse, FormModel } from \"@beinformed/ui/models\";\n\nconst getNotificationMessageId = (form: FormModel) => {\n if (form.actiontype === \"create\") {\n return \"Notification.Msg.Create\";\n }\n\n if (form.actiontype === \"update\") {\n return \"Notification.Msg.Update\";\n }\n\n if (form.actiontype === \"delete\") {\n return \"Notification.Msg.Delete\";\n }\n\n return \"Notification.Msg.Generic\";\n};\n\n/**\n * Show form notification\n */\nexport const showFormNotification = createAsyncThunk(\n \"notification/show_form\",\n async (form: FormModel, { dispatch }) => {\n dispatch(startProgress());\n\n dispatch(\n showNotification({\n type: NOTIFICATION_TYPES.SUCCESS,\n message: {\n id: getNotificationMessageId(form),\n },\n }),\n );\n\n setTimeout(() => {\n dispatch(dismissNotification());\n }, getNumberSetting(\"HIDE_NOTIFICATION_TIMEOUT\"));\n\n return dispatch(finishProgress());\n },\n);\n\n/**\n * Show error notification\n */\nexport const showXHRErrorNotification = (error: ErrorResponse) => {\n return showNotification({\n type: NOTIFICATION_TYPES.ERROR,\n message: {\n id: error.id,\n defaultMessage: error.message,\n parameters: error.properties,\n },\n error,\n });\n};\n","import { createAction } from \"@reduxjs/toolkit\";\n\nexport const startProgress = createAction(\"START_PROGRESS\");\nexport const finishProgress = createAction(\"FINISH_PROGRESS\");\nexport const resetProgress = createAction(\"RESET_PROGRESS\");\nexport const updateProgress = createAction(\n \"UPDATE_PROGRESS\",\n (percentComplete: number) => ({\n payload: {\n percentComplete,\n },\n }),\n);\n","import { createAction } from \"@reduxjs/toolkit\";\n\nimport type { LocationState } from \"history\";\nimport type { RouterLocation } from \"./routerReducer\";\n\nexport const push = createAction(\n \"ROUTER/PUSH\",\n (location: RouterLocation | string, state?: LocationState) => {\n return {\n payload: { location, state },\n };\n },\n);\n\nexport const replace = createAction(\n \"ROUTER/REPLACE\",\n (location: RouterLocation | string, state?: LocationState) => {\n return {\n payload: { location, state },\n };\n },\n);\n\nexport const go = createAction(\"ROUTER/GO\", (delta: number) => {\n return {\n payload: { delta },\n };\n});\n\nexport const goBack = createAction(\"ROUTER/GOBACK\");\n\nexport const goForward = createAction(\"ROUTER/GOFORWARD\");\n","import { createAction, createReducer } from \"@reduxjs/toolkit\";\n\nimport type { ErrorResponse } from \"@beinformed/ui/models\";\n\nexport type ErrorState = null | ErrorResponse;\n\nexport const saveError = createAction(\"SAVE_ERROR\", (error: ErrorResponse) => {\n return {\n payload: error,\n };\n});\n\nconst initialState = null;\n\nexport const errorReducer = createReducer<ErrorState>(\n initialState,\n (builder) => {\n builder.addCase(saveError, (_state, action) => {\n return action.payload;\n });\n },\n);\n","import { createAction, createReducer } from \"@reduxjs/toolkit\";\n\nexport interface ModalState {\n key: string;\n visible: boolean;\n size?: string;\n}\n\nexport interface ModalsState {\n modals: ModalState[];\n}\n\nexport const showModal = createAction(\"SHOW_MODAL\", (key: string) => {\n return {\n payload: key,\n };\n});\n\nexport const closeModal = createAction(\"CLOSE_MODAL\", (key: string) => {\n return {\n payload: key,\n };\n});\n\nconst initialState: ModalsState = {\n modals: [],\n};\n\nexport const modalsReducer = createReducer(initialState, (builder) => {\n builder\n .addCase(showModal, (state, action) => {\n const key = action.payload;\n\n // Hide all modals\n state.modals.forEach((modal) => {\n modal.visible = false;\n });\n\n // Find existing modal\n const existing = state.modals.find((modal) => modal.key === key);\n\n if (existing) {\n existing.visible = true;\n } else {\n state.modals.push({ key, visible: true });\n }\n })\n .addCase(closeModal, (state, action) => {\n const key = action.payload;\n\n // Remove the modal\n state.modals = state.modals.filter((modal) => modal.key !== key);\n\n // Show the last modal (if any)\n const last = state.modals[state.modals.length - 1];\n if (last) {\n last.visible = true;\n }\n });\n});\n","export enum MODULARUI_STATUS {\n IDLE = \"IDLE\",\n LOADING = \"LOADING\",\n FINISHED = \"FINISHED\",\n ERROR = \"ERROR\",\n}\n","import { createAction } from \"@reduxjs/toolkit\";\n\nimport type { ErrorResponse, ModularUIModel } from \"@beinformed/ui/models\";\n\nexport const updateErrorStatus = createAction(\n \"MODULARUI/ERROR_STATUS\",\n (key: string, error: ErrorResponse) => {\n return {\n payload: {\n key,\n error,\n },\n };\n },\n);\n\nexport const setModel = createAction(\n \"MODULARUI/SET\",\n (key: string, model: ModularUIModel) => {\n model.connectKey = key;\n return {\n payload: {\n key,\n model,\n },\n };\n },\n);\n\nexport const initModels = createAction(\n \"MODULARUI/INIT\",\n (models: { key: string; model: ModularUIModel }[]) => {\n return {\n payload: models,\n };\n },\n);\n\nexport const updateModel = createAction(\n \"MODULARUI/UPDATE\",\n (model: ModularUIModel) => {\n return {\n payload: model,\n };\n },\n);\n\nexport const updateForm = createAction(\n \"MODULARUI/UPDATE_FORM\",\n (model: ModularUIModel) => {\n return {\n payload: model,\n };\n },\n);\n\nexport const removeModelByKey = createAction(\n \"MODULARUI/REMOVE_KEY\",\n (key: string) => {\n return {\n payload: key,\n };\n },\n);\n\n/**\n * Removes all models except the application model from the modular ui reducer\n */\nexport const resetModularUI = createAction(\"MODULARUI/RESET\");\n","import { createSelector } from \"reselect\";\n\nimport { ContentModel, ContentTOCModel, Href } from \"@beinformed/ui/models\";\n\nimport { MODULARUI_STATUS } from \"../modularui/constants\";\n\nimport type {\n ContentLinkModel,\n ModularUIModel,\n ResourceModel,\n} from \"@beinformed/ui/models\";\nimport type { RootState } from \"../store\";\n\n/**\n * Helper to get the current pathname from the router state.\n * @private\n */\nconst getLocation = (state: RootState) => state?.router?.location?.pathname;\n\n/**\n * Retrieves all models from the state that are instances of the specified class\n * and match the current application locale.\n * @template T - A class constructor extending ResourceModel.\n * @param {RootState} state - The Redux root state.\n * @param {T} instance - The model class to filter by (e.g., TaskModel).\n * @returns {InstanceType<T>[]} An array of model instances.\n */\nexport const getAllModelsByInstance = <\n T extends new (...args: never[]) => ResourceModel,\n>(\n state: RootState,\n instance: T,\n): InstanceType<T>[] => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n const modelEntry = modularui[key];\n if (!modelEntry?.model) {\n return false;\n }\n return (\n modelEntry.model instanceof instance &&\n modelEntry.model.locale === locale\n );\n })\n .map((key) => modularui[key].model as InstanceType<T>);\n }\n\n return [];\n};\n\n/**\n * Finds the first occurrence of a model in the state that is an instance of the\n * provided class and matches the current locale.\n * @template T - A class constructor extending ResourceModel.\n * @param {RootState} state - The Redux root state.\n * @param {T} instance - The model class to look for.\n * @returns {InstanceType<T> | undefined} The first matching model instance or undefined.\n */\nexport const getFirstModelByInstance = <\n T extends new (...args: never[]) => ResourceModel,\n>(\n state: RootState,\n instance: T,\n): InstanceType<T> | undefined => {\n const modularui = state?.modularui;\n if (modularui) {\n const locale = state.i18n.locale || \"en\";\n\n const key = Object.keys(modularui).find((key) => {\n const modelEntry = modularui[key];\n if (!modelEntry?.model) {\n return false;\n }\n return (\n modelEntry.model instanceof instance &&\n modelEntry.model.locale === locale\n );\n });\n\n if (key) {\n const modelEntry = modularui[key];\n if (modelEntry?.model instanceof instance) {\n return modelEntry.model as InstanceType<T>;\n }\n }\n }\n\n return undefined;\n};\n\n/**\n * Finds the model that is currently \"active\" based on the current URL path.\n * Matches by instance type, locale, and verifies if the current location starts\n * with the model's selfhref path.\n * @template T - A class constructor extending ResourceModel.\n * @param {RootState} state - The Redux root state.\n * @param {T} instance - The model class to filter by.\n * @returns {InstanceType<T> | undefined} The active model instance or undefined.\n */\nexport const getActiveModelByInstance = <\n T extends new (...args: never[]) => ResourceModel,\n>(\n state: RootState,\n instance: T,\n) => {\n const location = getLocation(state);\n\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const modelEntry = modularui[key];\n if (!modelEntry?.model) {\n return false;\n }\n return (\n modelEntry.model instanceof instance &&\n modelEntry.model.locale === locale &&\n location?.startsWith(modelEntry.model.selfhref?.path || \"\")\n );\n });\n\n if (key) {\n const modelEntry = modularui[key];\n if (modelEntry?.model instanceof instance) {\n return modelEntry.model as InstanceType<T>;\n }\n }\n }\n\n return undefined;\n};\n\n/**\n * Retrieves a specific model from the store by comparing its selfhref.\n * @param {RootState} state - The Redux root state.\n * @param {Href | string} href - The href to search for.\n * @returns {ModularUIModel | undefined} The matching model or undefined.\n */\nexport const modelByHref = (state: RootState, href: Href | string) => {\n if (state?.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n const modelConfigKey = Object.keys(state.modularui).find((key) => {\n const model = state.modularui[key];\n\n return model.model?.selfhref?.equals(findHref);\n });\n\n if (modelConfigKey) {\n return state.modularui[modelConfigKey].model;\n }\n }\n\n return undefined;\n};\n\n/**\n * Return the unique state key of a model found by its selfhref.\n * @param {RootState} state - The Redux root state.\n * @param {Href | string} href - The href to search for.\n * @returns {string | undefined} The internal state key or undefined.\n */\nexport const keyByHref = (state: RootState, href: Href | string) => {\n if (state?.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).find((key) => {\n const { model } = state.modularui[key];\n return model?.selfhref?.equals(findHref);\n });\n }\n\n return undefined;\n};\n\n/**\n * Returns all keys for models that match a specific href.\n * @param {RootState} state - The Redux root state.\n * @param {Href | string} href - The href to filter keys by.\n * @returns {string[]} An array of state keys.\n */\nexport const allKeysByHref = (state: RootState, href: Href | string) => {\n if (state?.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).filter((key) => {\n const modelEntry = state.modularui[key];\n if (modelEntry) {\n return modelEntry.model?.selfhref?.equals(findHref);\n }\n });\n }\n\n return [];\n};\n\n/**\n * Memoized selector that maps the flat modularui state into a simplified array of\n * model metadata, including content links for specific content models.\n * @returns {Array<Object>} List of model metadata objects.\n */\nconst getModels = createSelector(\n [(state: RootState) => state.modularui],\n (modularui) => {\n const models: {\n selfContentLink: ContentLinkModel | null;\n key: string;\n selfhref: Href | undefined;\n label: string;\n type: string;\n }[] = [];\n\n if (!modularui) return models;\n\n Object.keys(modularui).forEach((modelKey: string) => {\n const modelEntry = modularui[modelKey];\n\n if (modelEntry && \"model\" in modelEntry) {\n const { key, selfhref, label, type } =\n modelEntry.model as ModularUIModel;\n\n const modelInfo = {\n key,\n selfhref,\n label,\n type,\n selfContentLink: null,\n };\n\n if (\n modelEntry.model instanceof ContentModel ||\n modelEntry.model instanceof ContentTOCModel\n ) {\n models.push({\n ...modelInfo,\n selfContentLink: modelEntry.model.selfContentLink,\n });\n } else {\n models.push(modelInfo);\n }\n }\n });\n\n return models;\n },\n);\n\n/**\n * Memoized selector that returns a \"context\" of active models based on the current path segments.\n * Useful for breadcrumbs or determining nested model hierarchy.\n * @returns {Array<Object>} Array of active models found in the current URL path.\n */\nexport const getActiveModels = createSelector(\n [getLocation, getModels],\n (location, models) => {\n if (!location || !models.length) return [];\n\n const modelMap = new Map(\n models.filter((m) => m.selfhref).map((m) => [m.selfhref?.toString(), m]),\n );\n\n const contextModels: {\n key: string;\n href: Href | undefined;\n label: string;\n type: string;\n }[] = [];\n const locationParts = location.split(\"/\");\n let currentPath = \"\";\n\n locationParts.forEach((part) => {\n currentPath = currentPath === \"/\" ? `/${part}` : `${currentPath}/${part}`;\n\n const comparePath = decodeURIComponent(currentPath).replace(\n \"/modelcatalog/\",\n \"/\",\n );\n\n const foundEntry = modelMap.get(comparePath);\n\n if (foundEntry) {\n const { key, label, type, selfhref, selfContentLink } = foundEntry;\n\n const href =\n currentPath.startsWith(\"/modelcatalog/\") && selfContentLink\n ? new Href(`/modelcatalog${selfContentLink.encodedHref.toString()}`)\n : selfhref;\n\n contextModels.push({ key, href, label, type });\n }\n });\n\n return contextModels;\n },\n);\n\n/**\n * Retrieves all models from the state that have a status of 'FINISHED'.\n * @returns {ModularUIModel[]} Array of finished model instances.\n */\nexport const getAllFinishedModels = createSelector(\n [\n (state: RootState) => state.modularui,\n (state: RootState) => state.i18n.locale,\n ],\n (modularui, locale) => {\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n if (modularui[key]) {\n const item = modularui[key];\n return (\n item.status === MODULARUI_STATUS.FINISHED &&\n item.model?.locale === locale\n );\n }\n return false;\n })\n .map((key) => modularui[key].model);\n }\n return [];\n },\n);\n","import { ApplicationModel } from \"@beinformed/ui/models\";\n\nimport type { RootState } from \"../store\";\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: RootState) => {\n const locale = state.i18n.locale || \"en\";\n const modularui = state.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const modelEntry = modularui[key];\n if (!modelEntry?.model) {\n return false;\n }\n return (\n modelEntry.model instanceof ApplicationModel &&\n modelEntry.model.locale === locale\n );\n });\n\n if (key) {\n return modularui[key] as unknown as ApplicationModel;\n }\n }\n\n return undefined;\n};\n","import { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport { ApplicationModel, Href } from \"@beinformed/ui/models\";\n\nimport { getLocale } from \"../i18n/i18nSelectors\";\nimport { fetchModel } from \"../modularui/fetchModel\";\nimport { removeModelByKey } from \"../modularui/modelActions\";\nimport { allKeysByHref } from \"../shared/selectors\";\n\nimport { getApplication } from \"./applicationSelectors\";\n\nimport type { BEIDispatch, RootState } from \"../store\";\n\nexport const reloadApplication = createAsyncThunk<\n void,\n void,\n { dispatch: BEIDispatch; state: RootState; extra: unknown }\n>(\"application/reload\", async (_, { dispatch, getState }) => {\n const state = getState();\n\n const applicationHref = new Href(\"/\", \"Application\");\n\n const application = getApplication(state);\n if (application) {\n if (application.contextPath) {\n applicationHref.contextPath = application.contextPath;\n }\n if (application.origin) {\n applicationHref.origin = application.origin;\n }\n }\n\n const allKeys = allKeysByHref(state, applicationHref);\n for (const key of allKeys) {\n dispatch(removeModelByKey(key));\n }\n\n const locale = getLocale(state);\n const modelKey = `application(/)(${locale}`;\n\n await dispatch(\n fetchModel({\n key: modelKey,\n href: applicationHref,\n options: {\n targetModel: ApplicationModel,\n },\n }),\n );\n});\n","import { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { ErrorResponse, Href } from \"@beinformed/ui/models\";\nimport { ModularUIRequest } from \"@beinformed/ui/modularui\";\n\nimport { handleError } from \"../error/errorActions\";\n\nimport { MODULARUI_STATUS } from \"./constants\";\nimport { removeModelByKey, updateErrorStatus } from \"./modelActions\";\nimport { getRequestLocale } from \"./utils\";\n\nimport type { BEIDispatch, RootState } from \"../store\";\nimport type { FetchModelPayload, FetchModelResult } from \"./types\";\n\nconst executeRequest = async (\n { key, href, options }: FetchModelPayload,\n {\n dispatch,\n getState,\n rejectWithValue,\n }: {\n dispatch: BEIDispatch;\n getState: () => RootState;\n rejectWithValue: (value: ErrorResponse) => unknown;\n },\n): Promise<FetchModelResult> => {\n try {\n const locale = getRequestLocale(options?.locale, getState().i18n.locale);\n\n const requestHref =\n href instanceof Href\n ? href\n : new Href(href, \"\", {\n origin: options?.origin,\n contextPath: options?.contextPath,\n });\n\n const modularuiRequest = new ModularUIRequest(requestHref, {\n method: options?.method || HTTP_METHODS.GET,\n params: options?.params || \"\",\n data: options?.data || null,\n locale: locale,\n childmodels: options?.childmodels ?? true,\n isReload: options?.isReload,\n cache: options?.cache,\n headers: options?.headers,\n events: options?.events,\n onProgress: options?.onProgress,\n origin: options?.origin,\n contextPath: options?.contextPath,\n targetModel: options?.targetModel,\n forceTargetModel: options?.forceTargetModel ?? false,\n timeout: options?.timeout,\n });\n\n const model = await modularuiRequest.fetch();\n\n if (model) {\n model.connectKey = key;\n }\n\n // Return data for the fulfilled action\n return {\n key,\n model,\n updateHandler: options?.updateHandler,\n };\n } catch (error: unknown) {\n const errorResponse = new ErrorResponse(error as Error, key, {\n origin: options?.origin,\n contextPath: options?.contextPath,\n });\n\n // Specific error handling for removing model on certain errors\n if (\n errorResponse.isChangePassword ||\n errorResponse.isResourceNotFoundAfterReload\n ) {\n dispatch(removeModelByKey(key));\n } else {\n dispatch(updateErrorStatus(key, errorResponse));\n }\n\n // Dispatch the global error handler\n dispatch(handleError(error));\n\n throw rejectWithValue(errorResponse);\n }\n};\n\nexport const fetchModel = createAsyncThunk<\n FetchModelResult, // Return type of the fulfilled action payload\n FetchModelPayload, // First argument to the thunk\n {\n dispatch: BEIDispatch;\n state: RootState;\n rejectValue: ErrorResponse; // Type of the error payload in case of rejection\n }\n>(\"modularui/fetchModel\", executeRequest, {\n condition: ({ key }, { getState }) => {\n if (getState().modularui[key]?.status === MODULARUI_STATUS.LOADING) {\n return false;\n }\n },\n});\n","import { IS_SERVER } from \"@beinformed/ui/constants\";\nimport { ErrorResponse } from \"@beinformed/ui/models\";\nimport { logoutPath } from \"@beinformed/ui/settings\";\n\nimport { saveChangePassword } from \"../auth/authReducer\";\nimport { handleUnauthorized } from \"../auth/unauthorizedActions\";\nimport { showXHRErrorNotification } from \"../notifications/notificationActions\";\nimport { push } from \"../router/routerActions\";\nimport { noAction } from \"../shared/actions\";\n\nimport { saveError } from \"./errorReducer\";\n\nimport type { BEIDispatch } from \"../store\";\n\ntype DefaultHandler = typeof defaultErrorResponseHandler;\n\n// Default handler\nconst defaultErrorResponseHandler =\n (error: ErrorResponse) => (dispatch: BEIDispatch) => {\n if (error.isResourceNotFoundAfterReload || error.isRemoteServiceException) {\n return dispatch(noAction());\n }\n\n if (error.isUnauthorized) {\n return dispatch(handleUnauthorized(error));\n }\n\n if (error.isBlocked || error.isConcurrentUser || error.isInvalidUsername) {\n dispatch(push(logoutPath()));\n return;\n }\n\n if (error.isChangePassword) {\n return dispatch(saveChangePassword());\n }\n\n if (IS_SERVER) {\n return dispatch(saveError(error));\n }\n\n // This setTimeout might hide errors from Sentry/monitoring tools\n setTimeout(() => {\n throw error.error || error;\n });\n\n return dispatch(showXHRErrorNotification(error));\n };\n\ntype CustomErrorResponseHandler = (\n error: ErrorResponse,\n defaultHandler: DefaultHandler,\n) => (dispatch: BEIDispatch) => void;\n\nlet customErrorResponseHandler: CustomErrorResponseHandler =\n (error, defaultHandler) => (dispatch) =>\n dispatch(defaultHandler(error));\n\nexport const setCustomErrorResponseHandler = (\n handler: CustomErrorResponseHandler,\n) => {\n customErrorResponseHandler = handler;\n};\n\nexport const handleError = (error: unknown) => {\n // Ensure the error is an ErrorResponse if possible, otherwise create one.\n const errorResponse =\n error instanceof ErrorResponse ? error : new ErrorResponse(error as Error);\n\n // Dispatch the default handler or custom handler\n return customErrorResponseHandler(errorResponse, defaultErrorResponseHandler);\n};\n","import { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport { getBooleanSetting, getStringSetting } from \"@beinformed/ui/settings\";\nimport { Cache } from \"@beinformed/ui/utils\";\n\nimport { reloadApplication } from \"../application/applicationActions\";\nimport { getApplication } from \"../application/applicationSelectors\";\nimport { removeModelByKey } from \"../modularui/modelActions\";\nimport { replace } from \"../router/routerActions\";\n\nimport { logoutSuccess, sendAuthenticationError } from \"./authReducer\";\n\nimport type { ErrorResponse } from \"@beinformed/ui/models\";\nimport type { BEIDispatch, RootState } from \"../store\";\n\nexport const handleUnauthorized = createAsyncThunk<\n void,\n ErrorResponse,\n { state: RootState; dispatch: BEIDispatch }\n>(\"auth/unauthorized\", (errorResponse, { dispatch, getState }) => {\n if (errorResponse.connectKey) {\n dispatch(removeModelByKey(errorResponse.connectKey));\n }\n\n if (\n getBooleanSetting(\"PAGE_RELOAD_ON_UNAUTHORIZED_ERROR\", false) &&\n errorResponse.response\n ) {\n window.location.reload();\n return;\n }\n\n // reload application when flag auth is set or isLogged\n const application = getApplication(getState());\n if (Cache.getItem(\"auth\") || application?.isLoggedIn) {\n dispatch(reloadApplication());\n }\n\n // set logged out\n dispatch(logoutSuccess());\n\n Cache.removeItem(\"auth\");\n\n if (errorResponse.isInvalidUsername) {\n dispatch(sendAuthenticationError(errorResponse.message || \"\"));\n }\n\n // add current location as from location before redirect\n const location = getState().router.location;\n const LOGIN_PATH = getStringSetting(\"LOGIN_PATH\", \"/signin\");\n if (location?.pathname !== LOGIN_PATH) {\n const locationFrom = location?.state?.from;\n dispatch(\n replace(LOGIN_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n // cannot open login in a modal, because of previous locations that might be secure\n modal: false,\n }),\n );\n }\n});\n","import { createAction } from \"@reduxjs/toolkit\";\n\nexport const noAction = createAction(\"NO_ACTION\");\n","/**\n * Retrieve the preferred language for this request, falls back to the browser language or english\n */\nexport const getRequestLocale = (\n optionLocale: string | undefined,\n currentStateLocale: string,\n) => {\n if (optionLocale) {\n return optionLocale;\n }\n\n if (typeof navigator !== \"undefined\" && navigator?.language) {\n return navigator.language.split(\"-\")[0] || currentStateLocale;\n }\n\n return currentStateLocale;\n};\n"],"mappings":"iJAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cACA,IAAIC,GAAmB,iBAGnBC,GAAW,mBAUf,SAASC,GAAQC,EAAOC,EAAQ,CAC9B,IAAIC,EAAO,OAAOF,EAClB,OAAAC,EAASA,GAAiBJ,GAEnB,CAAC,CAACI,IACNC,GAAQ,UACNA,GAAQ,UAAYJ,GAAS,KAAKE,CAAK,IACrCA,EAAQ,IAAMA,EAAQ,GAAK,GAAKA,EAAQC,CACjD,CAEAL,EAAO,QAAUG,KCxBjB,IAAAI,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cACA,IAAIC,GAAmB,iBA4BvB,SAASC,GAASC,EAAO,CACvB,OAAO,OAAOA,GAAS,UACrBA,EAAQ,IAAMA,EAAQ,GAAK,GAAKA,GAASF,EAC7C,CAEAD,EAAO,QAAUE,KClCjB,IAAAE,GAAAC,EAAA,CAAAC,GAAAC,KAAA,kBAAIC,GAAW,KACXC,GAAc,KACdC,GAAU,KACVC,GAAU,IACVC,GAAW,IACXC,GAAQ,KAWZ,SAASC,GAAQC,EAAQC,EAAMC,EAAS,CACtCD,EAAOR,GAASQ,EAAMD,CAAM,EAM5B,QAJIG,EAAQ,GACRC,EAASH,EAAK,OACdI,EAAS,GAEN,EAAEF,EAAQC,GAAQ,CACvB,IAAIE,EAAMR,GAAMG,EAAKE,CAAK,CAAC,EAC3B,GAAI,EAAEE,EAASL,GAAU,MAAQE,EAAQF,EAAQM,CAAG,GAClD,MAEFN,EAASA,EAAOM,CAAG,CACrB,CACA,OAAID,GAAU,EAAEF,GAASC,EAChBC,GAETD,EAASJ,GAAU,KAAO,EAAIA,EAAO,OAC9B,CAAC,CAACI,GAAUP,GAASO,CAAM,GAAKR,GAAQU,EAAKF,CAAM,IACvDT,GAAQK,CAAM,GAAKN,GAAYM,CAAM,GAC1C,CAEAR,GAAO,QAAUO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S,WACxB,CAAC,EAGD,MACEY,EAAc,kBACdA,EAAc,8BAEdX,EAASa,EAAiBhB,CAAG,CAAC,EAE9BG,EAASc,EAAkBjB,EAAKc,CAAa,CAAC,EAIhDX,EAASe,EAAYL,CAAK,CAAC,EAErBR,EAAgBS,CAAa,CACrC,CACF,EAEaK,EAAaC,GAQxB,uBAAwBrB,GAAgB,CACxC,UAAW,CAAC,CAAE,IAAAC,CAAI,EAAG,CAAE,SAAAI,CAAS,IAAM,CACpC,GAAIA,EAAS,EAAE,UAAUJ,CAAG,GAAG,SAAW,UACxC,MAAO,EAEX,CACF,CAAC,ED5FM,IAAMqB,EAAoBC,GAI/B,qBAAsB,MAAOC,EAAG,CAAE,SAAAC,EAAU,SAAAC,CAAS,IAAM,CAC3D,IAAMC,EAAQD,EAAS,EAEjBE,EAAkB,IAAIC,GAAK,IAAK,aAAa,EAE7CC,EAAcC,EAAeJ,CAAK,EACpCG,IACEA,EAAY,cACdF,EAAgB,YAAcE,EAAY,aAExCA,EAAY,SACdF,EAAgB,OAASE,EAAY,SAIzC,IAAME,EAAUC,EAAcN,EAAOC,CAAe,EACpD,QAAWM,KAAOF,EAChBP,EAASU,EAAiBD,CAAG,CAAC,EAIhC,IAAME,EAAW,kBADFC,EAAUV,CAAK,CACW,GAEzC,MAAMF,EACJa,EAAW,CACT,IAAKF,EACL,KAAMR,EACN,QAAS,CACP,YAAaW,EACf,CACF,CAAC,CACH,CACF,CAAC","names":["require_isIndex","__commonJSMin","exports","module","MAX_SAFE_INTEGER","reIsUint","isIndex","value","length","type","require_isLength","__commonJSMin","exports","module","MAX_SAFE_INTEGER","isLength","value","require_hasPath","__commonJSMin","exports","module","castPath","isArguments","isArray","isIndex","isLength","toKey","hasPath","object","path","hasFunc","index","length","result","key","createAction","createReducer","initalState","loginSuccess","logoutSuccess","sendAuthenticationError","errorMessage","resetAuthErrors","saveChangePassword","authReducer","builder","state","action","createAction","createReducer","Cache","updateEntryDate","entryDate","initialState","modelCatalogReducer","builder","state","action","createAction","createAsyncThunk","createReducer","NOTIFICATION_TYPES","saveNotification","type","message","error","showNotification","timeout","dispatch","dismissNotification","initialState","notificationReducer","builder","state","action","createAsyncThunk","getNumberSetting","createAction","startProgress","finishProgress","resetProgress","updateProgress","percentComplete","getNotificationMessageId","form","showFormNotification","createAsyncThunk","dispatch","startProgress","showNotification","dismissNotification","getNumberSetting","finishProgress","showXHRErrorNotification","error","createAction","push","location","state","replace","go","delta","goBack","goForward","createAction","createReducer","saveError","error","initialState","errorReducer","builder","_state","action","createAction","createReducer","showModal","key","closeModal","initialState","modalsReducer","builder","state","action","modal","existing","last","MODULARUI_STATUS","createAction","updateErrorStatus","key","error","setModel","model","initModels","models","updateModel","updateForm","removeModelByKey","resetModularUI","createSelector","ContentModel","ContentTOCModel","Href","getLocation","state","getAllModelsByInstance","instance","locale","modularui","key","modelEntry","getFirstModelByInstance","getActiveModelByInstance","location","modelByHref","href","findHref","Href","modelConfigKey","keyByHref","model","allKeysByHref","getModels","createSelector","models","modelKey","selfhref","label","type","modelInfo","ContentModel","ContentTOCModel","getActiveModels","modelMap","m","contextModels","locationParts","currentPath","part","comparePath","foundEntry","selfContentLink","getAllFinishedModels","item","ApplicationModel","getApplication","state","locale","modularui","key","modelEntry","createAsyncThunk","ApplicationModel","Href","createAsyncThunk","HTTP_METHODS","ErrorResponse","Href","ModularUIRequest","IS_SERVER","ErrorResponse","logoutPath","createAsyncThunk","getBooleanSetting","getStringSetting","Cache","handleUnauthorized","createAsyncThunk","errorResponse","dispatch","getState","removeModelByKey","getBooleanSetting","application","getApplication","Cache","reloadApplication","logoutSuccess","sendAuthenticationError","location","LOGIN_PATH","getStringSetting","locationFrom","replace","createAction","noAction","defaultErrorResponseHandler","error","dispatch","noAction","handleUnauthorized","push","logoutPath","saveChangePassword","IS_SERVER","saveError","showXHRErrorNotification","customErrorResponseHandler","defaultHandler","setCustomErrorResponseHandler","handler","handleError","errorResponse","ErrorResponse","getRequestLocale","optionLocale","currentStateLocale","executeRequest","key","href","options","dispatch","getState","rejectWithValue","locale","getRequestLocale","requestHref","Href","model","ModularUIRequest","HTTP_METHODS","error","errorResponse","ErrorResponse","removeModelByKey","updateErrorStatus","handleError","fetchModel","createAsyncThunk","reloadApplication","createAsyncThunk","_","dispatch","getState","state","applicationHref","Href","application","getApplication","allKeys","allKeysByHref","key","removeModelByKey","modelKey","getLocale","fetchModel","ApplicationModel"]}
@@ -0,0 +1,2 @@
1
+ import{g as c,j as r,k as a}from"./chunk-KZB56W7Q.js";import{g as d,h as i,i as o}from"./chunk-HTR32BUX.js";import{b as u}from"./chunk-FW4363Y4.js";var n=u(d(),1);import{useCallback as f}from"react";import{createSelector as m}from"reselect";var p=m([a,r],(e,t)=>(0,n.default)((s,g,l)=>e.getLocale(t).getMessage(s,g,l),(...s)=>JSON.stringify(s))),P=(e,t,s)=>o(p)(e,t,s),b=()=>o(p),h=()=>o(r),B=()=>o(a),L=m(e=>e.i18n.locales,e=>e.map(t=>t.code)),E=()=>o(L),I=()=>{let e=i();return f(t=>{e(c(t))},[e])};export{P as a,b,h as c,B as d,E as e,I as f};
2
+ //# sourceMappingURL=chunk-JWOBKHOJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useI18n.ts"],"sourcesContent":["import { useCallback } from \"react\";\n\nimport memoize from \"lodash/memoize\";\nimport { createSelector } from \"reselect\";\n\nimport { useBEIDispatch, useBEISelector } from \"../redux/hooks\";\nimport { updateLocale } from \"../redux/i18n/i18nReducer\";\nimport { getLocale, getLocales } from \"../redux/i18n/i18nSelectors\";\n\nimport type { MessageParameters } from \"@beinformed/ui/types\";\nimport type { RootState } from \"../redux/store\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (\n id: string,\n defaultMessage?: string,\n placeholders?: MessageParameters | undefined,\n ) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\nexport const useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: MessageParameters | undefined,\n) => useBEISelector(getMessage)(id, defaultMessage, placeholders);\n\nexport const useTranslate = () => useBEISelector(getMessage);\n\nexport const useLocale = (): string => useBEISelector(getLocale);\n\nexport const useLocales = () => useBEISelector(getLocales);\n\nconst getLocaleCodes = createSelector(\n (state: RootState) => state.i18n.locales,\n (locales) => locales.map((locale: { code: string }) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nexport const useLocaleCodes = (): string[] => useBEISelector(getLocaleCodes);\n\n/**\n * A hook that returns a memoized function to update the application locale.\n *\n * @returns {(locale: string) => void} A memoized function to update the locale.\n */\nexport const useUpdateLocale = () => {\n const dispatch = useBEIDispatch();\n\n return useCallback(\n (locale: string) => {\n dispatch(updateLocale(locale));\n },\n [dispatch],\n );\n};\n"],"mappings":"oJAEA,IAAAA,EAAoB,SAFpB,OAAS,eAAAC,MAAmB,QAG5B,OAAS,kBAAAC,MAAsB,WAS/B,IAAMC,EAAaC,EACjB,CAACC,EAAYC,CAAS,EACtB,CAACC,EAASC,OACR,EAAAC,SACE,CACEC,EACAC,EACAC,IAEAL,EACG,UAAUC,CAAU,EACpB,WAAWE,EAAIC,EAAgBC,CAAY,EAChD,IAAIC,IAAS,KAAK,UAAUA,CAAI,CAClC,CACJ,EAEaC,EAAa,CACxBJ,EACAC,EACAC,IACGG,EAAeZ,CAAU,EAAEO,EAAIC,EAAgBC,CAAY,EAEnDI,EAAe,IAAMD,EAAeZ,CAAU,EAE9Cc,EAAY,IAAcF,EAAeT,CAAS,EAElDY,EAAa,IAAMH,EAAeV,CAAU,EAEnDc,EAAiBf,EACpBgB,GAAqBA,EAAM,KAAK,QAChCb,GAAYA,EAAQ,IAAKc,GAA6BA,EAAO,IAAI,CACpE,EAKaC,EAAiB,IAAgBP,EAAeI,CAAc,EAO9DI,EAAkB,IAAM,CACnC,IAAMC,EAAWC,EAAe,EAEhC,OAAOC,EACJL,GAAmB,CAClBG,EAASG,EAAaN,CAAM,CAAC,CAC/B,EACA,CAACG,CAAQ,CACX,CACF","names":["import_memoize","useCallback","createSelector","getMessage","createSelector","getLocales","getLocale","locales","localeCode","memoize","id","defaultMessage","placeholders","args","useMessage","useBEISelector","useTranslate","useLocale","useLocales","getLocaleCodes","state","locale","useLocaleCodes","useUpdateLocale","dispatch","useBEIDispatch","useCallback","updateLocale"]}
@@ -1,2 +1,2 @@
1
- var d={attribute:{name:0,nativeName:1},rtl:{ar:1,dv:1,fa:1,ha:1,he:1,ks:1,ku:1,ps:1,ur:1,yi:1},lang:{aa:["Afar","Afar"],ab:["Abkhazian","\u0410\u04A7\u0441\u0443\u0430"],af:["Afrikaans","Afrikaans"],ak:["Akan","Akana"],am:["Amharic","\u12A0\u121B\u122D\u129B"],an:["Aragonese","Aragon\xE9s"],ar:["Arabic","\u0627\u0644\u0639\u0631\u0628\u064A\u0629"],as:["Assamese","\u0985\u09B8\u09AE\u09C0\u09AF\u09BC\u09BE"],av:["Avar","\u0410\u0432\u0430\u0440"],ay:["Aymara","Aymar"],az:["Azerbaijani","Az\u0259rbaycanca / \u0622\u0630\u0631\u0628\u0627\u064A\u062C\u0627\u0646"],ba:["Bashkir","\u0411\u0430\u0448\u04A1\u043E\u0440\u0442"],be:["Belarusian","\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F"],bg:["Bulgarian","\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438"],bh:["Bihari","\u092D\u094B\u091C\u092A\u0941\u0930\u0940"],bi:["Bislama","Bislama"],bm:["Bambara","Bamanankan"],bn:["Bengali","\u09AC\u09BE\u0982\u09B2\u09BE"],bo:["Tibetan","\u0F56\u0F7C\u0F51\u0F0B\u0F61\u0F72\u0F42 / Bod skad"],br:["Breton","Brezhoneg"],bs:["Bosnian","Bosanski"],ca:["Catalan","Catal\xE0"],ce:["Chechen","\u041D\u043E\u0445\u0447\u0438\u0439\u043D"],ch:["Chamorro","Chamoru"],co:["Corsican","Corsu"],cr:["Cree","Nehiyaw"],cs:["Czech","\u010Cesky"],cu:["Old Church Slavonic / Old Bulgarian","\u0441\u043B\u043E\u0432\u0463\u043D\u044C\u0441\u043A\u044A / slov\u011Bn\u012Dsk\u016D"],cv:["Chuvash","\u0427\u0103\u0432\u0430\u0448"],cy:["Welsh","Cymraeg"],da:["Danish","Dansk"],de:["German","Deutsch"],dv:["Divehi","\u078B\u07A8\u0788\u07AC\u0780\u07A8\u0784\u07A6\u0790\u07B0"],dz:["Dzongkha","\u0F47\u0F7C\u0F44\u0F0B\u0F41"],ee:["Ewe","\u0190\u028B\u025B"],el:["Greek","\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"],en:["English","English"],eo:["Esperanto","Esperanto"],es:["Spanish","Espa\xF1ol"],et:["Estonian","Eesti"],eu:["Basque","Euskara"],fa:["Persian","\u0641\u0627\u0631\u0633\u06CC"],ff:["Peul","Fulfulde"],fi:["Finnish","Suomi"],fj:["Fijian","Na Vosa Vakaviti"],fo:["Faroese","F\xF8royskt"],fr:["French","Fran\xE7ais"],fy:["West Frisian","Frysk"],ga:["Irish","Gaeilge"],gd:["Scottish Gaelic","G\xE0idhlig"],gl:["Galician","Galego"],gn:["Guarani","Ava\xF1e'\u1EBD"],gu:["Gujarati","\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0"],gv:["Manx","Gaelg"],ha:["Hausa","\u0647\u064E\u0648\u064F\u0633\u064E"],he:["Hebrew","\u05E2\u05D1\u05E8\u05D9\u05EA"],hi:["Hindi","\u0939\u093F\u0928\u094D\u0926\u0940"],ho:["Hiri Motu","Hiri Motu"],hr:["Croatian","Hrvatski"],ht:["Haitian","Kr\xE8yol ayisyen"],hu:["Hungarian","Magyar"],hy:["Armenian","\u0540\u0561\u0575\u0565\u0580\u0565\u0576"],hz:["Herero","Otsiherero"],ia:["Interlingua","Interlingua"],id:["Indonesian","Bahasa Indonesia"],ie:["Interlingue","Interlingue"],ig:["Igbo","Igbo"],ii:["Sichuan Yi","\uA187\uA259 / \u56DB\u5DDD\u5F5D\u8BED"],ik:["Inupiak","I\xF1upiak"],io:["Ido","Ido"],is:["Icelandic","\xCDslenska"],it:["Italian","Italiano"],iu:["Inuktitut","\u1403\u14C4\u1483\u144E\u1450\u1466"],ja:["Japanese","\u65E5\u672C\u8A9E"],jv:["Javanese","Basa Jawa"],ka:["Georgian","\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8"],kg:["Kongo","KiKongo"],ki:["Kikuyu","G\u0129k\u0169y\u0169"],kj:["Kuanyama","Kuanyama"],kk:["Kazakh","\u049A\u0430\u0437\u0430\u049B\u0448\u0430"],kl:["Greenlandic","Kalaallisut"],km:["Cambodian","\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A"],kn:["Kannada","\u0C95\u0CA8\u0CCD\u0CA8\u0CA1"],ko:["Korean","\uD55C\uAD6D\uC5B4"],kr:["Kanuri","Kanuri"],ks:["Kashmiri","\u0915\u0936\u094D\u092E\u0940\u0930\u0940 / \u0643\u0634\u0645\u064A\u0631\u064A"],ku:["Kurdish","Kurd\xEE / \u0643\u0648\u0631\u062F\u06CC"],kv:["Komi","\u041A\u043E\u043C\u0438"],kw:["Cornish","Kernewek"],ky:["Kirghiz","K\u0131rg\u0131zca / \u041A\u044B\u0440\u0433\u044B\u0437\u0447\u0430"],la:["Latin","Latina"],lb:["Luxembourgish","L\xEBtzebuergesch"],lg:["Ganda","Luganda"],li:["Limburgian","Limburgs"],ln:["Lingala","Ling\xE1la"],lo:["Laotian","\u0EA5\u0EB2\u0EA7 / Pha xa lao"],lt:["Lithuanian","Lietuvi\u0173"],lv:["Latvian","Latvie\u0161u"],mg:["Malagasy","Malagasy"],mh:["Marshallese","Kajin Majel / Ebon"],mi:["Maori","M\u0101ori"],mk:["Macedonian","\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438"],ml:["Malayalam","\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02"],mn:["Mongolian","\u041C\u043E\u043D\u0433\u043E\u043B"],mo:["Moldovan","Moldoveneasc\u0103"],mr:["Marathi","\u092E\u0930\u093E\u0920\u0940"],ms:["Malay","Bahasa Melayu"],mt:["Maltese","bil-Malti"],my:["Burmese","Myanmasa"],na:["Nauruan","Dorerin Naoero"],nd:["North Ndebele","Sindebele"],ne:["Nepali","\u0928\u0947\u092A\u093E\u0932\u0940"],ng:["Ndonga","Oshiwambo"],nl:["Dutch","Nederlands"],nn:["Norwegian Nynorsk","Norsk (nynorsk)"],no:["Norwegian","Norsk (bokm\xE5l / riksm\xE5l)"],nr:["South Ndebele","isiNdebele"],nv:["Navajo","Din\xE9 bizaad"],ny:["Chichewa","Chi-Chewa"],oc:["Occitan","Occitan"],oj:["Ojibwa","\u140A\u14C2\u1511\u14C8\u142F\u14A7\u140E\u14D0 / Anishinaabemowin"],om:["Oromo","Oromoo"],or:["Oriya","\u0B13\u0B21\u0B3C\u0B3F\u0B06"],os:["Ossetian / Ossetic","\u0418\u0440\u043E\u043D\u0430\u0443"],pa:["Panjabi / Punjabi","\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40 / \u092A\u0902\u091C\u093E\u092C\u0940 / \u067E\u0646\u062C\u0627\u0628\u064A"],pi:["Pali","P\u0101li / \u092A\u093E\u0934\u093F"],pl:["Polish","Polski"],ps:["Pashto","\u067E\u069A\u062A\u0648"],pt:["Portuguese","Portugu\xEAs"],qu:["Quechua","Runa Simi"],rm:["Raeto Romance","Rumantsch"],rn:["Kirundi","Kirundi"],ro:["Romanian","Rom\xE2n\u0103"],ru:["Russian","\u0420\u0443\u0441\u0441\u043A\u0438\u0439"],rw:["Rwandi","Kinyarwandi"],sa:["Sanskrit","\u0938\u0902\u0938\u094D\u0915\u0943\u0924\u092E\u094D"],sc:["Sardinian","Sardu"],sd:["Sindhi","\u0938\u093F\u0928\u0927\u093F"],se:["Northern Sami","S\xE1megiella"],sg:["Sango","S\xE4ng\xF6"],sh:["Serbo-Croatian","Srpskohrvatski / \u0421\u0440\u043F\u0441\u043A\u043E\u0445\u0440\u0432\u0430\u0442\u0441\u043A\u0438"],si:["Sinhalese","\u0DC3\u0DD2\u0D82\u0DC4\u0DBD"],sk:["Slovak","Sloven\u010Dina"],sl:["Slovenian","Sloven\u0161\u010Dina"],sm:["Samoan","Gagana Samoa"],sn:["Shona","chiShona"],so:["Somalia","Soomaaliga"],sq:["Albanian","Shqip"],sr:["Serbian","\u0421\u0440\u043F\u0441\u043A\u0438"],ss:["Swati","SiSwati"],st:["Southern Sotho","Sesotho"],su:["Sundanese","Basa Sunda"],sv:["Swedish","Svenska"],sw:["Swahili","Kiswahili"],ta:["Tamil","\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD"],te:["Telugu","\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41"],tg:["Tajik","\u0422\u043E\u04B7\u0438\u043A\u04E3"],th:["Thai","\u0E44\u0E17\u0E22 / Phasa Thai"],ti:["Tigrinya","\u1275\u130D\u122D\u129B"],tk:["Turkmen","\u0422\u0443\u0440\u043A\u043C\u0435\u043D / \u062A\u0631\u0643\u0645\u0646"],tl:["Tagalog / Filipino","Tagalog"],tn:["Tswana","Setswana"],to:["Tonga","Lea Faka-Tonga"],tr:["Turkish","T\xFCrk\xE7e"],ts:["Tsonga","Xitsonga"],tt:["Tatar","Tatar\xE7a"],tw:["Twi","Twi"],ty:["Tahitian","Reo M\u0101`ohi"],ug:["Uyghur","Uy\u01A3urq\u0259 / \u0626\u06C7\u064A\u063A\u06C7\u0631\u0686\u06D5"],uk:["Ukrainian","\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"],ur:["Urdu","\u0627\u0631\u062F\u0648"],uz:["Uzbek","\u040E\u0437\u0431\u0435\u043A"],ve:["Venda","Tshiven\u1E13a"],vi:["Vietnamese","Ti\u1EBFng Vi\u1EC7t"],vo:["Volap\xFCk","Volap\xFCk"],wa:["Walloon","Walon"],wo:["Wolof","Wollof"],xh:["Xhosa","isiXhosa"],yi:["Yiddish","\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9"],yo:["Yoruba","Yor\xF9b\xE1"],za:["Zhuang","Cuengh / T\xF4\xF4 / \u58EE\u8BED"],zh:["Chinese","\u4E2D\u6587"],zu:["Zulu","isiZulu"],pap:["Papiamento","Papiamento"]}};import l from"format-message";import{immerable as C}from"immer";import{IllegalStateException as v}from"@beinformed/ui/exceptions";import{getBooleanSetting as f}from"@beinformed/ui/settings";import{IS_DEV as w}from"@beinformed/ui/utils";var i=class{[C]=!0;#n;#e;#a;#t;constructor(e){this.#n=e.code,this.#e=this.fixPlaceHoldersInObject(e.messages),this.#a=this.fixPlaceHoldersInObject(e.errors),this.#t=e.nativeName,l.setup({missingTranslation:"ignore"})}get code(){return this.#n}get nativeName(){if(this.#t)return this.#t;let e=this.code.split("-");if(e.length>0){let a=e[0];if(a){let t=d.lang[a];if(t)return t[1]+(e[1]?` (${e[1].toUpperCase()})`:"")}}throw new v(`Can not find language name based on locale: ${this.code}`)}fixPlaceHolders(e){return typeof e=="string"?e.replace(/'\$\{(?<key>.*?)}'/g,"''{$<key>}''").replace(/\$\{(?<key>.*?)}/g,"{$<key>}"):null}fixPlaceHoldersInObject(e={}){return JSON.parse(JSON.stringify(e).replace(/'\$\{(?<key>.*?)}'/g,"''{$<key>}''").replace(/\$\{(?<key>.*?)}/g,"{$<key>}"))}getBaseMessage(e,a){if(!e&&!a)return"[message: id or defaultMessage missing]";let t=this.#e[e]||this.#a[e];return w&&!t&&e&&f("DEBUG_I18N_MESSAGE_NOT_FOUND")&&console.debug(`Message with id ${e} not found for locale ${this.code} in layout translations`),t||this.fixPlaceHolders(a)||e}formatMessage(e,a){return a?l(e,a):e}getMessage(e,a,t){let r=this.getBaseMessage(e,a);return this.formatMessage(r,t)}update(e={},a={}){this.#e={...this.#e,...this.fixPlaceHoldersInObject(e)},this.#a={...this.#a,...this.fixPlaceHoldersInObject(a)}}};import{IllegalArgumentException as y}from"@beinformed/ui/exceptions";import{BaseCollection as I}from"@beinformed/ui/models";var m={"Constraint.Attribute.IncorrectValue":"Incorrect value","Constraint.Boolean.InvalidValue":"Invalid boolean value, only values 'true' or 'false' are valid","Constraint.BSN.InvalidFormat":"Must be a valid BSN","Constraint.Captcha.InvalidToken":"The captcha is invalid","Constraint.Choice.ConflictingAnswer":"Cannot select '${answer-option-key}' because this is not a relevant option, given the other answers","Constraint.Choice.ConflictingOptions":"Cannot select '${answer-option-key1}' and '${answer-option-key2}' at the same time","Constraint.Choice.InvalidOption":"Allowed options are: ${options}","Constraint.Choice.InvalidOption.General":"Value '${value}' is not allowed","Constraint.Choice.MultipleNotAllowed":"Selecting multiple options is not allowed","Constraint.ConfirmCurrentPassword.Invalid":"Must match the current password","Constraint.Date.AboveMaximum":"Must be on or before ${max-date}","Constraint.Date.BelowMinimum":"Must be on or after ${min-date}","Constraint.Date.InvalidFormat":"Must be entered in the format ${format}","Constraint.Date.NotOnDate":"Must be on ${date}","Constraint.Date.OutOfRange":"Must be between ${min-date} and ${max-date}","Constraint.DateRange.InvalidRange":"Start date must be before end date","Constraint.DateRange.Mandatory":"Field is mandatory: must contain at least a start or end date","Constraint.DateTime.AboveMaximum":"Must be before ${max-date-time}","Constraint.DateTime.BelowMinimum":"Must be at ${min-date-time} or after","Constraint.DateTime.InvalidFormat":"Must be entered in the format ${format}","Constraint.DateTime.OutOfRange":"Must be between ${min-date-time} and ${max-date-time}","Constraint.DateTimeRange.InvalidRange":"Start date-time must be before end date-time","Constraint.DateTimeRange.Mandatory":"Field is mandatory: must contain at least a start or end date-time","Constraint.Document.MimeTypeNotAllowed":"The document mime type is not valid for the selected document type","Constraint.Email.InvalidFormat":"Must be a valid e-mail address","Constraint.File.DataEmpty":"File does not exist or has no content","Constraint.File.InvalidExtension":"Allowed extensions are: ${extensions}","Constraint.File.InvalidFormat":"Must meet the requirements of the file name","Constraint.File.InvalidMimeType":"Allowed mime types are: ${mime-types}","Constraint.File.MaxFileSizeExceeded":"Maximum file upload size is ${max-filesize}","Constraint.File.OnlyAllowsOneFile":"Only one file is allowed","Constraint.IBAN.InvalidFormat":"Must be a valid IBAN number","Constraint.InvalidLengthBetween":"Length must be between ${min-length} and ${max-length} characters","Constraint.InvalidLengthExact":"Length must be precisely ${length} characters","Constraint.InvalidLengthTooLong":"Length must not be larger than ${max-length} characters","Constraint.InvalidLengthTooShort":"Length must be at least ${min-length} characters","Constraint.InvalidRegularExpression":"The value is not according the given regular expression ${regexp}","Constraint.Mandatory":"Field is mandatory","Constraint.Missing":"Field is mandatory","Constraint.Number.AboveMaximum":"Must be at most ${max-number}","Constraint.Number.BelowMinimum":"Must be at least ${min-number}","Constraint.Number.InvalidDecimal":"Must be a number with up to ${max-digits} decimal places","Constraint.Number.InvalidInteger":"Must be a whole number","Constraint.Number.InvalidLong":"Must be a whole number","Constraint.Number.OutOfRange":"Must be between ${min-number} and ${max-number}","Constraint.NumberRange.BothFieldsMandatory":"Must contain start and end value","Constraint.NumberRange.InvalidRange":"Start value must be less than the end value","Constraint.NumberRange.Mandatory":"Field is mandatory: must contain at least a start or end value","Constraint.Password.AlreadyUsed":"Must not have been used before","Constraint.Password.LowerAndUpperCaseMandatory":"Must contain both upper and lowercase characters","Constraint.Password.MinNumericCharactersMandatory":"Must contain ${min-numeric} or more numerical characters","Constraint.Password.MinSpecialCharactersMandatory":"Must contain ${min-special} or more special characters","Constraint.Password.ThreeConsecutiveCharactersNotAllowed":"Must not contain any character more than twice consecutively","Constraint.Password.Unchanged":"Must not be the same as the old password","Constraint.Password.UserNameSubstringNotAllowed":"Must not have 5 consecutive characters from username","Constraint.SortParameter.InvalidValue":"Invalid sort parameter. Allowed values: field+[asc|desc]","Constraint.Time.InvalidFormat":"Must be entered in the format ${format}","Constraint.TimeRange.InvalidRange":"Start time must be before end time","Constraint.TimeRange.Mandatory":"Field is mandatory: must contain at least a start or end time","Constraint.TimeStamp.AboveMaximum":"Must be on or before ${max-date}","Constraint.TimeStamp.BelowMinimum":"Must be on or after ${min-date}","Constraint.Timestamp.InvalidFormat":"Must be entered in the format ${format}","Constraint.TimeStampRange.InvalidRange":"Start value must be before end value","Constraint.TimeStampRange.Mandatory":"Field is mandatory: must contain at least a start or end value","Constraint.XML.InvalidFormat":"Must be well-formed XML","Constraint.ZipCode.InvalidFormat":"Must be a valid Dutch ZIP code, e.g. 1234AB","Error.AcceptHeaderRequired":"The 'Accept' request-header field must be provided","Error.Authentication.BlockedUser":"You have been logged out, because your account has been blocked","Error.Authentication.ConcurrentUser":"You have been logged out, since your username has been used at a different location.","Error.Authentication.InvalidCredentials":"Authentication failed","Error.Authentication.InvalidUsername":"You have been logged out, because your username is not valid anymore","Error.Authentication.Required":"Authentication is required","Error.Case.ConcurrentModification":"Another user has updated a case used in this task. As a result, this task can not be completed.","Error.ChangePasswordRequired":"User password is initial or expired, and must be changed ","Error.CodemapLookup.InvalidToken":"Token for codemap lookup is not valid","Error.DataStore.ConcurrentModification":"Another user has updated a record used in this task","Error.DataStore.RecordAlreadyExists":"","Error.DataStore.RowCannotBeLocked":"Another user has already locked a record used in this task","Error.Form.DataNotAvailableForId":"Service can not be completed, data not available for mandatory element ${elementid}","Error.Form.ObjectNotAllowed":"Object '${objectid}' is not allowed","Error.Form.ReadOnlyElementId":"Element '${elementid}' is read only","Error.Form.TooManyObjects":"Too many objects '${objectid}' provided","Error.Form.UndefinedElementId":"Undefined element '${elementid}'","Error.Form.UndefinedObject":"Undefined object(s) '${objectid}'","Error.GeneralError":"An unexpected error occurred","Error.MethodNotAllowed":"The given HTTP method is not allowed for this resource","Error.Parameter.InvalidValue":"The parameter contains characters that are not allowed","Error.Parameter.Mandatory":"Parameter ${parameter} is mandatory","Error.Parameter.NotAllowed":"Parameter '${parameter}' is not allowed","Error.ResourceNotFound":"The requested resource cannot be found","Validation.StandardCreateAndUpdateUserTask.PasswordsDoNotMatch":"Password and password confirmation do not match.","Validation.StandardCreateAndUpdateUserTask.UserEmailAlreadyExists":"A user with email address '${Email}' already exists","Validation.StandardCreateAndUpdateUserTask.UserNameAlreadyExists":"A user with username '${Username}' already exists","Validation.StandardCreateOrganizationTask.OrganizationAlreadyExists":"An organization with id '${ID}' already exists"};var g={"Constraint.Attribute.IncorrectValue":"Ongeldige waarde","Constraint.Boolean.InvalidValue":"Waarde voldoet niet aan het boolean formaat, alleen waarden 'true' en 'false' zijn toegestaan","Constraint.BSN.InvalidFormat":"Moet een geldig BSN zijn","Constraint.Captcha.InvalidToken":"Captcha is niet correct","Constraint.Choice.ConflictingAnswer":"'${answer-option-key}' kan niet worden gekozen omdat dit geen relevante optie is, gegeven de andere antwoorden","Constraint.Choice.ConflictingOptions":"'${answer-option-key1}' and '${answer-option-key2}' kunnen niet tegelijkertijd worden gekozen","Constraint.Choice.InvalidOption":"Toegestane waarden zijn: ${options}","Constraint.Choice.InvalidOption.General":"Waarde '${value}' is niet toegestaan","Constraint.Choice.MultipleNotAllowed":"Meerdere opties selecteren is niet toegestaan","Constraint.ConfirmCurrentPassword.Invalid":"Moet overeenkomen met het huidige wachtwoord","Constraint.Date.AboveMaximum":"Moet op of voor ${max-date} liggen","Constraint.Date.BelowMinimum":"Moet op of na ${min-date} liggen","Constraint.Date.InvalidFormat":"Moet worden opgegeven in het formaat ${format}","Constraint.Date.NotOnDate":"Moet op ${date} liggen","Constraint.Date.OutOfRange":"Moet tussen ${min-date} en ${max-date} liggen","Constraint.DateRange.InvalidRange":"De begindatum dient voor de einddatum te liggen","Constraint.DateRange.Mandatory":"Veld is verplicht: moet tenminste begin- of einddatum bevatten","Constraint.DateTime.AboveMaximum":"Moet voor ${max-date-time} liggen","Constraint.DateTime.BelowMinimum":"Moet op ${min-date-time} of later liggen","Constraint.DateTime.InvalidFormat":"Moet worden opgegeven in het formaat ${format}","Constraint.DateTime.OutOfRange":"Moet tussen ${min-date-time} en ${max-date-time} liggen","Constraint.DateTimeRange.InvalidRange":"De begindatumtijd dient voor de einddatumtijd te liggen","Constraint.DateTimeRange.Mandatory":"Veld is verplicht: moet tenminste begin- of einddatumtijd bevatten","Constraint.Document.MimeTypeNotAllowed":"Het document mime type voldoet niet aan het document type","Constraint.Email.InvalidFormat":"Moet een geldig emailadres zijn","Constraint.File.DataEmpty":"Bestand bestaat niet of heeft geen inhoud","Constraint.File.InvalidExtension":"Toegestane extensies zijn: ${extensions}","Constraint.File.InvalidFormat":"Voldoet niet aan de voorwaarden van een bestandsnaam","Constraint.File.InvalidMimeType":"Toegestane mime-types zijn: ${mime-types}","Constraint.File.MaxFileSizeExceeded":"De maximum file grootte voor upload is ${max-filesize}","Constraint.File.OnlyAllowsOneFile":"Er is slechts \xE9\xE9n bestand toegestaan","Constraint.IBAN.InvalidFormat":"Moet een geldig IBAN nummer zijn","Constraint.InvalidLengthBetween":"Lengte moet tussen ${min-length} en ${max-length} karakters liggen","Constraint.InvalidLengthExact":"Lengte moet precies ${length} karakters zijn","Constraint.InvalidLengthTooLong":"Lengte mag niet langer dan ${max-length} karakters zijn","Constraint.InvalidLengthTooShort":"Lengte moet tenminste ${min-length} karakters zijn","Constraint.InvalidRegularExpression":"De waarde voldoet niet aan de reguliere expressie ${regexp}","Constraint.Mandatory":"Veld is verplicht","Constraint.Missing":"Veld is verplicht","Constraint.Number.AboveMaximum":"Mag niet groter dan ${max-number} zijn","Constraint.Number.BelowMinimum":"Moet minstens ${min-number} zijn","Constraint.Number.InvalidDecimal":"Moet een getal zijn met maximaal ${max-digits} decimalen","Constraint.Number.InvalidInteger":"Moet een geheel getal zijn","Constraint.Number.InvalidLong":"Moet een geheel getal zijn","Constraint.Number.OutOfRange":"Moet tussen ${min-number} en ${max-number} liggen","Constraint.NumberRange.BothFieldsMandatory":"Moet zowel een begin- als een eindwaarde bevatten","Constraint.NumberRange.InvalidRange":"De beginwaarde dient kleiner te zijn dan de eindwaarde","Constraint.NumberRange.Mandatory":"Veld is verplicht: moet tenminste begin- of eindwaarde bevatten","Constraint.Password.AlreadyUsed":"Mag niet eerder zijn gebruikt","Constraint.Password.LowerAndUpperCaseMandatory":"Moet zowel hoofdletters als kleine letters bevatten","Constraint.Password.MinNumericCharactersMandatory":"Moet ${min-numeric} of meer numerieke karakters bevatten","Constraint.Password.MinSpecialCharactersMandatory":"Moet ${min-special} of meer speciale karakters bevatten","Constraint.Password.ThreeConsecutiveCharactersNotAllowed":"Mag niet meer dan twee dezelfde karakters achter elkaar bevatten","Constraint.Password.Unchanged":"Mag niet hetzelfde zijn als het oude wachtwoord","Constraint.Password.UserNameSubstringNotAllowed":"Mag niet vijf opeenvolgende karakters van de gebruikersnaam bevatten","Constraint.SortParameter.InvalidValue":"Ongeldige sorteerparameter. Toegestane waardes: veld+[asc|desc]","Constraint.Time.InvalidFormat":"Moet worden opgegeven in het formaat ${format}","Constraint.TimeRange.InvalidRange":"De begintijd dient voor de eindtijd te liggen","Constraint.TimeRange.Mandatory":"Veld is verplicht: moet tenminste begin- of eindtijd bevatten","Constraint.TimeStamp.AboveMaximum":"Moet op of voor ${max-date} liggen","Constraint.TimeStamp.BelowMinimum":"Moet op of na ${min-date} liggen","Constraint.Timestamp.InvalidFormat":"Moet worden opgegeven in het formaat ${format}","Constraint.TimeStampRange.InvalidRange":"De beginwaarde dient voor de eindwaarde te liggen","Constraint.TimeStampRange.Mandatory":"Veld is verplicht: moet tenminste begin- of eindwaarde bevatten","Constraint.XML.InvalidFormat":"Moet geldige XML zijn","Constraint.ZipCode.InvalidFormat":"Moet een geldige postcode zijn, bijvoorbeeld 1234AB","Error.AcceptHeaderRequired":"De 'Accept' request-header moet worden meegegeven","Error.Authentication.BlockedUser":"U bent uitgelogd omdat uw account geblokkeerd is","Error.Authentication.ConcurrentUser":"U bent uitgelogd omdat uw gebruikersnaam op een andere locatie is gebruikt om in te loggen.","Error.Authentication.InvalidCredentials":"Inloggen is mislukt","Error.Authentication.InvalidUsername":"U bent uitgelogd omdat uw gebruikersnaam niet meer geldig is","Error.Authentication.Required":"Autorisatie is vereist","Error.Case.ConcurrentModification":"Een andere gebruiker heeft het dossier aangepast waardoor deze taak nu niet meer is toegestaan","Error.ChangePasswordRequired":"Gebruikerswachtwoord is initieel of verlopen, en moet worden aangepast","Error.CodemapLookup.InvalidToken":"Token voor keuzelijst lookup is niet valide","Error.DataStore.ConcurrentModification":"Een andere gebruiker heeft de rij in de datastore reeds aangepast","Error.DataStore.RecordAlreadyExists":"","Error.DataStore.RowCannotBeLocked":"Een andere gebruiker heeft de rij in bewerking en daarom kan deze taak niet worden volbracht.","Error.Form.DataNotAvailableForId":"Service kan niet worden afgrond, data voor verplicht element ${elementid} is niet beschikbaar","Error.Form.ObjectNotAllowed":"Object '${objectid}' is niet toegestaan","Error.Form.ReadOnlyElementId":"Element '${elementid}' is alleen lezen","Error.Form.TooManyObjects":"Te veel objecten '${objectid}' aangeleverd","Error.Form.UndefinedElementId":"Element '${elementid}' is ongedefinieerd","Error.Form.UndefinedObject":"Object(en) '${objectid}' ongedefinieerd","Error.GeneralError":"Er is een onverwachte fout opgetreden","Error.MethodNotAllowed":"De opgegeven HTTP methode is niet toegestaan op deze resource","Error.Parameter.InvalidValue":"De parameter bevat karakters die niet zijn toegestaan","Error.Parameter.Mandatory":"De parameter ${parameter} is verplicht","Error.Parameter.NotAllowed":"Parameter '${parameter}' is niet toegestaan","Error.ResourceNotFound":"De opgevraagde resource kan niet worden gevonden","Validation.StandardCreateAndUpdateUserTask.PasswordsDoNotMatch":"Het wachtwoord en de wachtwoordbevestiging komen niet overeen","Validation.StandardCreateAndUpdateUserTask.UserEmailAlreadyExists":"Een gebruiker met e-mailadres '${Email}' bestaat al","Validation.StandardCreateAndUpdateUserTask.UserNameAlreadyExists":"Een gebruiker met gebruikersnaam '${Username}' bestaat al","Validation.StandardCreateOrganizationTask.OrganizationAlreadyExists":"Een organisatie met id '${ID}' bestaat al"};var u=[{code:"en",messages:{},errors:m},{code:"nl",messages:{},errors:g}],G=n=>u.map(e=>n[e.code]?{...e,errors:{...e.errors,...n[e.code]}}:e),o=class n extends I{constructor(e=u){super(e.map(a=>new i(a)))}static rehydrate(e){return e&&e.collection?new n(e.collection.map(a=>({code:a.code,messages:a.messages,errors:a.errors}))):new n([])}hasLocale(e){return this.some(a=>e.startsWith(a.code))}getLocale(e){if(this.hasLocale(e)){let a=this.find(t=>e.startsWith(t.code));if(a)return a}throw new y(`Locale configuration for locale ${e} not found`)}get availableLocaleCodes(){return this.map(e=>e.code)}getPreferredLocale(e){if(e!=null){let t=(e.match(/[-A-Za-z]{2,10}/gu)||[]).filter(r=>this.availableLocaleCodes.some(s=>r.startsWith(s))).map(r=>this.availableLocaleCodes.find(s=>r.startsWith(s)));if(t.length>0)return t[0]}return this.availableLocaleCodes[0]}update(e,a={},t={}){this.hasLocale(e)?this.getLocale(e).update(a,t):this.add(new i({code:e,messages:a,errors:t}))}};import{createAction as b,createReducer as E}from"@reduxjs/toolkit";import{Cache as A,clearCookie as c,setCookie as h}from"@beinformed/ui/utils";var Z=n=>p(n),p=b("UPDATE_LOCALE",n=>({payload:n})),$=b("SET_LOCALES",(n,e)=>({payload:{locales:n,locale:e}})),S=()=>typeof navigator<"u"&&navigator?.language&&navigator?.language.split("-")[0]||"en",T={locales:new o,locale:S()},J=E(T,n=>{n.addCase(p,(e,a)=>{e.locales?.length>1?h("locale",a.payload):c("locale"),A.clear(),e.locale=a.payload}).addCase($,(e,a)=>{let{locale:t,locales:r}=a.payload;e.locales.length>1?h("locale",t):c("locale"),e.locales=r,t&&(e.locale=t)})});export{d as a,i as b,u as c,G as d,o as e,Z as f,p as g,$ as h,J as i};
2
- //# sourceMappingURL=chunk-X6L6BWD4.js.map
1
+ var l={attribute:{name:0,nativeName:1},rtl:{ar:1,dv:1,fa:1,ha:1,he:1,ks:1,ku:1,ps:1,ur:1,yi:1},lang:{aa:["Afar","Afar"],ab:["Abkhazian","\u0410\u04A7\u0441\u0443\u0430"],af:["Afrikaans","Afrikaans"],ak:["Akan","Akana"],am:["Amharic","\u12A0\u121B\u122D\u129B"],an:["Aragonese","Aragon\xE9s"],ar:["Arabic","\u0627\u0644\u0639\u0631\u0628\u064A\u0629"],as:["Assamese","\u0985\u09B8\u09AE\u09C0\u09AF\u09BC\u09BE"],av:["Avar","\u0410\u0432\u0430\u0440"],ay:["Aymara","Aymar"],az:["Azerbaijani","Az\u0259rbaycanca / \u0622\u0630\u0631\u0628\u0627\u064A\u062C\u0627\u0646"],ba:["Bashkir","\u0411\u0430\u0448\u04A1\u043E\u0440\u0442"],be:["Belarusian","\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F"],bg:["Bulgarian","\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438"],bh:["Bihari","\u092D\u094B\u091C\u092A\u0941\u0930\u0940"],bi:["Bislama","Bislama"],bm:["Bambara","Bamanankan"],bn:["Bengali","\u09AC\u09BE\u0982\u09B2\u09BE"],bo:["Tibetan","\u0F56\u0F7C\u0F51\u0F0B\u0F61\u0F72\u0F42 / Bod skad"],br:["Breton","Brezhoneg"],bs:["Bosnian","Bosanski"],ca:["Catalan","Catal\xE0"],ce:["Chechen","\u041D\u043E\u0445\u0447\u0438\u0439\u043D"],ch:["Chamorro","Chamoru"],co:["Corsican","Corsu"],cr:["Cree","Nehiyaw"],cs:["Czech","\u010Cesky"],cu:["Old Church Slavonic / Old Bulgarian","\u0441\u043B\u043E\u0432\u0463\u043D\u044C\u0441\u043A\u044A / slov\u011Bn\u012Dsk\u016D"],cv:["Chuvash","\u0427\u0103\u0432\u0430\u0448"],cy:["Welsh","Cymraeg"],da:["Danish","Dansk"],de:["German","Deutsch"],dv:["Divehi","\u078B\u07A8\u0788\u07AC\u0780\u07A8\u0784\u07A6\u0790\u07B0"],dz:["Dzongkha","\u0F47\u0F7C\u0F44\u0F0B\u0F41"],ee:["Ewe","\u0190\u028B\u025B"],el:["Greek","\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"],en:["English","English"],eo:["Esperanto","Esperanto"],es:["Spanish","Espa\xF1ol"],et:["Estonian","Eesti"],eu:["Basque","Euskara"],fa:["Persian","\u0641\u0627\u0631\u0633\u06CC"],ff:["Peul","Fulfulde"],fi:["Finnish","Suomi"],fj:["Fijian","Na Vosa Vakaviti"],fo:["Faroese","F\xF8royskt"],fr:["French","Fran\xE7ais"],fy:["West Frisian","Frysk"],ga:["Irish","Gaeilge"],gd:["Scottish Gaelic","G\xE0idhlig"],gl:["Galician","Galego"],gn:["Guarani","Ava\xF1e'\u1EBD"],gu:["Gujarati","\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0"],gv:["Manx","Gaelg"],ha:["Hausa","\u0647\u064E\u0648\u064F\u0633\u064E"],he:["Hebrew","\u05E2\u05D1\u05E8\u05D9\u05EA"],hi:["Hindi","\u0939\u093F\u0928\u094D\u0926\u0940"],ho:["Hiri Motu","Hiri Motu"],hr:["Croatian","Hrvatski"],ht:["Haitian","Kr\xE8yol ayisyen"],hu:["Hungarian","Magyar"],hy:["Armenian","\u0540\u0561\u0575\u0565\u0580\u0565\u0576"],hz:["Herero","Otsiherero"],ia:["Interlingua","Interlingua"],id:["Indonesian","Bahasa Indonesia"],ie:["Interlingue","Interlingue"],ig:["Igbo","Igbo"],ii:["Sichuan Yi","\uA187\uA259 / \u56DB\u5DDD\u5F5D\u8BED"],ik:["Inupiak","I\xF1upiak"],io:["Ido","Ido"],is:["Icelandic","\xCDslenska"],it:["Italian","Italiano"],iu:["Inuktitut","\u1403\u14C4\u1483\u144E\u1450\u1466"],ja:["Japanese","\u65E5\u672C\u8A9E"],jv:["Javanese","Basa Jawa"],ka:["Georgian","\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8"],kg:["Kongo","KiKongo"],ki:["Kikuyu","G\u0129k\u0169y\u0169"],kj:["Kuanyama","Kuanyama"],kk:["Kazakh","\u049A\u0430\u0437\u0430\u049B\u0448\u0430"],kl:["Greenlandic","Kalaallisut"],km:["Cambodian","\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A"],kn:["Kannada","\u0C95\u0CA8\u0CCD\u0CA8\u0CA1"],ko:["Korean","\uD55C\uAD6D\uC5B4"],kr:["Kanuri","Kanuri"],ks:["Kashmiri","\u0915\u0936\u094D\u092E\u0940\u0930\u0940 / \u0643\u0634\u0645\u064A\u0631\u064A"],ku:["Kurdish","Kurd\xEE / \u0643\u0648\u0631\u062F\u06CC"],kv:["Komi","\u041A\u043E\u043C\u0438"],kw:["Cornish","Kernewek"],ky:["Kirghiz","K\u0131rg\u0131zca / \u041A\u044B\u0440\u0433\u044B\u0437\u0447\u0430"],la:["Latin","Latina"],lb:["Luxembourgish","L\xEBtzebuergesch"],lg:["Ganda","Luganda"],li:["Limburgian","Limburgs"],ln:["Lingala","Ling\xE1la"],lo:["Laotian","\u0EA5\u0EB2\u0EA7 / Pha xa lao"],lt:["Lithuanian","Lietuvi\u0173"],lv:["Latvian","Latvie\u0161u"],mg:["Malagasy","Malagasy"],mh:["Marshallese","Kajin Majel / Ebon"],mi:["Maori","M\u0101ori"],mk:["Macedonian","\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438"],ml:["Malayalam","\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02"],mn:["Mongolian","\u041C\u043E\u043D\u0433\u043E\u043B"],mo:["Moldovan","Moldoveneasc\u0103"],mr:["Marathi","\u092E\u0930\u093E\u0920\u0940"],ms:["Malay","Bahasa Melayu"],mt:["Maltese","bil-Malti"],my:["Burmese","Myanmasa"],na:["Nauruan","Dorerin Naoero"],nd:["North Ndebele","Sindebele"],ne:["Nepali","\u0928\u0947\u092A\u093E\u0932\u0940"],ng:["Ndonga","Oshiwambo"],nl:["Dutch","Nederlands"],nn:["Norwegian Nynorsk","Norsk (nynorsk)"],no:["Norwegian","Norsk (bokm\xE5l / riksm\xE5l)"],nr:["South Ndebele","isiNdebele"],nv:["Navajo","Din\xE9 bizaad"],ny:["Chichewa","Chi-Chewa"],oc:["Occitan","Occitan"],oj:["Ojibwa","\u140A\u14C2\u1511\u14C8\u142F\u14A7\u140E\u14D0 / Anishinaabemowin"],om:["Oromo","Oromoo"],or:["Oriya","\u0B13\u0B21\u0B3C\u0B3F\u0B06"],os:["Ossetian / Ossetic","\u0418\u0440\u043E\u043D\u0430\u0443"],pa:["Panjabi / Punjabi","\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40 / \u092A\u0902\u091C\u093E\u092C\u0940 / \u067E\u0646\u062C\u0627\u0628\u064A"],pi:["Pali","P\u0101li / \u092A\u093E\u0934\u093F"],pl:["Polish","Polski"],ps:["Pashto","\u067E\u069A\u062A\u0648"],pt:["Portuguese","Portugu\xEAs"],qu:["Quechua","Runa Simi"],rm:["Raeto Romance","Rumantsch"],rn:["Kirundi","Kirundi"],ro:["Romanian","Rom\xE2n\u0103"],ru:["Russian","\u0420\u0443\u0441\u0441\u043A\u0438\u0439"],rw:["Rwandi","Kinyarwandi"],sa:["Sanskrit","\u0938\u0902\u0938\u094D\u0915\u0943\u0924\u092E\u094D"],sc:["Sardinian","Sardu"],sd:["Sindhi","\u0938\u093F\u0928\u0927\u093F"],se:["Northern Sami","S\xE1megiella"],sg:["Sango","S\xE4ng\xF6"],sh:["Serbo-Croatian","Srpskohrvatski / \u0421\u0440\u043F\u0441\u043A\u043E\u0445\u0440\u0432\u0430\u0442\u0441\u043A\u0438"],si:["Sinhalese","\u0DC3\u0DD2\u0D82\u0DC4\u0DBD"],sk:["Slovak","Sloven\u010Dina"],sl:["Slovenian","Sloven\u0161\u010Dina"],sm:["Samoan","Gagana Samoa"],sn:["Shona","chiShona"],so:["Somalia","Soomaaliga"],sq:["Albanian","Shqip"],sr:["Serbian","\u0421\u0440\u043F\u0441\u043A\u0438"],ss:["Swati","SiSwati"],st:["Southern Sotho","Sesotho"],su:["Sundanese","Basa Sunda"],sv:["Swedish","Svenska"],sw:["Swahili","Kiswahili"],ta:["Tamil","\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD"],te:["Telugu","\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41"],tg:["Tajik","\u0422\u043E\u04B7\u0438\u043A\u04E3"],th:["Thai","\u0E44\u0E17\u0E22 / Phasa Thai"],ti:["Tigrinya","\u1275\u130D\u122D\u129B"],tk:["Turkmen","\u0422\u0443\u0440\u043A\u043C\u0435\u043D / \u062A\u0631\u0643\u0645\u0646"],tl:["Tagalog / Filipino","Tagalog"],tn:["Tswana","Setswana"],to:["Tonga","Lea Faka-Tonga"],tr:["Turkish","T\xFCrk\xE7e"],ts:["Tsonga","Xitsonga"],tt:["Tatar","Tatar\xE7a"],tw:["Twi","Twi"],ty:["Tahitian","Reo M\u0101`ohi"],ug:["Uyghur","Uy\u01A3urq\u0259 / \u0626\u06C7\u064A\u063A\u06C7\u0631\u0686\u06D5"],uk:["Ukrainian","\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"],ur:["Urdu","\u0627\u0631\u062F\u0648"],uz:["Uzbek","\u040E\u0437\u0431\u0435\u043A"],ve:["Venda","Tshiven\u1E13a"],vi:["Vietnamese","Ti\u1EBFng Vi\u1EC7t"],vo:["Volap\xFCk","Volap\xFCk"],wa:["Walloon","Walon"],wo:["Wolof","Wollof"],xh:["Xhosa","isiXhosa"],yi:["Yiddish","\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9"],yo:["Yoruba","Yor\xF9b\xE1"],za:["Zhuang","Cuengh / T\xF4\xF4 / \u58EE\u8BED"],zh:["Chinese","\u4E2D\u6587"],zu:["Zulu","isiZulu"],pap:["Papiamento","Papiamento"]}};import d from"format-message";import{immerable as C}from"immer";import{IllegalStateException as v}from"@beinformed/ui/exceptions";import{getBooleanSetting as f}from"@beinformed/ui/settings";import{IS_DEV as w}from"@beinformed/ui/utils";var i=class{[C]=!0;#n;#e;#a;#t;constructor(e){this.#n=e.code,this.#e=this.fixPlaceHoldersInObject(e.messages),this.#a=this.fixPlaceHoldersInObject(e.errors),this.#t=e.nativeName,d.setup({missingTranslation:"ignore"})}get code(){return this.#n}get nativeName(){if(this.#t)return this.#t;let e=this.code.split("-");if(e.length>0){let a=e[0];if(a){let t=l.lang[a];if(t)return t[1]+(e[1]?` (${e[1].toUpperCase()})`:"")}}throw new v(`Can not find language name based on locale: ${this.code}`)}fixPlaceHolders(e){return typeof e=="string"?e.replace(/'\$\{(?<key>.*?)}'/g,"''{$<key>}''").replace(/\$\{(?<key>.*?)}/g,"{$<key>}"):null}fixPlaceHoldersInObject(e={}){return JSON.parse(JSON.stringify(e).replace(/'\$\{(?<key>.*?)}'/g,"''{$<key>}''").replace(/\$\{(?<key>.*?)}/g,"{$<key>}"))}getBaseMessage(e,a){if(!e&&!a)return"[message: id or defaultMessage missing]";let t=this.#e[e]||this.#a[e];return w&&!t&&e&&f("DEBUG_I18N_MESSAGE_NOT_FOUND")&&console.debug(`Message with id ${e} not found for locale ${this.code} in layout translations`),t||this.fixPlaceHolders(a)||e}formatMessage(e,a){return a?d(e,a):e}getMessage(e,a,t){let r=this.getBaseMessage(e,a);return this.formatMessage(r,t)}update(e={},a={}){this.#e={...this.#e,...this.fixPlaceHoldersInObject(e)},this.#a={...this.#a,...this.fixPlaceHoldersInObject(a)}}};import{IllegalArgumentException as y}from"@beinformed/ui/exceptions";import{BaseCollection as I}from"@beinformed/ui/models";var m={"Constraint.Attribute.IncorrectValue":"Incorrect value","Constraint.Boolean.InvalidValue":"Invalid boolean value, only values 'true' or 'false' are valid","Constraint.BSN.InvalidFormat":"Must be a valid BSN","Constraint.Captcha.InvalidToken":"The captcha is invalid","Constraint.Choice.ConflictingAnswer":"Cannot select '${answer-option-key}' because this is not a relevant option, given the other answers","Constraint.Choice.ConflictingOptions":"Cannot select '${answer-option-key1}' and '${answer-option-key2}' at the same time","Constraint.Choice.InvalidOption":"Allowed options are: ${options}","Constraint.Choice.InvalidOption.General":"Value '${value}' is not allowed","Constraint.Choice.MultipleNotAllowed":"Selecting multiple options is not allowed","Constraint.ConfirmCurrentPassword.Invalid":"Must match the current password","Constraint.Date.AboveMaximum":"Must be on or before ${max-date}","Constraint.Date.BelowMinimum":"Must be on or after ${min-date}","Constraint.Date.InvalidFormat":"Must be entered in the format ${format}","Constraint.Date.NotOnDate":"Must be on ${date}","Constraint.Date.OutOfRange":"Must be between ${min-date} and ${max-date}","Constraint.DateRange.InvalidRange":"Start date must be before end date","Constraint.DateRange.Mandatory":"Field is mandatory: must contain at least a start or end date","Constraint.DateTime.AboveMaximum":"Must be before ${max-date-time}","Constraint.DateTime.BelowMinimum":"Must be at ${min-date-time} or after","Constraint.DateTime.InvalidFormat":"Must be entered in the format ${format}","Constraint.DateTime.OutOfRange":"Must be between ${min-date-time} and ${max-date-time}","Constraint.DateTimeRange.InvalidRange":"Start date-time must be before end date-time","Constraint.DateTimeRange.Mandatory":"Field is mandatory: must contain at least a start or end date-time","Constraint.Document.MimeTypeNotAllowed":"The document mime type is not valid for the selected document type","Constraint.Email.InvalidFormat":"Must be a valid e-mail address","Constraint.File.DataEmpty":"File does not exist or has no content","Constraint.File.InvalidExtension":"Allowed extensions are: ${extensions}","Constraint.File.InvalidFormat":"Must meet the requirements of the file name","Constraint.File.InvalidMimeType":"Allowed mime types are: ${mime-types}","Constraint.File.MaxFileSizeExceeded":"Maximum file upload size is ${max-filesize}","Constraint.File.OnlyAllowsOneFile":"Only one file is allowed","Constraint.IBAN.InvalidFormat":"Must be a valid IBAN number","Constraint.InvalidLengthBetween":"Length must be between ${min-length} and ${max-length} characters","Constraint.InvalidLengthExact":"Length must be precisely ${length} characters","Constraint.InvalidLengthTooLong":"Length must not be larger than ${max-length} characters","Constraint.InvalidLengthTooShort":"Length must be at least ${min-length} characters","Constraint.InvalidRegularExpression":"The value is not according the given regular expression ${regexp}","Constraint.Mandatory":"Field is mandatory","Constraint.Missing":"Field is mandatory","Constraint.Number.AboveMaximum":"Must be at most ${max-number}","Constraint.Number.BelowMinimum":"Must be at least ${min-number}","Constraint.Number.InvalidDecimal":"Must be a number with up to ${max-digits} decimal places","Constraint.Number.InvalidInteger":"Must be a whole number","Constraint.Number.InvalidLong":"Must be a whole number","Constraint.Number.OutOfRange":"Must be between ${min-number} and ${max-number}","Constraint.NumberRange.BothFieldsMandatory":"Must contain start and end value","Constraint.NumberRange.InvalidRange":"Start value must be less than the end value","Constraint.NumberRange.Mandatory":"Field is mandatory: must contain at least a start or end value","Constraint.Password.AlreadyUsed":"Must not have been used before","Constraint.Password.LowerAndUpperCaseMandatory":"Must contain both upper and lowercase characters","Constraint.Password.MinNumericCharactersMandatory":"Must contain ${min-numeric} or more numerical characters","Constraint.Password.MinSpecialCharactersMandatory":"Must contain ${min-special} or more special characters","Constraint.Password.ThreeConsecutiveCharactersNotAllowed":"Must not contain any character more than twice consecutively","Constraint.Password.Unchanged":"Must not be the same as the old password","Constraint.Password.UserNameSubstringNotAllowed":"Must not have 5 consecutive characters from username","Constraint.SortParameter.InvalidValue":"Invalid sort parameter. Allowed values: field+[asc|desc]","Constraint.Time.InvalidFormat":"Must be entered in the format ${format}","Constraint.TimeRange.InvalidRange":"Start time must be before end time","Constraint.TimeRange.Mandatory":"Field is mandatory: must contain at least a start or end time","Constraint.TimeStamp.AboveMaximum":"Must be on or before ${max-date}","Constraint.TimeStamp.BelowMinimum":"Must be on or after ${min-date}","Constraint.Timestamp.InvalidFormat":"Must be entered in the format ${format}","Constraint.TimeStampRange.InvalidRange":"Start value must be before end value","Constraint.TimeStampRange.Mandatory":"Field is mandatory: must contain at least a start or end value","Constraint.XML.InvalidFormat":"Must be well-formed XML","Constraint.ZipCode.InvalidFormat":"Must be a valid Dutch ZIP code, e.g. 1234AB","Error.AcceptHeaderRequired":"The 'Accept' request-header field must be provided","Error.Authentication.BlockedUser":"You have been logged out, because your account has been blocked","Error.Authentication.ConcurrentUser":"You have been logged out, since your username has been used at a different location.","Error.Authentication.InvalidCredentials":"Authentication failed","Error.Authentication.InvalidUsername":"You have been logged out, because your username is not valid anymore","Error.Authentication.Required":"Authentication is required","Error.Case.ConcurrentModification":"Another user has updated a case used in this task. As a result, this task can not be completed.","Error.ChangePasswordRequired":"User password is initial or expired, and must be changed ","Error.CodemapLookup.InvalidToken":"Token for codemap lookup is not valid","Error.DataStore.ConcurrentModification":"Another user has updated a record used in this task","Error.DataStore.RecordAlreadyExists":"","Error.DataStore.RowCannotBeLocked":"Another user has already locked a record used in this task","Error.Form.DataNotAvailableForId":"Service can not be completed, data not available for mandatory element ${elementid}","Error.Form.ObjectNotAllowed":"Object '${objectid}' is not allowed","Error.Form.ReadOnlyElementId":"Element '${elementid}' is read only","Error.Form.TooManyObjects":"Too many objects '${objectid}' provided","Error.Form.UndefinedElementId":"Undefined element '${elementid}'","Error.Form.UndefinedObject":"Undefined object(s) '${objectid}'","Error.GeneralError":"An unexpected error occurred","Error.MethodNotAllowed":"The given HTTP method is not allowed for this resource","Error.Parameter.InvalidValue":"The parameter contains characters that are not allowed","Error.Parameter.Mandatory":"Parameter ${parameter} is mandatory","Error.Parameter.NotAllowed":"Parameter '${parameter}' is not allowed","Error.ResourceNotFound":"The requested resource cannot be found","Validation.StandardCreateAndUpdateUserTask.PasswordsDoNotMatch":"Password and password confirmation do not match.","Validation.StandardCreateAndUpdateUserTask.UserEmailAlreadyExists":"A user with email address '${Email}' already exists","Validation.StandardCreateAndUpdateUserTask.UserNameAlreadyExists":"A user with username '${Username}' already exists","Validation.StandardCreateOrganizationTask.OrganizationAlreadyExists":"An organization with id '${ID}' already exists"};var g={"Constraint.Attribute.IncorrectValue":"Ongeldige waarde","Constraint.Boolean.InvalidValue":"Waarde voldoet niet aan het boolean formaat, alleen waarden 'true' en 'false' zijn toegestaan","Constraint.BSN.InvalidFormat":"Moet een geldig BSN zijn","Constraint.Captcha.InvalidToken":"Captcha is niet correct","Constraint.Choice.ConflictingAnswer":"'${answer-option-key}' kan niet worden gekozen omdat dit geen relevante optie is, gegeven de andere antwoorden","Constraint.Choice.ConflictingOptions":"'${answer-option-key1}' and '${answer-option-key2}' kunnen niet tegelijkertijd worden gekozen","Constraint.Choice.InvalidOption":"Toegestane waarden zijn: ${options}","Constraint.Choice.InvalidOption.General":"Waarde '${value}' is niet toegestaan","Constraint.Choice.MultipleNotAllowed":"Meerdere opties selecteren is niet toegestaan","Constraint.ConfirmCurrentPassword.Invalid":"Moet overeenkomen met het huidige wachtwoord","Constraint.Date.AboveMaximum":"Moet op of voor ${max-date} liggen","Constraint.Date.BelowMinimum":"Moet op of na ${min-date} liggen","Constraint.Date.InvalidFormat":"Moet worden opgegeven in het formaat ${format}","Constraint.Date.NotOnDate":"Moet op ${date} liggen","Constraint.Date.OutOfRange":"Moet tussen ${min-date} en ${max-date} liggen","Constraint.DateRange.InvalidRange":"De begindatum dient voor de einddatum te liggen","Constraint.DateRange.Mandatory":"Veld is verplicht: moet tenminste begin- of einddatum bevatten","Constraint.DateTime.AboveMaximum":"Moet voor ${max-date-time} liggen","Constraint.DateTime.BelowMinimum":"Moet op ${min-date-time} of later liggen","Constraint.DateTime.InvalidFormat":"Moet worden opgegeven in het formaat ${format}","Constraint.DateTime.OutOfRange":"Moet tussen ${min-date-time} en ${max-date-time} liggen","Constraint.DateTimeRange.InvalidRange":"De begindatumtijd dient voor de einddatumtijd te liggen","Constraint.DateTimeRange.Mandatory":"Veld is verplicht: moet tenminste begin- of einddatumtijd bevatten","Constraint.Document.MimeTypeNotAllowed":"Het document mime type voldoet niet aan het document type","Constraint.Email.InvalidFormat":"Moet een geldig emailadres zijn","Constraint.File.DataEmpty":"Bestand bestaat niet of heeft geen inhoud","Constraint.File.InvalidExtension":"Toegestane extensies zijn: ${extensions}","Constraint.File.InvalidFormat":"Voldoet niet aan de voorwaarden van een bestandsnaam","Constraint.File.InvalidMimeType":"Toegestane mime-types zijn: ${mime-types}","Constraint.File.MaxFileSizeExceeded":"De maximum file grootte voor upload is ${max-filesize}","Constraint.File.OnlyAllowsOneFile":"Er is slechts \xE9\xE9n bestand toegestaan","Constraint.IBAN.InvalidFormat":"Moet een geldig IBAN nummer zijn","Constraint.InvalidLengthBetween":"Lengte moet tussen ${min-length} en ${max-length} karakters liggen","Constraint.InvalidLengthExact":"Lengte moet precies ${length} karakters zijn","Constraint.InvalidLengthTooLong":"Lengte mag niet langer dan ${max-length} karakters zijn","Constraint.InvalidLengthTooShort":"Lengte moet tenminste ${min-length} karakters zijn","Constraint.InvalidRegularExpression":"De waarde voldoet niet aan de reguliere expressie ${regexp}","Constraint.Mandatory":"Veld is verplicht","Constraint.Missing":"Veld is verplicht","Constraint.Number.AboveMaximum":"Mag niet groter dan ${max-number} zijn","Constraint.Number.BelowMinimum":"Moet minstens ${min-number} zijn","Constraint.Number.InvalidDecimal":"Moet een getal zijn met maximaal ${max-digits} decimalen","Constraint.Number.InvalidInteger":"Moet een geheel getal zijn","Constraint.Number.InvalidLong":"Moet een geheel getal zijn","Constraint.Number.OutOfRange":"Moet tussen ${min-number} en ${max-number} liggen","Constraint.NumberRange.BothFieldsMandatory":"Moet zowel een begin- als een eindwaarde bevatten","Constraint.NumberRange.InvalidRange":"De beginwaarde dient kleiner te zijn dan de eindwaarde","Constraint.NumberRange.Mandatory":"Veld is verplicht: moet tenminste begin- of eindwaarde bevatten","Constraint.Password.AlreadyUsed":"Mag niet eerder zijn gebruikt","Constraint.Password.LowerAndUpperCaseMandatory":"Moet zowel hoofdletters als kleine letters bevatten","Constraint.Password.MinNumericCharactersMandatory":"Moet ${min-numeric} of meer numerieke karakters bevatten","Constraint.Password.MinSpecialCharactersMandatory":"Moet ${min-special} of meer speciale karakters bevatten","Constraint.Password.ThreeConsecutiveCharactersNotAllowed":"Mag niet meer dan twee dezelfde karakters achter elkaar bevatten","Constraint.Password.Unchanged":"Mag niet hetzelfde zijn als het oude wachtwoord","Constraint.Password.UserNameSubstringNotAllowed":"Mag niet vijf opeenvolgende karakters van de gebruikersnaam bevatten","Constraint.SortParameter.InvalidValue":"Ongeldige sorteerparameter. Toegestane waardes: veld+[asc|desc]","Constraint.Time.InvalidFormat":"Moet worden opgegeven in het formaat ${format}","Constraint.TimeRange.InvalidRange":"De begintijd dient voor de eindtijd te liggen","Constraint.TimeRange.Mandatory":"Veld is verplicht: moet tenminste begin- of eindtijd bevatten","Constraint.TimeStamp.AboveMaximum":"Moet op of voor ${max-date} liggen","Constraint.TimeStamp.BelowMinimum":"Moet op of na ${min-date} liggen","Constraint.Timestamp.InvalidFormat":"Moet worden opgegeven in het formaat ${format}","Constraint.TimeStampRange.InvalidRange":"De beginwaarde dient voor de eindwaarde te liggen","Constraint.TimeStampRange.Mandatory":"Veld is verplicht: moet tenminste begin- of eindwaarde bevatten","Constraint.XML.InvalidFormat":"Moet geldige XML zijn","Constraint.ZipCode.InvalidFormat":"Moet een geldige postcode zijn, bijvoorbeeld 1234AB","Error.AcceptHeaderRequired":"De 'Accept' request-header moet worden meegegeven","Error.Authentication.BlockedUser":"U bent uitgelogd omdat uw account geblokkeerd is","Error.Authentication.ConcurrentUser":"U bent uitgelogd omdat uw gebruikersnaam op een andere locatie is gebruikt om in te loggen.","Error.Authentication.InvalidCredentials":"Inloggen is mislukt","Error.Authentication.InvalidUsername":"U bent uitgelogd omdat uw gebruikersnaam niet meer geldig is","Error.Authentication.Required":"Autorisatie is vereist","Error.Case.ConcurrentModification":"Een andere gebruiker heeft het dossier aangepast waardoor deze taak nu niet meer is toegestaan","Error.ChangePasswordRequired":"Gebruikerswachtwoord is initieel of verlopen, en moet worden aangepast","Error.CodemapLookup.InvalidToken":"Token voor keuzelijst lookup is niet valide","Error.DataStore.ConcurrentModification":"Een andere gebruiker heeft de rij in de datastore reeds aangepast","Error.DataStore.RecordAlreadyExists":"","Error.DataStore.RowCannotBeLocked":"Een andere gebruiker heeft de rij in bewerking en daarom kan deze taak niet worden volbracht.","Error.Form.DataNotAvailableForId":"Service kan niet worden afgrond, data voor verplicht element ${elementid} is niet beschikbaar","Error.Form.ObjectNotAllowed":"Object '${objectid}' is niet toegestaan","Error.Form.ReadOnlyElementId":"Element '${elementid}' is alleen lezen","Error.Form.TooManyObjects":"Te veel objecten '${objectid}' aangeleverd","Error.Form.UndefinedElementId":"Element '${elementid}' is ongedefinieerd","Error.Form.UndefinedObject":"Object(en) '${objectid}' ongedefinieerd","Error.GeneralError":"Er is een onverwachte fout opgetreden","Error.MethodNotAllowed":"De opgegeven HTTP methode is niet toegestaan op deze resource","Error.Parameter.InvalidValue":"De parameter bevat karakters die niet zijn toegestaan","Error.Parameter.Mandatory":"De parameter ${parameter} is verplicht","Error.Parameter.NotAllowed":"Parameter '${parameter}' is niet toegestaan","Error.ResourceNotFound":"De opgevraagde resource kan niet worden gevonden","Validation.StandardCreateAndUpdateUserTask.PasswordsDoNotMatch":"Het wachtwoord en de wachtwoordbevestiging komen niet overeen","Validation.StandardCreateAndUpdateUserTask.UserEmailAlreadyExists":"Een gebruiker met e-mailadres '${Email}' bestaat al","Validation.StandardCreateAndUpdateUserTask.UserNameAlreadyExists":"Een gebruiker met gebruikersnaam '${Username}' bestaat al","Validation.StandardCreateOrganizationTask.OrganizationAlreadyExists":"Een organisatie met id '${ID}' bestaat al"};var u=[{code:"en",messages:{},errors:m},{code:"nl",messages:{},errors:g}],G=n=>u.map(e=>n[e.code]?{...e,errors:{...e.errors,...n[e.code]}}:e),o=class n extends I{constructor(e=u){super(e.map(a=>new i(a)))}static rehydrate(e){return e&&e.collection?new n(e.collection.map(a=>({code:a.code,messages:a.messages,errors:a.errors}))):new n([])}hasLocale(e){return this.some(a=>e.startsWith(a.code))}getLocale(e){if(this.hasLocale(e)){let a=this.find(t=>e.startsWith(t.code));if(a)return a}throw new y(`Locale configuration for locale ${e} not found`)}get availableLocaleCodes(){return this.map(e=>e.code)}getPreferredLocale(e){if(e!=null){let t=(e.match(/[-A-Za-z]{2,10}/gu)||[]).filter(r=>this.availableLocaleCodes.some(s=>r.startsWith(s))).map(r=>this.availableLocaleCodes.find(s=>r.startsWith(s)));if(t.length>0)return t[0]}return this.availableLocaleCodes[0]}update(e,a={},t={}){this.hasLocale(e)?this.getLocale(e).update(a,t):this.add(new i({code:e,messages:a,errors:t}))}};import{createAction as b,createReducer as E}from"@reduxjs/toolkit";import{Cache as A,clearCookie as c,setCookie as h}from"@beinformed/ui/utils";var Z=n=>p(n),p=b("UPDATE_LOCALE",n=>({payload:n})),$=b("SET_LOCALES",(n,e)=>({payload:{locales:n,locale:e}})),S=()=>typeof navigator<"u"&&navigator?.language&&navigator?.language.split("-")[0]||"en",T={locales:new o,locale:S()},J=E(T,n=>{n.addCase(p,(e,a)=>{e.locales?.length>1?h("locale",a.payload):c("locale"),A.clear(),e.locale=a.payload}).addCase($,(e,a)=>{let{locale:t,locales:r}=a.payload;e.locales.length>1?h("locale",t):c("locale"),e.locales=r,t&&(e.locale=t)})});var Q=n=>n.i18n?.locale??"en",ee=n=>n.i18n.locales;export{l as a,i as b,u as c,G as d,o as e,Z as f,p as g,$ as h,J as i,Q as j,ee as k};
2
+ //# sourceMappingURL=chunk-KZB56W7Q.js.map