@beinformed/react 1.0.0-beta.0 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{beforeRenderHooks-Gb0tcmCY.d.ts → beforeRenderHooks-B0CWdI7P.d.ts} +1 -1
  3. package/dist/{beforeRenderHooks-CNvsMmi8.d.cts → beforeRenderHooks-CKR6eECI.d.cts} +1 -1
  4. package/dist/chunk-4IDEBSD5.js +2 -0
  5. package/dist/chunk-4IDEBSD5.js.map +1 -0
  6. package/dist/chunk-6AKWSGWH.js +2 -0
  7. package/dist/chunk-6AKWSGWH.js.map +1 -0
  8. package/dist/chunk-6EK3TAMN.js +2 -0
  9. package/dist/chunk-6EK3TAMN.js.map +1 -0
  10. package/dist/{chunk-YJNJVQFW.js → chunk-7JMMW2FM.js} +2 -2
  11. package/dist/{chunk-YJNJVQFW.js.map → chunk-7JMMW2FM.js.map} +1 -1
  12. package/dist/{chunk-X2C7CKOK.js → chunk-A3D5R7MI.js} +2 -2
  13. package/dist/{chunk-X2C7CKOK.js.map → chunk-A3D5R7MI.js.map} +1 -1
  14. package/dist/{chunk-HDOILTJ2.js → chunk-BV77KA4Y.js} +2 -2
  15. package/dist/chunk-BV77KA4Y.js.map +1 -0
  16. package/dist/{chunk-K3DTH6XN.js → chunk-FBCZEJSD.js} +2 -2
  17. package/dist/chunk-FBCZEJSD.js.map +1 -0
  18. package/dist/{chunk-DI7VM62A.js → chunk-GD4NSZBN.js} +2 -2
  19. package/dist/chunk-GD4NSZBN.js.map +1 -0
  20. package/dist/chunk-HTR32BUX.js +2 -0
  21. package/dist/{chunk-6KRECIRI.js.map → chunk-HTR32BUX.js.map} +1 -1
  22. package/dist/chunk-ITSZQHGD.js +2 -0
  23. package/dist/chunk-ITSZQHGD.js.map +1 -0
  24. package/dist/chunk-JWOBKHOJ.js +2 -0
  25. package/dist/chunk-JWOBKHOJ.js.map +1 -0
  26. package/dist/chunk-KZB56W7Q.js +2 -0
  27. package/dist/chunk-KZB56W7Q.js.map +1 -0
  28. package/dist/chunk-KZLW2NHD.js +2 -0
  29. package/dist/chunk-KZLW2NHD.js.map +1 -0
  30. package/dist/{chunk-WBPDMDW4.js → chunk-L7DO7AZT.js} +2 -2
  31. package/dist/{chunk-WBPDMDW4.js.map → chunk-L7DO7AZT.js.map} +1 -1
  32. package/dist/{chunk-VG3QU524.js → chunk-OQK6SSUD.js} +3 -3
  33. package/dist/chunk-OQK6SSUD.js.map +1 -0
  34. package/dist/chunk-SPV6MD7J.js +2 -0
  35. package/dist/chunk-SPV6MD7J.js.map +1 -0
  36. package/dist/{chunk-Z2Y3OPVI.js → chunk-TAWZ2VIM.js} +2 -2
  37. package/dist/chunk-TAWZ2VIM.js.map +1 -0
  38. package/dist/{chunk-A4USB53Q.js → chunk-TDYPCNQI.js} +2 -2
  39. package/dist/{chunk-A4USB53Q.js.map → chunk-TDYPCNQI.js.map} +1 -1
  40. package/dist/chunk-VXOYOMNN.js +2 -0
  41. package/dist/chunk-VXOYOMNN.js.map +1 -0
  42. package/dist/chunk-WEJGEXAP.js +2 -0
  43. package/dist/chunk-WEJGEXAP.js.map +1 -0
  44. package/dist/client/index.cjs +5 -5
  45. package/dist/client/index.cjs.map +1 -1
  46. package/dist/client/index.d.cts +3 -3
  47. package/dist/client/index.d.ts +3 -3
  48. package/dist/client/index.js +1 -1
  49. package/dist/hooks/index.cjs +1 -1
  50. package/dist/hooks/index.cjs.map +1 -1
  51. package/dist/hooks/index.d.cts +193 -69
  52. package/dist/hooks/index.d.ts +193 -69
  53. package/dist/hooks/index.js +1 -1
  54. package/dist/i18n/index.cjs +1 -1
  55. package/dist/i18n/index.cjs.map +1 -1
  56. package/dist/i18n/index.d.cts +22 -4
  57. package/dist/i18n/index.d.ts +22 -4
  58. package/dist/i18n/index.js +1 -1
  59. package/dist/index.cjs +6 -6
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.cts +9 -8
  62. package/dist/index.d.ts +9 -8
  63. package/dist/index.js +1 -1
  64. package/dist/index.js.map +1 -1
  65. package/dist/redux/index.cjs +1 -1
  66. package/dist/redux/index.cjs.map +1 -1
  67. package/dist/redux/index.d.cts +215 -28
  68. package/dist/redux/index.d.ts +215 -28
  69. package/dist/redux/index.js +1 -1
  70. package/dist/server/index.cjs +2 -2
  71. package/dist/server/index.cjs.map +1 -1
  72. package/dist/server/index.d.cts +3 -3
  73. package/dist/server/index.d.ts +3 -3
  74. package/dist/server/index.js +1 -1
  75. package/dist/{styled-components.d-CrkOxzv5.d.cts → styled-components.d-C19eFejP.d.cts} +7 -13
  76. package/dist/{styled-components.d-CrkOxzv5.d.ts → styled-components.d-C19eFejP.d.ts} +7 -13
  77. package/dist/theme/index.cjs +1 -1
  78. package/dist/theme/index.cjs.map +1 -1
  79. package/dist/theme/index.d.cts +1 -1
  80. package/dist/theme/index.d.ts +1 -1
  81. package/dist/theme/index.js +1 -1
  82. package/dist/{useForm-DW-a5mcV.d.ts → useForm-BWwXFuv5.d.cts} +3 -3
  83. package/dist/{useForm-CG_DMYfZ.d.cts → useForm-DqaU9T78.d.ts} +3 -3
  84. package/dist/utils/index.cjs +1 -1
  85. package/dist/utils/index.cjs.map +1 -1
  86. package/dist/utils/index.d.cts +6 -1
  87. package/dist/utils/index.d.ts +6 -1
  88. package/dist/utils/index.js +1 -1
  89. package/package.json +16 -16
  90. package/dist/chunk-3OP2KQ56.js +0 -2
  91. package/dist/chunk-3OP2KQ56.js.map +0 -1
  92. package/dist/chunk-4AC7YQ5Q.js +0 -2
  93. package/dist/chunk-4AC7YQ5Q.js.map +0 -1
  94. package/dist/chunk-6KRECIRI.js +0 -2
  95. package/dist/chunk-AMFWIR2R.js +0 -2
  96. package/dist/chunk-AMFWIR2R.js.map +0 -1
  97. package/dist/chunk-B7PQLTVC.js +0 -2
  98. package/dist/chunk-B7PQLTVC.js.map +0 -1
  99. package/dist/chunk-DI7VM62A.js.map +0 -1
  100. package/dist/chunk-HDOILTJ2.js.map +0 -1
  101. package/dist/chunk-JYAETKRB.js +0 -2
  102. package/dist/chunk-JYAETKRB.js.map +0 -1
  103. package/dist/chunk-K3DTH6XN.js.map +0 -1
  104. package/dist/chunk-RKGGCIUD.js +0 -2
  105. package/dist/chunk-RKGGCIUD.js.map +0 -1
  106. package/dist/chunk-UZIZDEU6.js +0 -2
  107. package/dist/chunk-UZIZDEU6.js.map +0 -1
  108. package/dist/chunk-VFLYA5WJ.js +0 -2
  109. package/dist/chunk-VFLYA5WJ.js.map +0 -1
  110. package/dist/chunk-VG3QU524.js.map +0 -1
  111. package/dist/chunk-X3N2NQVZ.js +0 -2
  112. package/dist/chunk-X3N2NQVZ.js.map +0 -1
  113. package/dist/chunk-Y7ESITVO.js +0 -2
  114. package/dist/chunk-Y7ESITVO.js.map +0 -1
  115. package/dist/chunk-YG7XDCNV.js +0 -2
  116. package/dist/chunk-YG7XDCNV.js.map +0 -1
  117. package/dist/chunk-Z2Y3OPVI.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import * as _beinformed_ui_models from '@beinformed/ui/models';
2
- import { Href, ModularUIModel, FormModel, FormObjectModel, AttributeModel } from '@beinformed/ui/models';
2
+ import { Href, FormModel, ModularUIModel, FormObjectModel, AttributeModel } from '@beinformed/ui/models';
3
3
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
4
- import { C as FetchModelResult, F as FetchModelPayload } from './styled-components.d-CrkOxzv5.cjs';
4
+ import { C as FetchModelResult, F as FetchModelPayload } from './styled-components.d-C19eFejP.js';
5
5
 
6
6
  interface UpdateFormOptions {
7
7
  autosubmit: boolean;
@@ -14,7 +14,7 @@ interface UpdateFormOptions {
14
14
  /**
15
15
  * Load a form by href
16
16
  */
17
- declare const useForm: (href: string | Href, data?: Record<string, unknown>) => ModularUIModel | undefined;
17
+ declare const useForm: (href: string | Href, data?: Record<string, unknown>) => FormModel | undefined;
18
18
  /**
19
19
  * Form navigation methods
20
20
  */
@@ -1,2 +1,2 @@
1
- "use strict";var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var s=(n,e)=>{for(var t in e)p(n,t,{get:e[t],enumerable:!0})},i=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c(e))!f.call(n,r)&&r!==t&&p(n,r,{get:()=>e[r],enumerable:!(o=m(e,r))||o.enumerable});return n};var a=n=>i(p({},"__esModule",{value:!0}),n);var u={};s(u,{getDisplayName:()=>y,mergeRefs:()=>l});module.exports=a(u);var y=(n,e="Component",t)=>{let o=n.displayName||n.name||e;return t?`${o}[${t}]`:o},l=n=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t!=null&&typeof t=="object"&&(t.current=e)})};0&&(module.exports={getDisplayName,mergeRefs});
1
+ "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var c=(e,t)=>{for(var o in t)i(e,o,{get:t[o],enumerable:!0})},g=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of a(t))!f.call(e,n)&&n!==o&&i(e,n,{get:()=>t[n],enumerable:!(r=s(t,n))||r.enumerable});return e};var u=e=>g(i({},"__esModule",{value:!0}),e);var T={};c(T,{getDisplayName:()=>l,getSwimLaneDiagramConfiguration:()=>y,mergeRefs:()=>R});module.exports=u(T);var m=require("@beinformed/ui/settings"),p=require("@beinformed/ui/utils"),y=()=>{let e=(0,m.getStringSetting)("SWIM_LANE_DIAGRAM_CONFIGURATION","/Library/Diagrams/Overviews.json");return e.startsWith("/")||(e=`/${e}`),(0,p.getRepositoryResourceUrl)(e)};var l=(e,t="Component",o)=>{let r=e.displayName||e.name||t;return o?`${r}[${o}]`:r},R=e=>t=>{e.forEach(o=>{typeof o=="function"?o(t):o!=null&&typeof o=="object"&&(o.current=t)})};0&&(module.exports={getDisplayName,getSwimLaneDiagramConfiguration,mergeRefs});
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/utils.ts"],"sourcesContent":["// Generated by createIndex.js - Do not edit manually!\n// This file is automatically updated when the script runs.\n\nexport * from \"./utils\";\n","import type { ComponentType, Ref } from \"react\";\n\nexport const getDisplayName = (\n WrappedComponent: ComponentType<never>,\n defaultName = \"Component\",\n contextId?: string,\n) => {\n const componentName =\n WrappedComponent.displayName || WrappedComponent.name || defaultName;\n\n if (contextId) {\n return `${componentName}[${contextId}]`;\n }\n\n return componentName;\n};\n\nexport const mergeRefs =\n <T>(refs: Ref<T>[]): Ref<T> =>\n (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref != null && typeof ref === \"object\") {\n (ref as { current: T | null }).current = value;\n }\n });\n };\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,cAAAC,IAAA,eAAAC,EAAAJ,GCEO,IAAMK,EAAiB,CAC5BC,EACAC,EAAc,YACdC,IACG,CACH,IAAMC,EACJH,EAAiB,aAAeA,EAAiB,MAAQC,EAE3D,OAAIC,EACK,GAAGC,CAAa,IAAID,CAAS,IAG/BC,CACT,EAEaC,EACPC,GACHC,GAAU,CACTD,EAAK,QAASE,GAAQ,CAChB,OAAOA,GAAQ,WACjBA,EAAID,CAAK,EACAC,GAAO,MAAQ,OAAOA,GAAQ,WACtCA,EAA8B,QAAUD,EAE7C,CAAC,CACH","names":["utils_exports","__export","getDisplayName","mergeRefs","__toCommonJS","getDisplayName","WrappedComponent","defaultName","contextId","componentName","mergeRefs","refs","value","ref"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/swimlane_diagram.ts","../../src/utils/utils.ts"],"sourcesContent":["// Generated by createIndex.js - Do not edit manually!\n// This file is automatically updated when the script runs.\n\nexport * from \"./swimlane_diagram\";\nexport * from \"./utils\";\n","import { getStringSetting } from \"@beinformed/ui/settings\";\nimport { getRepositoryResourceUrl } from \"@beinformed/ui/utils\";\n\n/**\n * Model overview swim lane configuration\n */\nexport const getSwimLaneDiagramConfiguration = () => {\n let configLocation = getStringSetting(\n \"SWIM_LANE_DIAGRAM_CONFIGURATION\",\n \"/Library/Diagrams/Overviews.json\",\n );\n if (!configLocation.startsWith(\"/\")) {\n configLocation = `/${configLocation}`;\n }\n return getRepositoryResourceUrl(configLocation);\n};\n","import type { ComponentType, Ref } from \"react\";\n\nexport const getDisplayName = (\n WrappedComponent: ComponentType<never>,\n defaultName = \"Component\",\n contextId?: string,\n) => {\n const componentName =\n WrappedComponent.displayName || WrappedComponent.name || defaultName;\n\n if (contextId) {\n return `${componentName}[${contextId}]`;\n }\n\n return componentName;\n};\n\nexport const mergeRefs =\n <T>(refs: Ref<T>[]): Ref<T> =>\n (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref != null && typeof ref === \"object\") {\n (ref as { current: T | null }).current = value;\n }\n });\n };\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,oCAAAC,EAAA,cAAAC,IAAA,eAAAC,EAAAL,GCAA,IAAAM,EAAiC,mCACjCC,EAAyC,gCAK5BC,EAAkC,IAAM,CACnD,IAAIC,KAAiB,oBACnB,kCACA,kCACF,EACA,OAAKA,EAAe,WAAW,GAAG,IAChCA,EAAiB,IAAIA,CAAc,OAE9B,4BAAyBA,CAAc,CAChD,ECbO,IAAMC,EAAiB,CAC5BC,EACAC,EAAc,YACdC,IACG,CACH,IAAMC,EACJH,EAAiB,aAAeA,EAAiB,MAAQC,EAE3D,OAAIC,EACK,GAAGC,CAAa,IAAID,CAAS,IAG/BC,CACT,EAEaC,EACPC,GACHC,GAAU,CACTD,EAAK,QAASE,GAAQ,CAChB,OAAOA,GAAQ,WACjBA,EAAID,CAAK,EACAC,GAAO,MAAQ,OAAOA,GAAQ,WACtCA,EAA8B,QAAUD,EAE7C,CAAC,CACH","names":["utils_exports","__export","getDisplayName","getSwimLaneDiagramConfiguration","mergeRefs","__toCommonJS","import_settings","import_utils","getSwimLaneDiagramConfiguration","configLocation","getDisplayName","WrappedComponent","defaultName","contextId","componentName","mergeRefs","refs","value","ref"]}
@@ -1,6 +1,11 @@
1
1
  import { ComponentType, Ref } from 'react';
2
2
 
3
+ /**
4
+ * Model overview swim lane configuration
5
+ */
6
+ declare const getSwimLaneDiagramConfiguration: () => string;
7
+
3
8
  declare const getDisplayName: (WrappedComponent: ComponentType<never>, defaultName?: string, contextId?: string) => string;
4
9
  declare const mergeRefs: <T>(refs: Ref<T>[]) => Ref<T>;
5
10
 
6
- export { getDisplayName, mergeRefs };
11
+ export { getDisplayName, getSwimLaneDiagramConfiguration, mergeRefs };
@@ -1,6 +1,11 @@
1
1
  import { ComponentType, Ref } from 'react';
2
2
 
3
+ /**
4
+ * Model overview swim lane configuration
5
+ */
6
+ declare const getSwimLaneDiagramConfiguration: () => string;
7
+
3
8
  declare const getDisplayName: (WrappedComponent: ComponentType<never>, defaultName?: string, contextId?: string) => string;
4
9
  declare const mergeRefs: <T>(refs: Ref<T>[]) => Ref<T>;
5
10
 
6
- export { getDisplayName, mergeRefs };
11
+ export { getDisplayName, getSwimLaneDiagramConfiguration, mergeRefs };
@@ -1,2 +1,2 @@
1
- import{a,b}from"../chunk-AMFWIR2R.js";import"../chunk-FW4363Y4.js";export{a as getDisplayName,b as mergeRefs};
1
+ import{a,b,c}from"../chunk-WEJGEXAP.js";import"../chunk-FW4363Y4.js";export{b as getDisplayName,a as getSwimLaneDiagramConfiguration,c as mergeRefs};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beinformed/react",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "Be Informed UI React",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -28,33 +28,33 @@
28
28
  "deepmerge": "^4.3.1",
29
29
  "dequal": "^2.0.3",
30
30
  "format-message": "^6.2.4",
31
- "immer": "^10.1.1",
31
+ "immer": "^11.1.4",
32
32
  "js-cookie": "^3.0.5",
33
33
  "reselect": "^5.1.1",
34
- "@beinformed/ui": "2.0.0-beta.0"
34
+ "@beinformed/ui": "2.0.0-beta.2"
35
35
  },
36
36
  "devDependencies": {
37
- "@dr.pogodin/react-helmet": "^3.0.2",
38
- "@reduxjs/toolkit": "^2.8.2",
39
- "@testing-library/dom": "^10.4.0",
40
- "@testing-library/react": "^16.3.0",
37
+ "@dr.pogodin/react-helmet": "^3.0.6",
38
+ "@reduxjs/toolkit": "^2.11.2",
39
+ "@testing-library/dom": "^10.4.1",
40
+ "@testing-library/react": "^16.3.2",
41
41
  "@types/big.js": "^6.2.2",
42
42
  "@types/history": "^4.0.0",
43
43
  "@types/js-cookie": "^3.0.6",
44
- "@types/react": "^19.1.8",
45
- "@types/react-dom": "^19.1.6",
44
+ "@types/react": "^19.2.14",
45
+ "@types/react-dom": "^19.2.3",
46
46
  "@types/react-router": "^5.1.20",
47
47
  "@types/setimmediate": "^1.0.4",
48
48
  "history": "^4.0.0",
49
- "msw": "^2.10.4",
49
+ "msw": "^2.12.10",
50
50
  "polished": "^4.3.1",
51
- "react": "^19.1.0",
52
- "react-dom": "^19.1.0",
51
+ "react": "^19.2.4",
52
+ "react-dom": "^19.2.4",
53
53
  "react-redux": "^9.2.0",
54
54
  "react-router": "^5.0.0",
55
55
  "redux": "^5.0.1",
56
- "styled-components": "^6.1.19",
57
- "@beinformed/typescript-config": "0.0.0"
56
+ "styled-components": "^6.3.11",
57
+ "@beinformed/typescript-config": "0.0.1-beta.0"
58
58
  },
59
59
  "exports": {
60
60
  "./client": {
@@ -114,11 +114,11 @@
114
114
  "build": "tsup",
115
115
  "clean:build": "rimraf ./dist",
116
116
  "lint": "eslint .",
117
- "lint:ci": "eslint . --ext .ts,.tsx --format junit -o ../../reports/eslint-report-react.xml",
117
+ "lint:ci": "eslint . --format junit -o ./reports/eslint-report-react.xml",
118
118
  "lint:fix": "pnpm lint --fix",
119
119
  "prettier": "prettier --write .",
120
120
  "test": "vitest run",
121
- "test:ci": "vitest run --reporter=junit --outputFile=../../reports/vitest-report-react.xml",
121
+ "test:ci": "vitest run --reporter=junit --outputFile=./reports/vitest-report-react.xml",
122
122
  "typecheck": "tsc --noEmit",
123
123
  "createIndex": "node ./createIndex.mjs ./src"
124
124
  }
@@ -1,2 +0,0 @@
1
- import{A as w,D as H,F as D,G as x,H as E,I as P,J as k,K as B,L as b,V as n,f as l,h as J,j as p,k as c,l as m,m as u,n as f,r as y,u as S,v as I,w as h,x as M,y as g}from"./chunk-Y7ESITVO.js";import{i as C}from"./chunk-YG7XDCNV.js";import{d as R}from"./chunk-K3DTH6XN.js";import{a as s}from"./chunk-FW4363Y4.js";var G=s((rt,W)=>{"use strict";var ye=Object.prototype,Re=ye.hasOwnProperty;function Se(e,t){return e!=null&&Re.call(e,t)}W.exports=Se});var ge=s((at,_)=>{"use strict";var Ie=G(),he=J();function Me(e,t){return e!=null&&he(e,t,Ie)}_.exports=Me});var we=(e=[],t)=>{if(e.length>0)for(let o of e)o(t)};import{getContextPathServer as z}from"@beinformed/ui/settings";import{createBrowserHistory as $}from"history";var i=null,v=null;function U(){if(typeof window>"u")throw new Error("getBrowserHistory can only be used in a browser environment.");let e=z();return(!i||e!==v)&&(i=$({basename:e}),v=e),i}import{createAction as Q,createReducer as V}from"@reduxjs/toolkit";var X={location:void 0,action:void 0},Y=Q("ROUTER/LOCATION_CHANGE",(e,t)=>({payload:{location:e,action:t}})),F=V(X,e=>{e.addCase(Y,(t,o)=>{t.location=o.payload.location,t.action=o.payload.action})});import{ApplicationModel as Z}from"@beinformed/ui/models";import{createReducer as ee}from"@reduxjs/toolkit";var te={},oe=(e,t)=>{let{key:o,error:r}=t.payload;e[o]?(e[o].status="ERROR",e[o].lastModification=Date.now()):e[o]={model:void 0,status:"ERROR",lastModification:Date.now()},e[o].error=r},re=(e,t)=>{let{key:o,model:r}=t.payload;e[o]={model:r||void 0,lastModification:Date.now(),status:r?"FINISHED":"IDLE"}},ae=(e,t)=>{let{payload:o}=t;for(let{key:r,model:a}of o)e[r]={status:"FINISHED",lastModification:Date.now(),model:a}},O=(e,t)=>{let o=t.payload,r=Object.keys(e).find(a=>e[a]?.model?.connectKey===o.connectKey);r&&e[r]?(e[r].model=o,e[r].lastModification=Date.now(),e[r].status="FINISHED",e[r].error=void 0):console.debug(`ModularUIReducer: Cannot update model with key ${o.connectKey} - model not found in state.`)},ne=(e,t)=>{delete e[t.payload]},de=e=>{for(let t in e)e[t]?.model instanceof Z||delete e[t]},ie=(e,t)=>{let{key:o}=t.meta.arg;e[o]?(e[o].status="LOADING",e[o].lastModification=Date.now(),e[o].error=void 0):e[o]={model:void 0,status:"LOADING",lastModification:Date.now(),error:void 0}},se=(e,t)=>{let{key:o,model:r,updateHandler:a}=t.payload,d=r;a&&(d=a(r)),e[o]={model:d,lastModification:Date.now(),status:"FINISHED",error:void 0}},le=(e,t)=>{let{key:o}=t.meta.arg,r=t.payload;e[o]?(e[o].status="ERROR",e[o].lastModification=Date.now(),e[o].error=r):e[o]={model:void 0,status:"ERROR",lastModification:Date.now(),error:r}},T=ee(te,e=>{e.addCase(D,oe).addCase(x,re).addCase(E,ae).addCase(P,O).addCase(k,O).addCase(B,ne).addCase(b,de).addCase(n.pending,ie).addCase(n.fulfilled,se).addCase(n.rejected,le)});import{createReducer as pe}from"@reduxjs/toolkit";var ce={count:0,timestamp:0,percentComplete:0},A=e=>({...e,count:e.count+1}),L=e=>{let t=e.count-1===0;return{...e,count:e.count<=0?0:e.count-1,timestamp:t?Date.now():e.timestamp,percentComplete:t?0:e.percentComplete}},me=e=>({...e,count:0,timestamp:Date.now(),percentComplete:0}),j=pe(ce,e=>{e.addCase(c,A).addCase(m,L).addCase(u,t=>({...t,count:0})).addCase(f,(t,o)=>({...t,percentComplete:o.payload?.percentComplete})).addCase(n.pending,A).addCase(n.fulfilled,L).addCase(n.rejected,me)});var N=e=>t=>o=>r=>{if(S.match(r)){let{location:a,state:d}=r.payload;e.push(a,d)}else if(I.match(r)){let{location:a,state:d}=r.payload;e.replace(a,d)}else if(h.match(r)){let{delta:a}=r.payload;e.go(a)}else M.match(r)?e.goBack():g.match(r)&&e.goForward();return o(r)};import{combineReducers as K,configureStore as ue}from"@reduxjs/toolkit";var q={router:F,preferences:R,modularui:T,i18n:C,auth:l,error:w,modals:H,modelcatalog:p,notification:y,progressindicator:j},fe=K(q),tt=(e,t,o=U())=>{let r=t?K({...q,...t}):fe;return ue({reducer:r,middleware:a=>a({serializableCheck:!1}).concat(N(o)),preloadedState:e})};export{we as a,ge as b,U as c,Y as d,F as e,T as f,j as g,N as h,tt as i};
2
- //# sourceMappingURL=chunk-3OP2KQ56.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseHas.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/has.js","../src/redux/beforeRenderHooks.ts","../src/redux/router/browserHistory.ts","../src/redux/router/routerReducer.ts","../src/redux/modularui/modularuiReducer.ts","../src/redux/progressindicator/progressIndicatorReducer.ts","../src/redux/router/routerMiddleware.ts","../src/redux/store.ts"],"sourcesContent":["/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;\n","var baseHas = require('./_baseHas'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n","import type { HttpServletRequestJava } from \"../server/types\";\nimport type { BEIStore } from \"./store\";\n\nexport interface BeforeRenderHookProps {\n store: BEIStore;\n request?: HttpServletRequestJava;\n}\nexport type BeforeRenderHook = (props: BeforeRenderHookProps) => void;\n\n/**\n * Process handlers that need to be run before the react application starts,\n * for example to start a third party service<br>\n * An object with the store is available to make it possible to read state available in the redux store,\n * for example server preferences, and the request is available to retrieve request information\n *\n */\nexport const handleBeforeRenderHooks = (\n beforeRenderHooks: BeforeRenderHook[] = [],\n props: BeforeRenderHookProps,\n) => {\n if (beforeRenderHooks.length > 0) {\n for (const beforeRenderHook of beforeRenderHooks) {\n beforeRenderHook(props);\n }\n }\n};\n","// Assuming this utility is available\nimport { getContextPathServer } from \"@beinformed/ui/settings\";\nimport { createBrowserHistory } from \"history\";\n\nimport type { History as RouterHistory } from \"history\";\n\nlet browserHistoryInstance: RouterHistory | null = null; // Private variable to hold the instance\nlet historyContextPath: string | null = null;\n/**\n * Returns a singleton instance of the browser history.\n * Creates the instance on the first call.\n * This pattern is suitable for client-side applications.\n */\nexport function getBrowserHistory(): RouterHistory {\n if (typeof window === \"undefined\") {\n throw new Error(\n \"getBrowserHistory can only be used in a browser environment.\",\n );\n }\n\n const contextPathServer = getContextPathServer();\n if (!browserHistoryInstance || contextPathServer !== historyContextPath) {\n browserHistoryInstance = createBrowserHistory({\n basename: contextPathServer,\n });\n historyContextPath = contextPathServer;\n }\n return browserHistoryInstance;\n}\n","import { createAction, createReducer } from \"@reduxjs/toolkit\";\n\nimport type { Action, Location } from \"history\";\n\nexport type RouterLocation = Location<{ from?: string; modal?: boolean }>;\n\nexport interface RouterState {\n location: RouterLocation | undefined;\n action: Action | undefined;\n}\n\nconst initialState = { location: undefined, action: undefined };\n\nexport const locationChange = createAction(\n \"ROUTER/LOCATION_CHANGE\",\n (location: RouterLocation, action: Action) => {\n return {\n payload: {\n location,\n action,\n },\n };\n },\n);\n\nexport const routerReducer = createReducer<RouterState>(\n initialState,\n (builder) => {\n builder.addCase(locationChange, (state, action) => {\n state.location = action.payload.location;\n state.action = action.payload.action;\n });\n },\n);\n","import { ApplicationModel } from \"@beinformed/ui/models\";\nimport { createReducer } from \"@reduxjs/toolkit\";\n\nimport { MODULARUI_STATUS } from \"./constants\";\nimport { fetchModel } from \"./fetchModel\";\nimport {\n initModels,\n removeModelByKey,\n resetModularUI,\n setModel,\n updateErrorStatus,\n updateForm,\n updateModel,\n} from \"./modelActions\";\n\nimport type { WritableDraft } from \"immer\";\nimport type { ModelEntry } from \"./types\";\n\nexport type ModularUIState = Record<string, ModelEntry>;\n\ntype IntermediateState = WritableDraft<ModularUIState>;\n\nconst initialState: ModularUIState = {};\n\nconst handleUpdateErrorStatus = (\n state: IntermediateState,\n action: ReturnType<typeof updateErrorStatus>,\n) => {\n const { key, error } = action.payload;\n\n if (!state[key]) {\n state[key] = {\n model: undefined,\n status: MODULARUI_STATUS.ERROR,\n lastModification: Date.now(),\n };\n } else {\n state[key].status = MODULARUI_STATUS.ERROR;\n state[key].lastModification = Date.now();\n }\n // @ts-expect-error deep problem\n state[key].error = error;\n};\n\nconst handleSetModel = (\n state: IntermediateState,\n action: ReturnType<typeof setModel>,\n) => {\n const { key, model } = action.payload;\n // If model is null/undefined, this sets up an empty entry,\n // otherwise, it sets the model and marks as finished.\n state[key] = {\n model: model || undefined,\n lastModification: Date.now(),\n status: model ? MODULARUI_STATUS.FINISHED : MODULARUI_STATUS.IDLE,\n };\n};\n\nconst handleInitModel = (\n state: IntermediateState,\n action: ReturnType<typeof initModels>,\n) => {\n const { payload } = action;\n for (const { key, model } of payload) {\n state[key] = {\n status: MODULARUI_STATUS.FINISHED,\n lastModification: Date.now(),\n model,\n };\n }\n};\n\nconst handleUpdateModel = (\n state: IntermediateState,\n action: ReturnType<typeof updateModel | typeof updateForm>,\n) => {\n const model = action.payload;\n const modelKey = Object.keys(state).find(\n (key) => state[key]?.model?.connectKey === model.connectKey,\n );\n\n if (modelKey && state[modelKey]) {\n state[modelKey].model = model;\n state[modelKey].lastModification = Date.now();\n state[modelKey].status = MODULARUI_STATUS.FINISHED;\n state[modelKey].error = undefined; // Clear error on successful update\n } else {\n console.debug(\n `ModularUIReducer: Cannot update model with key ${model.connectKey} - model not found in state.`,\n );\n }\n};\n\nconst handleRemoveModelByKey = (\n state: IntermediateState,\n action: ReturnType<typeof removeModelByKey>,\n) => {\n delete state[action.payload];\n};\n\nconst handleResetModularUI = (state: IntermediateState) => {\n for (const key in state) {\n if (!(state[key]?.model instanceof ApplicationModel)) {\n delete state[key];\n }\n }\n};\n\nconst handleFetchModelPending = (\n state: IntermediateState,\n action: ReturnType<typeof fetchModel.pending>,\n) => {\n const { key } = action.meta.arg; // Access original thunk arguments\n if (!state[key]) {\n state[key] = {\n model: undefined,\n status: MODULARUI_STATUS.LOADING,\n lastModification: Date.now(),\n error: undefined, // Clear error when starting new load\n };\n } else {\n state[key].status = MODULARUI_STATUS.LOADING;\n state[key].lastModification = Date.now();\n state[key].error = undefined; // Clear error when starting new load\n }\n};\n\nconst handleFetchModelFulfilled = (\n state: IntermediateState,\n action: ReturnType<typeof fetchModel.fulfilled>,\n) => {\n const { key, model, updateHandler } = action.payload;\n let finalModel = model;\n\n if (updateHandler) {\n // Apply update handler if provided\n finalModel = updateHandler(model);\n }\n\n state[key] = {\n model: finalModel,\n lastModification: Date.now(),\n status: MODULARUI_STATUS.FINISHED,\n error: undefined, // Clear error on success\n };\n};\n\nconst handleFetchModelRejected = (\n state: IntermediateState,\n action: ReturnType<typeof fetchModel.rejected>,\n) => {\n const { key } = action.meta.arg;\n const error = action.payload;\n\n if (!state[key]) {\n state[key] = {\n model: undefined,\n status: MODULARUI_STATUS.ERROR,\n lastModification: Date.now(),\n error: error,\n };\n } else {\n state[key].status = MODULARUI_STATUS.ERROR;\n state[key].lastModification = Date.now();\n state[key].error = error;\n }\n};\n\nexport const modularUIReducer = createReducer<ModularUIState>(\n initialState,\n (builder) => {\n builder\n .addCase(updateErrorStatus, handleUpdateErrorStatus)\n .addCase(setModel, handleSetModel)\n .addCase(initModels, handleInitModel)\n .addCase(updateModel, handleUpdateModel)\n .addCase(updateForm, handleUpdateModel)\n .addCase(removeModelByKey, handleRemoveModelByKey)\n .addCase(resetModularUI, handleResetModularUI)\n .addCase(fetchModel.pending, handleFetchModelPending)\n .addCase(fetchModel.fulfilled, handleFetchModelFulfilled)\n .addCase(fetchModel.rejected, handleFetchModelRejected);\n },\n);\n","import { createReducer } from \"@reduxjs/toolkit\";\n\nimport { fetchModel } from \"../modularui/fetchModel\";\nimport {\n finishProgress,\n resetProgress,\n startProgress,\n updateProgress,\n} from \"./progressIndicatorActions\";\n\nimport type { WritableDraft } from \"immer\";\n\nexport interface ProgressIndicatorState {\n count: number;\n timestamp: number;\n percentComplete: number;\n}\n\ntype IntermediateState = WritableDraft<ProgressIndicatorState>;\n\nconst initialState = {\n count: 0,\n timestamp: 0,\n percentComplete: 0,\n};\n\nconst handleStartProgress = (state: IntermediateState) => {\n return {\n ...state,\n count: state.count + 1,\n };\n};\n\nconst handleEndProgress = (state: IntermediateState) => {\n const isFinalFinish = state.count - 1 === 0;\n return {\n ...state,\n count: state.count <= 0 ? 0 : state.count - 1,\n timestamp: isFinalFinish ? Date.now() : state.timestamp,\n percentComplete: isFinalFinish ? 0 : state.percentComplete,\n };\n};\n\nconst handleRejectedProgress = (state: IntermediateState) => {\n return {\n ...state,\n count: 0,\n timestamp: Date.now(),\n percentComplete: 0,\n };\n};\n\nexport const progressIndicatorReducer = createReducer<ProgressIndicatorState>(\n initialState,\n (builder) => {\n builder\n .addCase(startProgress, handleStartProgress)\n .addCase(finishProgress, handleEndProgress)\n .addCase(resetProgress, (state) => {\n return {\n ...state,\n count: 0,\n };\n })\n .addCase(updateProgress, (state, action) => {\n return {\n ...state,\n percentComplete: action.payload?.percentComplete,\n };\n })\n .addCase(fetchModel.pending, handleStartProgress)\n .addCase(fetchModel.fulfilled, handleEndProgress)\n .addCase(fetchModel.rejected, handleRejectedProgress);\n },\n);\n","// routerMiddleware.ts (updated based on your routerActions.ts)\n\nimport { go, goBack, goForward, push, replace } from \"./routerActions\"; // Correct path to routerActions.ts\n\nimport type { Middleware } from \"@reduxjs/toolkit\";\nimport type { History } from \"history\";\nimport type { RootState } from \"../store\";\n\nexport const routerMiddleware = (\n history: History,\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n): Middleware<{}, RootState> => {\n return (_storeApi) => (next) => (action: unknown) => {\n if (push.match(action)) {\n const { location, state } = action.payload; // TypeScript now knows 'action' is PushAction\n history.push(location, state);\n } else if (replace.match(action)) {\n const { location, state } = action.payload;\n history.replace(location, state);\n } else if (go.match(action)) {\n const { delta } = action.payload;\n history.go(delta);\n } else if (goBack.match(action)) {\n history.goBack();\n } else if (goForward.match(action)) {\n history.goForward();\n }\n\n return next(action);\n };\n};\n","import { combineReducers, configureStore } from \"@reduxjs/toolkit\";\n\nimport { authReducer } from \"./auth/authReducer\";\nimport { errorReducer } from \"./error/errorReducer\";\nimport { i18nReducer } from \"./i18n/i18nReducer\";\nimport { modalsReducer } from \"./modals/modalsReducer\";\nimport { modelCatalogReducer } from \"./modelcatalog/modelCatalogReducer\";\nimport { modularUIReducer } from \"./modularui/modularuiReducer\";\nimport { notificationReducer } from \"./notifications/notificationReducer\";\nimport { preferencesReducer } from \"./preferences/preferencesReducer\";\nimport { progressIndicatorReducer } from \"./progressindicator/progressIndicatorReducer\";\nimport { getBrowserHistory } from \"./router/browserHistory\";\nimport { routerMiddleware } from \"./router/routerMiddleware\";\nimport { routerReducer } from \"./router/routerReducer\";\n\nimport type { Reducer } from \"@reduxjs/toolkit\";\n\nconst reducers = {\n router: routerReducer,\n preferences: preferencesReducer,\n modularui: modularUIReducer,\n i18n: i18nReducer,\n auth: authReducer,\n error: errorReducer,\n modals: modalsReducer,\n modelcatalog: modelCatalogReducer,\n notification: notificationReducer,\n progressindicator: progressIndicatorReducer,\n};\nconst rootReducers = combineReducers(reducers);\n\nexport const setupStore = (\n preloadedState?: Partial<RootState>,\n customReducers?: Record<string, Reducer> | null,\n history = getBrowserHistory(),\n) => {\n const reducer = customReducers\n ? combineReducers({ ...reducers, ...customReducers })\n : rootReducers;\n\n return configureStore({\n reducer,\n middleware: (getDefaultMiddleware) =>\n getDefaultMiddleware({\n serializableCheck: false,\n }).concat(routerMiddleware(history)),\n preloadedState,\n });\n};\n\nexport type BEIStore = ReturnType<typeof setupStore>;\nexport type RootState = ReturnType<typeof rootReducers>;\nexport type BEIDispatch = BEIStore[\"dispatch\"];\n"],"mappings":"0TAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cACA,IAAIC,GAAc,OAAO,UAGrBC,GAAiBD,GAAY,eAUjC,SAASE,GAAQC,EAAQC,EAAK,CAC5B,OAAOD,GAAU,MAAQF,GAAe,KAAKE,EAAQC,CAAG,CAC1D,CAEAL,EAAO,QAAUG,KClBjB,IAAAG,GAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,GAAU,IACVC,GAAU,IA6Bd,SAASC,GAAIC,EAAQC,EAAM,CACzB,OAAOD,GAAU,MAAQF,GAAQE,EAAQC,EAAMJ,EAAO,CACxD,CAEAD,EAAO,QAAUG,KClBV,IAAMG,GAA0B,CACrCC,EAAwC,CAAC,EACzCC,IACG,CACH,GAAID,EAAkB,OAAS,EAC7B,QAAWE,KAAoBF,EAC7BE,EAAiBD,CAAK,CAG5B,ECxBA,OAAS,wBAAAE,MAA4B,0BACrC,OAAS,wBAAAC,MAA4B,UAIrC,IAAIC,EA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AGZ,EAAU,GAAGe,CAAe,CAAC,EAClDJ,GAEJ,OAAOQ,GAAe,CACpB,QAAAD,EACA,WAAaE,GACXA,EAAqB,CACnB,kBAAmB,EACrB,CAAC,EAAE,OAAOC,EAAiBL,CAAO,CAAC,EACrC,eAAAF,CACF,CAAC,CACH","names":["require_baseHas","__commonJSMin","exports","module","objectProto","hasOwnProperty","baseHas","object","key","require_has","__commonJSMin","exports","module","baseHas","hasPath","has","object","path","handleBeforeRenderHooks","beforeRenderHooks","props","beforeRenderHook","getContextPathServer","createBrowserHistory","browserHistoryInstance","historyContextPath","getBrowserHistory","contextPathServer","createAction","createReducer","initialState","locationChange","location","action","routerReducer","builder","state","ApplicationModel","createReducer","initialState","handleUpdateErrorStatus","state","action","key","error","handleSetModel","model","handleInitModel","payload","handleUpdateModel","modelKey","handleRemoveModelByKey","handleResetModularUI","ApplicationModel","handleFetchModelPending","handleFetchModelFulfilled","updateHandler","finalModel","handleFetchModelRejected","modularUIReducer","createReducer","builder","updateErrorStatus","setModel","initModels","updateModel","updateForm","removeModelByKey","resetModularUI","fetchModel","createReducer","initialState","handleStartProgress","state","handleEndProgress","isFinalFinish","handleRejectedProgress","progressIndicatorReducer","createReducer","builder","startProgress","finishProgress","resetProgress","updateProgress","action","fetchModel","routerMiddleware","history","_storeApi","next","action","push","location","state","replace","go","delta","goBack","goForward","combineReducers","configureStore","reducers","routerReducer","preferencesReducer","modularUIReducer","i18nReducer","authReducer","errorReducer","modalsReducer","modelCatalogReducer","notificationReducer","progressIndicatorReducer","rootReducers","combineReducers","setupStore","preloadedState","customReducers","history","getBrowserHistory","reducer","configureStore","getDefaultMiddleware","routerMiddleware"]}
@@ -1,2 +0,0 @@
1
- import{f as r}from"./chunk-K3DTH6XN.js";var c=i=>{let o=null,e=preferencesProvider.getLayoutConfigFileLocation();if(typeof e=="string"){let t=e.startsWith("/")?`/resource${e}`:`/resource/${e}`;if(o=dataFetcher.fetch(t),o)i.dispatch(r(o));else throw new Error(`Could not read theme configuration file from: ${t}`)}};export{c as a};
2
- //# sourceMappingURL=chunk-4AC7YQ5Q.js.map
@@ -1 +0,0 @@
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 let configTheme = null;\n\n const configFileLocation = preferencesProvider.getLayoutConfigFileLocation();\n if (typeof configFileLocation === \"string\") {\n const configFilePath = configFileLocation.startsWith(\"/\")\n ? `/resource${configFileLocation}`\n : `/resource/${configFileLocation}`;\n\n 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,IAAIC,EAAc,KAEZC,EAAqB,oBAAoB,4BAA4B,EAC3E,GAAI,OAAOA,GAAuB,SAAU,CAC1C,IAAMC,EAAiBD,EAAmB,WAAW,GAAG,EACpD,YAAYA,CAAkB,GAC9B,aAAaA,CAAkB,GAInC,GAFAD,EAAc,YAAY,MAAME,CAAc,EAE1CF,EACFD,EAAM,SAASI,EAAmBH,CAAW,CAAC,MAE9C,OAAM,IAAI,MACR,iDAAiDE,CAAc,EACjE,CAEJ,CACF","names":["setConfigurationTheme","store","configTheme","configFileLocation","configFilePath","setThemePreference"]}
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-FW4363Y4.js";var C=a((ra,b)=>{"use strict";var Xe=typeof global=="object"&&global&&global.Object===Object&&global;b.exports=Xe});var v=a((aa,S)=>{"use strict";var Qe=C(),We=typeof self=="object"&&self&&self.Object===Object&&self,Ye=Qe||We||Function("return this")();S.exports=Ye});var d=a((oa,O)=>{"use strict";var Ze=v(),ke=Ze.Symbol;O.exports=ke});var w=a((ia,T)=>{"use strict";var j=d(),m=Object.prototype,et=m.hasOwnProperty,tt=m.toString,p=j?j.toStringTag:void 0;function rt(e){var t=et.call(e,p),r=e[p];try{e[p]=void 0;var o=!0}catch{}var u=tt.call(e);return o&&(t?e[p]=r:delete e[p]),u}T.exports=rt});var I=a((na,D)=>{"use strict";var at=Object.prototype,ot=at.toString;function it(e){return ot.call(e)}D.exports=it});var H=a((sa,z)=>{"use strict";var P=d(),nt=w(),st=I(),ut="[object Null]",ct="[object Undefined]",E=P?P.toStringTag:void 0;function pt(e){return e==null?e===void 0?ct:ut:E&&E in Object(e)?nt(e):st(e)}z.exports=pt});var _=a((ua,M)=>{"use strict";function ht(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}M.exports=ht});var F=a((ca,N)=>{"use strict";var lt=H(),ft=_(),vt="[object AsyncFunction]",dt="[object Function]",_t="[object GeneratorFunction]",gt="[object Proxy]";function xt(e){if(!ft(e))return!1;var t=lt(e);return t==dt||t==_t||t==vt||t==gt}N.exports=xt});var R=a((pa,G)=>{"use strict";var yt=v(),qt=yt["__core-js_shared__"];G.exports=qt});var A=a((ha,$)=>{"use strict";var g=R(),B=function(){var e=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function bt(e){return!!B&&B in e}$.exports=bt});var K=a((la,U)=>{"use strict";var Ct=Function.prototype,St=Ct.toString;function Ot(e){if(e!=null){try{return St.call(e)}catch{}try{return e+""}catch{}}return""}U.exports=Ot});var L=a((fa,J)=>{"use strict";var jt=F(),mt=A(),Tt=_(),wt=K(),Dt=/[\\^$.*+?()[\]{}|]/g,It=/^\[object .+?Constructor\]$/,Pt=Function.prototype,Et=Object.prototype,zt=Pt.toString,Ht=Et.hasOwnProperty,Mt=RegExp("^"+zt.call(Ht).replace(Dt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Nt(e){if(!Tt(e)||mt(e))return!1;var t=jt(e)?Mt:It;return t.test(wt(e))}J.exports=Nt});var X=a((va,V)=>{"use strict";function Ft(e,t){return e?.[t]}V.exports=Ft});var x=a((da,Q)=>{"use strict";var Gt=L(),Rt=X();function Bt(e,t){var r=Rt(e,t);return Gt(r)?r:void 0}Q.exports=Bt});var h=a((_a,W)=>{"use strict";var $t=x(),At=$t(Object,"create");W.exports=At});var k=a((ga,Z)=>{"use strict";var Y=h();function Ut(){this.__data__=Y?Y(null):{},this.size=0}Z.exports=Ut});var te=a((xa,ee)=>{"use strict";function Kt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}ee.exports=Kt});var ae=a((ya,re)=>{"use strict";var Jt=h(),Lt="__lodash_hash_undefined__",Vt=Object.prototype,Xt=Vt.hasOwnProperty;function Qt(e){var t=this.__data__;if(Jt){var r=t[e];return r===Lt?void 0:r}return Xt.call(t,e)?t[e]:void 0}re.exports=Qt});var ie=a((qa,oe)=>{"use strict";var Wt=h(),Yt=Object.prototype,Zt=Yt.hasOwnProperty;function kt(e){var t=this.__data__;return Wt?t[e]!==void 0:Zt.call(t,e)}oe.exports=kt});var se=a((ba,ne)=>{"use strict";var er=h(),tr="__lodash_hash_undefined__";function rr(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=er&&t===void 0?tr:t,this}ne.exports=rr});var ce=a((Ca,ue)=>{"use strict";var ar=k(),or=te(),ir=ae(),nr=ie(),sr=se();function i(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}i.prototype.clear=ar;i.prototype.delete=or;i.prototype.get=ir;i.prototype.has=nr;i.prototype.set=sr;ue.exports=i});var he=a((Sa,pe)=>{"use strict";function ur(){this.__data__=[],this.size=0}pe.exports=ur});var fe=a((Oa,le)=>{"use strict";function cr(e,t){return e===t||e!==e&&t!==t}le.exports=cr});var l=a((ja,ve)=>{"use strict";var pr=fe();function hr(e,t){for(var r=e.length;r--;)if(pr(e[r][0],t))return r;return-1}ve.exports=hr});var _e=a((ma,de)=>{"use strict";var lr=l(),fr=Array.prototype,vr=fr.splice;function dr(e){var t=this.__data__,r=lr(t,e);if(r<0)return!1;var o=t.length-1;return r==o?t.pop():vr.call(t,r,1),--this.size,!0}de.exports=dr});var xe=a((Ta,ge)=>{"use strict";var _r=l();function gr(e){var t=this.__data__,r=_r(t,e);return r<0?void 0:t[r][1]}ge.exports=gr});var qe=a((wa,ye)=>{"use strict";var xr=l();function yr(e){return xr(this.__data__,e)>-1}ye.exports=yr});var Ce=a((Da,be)=>{"use strict";var qr=l();function br(e,t){var r=this.__data__,o=qr(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}be.exports=br});var Oe=a((Ia,Se)=>{"use strict";var Cr=he(),Sr=_e(),Or=xe(),jr=qe(),mr=Ce();function n(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}n.prototype.clear=Cr;n.prototype.delete=Sr;n.prototype.get=Or;n.prototype.has=jr;n.prototype.set=mr;Se.exports=n});var me=a((Pa,je)=>{"use strict";var Tr=x(),wr=v(),Dr=Tr(wr,"Map");je.exports=Dr});var De=a((Ea,we)=>{"use strict";var Te=ce(),Ir=Oe(),Pr=me();function Er(){this.size=0,this.__data__={hash:new Te,map:new(Pr||Ir),string:new Te}}we.exports=Er});var Pe=a((za,Ie)=>{"use strict";function zr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}Ie.exports=zr});var f=a((Ha,Ee)=>{"use strict";var Hr=Pe();function Mr(e,t){var r=e.__data__;return Hr(t)?r[typeof t=="string"?"string":"hash"]:r.map}Ee.exports=Mr});var He=a((Ma,ze)=>{"use strict";var Nr=f();function Fr(e){var t=Nr(this,e).delete(e);return this.size-=t?1:0,t}ze.exports=Fr});var Ne=a((Na,Me)=>{"use strict";var Gr=f();function Rr(e){return Gr(this,e).get(e)}Me.exports=Rr});var Ge=a((Fa,Fe)=>{"use strict";var Br=f();function $r(e){return Br(this,e).has(e)}Fe.exports=$r});var Be=a((Ga,Re)=>{"use strict";var Ar=f();function Ur(e,t){var r=Ar(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}Re.exports=Ur});var Ae=a((Ra,$e)=>{"use strict";var Kr=De(),Jr=He(),Lr=Ne(),Vr=Ge(),Xr=Be();function s(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}s.prototype.clear=Kr;s.prototype.delete=Jr;s.prototype.get=Lr;s.prototype.has=Vr;s.prototype.set=Xr;$e.exports=s});var Wr=a((Ba,Ke)=>{"use strict";var Ue=Ae(),Qr="Expected a function";function y(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Qr);var r=function(){var o=arguments,u=t?t.apply(this,o):o[0],c=r.cache;if(c.has(u))return c.get(u);var q=e.apply(this,o);return r.cache=c.set(u,q)||c,q};return r.cache=new(y.Cache||Ue),r}y.Cache=Ue;Ke.exports=y});import{useDispatch as Je,useSelector as Le,useStore as Ve}from"react-redux";var Zr=Je.withTypes(),kr=Le.withTypes(),ea=Ve.withTypes();export{v as a,d as b,H as c,_ as d,x as e,fe as f,Wr as g,Zr as h,kr as i,ea as j};
2
- //# sourceMappingURL=chunk-6KRECIRI.js.map
@@ -1,2 +0,0 @@
1
- var r=(t,n="Component",e)=>{let o=t.displayName||t.name||n;return e?`${o}[${e}]`:o},p=t=>n=>{t.forEach(e=>{typeof e=="function"?e(n):e!=null&&typeof e=="object"&&(e.current=n)})};export{r as a,p as b};
2
- //# sourceMappingURL=chunk-AMFWIR2R.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/utils.ts"],"sourcesContent":["import type { ComponentType, Ref } from \"react\";\n\nexport const getDisplayName = (\n WrappedComponent: ComponentType<never>,\n defaultName = \"Component\",\n contextId?: string,\n) => {\n const componentName =\n WrappedComponent.displayName || WrappedComponent.name || defaultName;\n\n if (contextId) {\n return `${componentName}[${contextId}]`;\n }\n\n return componentName;\n};\n\nexport const mergeRefs =\n <T>(refs: Ref<T>[]): Ref<T> =>\n (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref != null && typeof ref === \"object\") {\n (ref as { current: T | null }).current = value;\n }\n });\n };\n"],"mappings":"AAEO,IAAMA,EAAiB,CAC5BC,EACAC,EAAc,YACdC,IACG,CACH,IAAMC,EACJH,EAAiB,aAAeA,EAAiB,MAAQC,EAE3D,OAAIC,EACK,GAAGC,CAAa,IAAID,CAAS,IAG/BC,CACT,EAEaC,EACPC,GACHC,GAAU,CACTD,EAAK,QAASE,GAAQ,CAChB,OAAOA,GAAQ,WACjBA,EAAID,CAAK,EACAC,GAAO,MAAQ,OAAOA,GAAQ,WACtCA,EAA8B,QAAUD,EAE7C,CAAC,CACH","names":["getDisplayName","WrappedComponent","defaultName","contextId","componentName","mergeRefs","refs","value","ref"]}
@@ -1,2 +0,0 @@
1
- import{b as P}from"./chunk-MT7D3AJU.js";import{b as u}from"./chunk-VFLYA5WJ.js";import{a as h,c as l,d as S,i as _}from"./chunk-3OP2KQ56.js";import{a as s,i as d,t as y,v as w}from"./chunk-Y7ESITVO.js";import{a as T,b}from"./chunk-DI7VM62A.js";import{g as E,h as g,i as R}from"./chunk-K3DTH6XN.js";import{getContextPathModularUI as k,getStringSetting as B,setSetting as F,setSettings as H}from"@beinformed/ui/settings";import{Cache as a,xhr as D}from"@beinformed/ui/utils";import{createRoot as A,hydrateRoot as L}from"react-dom/client";import{HelmetProvider as x}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 f=({store:o,routerHistory:e,theme:t,children:r,ErrorFallbackComponent:i})=>p(C,{store:o,children:p(b,{theme:t,children:p(x,{children:p(P,{FallbackComponent:i,children:p(I,{history:e,children:r})})})})});f.displayName="BEI.Init";import{jsx as q}from"react/jsx-runtime";var M=o=>{window.onunhandledrejection=e=>e.reason?setImmediate(()=>{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(t,e)},v=o=>{let t=new URLSearchParams(window.location.search).get("redirectURI");t&&D({url:`${k()}${t}`}).catch(r=>{if(r.id==="UnauthorizedException"||r.id==="Error.NotAuthorized"||r.id==="Error.Authentication.Required"||r.id==="Error.Authentication.InvalidCredentials"){let i=B("LOGIN_PATH","/signin");o.dispatch(w(i,{from:{pathname:t},modal:!1}))}})},U=o=>{if(typeof window<"u"){let e=new URLSearchParams(window.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=window.contextPath;if(typeof i<"u")F("CONTEXT_PATH",i);else throw new Error("Missing contextPath on window object");r&&H(r),a.clear("^res:");let n=_(u(),o);return N(n.getState(),t),v(n),U(n),E(n.getState()),R(n.getState()),g(n.getState()),a.loadOtherBrowserTabs(()=>{a.getItem("auth")&&n.dispatch(s())}),a.getItem("auth")&&n.dispatch(s()),l().listen((m,c)=>{n.dispatch(S(m,c))}),M(n),document.body&&(document.body.className="js"),e&&h(e,{store:n}),{store:n}},j=(o,e,t,r,i)=>{window.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(f,{store:o,routerHistory:l(),theme:r,ErrorFallbackComponent:i,children:e()}))})},O=(o,e)=>{o.querySelector(".application")?L(o,e):A(o).render(e)},le=({customReducers:o,theme:e,settings:t,render:r,beforeRenderHooks:i,ErrorFallbackComponent:n,mount:m})=>{let{store:c}=W(o,i,t);j(c,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{f as a,M as b,U as c,W as d,j as e,le as f};
2
- //# sourceMappingURL=chunk-B7PQLTVC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/client/client.tsx","../src/client/Init.tsx","../src/client/contextPath.ts"],"sourcesContent":["import {\n getContextPathModularUI,\n getStringSetting,\n setSetting,\n setSettings,\n} from \"@beinformed/ui/settings\";\nimport { Cache, xhr } from \"@beinformed/ui/utils\";\nimport { createRoot, hydrateRoot } from \"react-dom/client\";\n\nimport { loginSuccess } from \"../redux/auth/authReducer\";\nimport { handleBeforeRenderHooks } from \"../redux/beforeRenderHooks\";\nimport { getDataFromServer } from \"../redux/dataFromServer\";\nimport { updateEntryDate } from \"../redux/modelcatalog/modelCatalogReducer\";\nimport { showXHRErrorNotification } from \"../redux/notifications/notificationActions\";\nimport {\n setAllContentInDataSetting,\n setDateTimeSettings,\n setLoginPreferences,\n} from \"../redux/preferences/preferencesActions\";\nimport { getBrowserHistory } from \"../redux/router/browserHistory\";\nimport { replace } from \"../redux/router/routerActions\";\nimport { locationChange } from \"../redux/router/routerReducer\";\nimport { setupStore } from \"../redux/store\";\nimport { createTheme } from \"../theme/createTheme\";\nimport { Init } from \"./Init\";\n\nimport type { Setting } from \"@beinformed/ui/settings\";\nimport type { Reducer } from \"@reduxjs/toolkit\";\nimport type { ComponentType, ElementType, ReactElement } from \"react\";\nimport type { ErrorBoundaryFallbackProps } from \"../components/ErrorBoundaryFallback\";\nimport type { BeforeRenderHook } from \"../redux/beforeRenderHooks\";\nimport type { RouterLocation } from \"../redux/router/routerReducer\";\nimport type { BEIStore, RootState } from \"../redux/store\";\nimport type { Theme } from \"../theme/types\";\nimport type { WindowWithContext } from \"./types\";\n\ntype RenderFunction = () => ReactElement<ElementType>;\ntype MountFunction = (\n applicationNode: Element,\n element: ReactElement<ElementType>,\n) => void;\n\ninterface Props {\n customReducers?: Record<string, Reducer>;\n theme?: Theme | Theme[];\n settings?: Record<string, Setting>;\n render: RenderFunction;\n mount: MountFunction;\n beforeRenderHooks?: BeforeRenderHook[];\n ErrorFallbackComponent?: ComponentType<ErrorBoundaryFallbackProps>;\n}\n\nexport const setUnhandledRejectionEvent = (store: BEIStore) => {\n window.onunhandledrejection = (event: PromiseRejectionEvent) => {\n if (event.reason) {\n return setImmediate(() => {\n const errorMessage =\n event.reason.message.toString() || String(event.reason);\n\n store.dispatch(showXHRErrorNotification(errorMessage));\n throw event.reason;\n });\n }\n\n return event;\n };\n};\n\nconst initThemeSettings = (state: RootState, theme?: Theme | Theme[]) => {\n const storedTheme = state.preferences.theme;\n createTheme(storedTheme, theme); // on theme creation, the settings are set\n};\n\n/**\n * The redirectURI querystring parameter is available when the server is redirecting an unauthorized deep link\n * @param store\n */\nconst handleRedirectURI = (store: BEIStore) => {\n const urlParams = new URLSearchParams(window.location.search);\n const redirectURI = urlParams.get(\"redirectURI\");\n if (redirectURI) {\n xhr({ url: `${getContextPathModularUI()}${redirectURI}` }).catch((e) => {\n if (\n e.id === \"UnauthorizedException\" ||\n e.id === \"Error.NotAuthorized\" ||\n e.id === \"Error.Authentication.Required\" ||\n e.id === \"Error.Authentication.InvalidCredentials\"\n ) {\n const LOGIN_PATH = getStringSetting(\"LOGIN_PATH\", \"/signin\");\n store.dispatch(\n replace(LOGIN_PATH, {\n from: { pathname: redirectURI },\n modal: false,\n }),\n );\n }\n });\n }\n};\n\nexport const setModelCatalogEntryDate = (store: BEIStore) => {\n if (typeof window !== \"undefined\") {\n const entryDateFromUrl = new URLSearchParams(window.location?.search).get(\n \"entryDate\",\n );\n if (entryDateFromUrl) {\n store.dispatch(updateEntryDate(entryDateFromUrl));\n } else if (Cache.hasItem(\"ModelCatalogEntryDate\")) {\n const entryDate = Cache.getItem(\"ModelCatalogEntryDate\") as string;\n store.dispatch(updateEntryDate(entryDate));\n }\n }\n};\n\nexport const setupClient = (\n customReducers?: Record<string, Reducer>,\n beforeRenderHooks?: BeforeRenderHook[],\n theme?: Theme | Theme[],\n settings?: Record<string, Setting>,\n) => {\n const contextPath = (window as WindowWithContext).contextPath;\n\n if (typeof contextPath !== \"undefined\") {\n setSetting(\"CONTEXT_PATH\", contextPath);\n } else {\n throw new Error(\"Missing contextPath on window object\");\n }\n\n if (settings) {\n setSettings(settings);\n }\n\n // remove all resources from cache\n Cache.clear(\"^res:\");\n\n const reduxStore = setupStore(getDataFromServer(), customReducers);\n\n initThemeSettings(reduxStore.getState(), theme);\n\n handleRedirectURI(reduxStore);\n setModelCatalogEntryDate(reduxStore);\n\n setAllContentInDataSetting(reduxStore.getState());\n setLoginPreferences(reduxStore.getState());\n setDateTimeSettings(reduxStore.getState());\n\n // load existing cache from other browser tabs\n Cache.loadOtherBrowserTabs(() => {\n if (Cache.getItem(\"auth\")) {\n reduxStore.dispatch(loginSuccess());\n }\n });\n\n if (Cache.getItem(\"auth\")) {\n reduxStore.dispatch(loginSuccess());\n }\n\n // listen to history change and update the redux router store\n getBrowserHistory().listen((location, action) => {\n reduxStore.dispatch(locationChange(location as RouterLocation, action));\n });\n\n setUnhandledRejectionEvent(reduxStore);\n\n if (document.body) {\n document.body.className = \"js\";\n }\n\n if (beforeRenderHooks) {\n handleBeforeRenderHooks(beforeRenderHooks, { store: reduxStore });\n }\n\n return { store: reduxStore };\n};\n\nexport const addContentLoadedEvent = (\n store: BEIStore,\n render: RenderFunction,\n mount: MountFunction,\n theme?: Theme | Theme[],\n ErrorFallbackComponent?: ComponentType<ErrorBoundaryFallbackProps>,\n) => {\n window.addEventListener(\"DOMContentLoaded\", () => {\n const applicationNode = document.querySelector(\"#application\");\n if (!applicationNode) {\n throw new Error(\n \"No DOM element with id application found to attach client to\",\n );\n }\n\n mount(\n applicationNode,\n <Init\n store={store}\n routerHistory={getBrowserHistory()}\n theme={theme}\n ErrorFallbackComponent={ErrorFallbackComponent}\n >\n {render()}\n </Init>,\n );\n });\n};\n\nconst mountClient = (\n applicationNode: Element,\n element: ReactElement<ElementType>,\n) => {\n const isSSR = applicationNode.querySelector(\".application\");\n if (isSSR) {\n hydrateRoot(applicationNode, element);\n } else {\n const root = createRoot(applicationNode);\n root.render(element);\n }\n};\n\n/**\n * Mount the webapplication to the DOM, setup redux store and caches, add unhandledRejectionEvent, used client side when JavaScript is enabled.\n */\nexport const client = ({\n customReducers,\n theme,\n settings,\n render,\n beforeRenderHooks,\n ErrorFallbackComponent,\n mount,\n}: Props) => {\n const { store } = setupClient(customReducers, beforeRenderHooks, settings);\n\n addContentLoadedEvent(\n store,\n render,\n mount ?? mountClient,\n theme,\n ErrorFallbackComponent,\n );\n};\n","import { HelmetProvider } from \"@dr.pogodin/react-helmet\";\nimport { Provider } from \"react-redux\";\nimport { Router } from \"react-router\";\n\nimport { ErrorBoundary } from \"../components/ErrorBoundary\";\nimport { ThemeProvider } from \"../theme/ThemeProvider\";\n\nimport type { History as RouterHistory } from \"history\";\nimport type { ComponentType, ReactNode } from \"react\";\nimport type { ErrorBoundaryFallbackProps } from \"../components/ErrorBoundaryFallback\";\nimport type { BEIStore } from \"../redux/store\";\nimport type { Theme } from \"../theme/types\";\n\ninterface Props {\n store: BEIStore;\n routerHistory: RouterHistory;\n theme?: Theme | Theme[];\n children: ReactNode;\n ErrorFallbackComponent?: ComponentType<ErrorBoundaryFallbackProps>;\n}\n\nexport const Init = ({\n store,\n routerHistory,\n theme,\n children,\n ErrorFallbackComponent,\n}: Props): ReactNode => (\n <Provider store={store}>\n <ThemeProvider theme={theme}>\n <HelmetProvider>\n <ErrorBoundary FallbackComponent={ErrorFallbackComponent}>\n <Router history={routerHistory}>{children}</Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </Provider>\n);\n\nInit.displayName = \"BEI.Init\";\n","import type { WindowWithContext } from \"./types\";\n\ndeclare let __webpack_public_path__: string;\ndeclare let __webpack_nonce__: string;\n\n(function x() {\n const dataElement = document.querySelector(\n 'script[type=\"application/json\"][data-app-state=\"app-json\"]',\n );\n if (!dataElement) {\n throw new Error(\n \"Error finding script with attribute app-json to retrieve context path in html\",\n );\n }\n\n const contextPath = dataElement.getAttribute(\"data-app-contextpath\");\n if (contextPath) {\n (window as WindowWithContext).contextPath = contextPath;\n }\n\n if (typeof __webpack_public_path__ !== \"undefined\") {\n const filePath = dataElement.getAttribute(\"data-app-filepath\");\n if (filePath && filePath !== \"{FILEPATH}\") {\n __webpack_public_path__ = `${filePath}/`; // NOSONAR\n } else if (contextPath) {\n __webpack_public_path__ = `${contextPath}/`; // NOSONAR\n }\n }\n\n const nonce = dataElement.getAttribute(\"data-app-nonce\");\n if (nonce) {\n __webpack_nonce__ = nonce; // NOSONAR\n }\n})();\n\nexport {};\n"],"mappings":"0SAAA,OACE,2BAAAA,EACA,oBAAAC,EACA,cAAAC,EACA,eAAAC,MACK,0BACP,OAAS,SAAAC,EAAO,OAAAC,MAAW,uBAC3B,OAAS,cAAAC,EAAY,eAAAC,MAAmB,mBCPxC,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,YAAAC,MAAgB,cACzB,OAAS,UAAAC,MAAc,eA8Bb,cAAAC,MAAA,oBAXH,IAAMC,EAAO,CAAC,CACnB,MAAAC,EACA,cAAAC,EACA,MAAAC,EACA,SAAAC,EACA,uBAAAC,CACF,IACEN,EAACO,EAAA,CAAS,MAAOL,EACf,SAAAF,EAACQ,EAAA,CAAc,MAAOJ,EACpB,SAAAJ,EAACS,EAAA,CACC,SAAAT,EAACU,EAAA,CAAc,kBAAmBJ,EAChC,SAAAN,EAACW,EAAA,CAAO,QAASR,EAAgB,SAAAE,EAAS,EAC5C,EACF,EACF,EACF,EAGFJ,EAAK,YAAc,WDyJb,cAAAW,MAAA,oBA5IC,IAAMC,EAA8BC,GAAoB,CAC7D,OAAO,qBAAwBC,GACzBA,EAAM,OACD,aAAa,IAAM,CACxB,IAAMC,EACJD,EAAM,OAAO,QAAQ,SAAS,GAAK,OAAOA,EAAM,MAAM,EAExD,MAAAD,EAAM,SA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ACA0C,EACAC,GAASI,EACTzC,EACAsC,CACF,CACF,GEzOC,UAAa,CACZ,IAAMQ,EAAc,SAAS,cAC3B,4DACF,EACA,GAAI,CAACA,EACH,MAAM,IAAI,MACR,+EACF,EAGF,IAAMC,EAAcD,EAAY,aAAa,sBAAsB,EAKnE,GAJIC,IACD,OAA6B,YAAcA,GAG1C,OAAO,wBAA4B,IAAa,CAClD,IAAMC,EAAWF,EAAY,aAAa,mBAAmB,EACzDE,GAAYA,IAAa,aAC3B,wBAA0B,GAAGA,CAAQ,IAC5BD,IACT,wBAA0B,GAAGA,CAAW,IAE5C,CAEA,IAAME,EAAQH,EAAY,aAAa,gBAAgB,EACnDG,IACF,kBAAoBA,EAExB,GAAG","names":["getContextPathModularUI","getStringSetting","setSetting","setSettings","Cache","xhr","createRoot","hydrateRoot","HelmetProvider","Provider","Router","jsx","Init","store","routerHistory","theme","children","ErrorFallbackComponent","Provider","ThemeProvider","HelmetProvider","ErrorBoundary","Router","jsx","setUnhandledRejectionEvent","store","event","errorMessage","showXHRErrorNotification","initThemeSettings","state","theme","storedTheme","createTheme","handleRedirectURI","redirectURI","xhr","getContextPathModularUI","e","LOGIN_PATH","getStringSetting","replace","setModelCatalogEntryDate","entryDateFromUrl","updateEntryDate","Cache","entryDate","setupClient","customReducers","beforeRenderHooks","settings","contextPath","setSetting","setSettings","reduxStore","setupStore","getDataFromServer","setAllContentInDataSetting","setLoginPreferences","setDateTimeSettings","loginSuccess","getBrowserHistory","location","action","locationChange","handleBeforeRenderHooks","addContentLoadedEvent","render","mount","ErrorFallbackComponent","applicationNode","Init","mountClient","element","hydrateRoot","createRoot","client","dataElement","contextPath","filePath","nonce"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/flattenDeep.js","../src/theme/createTheme.ts","../src/theme/ThemeProvider.tsx"],"sourcesContent":["var baseFlatten = require('./_baseFlatten');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n}\n\nmodule.exports = flattenDeep;\n","import { setSettings } from \"@beinformed/ui/settings\";\nimport flattenDeep from \"lodash/flattenDeep\";\nimport isPlainObject from \"lodash/isPlainObject\";\n\nimport type { DefaultTheme } from \"styled-components\";\n\nconst replacePlaceholders = (inputTheme: DefaultTheme): DefaultTheme => {\n const possibleKeys = Object.keys(inputTheme)\n .map((key) => `\\\\b${key}\\\\b`)\n .join(\"|\");\n\n const re = new RegExp(`\\\\$(${possibleKeys})`, \"g\");\n Object.entries(inputTheme).forEach(([key, value]) => {\n if (key !== \"settings\" && typeof value === \"string\") {\n inputTheme[key] = value.replace(re, (match, capture) => {\n const replacement = inputTheme[capture];\n return typeof replacement === \"string\" ? replacement : match;\n });\n }\n });\n\n return inputTheme;\n};\n\nconst generateTheme = (\n storedTheme: DefaultTheme | null | undefined,\n ...themeElements: (DefaultTheme | ((theme: DefaultTheme) => DefaultTheme))[]\n): DefaultTheme => {\n const storedSettings = storedTheme?.settings ?? {};\n\n let generatedTheme: DefaultTheme = { settings: {} };\n\n for (const element of themeElements) {\n if (typeof element === \"function\") {\n generatedTheme = element(replacePlaceholders(generatedTheme));\n } else if (isPlainObject(element)) {\n const generatedSettings = generatedTheme.settings ?? {};\n\n // Type assertion is less critical here if DefaultTheme is well-defined\n generatedTheme = {\n ...generatedTheme,\n ...(element as DefaultTheme),\n ...(storedTheme as DefaultTheme),\n };\n\n if (\"settings\" in element && typeof element.settings === \"object\") {\n generatedTheme.settings = {\n ...generatedSettings,\n ...(element.settings as Record<string, string>), // Adjusted to Record<string, string> based on your DefaultTheme\n ...storedSettings,\n };\n }\n }\n }\n\n return replacePlaceholders(generatedTheme);\n};\n\n/**\n * Create a theme from multiple theme configuration objects.\n * Properties are overwritten by iterating the configuration objects from left to right.\n *\n * The first argument represents a stored theme part, this is optional. The stored theme part will overwrite every part in the collection of theme parts.\n * Thus a stored configuration is leading as it can be configured by a modeller through the repository.\n *\n * Placeholders can be used, they are replaced before calling a function theme part or at the end of the theme creation.\n *\n * Both objects and function can be used, where a function receives the previous objects as input arguments.\n * For example using the method createTheme(ThemeObject, ThemeObject2, ThemeFunction, ThemeFunction2), will be handled as:\n *\n * ThemeFunction2(ThemeFunction1({ ...ThemeObject, ...ThemeObject2 }))\n *\n * @example\n * Example where the primary color of the default theme is overwritten with a primary color of the custom theme,\n * but the button bg still uses the yiq function of the default theme:\n *\n * const DefaultTheme = {\n * PRIMARY_COLOR: \"#0000ff\",\n * SECONDARY_COLOR: \"#00ff00\",\n * BUTTON_COLOR: \"$PRIMARY_COLOR\"\n * }\n *\n * const createDefaultTheme = (input) => ({\n * ...input,\n * BUTTON_BG: getContrastYIQ(input.BUTTON_COLOR)\n * })\n *\n * const CustomTheme = {\n * PRIMARY_COLOR: \"#ff0000\"\n * }\n *\n * createTheme(null, DefaultTheme, CustomTheme, createDefaultTheme);\n *\n * // Result:\n * {\n * PRIMARY_COLOR: \"#ff0000\",\n * BUTTON_COLOR: \"#ff0000\",\n * BUTTON_BG: \"#fff\",\n * SECONDARY_COLOR: \"#00ff00\",\n * }\n */\nexport const createTheme = (\n storedTheme: DefaultTheme | null | undefined,\n ...themeConfigs: (\n | DefaultTheme\n | (DefaultTheme | ((theme: DefaultTheme) => DefaultTheme))[]\n | ((theme: DefaultTheme) => DefaultTheme)\n | undefined\n )[]\n): DefaultTheme => {\n const flattenConfig = flattenDeep<\n | DefaultTheme\n | DefaultTheme[]\n | ((theme: DefaultTheme) => DefaultTheme)\n | undefined\n >(themeConfigs).filter((el) => el != null);\n\n const customTheme = generateTheme(storedTheme, ...flattenConfig);\n\n if (customTheme?.settings) {\n setSettings(customTheme.settings);\n }\n\n return customTheme;\n};\n","import { ThemeProvider as SCThemeProvider } from \"styled-components\";\n\nimport { useBEISelector } from \"../redux/hooks\";\nimport { createTheme } from \"./createTheme\";\n\nimport type { ReactNode } from \"react\";\nimport type { RootState } from \"../redux/store\";\nimport type { Theme } from \"./types\";\n\nexport interface Props {\n theme?: Theme | Theme[];\n children: ReactNode;\n}\n\nexport const ThemeProvider = ({ theme, children }: Props): ReactNode => {\n const storedTheme = useBEISelector<RootState, Theme | undefined>(\n (state) => state.preferences.theme,\n );\n const finalTheme = createTheme(storedTheme, theme);\n\n return <SCThemeProvider theme={finalTheme}>{children}</SCThemeProvider>;\n};\nThemeProvider.displayName = \"BI.ThemeProvider\";\n"],"mappings":"kKAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,kBAAIC,EAAc,IAGdC,EAAW,IAgBf,SAASC,EAAYC,EAAO,CAC1B,IAAIC,EAASD,GAAS,KAAO,EAAIA,EAAM,OACvC,OAAOC,EAASJ,EAAYG,EAAOF,CAAQ,EAAI,CAAC,CAClD,CAEAF,EAAO,QAAUG,ICvBjB,IAAAG,EAAwB,SACxBC,EAA0B,SAF1B,OAAS,eAAAC,MAAmB,0BAM5B,IAAMC,EAAuBC,GAA2C,CACtE,IAAMC,EAAe,OAAO,KAAKD,CAAU,EACxC,IAAKE,GAAQ,MAAMA,CAAG,KAAK,EAC3B,KAAK,GAAG,EAELC,EAAK,IAAI,OAAO,OAAOF,CAAY,IAAK,GAAG,EACjD,cAAO,QAAQD,CAAU,EAAE,QAAQ,CAAC,CAACE,EAAKE,CAAK,IAAM,CAC/CF,IAAQ,YAAc,OAAOE,GAAU,WACzCJ,EAAWE,CAAG,EAAIE,EAAM,QAAQD,EAAI,CAACE,EAAOC,IAAY,CACtD,IAAMC,EAAcP,EAAWM,CAAO,EACtC,OAAO,OAAOC,GAAgB,SAAWA,EAAcF,CACzD,CAAC,EAEL,CAAC,EAEML,CACT,EAEMQ,EAAgB,CACpBC,KACGC,IACc,CACjB,IAAMC,EAAiBF,GAAa,UAAY,CAAC,EAE7CG,EAA+B,CAAE,SAAU,CAAC,CAAE,EAElD,QAAWC,KAAWH,EACpB,GAAI,OAAOG,GAAY,WACrBD,EAAiBC,EAAQd,EAAoBa,CAAc,CAAC,aACnD,EAAAE,SAAcD,CAAO,EAAG,CACjC,IAAME,EAAoBH,EAAe,UAAY,CAAC,EAGtDA,EAAiB,CACf,GAAGA,EACH,GAAIC,EACJ,GAAIJ,CACN,EAEI,aAAcI,GAAW,OAAOA,EAAQ,UAAa,WACvDD,EAAe,SAAW,CACxB,GAAGG,EACH,GAAIF,EAAQ,SACZ,GAAGF,CACL,EAEJ,CAGF,OAAOZ,EAAoBa,CAAc,CAC3C,EA6CaI,EAAc,CACzBP,KACGQ,IAMc,CACjB,IAAMC,KAAgB,EAAAC,SAKpBF,CAAY,EAAE,OAAQG,GAAOA,GAAM,IAAI,EAEnCC,EAAcb,EAAcC,EAAa,GAAGS,CAAa,EAE/D,OAAIG,GAAa,UACfvB,EAAYuB,EAAY,QAAQ,EAG3BA,CACT,EC5HA,OAAS,iBAAiBC,MAAuB,oBAoBxC,cAAAC,MAAA,oBANF,IAAMC,EAAgB,CAAC,CAAE,MAAAC,EAAO,SAAAC,CAAS,IAAwB,CACtE,IAAMC,EAAcC,EACjBC,GAAUA,EAAM,YAAY,KAC/B,EACMC,EAAaC,EAAYJ,EAAaF,CAAK,EAEjD,OAAOF,EAACS,EAAA,CAAgB,MAAOF,EAAa,SAAAJ,EAAS,CACvD,EACAF,EAAc,YAAc","names":["require_flattenDeep","__commonJSMin","exports","module","baseFlatten","INFINITY","flattenDeep","array","length","import_flattenDeep","import_isPlainObject","setSettings","replacePlaceholders","inputTheme","possibleKeys","key","re","value","match","capture","replacement","generateTheme","storedTheme","themeElements","storedSettings","generatedTheme","element","isPlainObject","generatedSettings","createTheme","themeConfigs","flattenConfig","flattenDeep","el","customTheme","SCThemeProvider","jsx","ThemeProvider","theme","children","storedTheme","useBEISelector","state","finalTheme","createTheme","SCThemeProvider"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/server/requestInformation.ts","../src/i18n/serverI18n.ts"],"sourcesContent":["import type { Locales } from \"../i18n/Locales\";\nimport type { RouterLocation } from \"../redux/router/routerReducer\";\nimport type { HttpServletRequestJava } from \"./types\";\n\nconst encodeQueryString = (queryString: string) => {\n if (!queryString) return \"\";\n\n const params: string[] = [];\n queryString.split(\"&\").forEach((part) => {\n const [key, value] = part.split(\"=\");\n if (key && value) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);\n } else if (key) {\n params.push(encodeURIComponent(key));\n }\n });\n return params.join(\"&\");\n};\n\nexport const getFullRequestUrl = (request: HttpServletRequestJava): string => {\n let pathInfo = request.getPathInfo() || \"/\";\n const queryString = request.getQueryString();\n\n pathInfo = pathInfo\n .split(\"/\")\n .map((segment) => encodeURIComponent(segment))\n .join(\"/\");\n\n if (queryString) {\n return `${pathInfo}?${encodeQueryString(queryString)}`;\n }\n\n return pathInfo;\n};\n\nexport const getFullRequestLocation = (\n request: HttpServletRequestJava,\n): RouterLocation => {\n return {\n pathname: request.getPathInfo() || \"/\",\n search: request.getQueryString() || \"\",\n state: {},\n hash: \"\",\n };\n};\n\nexport const getCookieFromRequest = (\n request: HttpServletRequestJava,\n cookieName: string,\n): null | string => {\n return request.getCookieByName(cookieName);\n};\n\nexport const getPreferredLocale = (\n request: HttpServletRequestJava,\n locales: Locales,\n): void | string => {\n const languageFromCookie = getCookieFromRequest(request, \"locale\");\n const acceptLanguageHeader =\n languageFromCookie || request.getHeader(\"Accept-Language\");\n\n // when no accept language header or cookie present, get first locale code\n if (acceptLanguageHeader === null) {\n return locales.availableLocaleCodes[0];\n }\n\n return locales.getPreferredLocale(acceptLanguageHeader);\n};\n","import { IllegalArgumentException } from \"@beinformed/ui/exceptions\";\nimport { getEnabledLocales } from \"@beinformed/ui/settings\";\nimport deepmerge from \"deepmerge\";\n\nimport { setLocales } from \"../redux/i18n/i18nReducer\";\nimport { getPreferredLocale } from \"../server/requestInformation\";\nimport { availableLocales, Locales } from \"./Locales\";\n\nimport type { BEIStore } from \"../redux/store\";\nimport type { HttpServletRequestJava } from \"../server/types\";\nimport type { LocaleConfiguration } from \"./types\";\n\nexport const setI18n = (\n store: BEIStore,\n locales: LocaleConfiguration[] = [],\n request: HttpServletRequestJava,\n) => {\n if (!Array.isArray(locales)) {\n throw new IllegalArgumentException(\"locales must be an array of objects\");\n }\n if (!request) {\n throw new IllegalArgumentException(\"missing request argument\");\n }\n\n const mergedLocales = availableLocales.map((locale) => {\n const code = locale.code;\n const customLocale = locales.find((custLocale) => custLocale.code === code);\n\n if (customLocale) {\n return deepmerge(locale, customLocale);\n }\n\n return locale;\n });\n\n locales.forEach((customLocale) => {\n if (!mergedLocales.some((locale) => locale.code === customLocale.code)) {\n mergedLocales.push(customLocale);\n }\n });\n\n const enabledLocales = mergedLocales.filter((locale: LocaleConfiguration) =>\n getEnabledLocales().includes(locale.code),\n );\n\n const localesInstance = new Locales(enabledLocales);\n const preferredLocale = getPreferredLocale(request, localesInstance);\n store.dispatch(setLocales(localesInstance, preferredLocale ?? \"en\"));\n};\n"],"mappings":"sDAIA,IAAMA,EAAqBC,GAAwB,CACjD,GAAI,CAACA,EAAa,MAAO,GAEzB,IAAMC,EAAmB,CAAC,EAC1B,OAAAD,EAAY,MAAM,GAAG,EAAE,QAASE,GAAS,CACvC,GAAM,CAACC,EAAKC,CAAK,EAAIF,EAAK,MAAM,GAAG,EAC/BC,GAAOC,EACTH,EAAO,KAAK,GAAG,mBAAmBE,CAAG,CAAC,IAAI,mBAAmBC,CAAK,CAAC,EAAE,EAC5DD,GACTF,EAAO,KAAK,mBAAmBE,CAAG,CAAC,CAEvC,CAAC,EACMF,EAAO,KAAK,GAAG,CACxB,EAEaI,EAAqBC,GAA4C,CAC5E,IAAIC,EAAWD,EAAQ,YAAY,GAAK,IAClCN,EAA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CAAc,EAC5CI,EAAkBC,EAAmBd,EAASW,CAAe,EACnEb,EAAM,SAASiB,EAAWJ,EAAiBE,GAAmB,IAAI,CAAC,CACrE","names":["encodeQueryString","queryString","params","part","key","value","getFullRequestUrl","request","pathInfo","segment","getFullRequestLocation","getCookieFromRequest","cookieName","getPreferredLocale","locales","acceptLanguageHeader","IllegalArgumentException","getEnabledLocales","deepmerge","setI18n","store","locales","request","IllegalArgumentException","mergedLocales","availableLocales","locale","code","customLocale","custLocale","deepmerge","enabledLocales","getEnabledLocales","localesInstance","Locales","preferredLocale","getPreferredLocale","setLocales"]}
@@ -1,2 +0,0 @@
1
- var t=o=>o.i18n?.locale??"en",e=o=>o.i18n.locales;export{t as a,e as b};
2
- //# sourceMappingURL=chunk-JYAETKRB.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/redux/i18n/i18nSelectors.ts"],"sourcesContent":["import type { Locales } from \"../../i18n/Locales\";\nimport type { RootState } from \"../store\";\n\n/**\n * Retrieve the locale from state\n */\nexport const getLocale = (state: RootState) => {\n return state.i18n?.locale ?? \"en\";\n};\n\n/**\n * Retrieve all available locales in the store\n */\nexport const getLocales = (state: RootState): Locales => state.i18n.locales;\n"],"mappings":"AAMO,IAAMA,EAAaC,GACjBA,EAAM,MAAM,QAAU,KAMlBC,EAAcD,GAA8BA,EAAM,KAAK","names":["getLocale","state","getLocales"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_overArg.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getPrototype.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isPlainObject.js","../src/redux/preferences/preferencesReducer.ts","../src/redux/preferences/preferencesActions.ts"],"sourcesContent":["/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","import { createAction, createReducer } from \"@reduxjs/toolkit\";\n\nimport type { Theme } from \"../../theme/types\";\nimport type { PreferenceValue } from \"./types\";\n\nexport type PreferencesState = Record<string, PreferenceValue> & {\n theme?: Theme;\n};\n\nexport const setPreference = createAction(\n \"SET_PREFERENCE\",\n (propertyName: string, propertyValue: PreferenceValue) => {\n return {\n payload: {\n key: propertyName,\n value: propertyValue,\n },\n };\n },\n);\n\nexport const setPreferences = createAction(\n \"SET_PREFERENCES\",\n (preferences: Record<string, PreferenceValue>) => {\n return {\n payload: {\n ...preferences,\n },\n };\n },\n);\n\nconst initialState = {};\n\nexport const preferencesReducer = createReducer<PreferencesState>(\n initialState,\n (builder) => {\n builder\n .addCase(setPreference, (state, action) => {\n const { key, value } = action.payload;\n state[key] = value;\n })\n .addCase(setPreferences, (state, action) => {\n for (const key of Object.keys(action.payload)) {\n state[key] = action.payload[key];\n }\n });\n },\n);\n","import {\n LOGIN_PASSWORD_SETTING,\n LOGIN_PATH_SETTING,\n LOGIN_TYPE,\n LOGIN_USERNAME_SETTING,\n LOGOUT_PATH_SETTING,\n} from \"@beinformed/ui/constants\";\nimport { JsonParseException } from \"@beinformed/ui/exceptions\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n INCLUDE_TIME_OFFSET,\n setSetting,\n setSettings,\n} from \"@beinformed/ui/settings\";\nimport isPlainObject from \"lodash/isPlainObject\";\n\nimport { setPreference, setPreferences } from \"./preferencesReducer\";\n\nimport type { RootState } from \"../store\";\nimport type { PreferenceValue } from \"./types\";\n\nconst getServerPreferenceValue = (\n preferenceName: string,\n defaultValue: PreferenceValue,\n type?: string,\n) => {\n let value;\n if (typeof preferencesProvider !== \"undefined\") {\n value = preferencesProvider.getPreferenceByName(preferenceName);\n }\n\n if (!value) {\n value = defaultValue;\n }\n\n if (typeof value === \"string\" && type !== \"string\" && value.includes(\",\")) {\n value = value.split(\",\").map((val) => val.trim());\n }\n\n return value as PreferenceValue;\n};\n\nexport const setServerPreference = (\n propertyName: string,\n defaultValue: PreferenceValue,\n type?: string,\n) => {\n const value = getServerPreferenceValue(propertyName, defaultValue, type);\n return setPreference(propertyName, value);\n};\n\nexport const setThemePreference = (configTheme: string) => {\n let themeData;\n\n try {\n themeData = configTheme ? JSON.parse(configTheme) : null;\n } catch (error) {\n throw new JsonParseException(`Theme file contains invalid JSON: ${error}`);\n }\n\n if (themeData && isPlainObject(themeData)) {\n setSettings(themeData.settings);\n }\n\n return setPreference(\"theme\", themeData);\n};\n\n/**\n * Make modular-ui-content-in-data preference available client side\n */\nexport const setAllContentInDataSetting = (state?: RootState) => {\n let allContentInDataSetting = false;\n\n if (\n typeof preferencesProvider !== \"undefined\" &&\n typeof preferencesProvider.getModularUIContentInData !== \"undefined\"\n ) {\n allContentInDataSetting = preferencesProvider.getModularUIContentInData();\n } else if (typeof state !== \"undefined\") {\n allContentInDataSetting = state.preferences[\n ALL_CONTENT_IN_DATA_SETTING\n ] as boolean;\n }\n\n setSetting(ALL_CONTENT_IN_DATA_SETTING, !!allContentInDataSetting);\n return setPreference(ALL_CONTENT_IN_DATA_SETTING, allContentInDataSetting);\n};\n\n/**\n * Retrieve settings for date time conversion\n */\nexport const setDateTimeSettings = (state?: RootState) => {\n let isIncludeTimeOffsetInDateTimes = false;\n if (\n typeof preferencesProvider !== \"undefined\" &&\n typeof preferencesProvider.isIncludeTimeOffsetInDateTimes !== \"undefined\"\n ) {\n isIncludeTimeOffsetInDateTimes =\n preferencesProvider.isIncludeTimeOffsetInDateTimes();\n } else if (typeof state !== \"undefined\") {\n isIncludeTimeOffsetInDateTimes = state.preferences[\n INCLUDE_TIME_OFFSET\n ] as boolean;\n }\n\n setSetting(INCLUDE_TIME_OFFSET, !!isIncludeTimeOffsetInDateTimes);\n return setPreference(INCLUDE_TIME_OFFSET, isIncludeTimeOffsetInDateTimes);\n};\n\n/**\n * Retrieves login settings from runtime preferences and sets them as setting in the preference reducer\n */\nexport const setLoginPreferences = (state?: RootState) => {\n const loginSettings = {\n [LOGIN_TYPE]: getServerPreferenceValue(\n LOGIN_TYPE,\n state?.preferences[LOGIN_TYPE] || \"\",\n ) as string,\n [LOGIN_PATH_SETTING]: getServerPreferenceValue(\n LOGIN_PATH_SETTING,\n state?.preferences[LOGIN_PATH_SETTING] ||\n `/callback?client_name=FormClient`,\n ) as string,\n [LOGIN_USERNAME_SETTING]: getServerPreferenceValue(\n LOGIN_USERNAME_SETTING,\n state?.preferences[LOGIN_USERNAME_SETTING] || \"j_username\",\n ) as string,\n [LOGIN_PASSWORD_SETTING]: getServerPreferenceValue(\n LOGIN_PASSWORD_SETTING,\n state?.preferences[LOGIN_PASSWORD_SETTING] || \"j_password\",\n ) as string,\n [LOGOUT_PATH_SETTING]: getServerPreferenceValue(\n LOGOUT_PATH_SETTING,\n state?.preferences[LOGOUT_PATH_SETTING] || `/logout`,\n ) as string,\n };\n\n setSettings(loginSettings);\n return setPreferences(loginSettings);\n};\n"],"mappings":"+HAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,cAQA,SAASC,EAAQC,EAAMC,EAAW,CAChC,OAAO,SAASC,EAAK,CACnB,OAAOF,EAAKC,EAAUC,CAAG,CAAC,CAC5B,CACF,CAEAJ,EAAO,QAAUC,ICdjB,IAAAI,EAAAC,EAAA,CAAAC,EAAAC,IAAA,kBAAIC,EAAU,IAGVC,EAAeD,EAAQ,OAAO,eAAgB,MAAM,EAExDD,EAAO,QAAUE,ICLjB,IAAAC,EAAAC,EAAA,CAAAC,EAAAC,IAAA,kBAAIC,EAAa,IACbC,EAAe,IACfC,EAAe,IAGfC,EAAY,kBAGZC,EAAY,SAAS,UACrBC,EAAc,OAAO,UAGrBC,EAAeF,EAAU,SAGzBG,EAAiBF,EAAY,eAG7BG,EAAmBF,EAAa,KAAK,MAAM,EA8B/C,SAASG,EAAcC,EAAO,CAC5B,GAAI,CAACR,EAAaQ,CAAK,GAAKV,EAAWU,CAAK,GAAKP,EAC/C,MAAO,GAET,IAAIQ,EAAQV,EAAaS,CAAK,EAC9B,GAAIC,IAAU,KACZ,MAAO,GAET,IAAIC,EAAOL,EAAe,KAAKI,EAAO,aAAa,GAAKA,EAAM,YAC9D,OAAO,OAAOC,GAAQ,YAAcA,aAAgBA,GAClDN,EAAa,KAAKM,CAAI,GAAKJ,CAC/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CACrC","names":["require_overArg","__commonJSMin","exports","module","overArg","func","transform","arg","require_getPrototype","__commonJSMin","exports","module","overArg","getPrototype","require_isPlainObject","__commonJSMin","exports","module","baseGetTag","getPrototype","isObjectLike","objectTag","funcProto","objectProto","funcToString","hasOwnProperty","objectCtorString","isPlainObject","value","proto","Ctor","createAction","createReducer","setPreference","propertyName","propertyValue","setPreferences","preferences","initialState","preferencesReducer","builder","state","action","key","value","import_isPlainObject","LOGIN_PASSWORD_SETTING","LOGIN_PATH_SETTING","LOGIN_TYPE","LOGIN_USERNAME_SETTING","LOGOUT_PATH_SETTING","JsonParseException","ALL_CONTENT_IN_DATA_SETTING","INCLUDE_TIME_OFFSET","setSetting","setSettings","getServerPreferenceValue","preferenceName","defaultValue","type","value","val","setServerPreference","propertyName","setPreference","setThemePreference","configTheme","themeData","error","JsonParseException","isPlainObject","setSettings","setAllContentInDataSetting","state","allContentInDataSetting","ALL_CONTENT_IN_DATA_SETTING","setSetting","setDateTimeSettings","isIncludeTimeOffsetInDateTimes","INCLUDE_TIME_OFFSET","setLoginPreferences","loginSettings","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","setPreferences"]}
@@ -1,2 +0,0 @@
1
- import{a as r,b as a}from"./chunk-JYAETKRB.js";import{g as l,i as s}from"./chunk-6KRECIRI.js";import{b as p}from"./chunk-FW4363Y4.js";var i=p(l(),1);import{createSelector as n}from"reselect";var g=n([a,r],(e,t)=>(0,i.default)((o,m,c)=>e.getLocale(t).getMessage(o,m,c),(...o)=>JSON.stringify(o))),M=(e,t,o)=>s(g)(e,t,o),x=()=>s(g),S=()=>s(r),d=n(e=>e.i18n.locales,e=>e.map(t=>t.code)),y=()=>s(d);export{M as a,x as b,S as c,y as d};
2
- //# sourceMappingURL=chunk-RKGGCIUD.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hooks/useI18n.ts"],"sourcesContent":["import memoize from \"lodash/memoize\";\nimport { createSelector } from \"reselect\";\n\nimport { useBEISelector } from \"../redux/hooks\";\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\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"],"mappings":"sIAAA,IAAAA,EAAoB,SACpB,OAAS,kBAAAC,MAAsB,WAQ/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,EAEzDY,EAAiBd,EACpBe,GAAqBA,EAAM,KAAK,QAChCZ,GAAYA,EAAQ,IAAKa,GAA6BA,EAAO,IAAI,CACpE,EAKaC,EAAiB,IAAgBN,EAAeG,CAAc","names":["import_memoize","createSelector","getMessage","createSelector","getLocales","getLocale","locales","localeCode","memoize","id","defaultMessage","placeholders","args","useMessage","useBEISelector","useTranslate","useLocale","getLocaleCodes","state","locale","useLocaleCodes"]}
@@ -1,2 +0,0 @@
1
- import{c as b}from"./chunk-RKGGCIUD.js";import{c as ee,d as te,j as oe,k as re,l as ne,m as se,n as ie,o as ae,p as ce,q as T}from"./chunk-Z2Y3OPVI.js";import{B as Q,C as X,K as I,O as R,V as O,d as L,g as ft,h as Mt,i as F,k as w,l as _,m as N,n as $,p as j,q as G,s as K,u as z,v as V,w as W,x as J,y as Y}from"./chunk-Y7ESITVO.js";import{a as Z}from"./chunk-JYAETKRB.js";import{a as ht}from"./chunk-YJNJVQFW.js";import{a as xt}from"./chunk-A4USB53Q.js";import{d as B,f as gt}from"./chunk-WBPDMDW4.js";import{d as dt,e as pt,f as mt,h as u,i as d}from"./chunk-6KRECIRI.js";import{a as f,b as ut}from"./chunk-FW4363Y4.js";var E=f((Os,Se)=>{"use strict";var so=pt(),io=function(){try{var e=so(Object,"defineProperty");return e({},"",{}),e}catch{}}();Se.exports=io});var Re=f((bs,Ue)=>{"use strict";var Ce=E();function ao(e,t,o){t=="__proto__"&&Ce?Ce(e,t,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[t]=o}Ue.exports=ao});var ve=f((Ss,Te)=>{"use strict";var co=Re(),lo=mt(),uo=Object.prototype,po=uo.hasOwnProperty;function mo(e,t,o){var r=e[t];(!(po.call(e,t)&&lo(r,o))||o===void 0&&!(t in e))&&co(e,t,o)}Te.exports=mo});var De=f((Cs,Pe)=>{"use strict";var fo=ve(),go=B(),Mo=ft(),He=dt(),xo=gt();function ho(e,t,o,r){if(!He(e))return e;t=go(t,e);for(var n=-1,s=t.length,i=s-1,a=e;a!=null&&++n<s;){var c=xo(t[n]),p=o;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(n!=i){var m=a[c];p=r?r(m,c,a):void 0,p===void 0&&(p=He(m)?m:Mo(t[n+1])?[]:{})}fo(a,c,p),a=a[c]}return e}Pe.exports=ho});var Ee=f((Us,qe)=>{"use strict";var yo=ht(),Io=De(),Oo=B();function bo(e,t,o){for(var r=-1,n=t.length,s={};++r<n;){var i=t[r],a=yo(e,i);o(a,i)&&Io(s,Oo(i,e),a)}return s}qe.exports=bo});var ke=f((Rs,Ae)=>{"use strict";function So(e,t){return e!=null&&t in Object(e)}Ae.exports=So});var Be=f((Ts,Le)=>{"use strict";var Co=ke(),Uo=Mt();function Ro(e,t){return e!=null&&Uo(e,t,Co)}Le.exports=Ro});var we=f((vs,Fe)=>{"use strict";var To=Ee(),vo=Be();function Ho(e,t){return To(e,t,function(o,r){return vo(e,r)})}Fe.exports=Ho});var Ne=f((Hs,_e)=>{"use strict";var Po=xt();function Do(e){var t=e==null?0:e.length;return t?Po(e,1):[]}_e.exports=Do});var je=f((Ps,$e)=>{"use strict";function qo(e,t,o){switch(o.length){case 0:return e.call(t);case 1:return e.call(t,o[0]);case 2:return e.call(t,o[0],o[1]);case 3:return e.call(t,o[0],o[1],o[2])}return e.apply(t,o)}$e.exports=qo});var ze=f((Ds,Ke)=>{"use strict";var Eo=je(),Ge=Math.max;function Ao(e,t,o){return t=Ge(t===void 0?e.length-1:t,0),function(){for(var r=arguments,n=-1,s=Ge(r.length-t,0),i=Array(s);++n<s;)i[n]=r[t+n];n=-1;for(var a=Array(t+1);++n<t;)a[n]=r[n];return a[t]=o(i),Eo(e,this,a)}}Ke.exports=Ao});var We=f((qs,Ve)=>{"use strict";function ko(e){return function(){return e}}Ve.exports=ko});var Ye=f((Es,Je)=>{"use strict";function Lo(e){return e}Je.exports=Lo});var Ze=f((As,Xe)=>{"use strict";var Bo=We(),Qe=E(),Fo=Ye(),wo=Qe?function(e,t){return Qe(e,"toString",{configurable:!0,enumerable:!1,value:Bo(t),writable:!0})}:Fo;Xe.exports=wo});var tt=f((ks,et)=>{"use strict";var _o=800,No=16,$o=Date.now;function jo(e){var t=0,o=0;return function(){var r=$o(),n=No-(r-o);if(o=r,n>0){if(++t>=_o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}et.exports=jo});var rt=f((Ls,ot)=>{"use strict";var Go=Ze(),Ko=tt(),zo=Ko(Go);ot.exports=zo});var st=f((Bs,nt)=>{"use strict";var Vo=Ne(),Wo=ze(),Jo=rt();function Yo(e){return Jo(Wo(e,void 0,Vo),e+"")}nt.exports=Yo});var at=f((Fs,it)=>{"use strict";var Qo=we(),Xo=st(),Zo=Xo(function(e,t){return e==null?{}:Qo(e,t)});it.exports=Zo});import{useEffect as bt,useState as v}from"react";import{HTTP_METHODS as St}from"@beinformed/ui/constants";import{FormModel as Ct,ListModel as Ut}from"@beinformed/ui/models";import{ModularUIRequest as yt}from"@beinformed/ui/modularui";import{createSelector as It}from"reselect";var Ot=It([Z],e=>(t,o)=>{let r=new yt(t,o);return r.locale=e,r}),le=()=>d(Ot);var mr=e=>{let t=le(),[o,r]=v(null),[n,s]=v(0),[i,a]=v(0);return bt(()=>{let c=Rt(e).map(p=>{let m=p.selfhref.addParameter("commit","false");return t(m,{method:St.POST}).fetch().then(g=>(g instanceof Ct&&(g.tokens=[]),{[p.name]:g}))});s(c.length),Promise.all(c).then(p=>{let m=Object.assign({},...p);r(m),a(p.length)})},[e,t]),i===n?o:null},Rt=e=>{if(!e.actionCollection)return[];let o=[...e.actionCollection.getActionsByType("create").filter(s=>!s.isDisabled)];e instanceof Ut&&e.listItemCollection.forEach(s=>{let i=s.actionCollection.getActionsByType("update").filter(a=>!a.isDisabled);o.push(...i)});let r=[],n=[];return o.forEach(s=>{n.includes(s.name)||(n.push(s.name),r.push(s))}),r};import{DEFAULT_AUTHENTICATION_TYPE as ue}from"@beinformed/ui/constants";import{IllegalStateException as Tt}from"@beinformed/ui/exceptions";import{getContextPathServer as de,logoutPath as vt}from"@beinformed/ui/settings";import{Cache as h}from"@beinformed/ui/utils";var Cr=()=>{h.setItem("isRedirectLogin",!1);let e=u(),t=d(R),o=d(n=>n.auth),r=t?.isLoggedIn??!1;return{isAuthenticated:r,authenticationTypes:t?.authenticationTypes??[ue],errorMessage:o.error,resetErrors:()=>e(L()),login:(n,s)=>e(ee({username:n,password:s})),redirectLogin:n=>{if(h.getItem("isRedirectLogin"))throw new Tt(`Could not redirect to '${n.authentication}' using url: '${n.redirectUri??""}'`);r||(h.setItem("isRedirectLogin",!0),window.location.assign(`${de()}${n.redirectUri??""}`))}}},Ur=()=>{let e=u(),t=d(R),o=vt(),r=de();return{isAuthenticated:t?.isLoggedIn??!1,authenticationTypes:t?.authenticationTypes??[ue],logout:()=>{if(h.getItem("isRedirectLogin")){let s=window.location.origin,i=`${s}${r}/logout?url=${s}${r}${o}`;h.setItem("isRedirectLogin",!1),window.location.assign(i)}else return e(te())}}};import{useEffect as Ht,useState as Pt}from"react";import{ModularUIRequest as Dt}from"@beinformed/ui/modularui";var pe=()=>{let e=u();return{...d(o=>o.progressindicator),start:()=>e(w()),finish:()=>e(_()),reset:()=>e(N()),update:o=>e($(o))}};var Ar=(e,t)=>{let[o,r]=Pt([]),n=b(),{start:s,finish:i}=pe(),a=e.map(p=>p.link?.selfhref.href).filter((p,m,g)=>g.indexOf(p)===m).map(p=>p?.toString()),c=JSON.stringify(a);return Ht(()=>{let p=JSON.parse(c).map(m=>{let g=new Dt(m);return g.locale=n,g.fetchContent(t)});s(),Promise.all(p).then(m=>{r(m),i()})},[c,n,t]),o};import{useEffect as qt,useRef as me}from"react";import{dequal as Et}from"dequal/lite";var At=e=>{let t=me(null),o=me(0);return Et(e,t.current)||(t.current=e,o.current+=1),[o.current]};function fe(e,t){return qt(e,At(t))}import{HTTP_METHODS as Me}from"@beinformed/ui/constants";import{FormModel as D,Href as wt}from"@beinformed/ui/models";import{getSetting as _t}from"@beinformed/ui/settings";import{produce as Nt}from"immer";import{useEffect as kt,useMemo as P,useRef as H}from"react";import{HTTP_METHODS as Lt}from"@beinformed/ui/constants";import{Href as ge}from"@beinformed/ui/models";import{useLocation as Bt}from"react-router";var Ft=(e,t)=>{let o=b();return P(()=>`${e}(${t.split("?")[0]})(${o})`,[e,t,o])},S=(e,t,o={method:Lt.GET,removeOnUnmount:!1})=>{let r=u(),n=P(()=>t?.toString()||"",[t]),s=Ft(e,n),i=P(()=>U=>U.modularui[s],[s]),a=d(i);t instanceof ge&&(o.origin=o.origin??t.origin,o.contextPath=o.contextPath??t.contextPath);let c=Bt(),p=c!==null&&typeof c=="object"&&c.state!==null&&typeof c.state=="object"&&"redirectLocation"in c.state?c.state.redirectLocation:void 0,m=a==null||(p instanceof ge?p?.equals(n):!1),g=H(o),A=H(n),k=H(m);return fe(()=>{let U=A.current===n&&g.current.isReload&&!o.isReload,lt=m&&!k.current;n!==""&&(lt||!U)&&r(O({key:s,href:n,options:o})),g.current=o,A.current=n,k.current=m},[s,n,o,m]),kt(()=>{if(o.removeOnUnmount)return()=>{r(I(s))}},[r,s,o.removeOnUnmount]),a};var cn=(e,t)=>{let o=new wt(e);_t("ALWAYS_COMMIT_FORM")||o.addParameter("commit","false");let r=S("form",o,{method:Me.POST,targetModel:D,removeOnUnmount:!0,data:t?JSON.stringify(t):void 0,origin:o.origin,contextPath:o.contextPath});if(r?.model)return r.model},ln=()=>{let e=u();return{previous:i=>e(re(i)),cancel:i=>e(ne(i)),submit:i=>e(O({key:i.connectKey||i.key,href:i.selfhref,options:{method:Me.POST,data:i.formdata,updateHandler:a=>a instanceof D?Nt(a,c=>{c.update(a)}):a,targetModel:D}})),remove:i=>e(I(i.connectKey||"")),showFormNotification:i=>e(K(i))}},un=(e,t)=>{let o=u();return(r,n,s)=>o(oe({form:e,formObject:t,attribute:r,inputvalue:n,options:s}))},dn=e=>{let t=u();return{save:()=>t(se(e)),cancel:o=>t(ie(e,o)),remove:o=>t(ae(e,o))}};import{useCallback as xe}from"react";import{IllegalArgumentException as $t}from"@beinformed/ui/exceptions";var xn=e=>{if(!e)throw new $t("Missing modalId argument for useModal hook");let t=u(),o=d(s=>s.modals.modals.find(i=>i.key===e)),r=xe(()=>{t(Q(e))},[t,e]),n=xe(()=>{t(X(e))},[t,e]);return{key:o?o.key:null,size:o?o.size:null,visible:o?o.visible:!1,show:r,close:n}};import{ConceptIndexModel as he,ContentIndexModel as Kt,ContentTOCModel as zt,ContentTypeModel as Vt,Href as Wt,ModelCatalogModel as Jt}from"@beinformed/ui/models";import{createHref as y,filterParameters as q}from"@beinformed/ui/utils";import{useMemo as C}from"react";var M=()=>d(e=>e.router.location),On=()=>M()?.key??"",bn=()=>M()?.search,Sn=()=>M()?.pathname,Cn=()=>{let e=u();return{push:(t,o)=>e(z(t,o)),replace:(t,o)=>e(V(t,o)),go:t=>e(W(t)),goBack:()=>e(J()),goForward:()=>e(Y())}};var jt=(e,t,o)=>{let r={targetModel:void 0,forceTargetModel:void 0,isReload:!1,origin:void 0,contextPath:void 0,cache:!1};return e.targetModel&&(r.targetModel=e.targetModel,r.forceTargetModel=e.forceTargetModel),e.cache&&(r.cache=e.cache),o!==null&&typeof o=="object"&&"state"in o&&o.state!==null&&typeof o.state=="object"&&"reload"in o.state&&"pathname"in o&&typeof o.pathname=="string"&&o.pathname.startsWith(t)&&(r.isReload=!0),r.origin=e.origin??r.origin,r.contextPath=e.contextPath??r.contextPath,r},Gt=(e,t)=>{t.length>0&&(t.some(r=>{if(e!==null&&typeof e=="object"&&"type"in e)return e.type===r})||console.warn(e,"is not of instance",t))},l=(e,t,o={expectedModels:[],targetModel:void 0,forceTargetModel:!1,origin:void 0,contextPath:void 0})=>{let r=M(),n=C(()=>t.toString(),[t]),s=C(()=>jt(o,n,r),[o,n,r]),i=S(e,t,s),a=C(()=>o.expectedModels??[],[o.expectedModels]);return C(()=>{if(i?.model)return Gt(i.model,a),i.model},[a,i])};var Bn=e=>l("modelcatalog","/modelcatalog",{expectedModels:["ModelCatalog"],targetModel:Jt,...e}),Yt=(e,t="conceptindex",o)=>{let{entryDate:r}=x(),n=q(e,["index","label","modelcategory","type"]);return n.setParameter("entryDate",r),l(t,n,{expectedModels:["ConceptIndex"],targetModel:he,...o})},Fn=(e,t="conceptdetail",o)=>{let{entryDate:r}=x(),n=M(),s=y("concepts",e,r,n,[]);return l(t,s,{expectedModels:["ConceptDetail","BusinessScenario"],...o})},Qt=(e,t="contentindex",o)=>{let r=q(e,["index","label","type"]);return l(t,r,{expectedModels:["ContentIndex"],targetModel:Kt,...o})},wn=(e,t="contenttoc",o)=>{let{entryDate:r}=x(),n=M(),s=y("content",e,r,n,["complete"]);return l(t,s,{expectedModels:["ContentTOC"],targetModel:zt,...o})},_n=(e,t="content",o)=>{let{entryDate:r}=x(),n=M(),s=y("content",e,r,n,["complete"]);return l(t,s,{expectedModels:["Content","ContentTOC"],...o})},Nn=(e,t="content",o)=>{let{entryDate:r}=x(),n=M(),s=new Wt(e);s.removeParameter("complete"),s.addParameter("complete","true");let i=y("content",s,r,n,["complete"]);return l(t,i,{expectedModels:["Content","ContentTOC"],...o})},$n=(e,t="contenttypes",o)=>{let r=y("contenttypes",e,void 0,void 0,[]);return l(t,r,{expectedModels:["ContentType"],targetModel:Vt,...o})},jn=(e,t="relatedconcepts",o)=>{let{entryDate:r}=x(),n=q(e,["modelcategory"]);return n.setParameter("entryDate",r),l(t,n,{expectedModels:["ConceptIndex"],targetModel:he,...o})},ye=(e,t)=>{let o=[];for(let r of Object.keys(t)){let n=t[r];if(n){let s=Array.isArray(n)?n.join(","):n;r==="type"&&(s=s.replace("#","%23")),o.push(`${r}=${s}`)}}return o.length?`${e}?${o.join("&")}`:e},Gn=(e,t,o)=>{let r=ye("/concepts",e);return Yt(r,t,o)},Kn=(e,t,o)=>{let r=ye("/content",e);return Qt(r,t,o)},x=()=>{let e=u();return{entryDate:d(ce),setEntryDate:o=>e(F(o))}};import{createSelector as Xt}from"reselect";var Xn=()=>{let e=u(),o=Xt([n=>n.modularui],n=>{let s=[],i=Object.keys(n);for(let a of i){let c=n[a];c?.status==="FINISHED"&&s.push(c.model)}return s}),r=d(o);return{reload:(n,s)=>{e(T(n,s))},reloadWithFilter:(n,s)=>{let i=r.filter(n);for(let a of i)a&&e(T(a,s))}}};import{ApplicationModel as Zt,CaseSearchModel as Ie,CaseViewModel as eo,DetailModel as Oe,GroupingPanelModel as to,ListDetailModel as oo,ListModel as be,TabModel as ro,UserProfileModel as no}from"@beinformed/ui/models";var os=e=>l("application","/",{expectedModels:["Application"],targetModel:Zt,...e}),rs=(e,t)=>l("tab",e,{expectedModels:["Tab"],targetModel:ro,...t}),ns=(e,t)=>l("caseview",e,{expectedModels:["CaseView"],targetModel:eo,...t}),ss=(e,t)=>l("panel",e,{expectedModels:["List","GroupingPanel","Detail"],...t}),is=(e,t)=>l("list",e,{expectedModels:["List"],targetModel:be,...t}),as=(e,t)=>l("list",e,{expectedModels:["List","Detail"],targetModel:[be,Oe],...t}),cs=(e,t)=>l("listdetail",e,{expectedModels:["ListDetail"],targetModel:oo,forceTargetModel:!0,...t}),ls=(e,t)=>l("groupingpanel",e,{expectedModels:["GroupingPanel"],targetModel:to,...t}),us=(e,t)=>l("detailpanel",e,{expectedModels:["Detail"],targetModel:Oe,...t}),ds=(e,t)=>l("quicksearch",e,{expectedModels:["CaseSearch"],targetModel:Ie,...t}),ps=(e,t)=>l("search",e,{expectedModels:["CaseSearch"],targetModel:Ie,...t}),ms=(e,t)=>l("userprofile",e,{expectedModels:["UserProfile"],targetModel:no,...t});var hs=()=>{let e=u(),{render:t,messageType:o,message:r,error:n}=d(s=>s.notification);return{render:t,messageType:o,message:r,error:n,dismiss:()=>e(G())}},ys=()=>{let e=u();return(t,o)=>e(j({type:"ERROR",message:t,error:o}))};var ct=ut(at(),1);import{useMemo as er}from"react";import{createSelector as tr}from"reselect";var or=e=>e.preferences,rr=e=>{let t=Array.isArray(e)?e:[e];return tr([or],o=>(0,ct.default)(o,t))},$s=e=>{let t=er(()=>rr(e),[Array.isArray(e)?e.join(","):e]);return d(t)};export{le as a,mr as b,Cr as c,Ur as d,pe as e,Ar as f,fe as g,S as h,cn as i,ln as j,un as k,dn as l,xn as m,M as n,On as o,bn as p,Sn as q,Cn as r,l as s,Bn as t,Yt as u,Fn as v,Qt as w,wn as x,_n as y,Nn as z,$n as A,jn as B,Gn as C,Kn as D,x as E,Xn as F,os as G,rs as H,ns as I,ss as J,is as K,as as L,cs as M,ls as N,us as O,ds as P,ps as Q,ms as R,hs as S,ys as T,$s as U};
2
- //# sourceMappingURL=chunk-UZIZDEU6.js.map