@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.
- package/CHANGELOG.md +17 -0
- package/dist/{beforeRenderHooks-Gb0tcmCY.d.ts → beforeRenderHooks-B0CWdI7P.d.ts} +1 -1
- package/dist/{beforeRenderHooks-CNvsMmi8.d.cts → beforeRenderHooks-CKR6eECI.d.cts} +1 -1
- package/dist/chunk-4IDEBSD5.js +2 -0
- package/dist/chunk-4IDEBSD5.js.map +1 -0
- package/dist/chunk-6AKWSGWH.js +2 -0
- package/dist/chunk-6AKWSGWH.js.map +1 -0
- package/dist/chunk-6EK3TAMN.js +2 -0
- package/dist/chunk-6EK3TAMN.js.map +1 -0
- package/dist/{chunk-YJNJVQFW.js → chunk-7JMMW2FM.js} +2 -2
- package/dist/{chunk-YJNJVQFW.js.map → chunk-7JMMW2FM.js.map} +1 -1
- package/dist/{chunk-X2C7CKOK.js → chunk-A3D5R7MI.js} +2 -2
- package/dist/{chunk-X2C7CKOK.js.map → chunk-A3D5R7MI.js.map} +1 -1
- package/dist/{chunk-HDOILTJ2.js → chunk-BV77KA4Y.js} +2 -2
- package/dist/chunk-BV77KA4Y.js.map +1 -0
- package/dist/{chunk-K3DTH6XN.js → chunk-FBCZEJSD.js} +2 -2
- package/dist/chunk-FBCZEJSD.js.map +1 -0
- package/dist/{chunk-DI7VM62A.js → chunk-GD4NSZBN.js} +2 -2
- package/dist/chunk-GD4NSZBN.js.map +1 -0
- package/dist/chunk-HTR32BUX.js +2 -0
- package/dist/{chunk-6KRECIRI.js.map → chunk-HTR32BUX.js.map} +1 -1
- package/dist/chunk-ITSZQHGD.js +2 -0
- package/dist/chunk-ITSZQHGD.js.map +1 -0
- package/dist/chunk-JWOBKHOJ.js +2 -0
- package/dist/chunk-JWOBKHOJ.js.map +1 -0
- package/dist/chunk-KZB56W7Q.js +2 -0
- package/dist/chunk-KZB56W7Q.js.map +1 -0
- package/dist/chunk-KZLW2NHD.js +2 -0
- package/dist/chunk-KZLW2NHD.js.map +1 -0
- package/dist/{chunk-WBPDMDW4.js → chunk-L7DO7AZT.js} +2 -2
- package/dist/{chunk-WBPDMDW4.js.map → chunk-L7DO7AZT.js.map} +1 -1
- package/dist/{chunk-VG3QU524.js → chunk-OQK6SSUD.js} +3 -3
- package/dist/chunk-OQK6SSUD.js.map +1 -0
- package/dist/chunk-SPV6MD7J.js +2 -0
- package/dist/chunk-SPV6MD7J.js.map +1 -0
- package/dist/{chunk-Z2Y3OPVI.js → chunk-TAWZ2VIM.js} +2 -2
- package/dist/chunk-TAWZ2VIM.js.map +1 -0
- package/dist/{chunk-A4USB53Q.js → chunk-TDYPCNQI.js} +2 -2
- package/dist/{chunk-A4USB53Q.js.map → chunk-TDYPCNQI.js.map} +1 -1
- package/dist/chunk-VXOYOMNN.js +2 -0
- package/dist/chunk-VXOYOMNN.js.map +1 -0
- package/dist/chunk-WEJGEXAP.js +2 -0
- package/dist/chunk-WEJGEXAP.js.map +1 -0
- package/dist/client/index.cjs +5 -5
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +1 -1
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +193 -69
- package/dist/hooks/index.d.ts +193 -69
- package/dist/hooks/index.js +1 -1
- package/dist/i18n/index.cjs +1 -1
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +22 -4
- package/dist/i18n/index.d.ts +22 -4
- package/dist/i18n/index.js +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/redux/index.cjs +1 -1
- package/dist/redux/index.cjs.map +1 -1
- package/dist/redux/index.d.cts +215 -28
- package/dist/redux/index.d.ts +215 -28
- package/dist/redux/index.js +1 -1
- package/dist/server/index.cjs +2 -2
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/{styled-components.d-CrkOxzv5.d.cts → styled-components.d-C19eFejP.d.cts} +7 -13
- package/dist/{styled-components.d-CrkOxzv5.d.ts → styled-components.d-C19eFejP.d.ts} +7 -13
- package/dist/theme/index.cjs +1 -1
- package/dist/theme/index.cjs.map +1 -1
- package/dist/theme/index.d.cts +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/{useForm-DW-a5mcV.d.ts → useForm-BWwXFuv5.d.cts} +3 -3
- package/dist/{useForm-CG_DMYfZ.d.cts → useForm-DqaU9T78.d.ts} +3 -3
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +6 -1
- package/dist/utils/index.d.ts +6 -1
- package/dist/utils/index.js +1 -1
- package/package.json +16 -16
- package/dist/chunk-3OP2KQ56.js +0 -2
- package/dist/chunk-3OP2KQ56.js.map +0 -1
- package/dist/chunk-4AC7YQ5Q.js +0 -2
- package/dist/chunk-4AC7YQ5Q.js.map +0 -1
- package/dist/chunk-6KRECIRI.js +0 -2
- package/dist/chunk-AMFWIR2R.js +0 -2
- package/dist/chunk-AMFWIR2R.js.map +0 -1
- package/dist/chunk-B7PQLTVC.js +0 -2
- package/dist/chunk-B7PQLTVC.js.map +0 -1
- package/dist/chunk-DI7VM62A.js.map +0 -1
- package/dist/chunk-HDOILTJ2.js.map +0 -1
- package/dist/chunk-JYAETKRB.js +0 -2
- package/dist/chunk-JYAETKRB.js.map +0 -1
- package/dist/chunk-K3DTH6XN.js.map +0 -1
- package/dist/chunk-RKGGCIUD.js +0 -2
- package/dist/chunk-RKGGCIUD.js.map +0 -1
- package/dist/chunk-UZIZDEU6.js +0 -2
- package/dist/chunk-UZIZDEU6.js.map +0 -1
- package/dist/chunk-VFLYA5WJ.js +0 -2
- package/dist/chunk-VFLYA5WJ.js.map +0 -1
- package/dist/chunk-VG3QU524.js.map +0 -1
- package/dist/chunk-X3N2NQVZ.js +0 -2
- package/dist/chunk-X3N2NQVZ.js.map +0 -1
- package/dist/chunk-Y7ESITVO.js +0 -2
- package/dist/chunk-Y7ESITVO.js.map +0 -1
- package/dist/chunk-YG7XDCNV.js +0 -2
- package/dist/chunk-YG7XDCNV.js.map +0 -1
- package/dist/chunk-Z2Y3OPVI.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/i18n/languages.ts","../src/i18n/Locale.ts","../src/i18n/Locales.ts","../src/i18n/translations/beinformed_error_messages_en.nl.json","../src/i18n/translations/beinformed_error_messages_nl.nl.json","../src/redux/i18n/i18nReducer.ts","../src/redux/i18n/i18nSelectors.ts"],"sourcesContent":["interface LanguagesObject {\n attribute: { name: number; nativeName: number };\n rtl: Record<string, number>;\n lang: Record<string, string[]>;\n}\n\nexport const languages: LanguagesObject = {\n attribute: {\n name: 0,\n nativeName: 1,\n },\n rtl: {\n ar: 1,\n dv: 1,\n fa: 1,\n ha: 1,\n he: 1,\n ks: 1,\n ku: 1,\n ps: 1,\n ur: 1,\n yi: 1,\n },\n lang: {\n aa: [\"Afar\", \"Afar\"],\n ab: [\"Abkhazian\", \"Аҧсуа\"],\n af: [\"Afrikaans\", \"Afrikaans\"],\n ak: [\"Akan\", \"Akana\"],\n am: [\"Amharic\", \"አማርኛ\"],\n an: [\"Aragonese\", \"Aragonés\"],\n ar: [\"Arabic\", \"العربية\"],\n as: [\"Assamese\", \"অসমীয়া\"],\n av: [\"Avar\", \"Авар\"],\n ay: [\"Aymara\", \"Aymar\"],\n az: [\"Azerbaijani\", \"Azərbaycanca / آذربايجان\"],\n ba: [\"Bashkir\", \"Башҡорт\"],\n be: [\"Belarusian\", \"Беларуская\"],\n bg: [\"Bulgarian\", \"Български\"],\n bh: [\"Bihari\", \"भोजपुरी\"],\n bi: [\"Bislama\", \"Bislama\"],\n bm: [\"Bambara\", \"Bamanankan\"],\n bn: [\"Bengali\", \"বাংলা\"],\n bo: [\"Tibetan\", \"བོད་ཡིག / Bod skad\"],\n br: [\"Breton\", \"Brezhoneg\"],\n bs: [\"Bosnian\", \"Bosanski\"],\n ca: [\"Catalan\", \"Català\"],\n ce: [\"Chechen\", \"Нохчийн\"],\n ch: [\"Chamorro\", \"Chamoru\"],\n co: [\"Corsican\", \"Corsu\"],\n cr: [\"Cree\", \"Nehiyaw\"],\n cs: [\"Czech\", \"Česky\"],\n cu: [\"Old Church Slavonic / Old Bulgarian\", \"словѣньскъ / slověnĭskŭ\"],\n cv: [\"Chuvash\", \"Чăваш\"],\n cy: [\"Welsh\", \"Cymraeg\"],\n da: [\"Danish\", \"Dansk\"],\n de: [\"German\", \"Deutsch\"],\n dv: [\"Divehi\", \"ދިވެހިބަސް\"],\n dz: [\"Dzongkha\", \"ཇོང་ཁ\"],\n ee: [\"Ewe\", \"Ɛʋɛ\"],\n el: [\"Greek\", \"Ελληνικά\"],\n en: [\"English\", \"English\"],\n eo: [\"Esperanto\", \"Esperanto\"],\n es: [\"Spanish\", \"Español\"],\n et: [\"Estonian\", \"Eesti\"],\n eu: [\"Basque\", \"Euskara\"],\n fa: [\"Persian\", \"فارسی\"],\n ff: [\"Peul\", \"Fulfulde\"],\n fi: [\"Finnish\", \"Suomi\"],\n fj: [\"Fijian\", \"Na Vosa Vakaviti\"],\n fo: [\"Faroese\", \"Føroyskt\"],\n fr: [\"French\", \"Français\"],\n fy: [\"West Frisian\", \"Frysk\"],\n ga: [\"Irish\", \"Gaeilge\"],\n gd: [\"Scottish Gaelic\", \"Gàidhlig\"],\n gl: [\"Galician\", \"Galego\"],\n gn: [\"Guarani\", \"Avañe'ẽ\"],\n gu: [\"Gujarati\", \"ગુજરાતી\"],\n gv: [\"Manx\", \"Gaelg\"],\n ha: [\"Hausa\", \"هَوُسَ\"],\n he: [\"Hebrew\", \"עברית\"],\n hi: [\"Hindi\", \"हिन्दी\"],\n ho: [\"Hiri Motu\", \"Hiri Motu\"],\n hr: [\"Croatian\", \"Hrvatski\"],\n ht: [\"Haitian\", \"Krèyol ayisyen\"],\n hu: [\"Hungarian\", \"Magyar\"],\n hy: [\"Armenian\", \"Հայերեն\"],\n hz: [\"Herero\", \"Otsiherero\"],\n ia: [\"Interlingua\", \"Interlingua\"],\n id: [\"Indonesian\", \"Bahasa Indonesia\"],\n ie: [\"Interlingue\", \"Interlingue\"],\n ig: [\"Igbo\", \"Igbo\"],\n ii: [\"Sichuan Yi\", \"ꆇꉙ / 四川彝语\"],\n ik: [\"Inupiak\", \"Iñupiak\"],\n io: [\"Ido\", \"Ido\"],\n is: [\"Icelandic\", \"Íslenska\"],\n it: [\"Italian\", \"Italiano\"],\n iu: [\"Inuktitut\", \"ᐃᓄᒃᑎᑐᑦ\"],\n ja: [\"Japanese\", \"日本語\"],\n jv: [\"Javanese\", \"Basa Jawa\"],\n ka: [\"Georgian\", \"ქართული\"],\n kg: [\"Kongo\", \"KiKongo\"],\n ki: [\"Kikuyu\", \"Gĩkũyũ\"],\n kj: [\"Kuanyama\", \"Kuanyama\"],\n kk: [\"Kazakh\", \"Қазақша\"],\n kl: [\"Greenlandic\", \"Kalaallisut\"],\n km: [\"Cambodian\", \"ភាសាខ្មែរ\"],\n kn: [\"Kannada\", \"ಕನ್ನಡ\"],\n ko: [\"Korean\", \"한국어\"],\n kr: [\"Kanuri\", \"Kanuri\"],\n ks: [\"Kashmiri\", \"कश्मीरी / كشميري\"],\n ku: [\"Kurdish\", \"Kurdî / كوردی\"],\n kv: [\"Komi\", \"Коми\"],\n kw: [\"Cornish\", \"Kernewek\"],\n ky: [\"Kirghiz\", \"Kırgızca / Кыргызча\"],\n la: [\"Latin\", \"Latina\"],\n lb: [\"Luxembourgish\", \"Lëtzebuergesch\"],\n lg: [\"Ganda\", \"Luganda\"],\n li: [\"Limburgian\", \"Limburgs\"],\n ln: [\"Lingala\", \"Lingála\"],\n lo: [\"Laotian\", \"ລາວ / Pha xa lao\"],\n lt: [\"Lithuanian\", \"Lietuvių\"],\n lv: [\"Latvian\", \"Latviešu\"],\n mg: [\"Malagasy\", \"Malagasy\"],\n mh: [\"Marshallese\", \"Kajin Majel / Ebon\"],\n mi: [\"Maori\", \"Māori\"],\n mk: [\"Macedonian\", \"Македонски\"],\n ml: [\"Malayalam\", \"മലയാളം\"],\n mn: [\"Mongolian\", \"Монгол\"],\n mo: [\"Moldovan\", \"Moldovenească\"],\n mr: [\"Marathi\", \"मराठी\"],\n ms: [\"Malay\", \"Bahasa Melayu\"],\n mt: [\"Maltese\", \"bil-Malti\"],\n my: [\"Burmese\", \"Myanmasa\"],\n na: [\"Nauruan\", \"Dorerin Naoero\"],\n nd: [\"North Ndebele\", \"Sindebele\"],\n ne: [\"Nepali\", \"नेपाली\"],\n ng: [\"Ndonga\", \"Oshiwambo\"],\n nl: [\"Dutch\", \"Nederlands\"],\n nn: [\"Norwegian Nynorsk\", \"Norsk (nynorsk)\"],\n no: [\"Norwegian\", \"Norsk (bokmål / riksmål)\"],\n nr: [\"South Ndebele\", \"isiNdebele\"],\n nv: [\"Navajo\", \"Diné bizaad\"],\n ny: [\"Chichewa\", \"Chi-Chewa\"],\n oc: [\"Occitan\", \"Occitan\"],\n oj: [\"Ojibwa\", \"ᐊᓂᔑᓈᐯᒧᐎᓐ / Anishinaabemowin\"],\n om: [\"Oromo\", \"Oromoo\"],\n or: [\"Oriya\", \"ଓଡ଼ିଆ\"],\n os: [\"Ossetian / Ossetic\", \"Иронау\"],\n pa: [\"Panjabi / Punjabi\", \"ਪੰਜਾਬੀ / पंजाबी / پنجابي\"],\n pi: [\"Pali\", \"Pāli / पाऴि\"],\n pl: [\"Polish\", \"Polski\"],\n ps: [\"Pashto\", \"پښتو\"],\n pt: [\"Portuguese\", \"Português\"],\n qu: [\"Quechua\", \"Runa Simi\"],\n rm: [\"Raeto Romance\", \"Rumantsch\"],\n rn: [\"Kirundi\", \"Kirundi\"],\n ro: [\"Romanian\", \"Română\"],\n ru: [\"Russian\", \"Русский\"],\n rw: [\"Rwandi\", \"Kinyarwandi\"],\n sa: [\"Sanskrit\", \"संस्कृतम्\"],\n sc: [\"Sardinian\", \"Sardu\"],\n sd: [\"Sindhi\", \"सिनधि\"],\n se: [\"Northern Sami\", \"Sámegiella\"],\n sg: [\"Sango\", \"Sängö\"],\n sh: [\"Serbo-Croatian\", \"Srpskohrvatski / Српскохрватски\"],\n si: [\"Sinhalese\", \"සිංහල\"],\n sk: [\"Slovak\", \"Slovenčina\"],\n sl: [\"Slovenian\", \"Slovenščina\"],\n sm: [\"Samoan\", \"Gagana Samoa\"],\n sn: [\"Shona\", \"chiShona\"],\n so: [\"Somalia\", \"Soomaaliga\"],\n sq: [\"Albanian\", \"Shqip\"],\n sr: [\"Serbian\", \"Српски\"],\n ss: [\"Swati\", \"SiSwati\"],\n st: [\"Southern Sotho\", \"Sesotho\"],\n su: [\"Sundanese\", \"Basa Sunda\"],\n sv: [\"Swedish\", \"Svenska\"],\n sw: [\"Swahili\", \"Kiswahili\"],\n ta: [\"Tamil\", \"தமிழ்\"],\n te: [\"Telugu\", \"తెలుగు\"],\n tg: [\"Tajik\", \"Тоҷикӣ\"],\n th: [\"Thai\", \"ไทย / Phasa Thai\"],\n ti: [\"Tigrinya\", \"ትግርኛ\"],\n tk: [\"Turkmen\", \"Туркмен / تركمن\"],\n tl: [\"Tagalog / Filipino\", \"Tagalog\"],\n tn: [\"Tswana\", \"Setswana\"],\n to: [\"Tonga\", \"Lea Faka-Tonga\"],\n tr: [\"Turkish\", \"Türkçe\"],\n ts: [\"Tsonga\", \"Xitsonga\"],\n tt: [\"Tatar\", \"Tatarça\"],\n tw: [\"Twi\", \"Twi\"],\n ty: [\"Tahitian\", \"Reo Mā`ohi\"],\n ug: [\"Uyghur\", \"Uyƣurqə / ئۇيغۇرچە\"],\n uk: [\"Ukrainian\", \"Українська\"],\n ur: [\"Urdu\", \"اردو\"],\n uz: [\"Uzbek\", \"Ўзбек\"],\n ve: [\"Venda\", \"Tshivenḓa\"],\n vi: [\"Vietnamese\", \"Tiếng Việt\"],\n vo: [\"Volapük\", \"Volapük\"],\n wa: [\"Walloon\", \"Walon\"],\n wo: [\"Wolof\", \"Wollof\"],\n xh: [\"Xhosa\", \"isiXhosa\"],\n yi: [\"Yiddish\", \"ייִדיש\"],\n yo: [\"Yoruba\", \"Yorùbá\"],\n za: [\"Zhuang\", \"Cuengh / Tôô / 壮语\"],\n zh: [\"Chinese\", \"中文\"],\n zu: [\"Zulu\", \"isiZulu\"],\n pap: [\"Papiamento\", \"Papiamento\"],\n },\n};\n","import formatMessage from \"format-message\";\nimport { immerable } from \"immer\";\n\nimport { IllegalStateException } from \"@beinformed/ui/exceptions\";\nimport { getBooleanSetting } from \"@beinformed/ui/settings\";\nimport { IS_DEV } from \"@beinformed/ui/utils\";\n\nimport { languages } from \"./languages\";\n\nimport type { MessageParameters } from \"@beinformed/ui/types\";\nimport type { LocaleConfiguration } from \"./types\";\n\n/**\n * Create a locale\n */\nexport class Locale {\n [immerable] = true;\n\n #code: string;\n #messages: Record<string, string>;\n #errors: Record<string, string>;\n #nativeName: string | undefined;\n\n constructor(locale: LocaleConfiguration) {\n this.#code = locale.code;\n\n this.#messages = this.fixPlaceHoldersInObject(locale.messages);\n this.#errors = this.fixPlaceHoldersInObject(locale.errors);\n\n this.#nativeName = locale.nativeName;\n\n formatMessage.setup({\n missingTranslation: \"ignore\",\n });\n }\n\n /**\n * Retrieve locale code\n */\n get code() {\n return this.#code;\n }\n\n /**\n * Retrieve nativeName\n */\n get nativeName() {\n if (this.#nativeName) {\n return this.#nativeName;\n }\n\n const locale = this.code.split(\"-\");\n\n if (locale.length > 0) {\n const languageCode = locale[0];\n if (languageCode) {\n const language = languages.lang[languageCode];\n\n if (language) {\n return (\n language[1] + (locale[1] ? ` (${locale[1].toUpperCase()})` : \"\")\n );\n }\n }\n }\n\n throw new IllegalStateException(\n `Can not find language name based on locale: ${this.code}`,\n );\n }\n\n /**\n * Exported messages from Be Informed have placeholders in the syntax ${placeholder_name}\n * where the ICU messageformat module uses {placeholder_name}.\n * This method converts the ${} to {}\n */\n fixPlaceHolders(message: string | undefined) {\n if (typeof message === \"string\") {\n return message\n .replace(/'\\$\\{(?<key>.*?)}'/g, \"''{$<key>}''\")\n .replace(/\\$\\{(?<key>.*?)}/g, \"{$<key>}\");\n }\n\n return null;\n }\n\n /**\n * Exported messages from Be Informed have placeholders in the syntax ${placeholder_name}\n * where the ICU messageformat module uses {placeholder_name}.\n * This method converts the ${} to {}\n */\n private fixPlaceHoldersInObject(messages: Record<string, string> = {}) {\n return JSON.parse(\n JSON.stringify(messages)\n .replace(/'\\$\\{(?<key>.*?)}'/g, \"''{$<key>}''\")\n .replace(/\\$\\{(?<key>.*?)}/g, \"{$<key>}\"),\n );\n }\n\n /**\n * Retrieve message by id\n */\n getBaseMessage(id: string, defaultMessage?: string) {\n if (!id && !defaultMessage) {\n return \"[message: id or defaultMessage missing]\";\n }\n\n const messageFromLocale = this.#messages[id] || this.#errors[id];\n\n if (\n IS_DEV &&\n !messageFromLocale &&\n id &&\n getBooleanSetting(\"DEBUG_I18N_MESSAGE_NOT_FOUND\")\n ) {\n console.debug(\n `Message with id ${id} not found for locale ${this.code} in layout translations`,\n );\n }\n return messageFromLocale || this.fixPlaceHolders(defaultMessage) || id;\n }\n\n /**\n * Format message using formatMessage library\n */\n formatMessage(message: string, parameters?: MessageParameters) {\n if (parameters) {\n return formatMessage(message, parameters);\n }\n\n return message;\n }\n\n /**\n * Retrieve a messages with replaced parameters\n */\n getMessage(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n ): string {\n const message = this.getBaseMessage(id, defaultMessage);\n return this.formatMessage(message, parameters);\n }\n\n /**\n * Add or change messages for this locale. It is not possible to remove messages.\n */\n update(\n messages: Record<string, string> = {},\n errors: Record<string, string> = {},\n ) {\n this.#messages = {\n ...this.#messages,\n ...this.fixPlaceHoldersInObject(messages),\n };\n\n this.#errors = {\n ...this.#errors,\n ...this.fixPlaceHoldersInObject(errors),\n };\n }\n}\n","import { IllegalArgumentException } from \"@beinformed/ui/exceptions\";\nimport { BaseCollection } from \"@beinformed/ui/models\";\n\nimport { Locale } from \"./Locale\";\nimport englishErrors from \"./translations/beinformed_error_messages_en.nl.json\";\nimport dutchErrors from \"./translations/beinformed_error_messages_nl.nl.json\";\n\nimport type { LocaleConfiguration } from \"./types\";\n\ntype ErrorMessageObject = Record<string, Record<string, string>>;\n\ninterface HydratedLocales {\n collection: {\n code: string;\n messages: Record<string, string>;\n errors: Record<string, string>;\n }[];\n}\n\n/**\n * Array of available locales\n * Order of locales is the preferred order of locales.\n * When user has an accept language header that does not correspond to the locales array,\n * the first one is used as the preferred language\n */\nexport const availableLocales: LocaleConfiguration[] = [\n {\n code: \"en\",\n messages: {},\n errors: englishErrors,\n },\n {\n code: \"nl\",\n messages: {},\n errors: dutchErrors,\n },\n];\n\n/**\n * Merge an object with custom error messages (exported and translated from be informed for example) and merge them with the existing translations.\n */\nexport const createLocalesWithConfiguredErrors = (\n configuredErrors: ErrorMessageObject,\n) =>\n availableLocales.map((availableLocale) => {\n if (configuredErrors[availableLocale.code]) {\n return {\n ...availableLocale,\n errors: {\n ...availableLocale.errors,\n ...configuredErrors[availableLocale.code],\n },\n };\n }\n\n return availableLocale;\n });\n\n/**\n * Locales, collection of Locale\n */\nexport class Locales extends BaseCollection<Locale> {\n constructor(locales: LocaleConfiguration[] = availableLocales) {\n super(locales.map((locale) => new Locale(locale)));\n }\n\n /**\n * rehydrate\n */\n static rehydrate(hydatedLocales: HydratedLocales): Locales {\n if (hydatedLocales && hydatedLocales.collection) {\n return new Locales(\n hydatedLocales.collection.map((locale) => ({\n code: locale.code,\n messages: locale.messages,\n errors: locale.errors,\n })),\n );\n }\n\n return new Locales([]);\n }\n\n /**\n * Check if locale with localeCode exists\n */\n hasLocale(localeCode: string) {\n return this.some((item) => localeCode.startsWith(item.code));\n }\n\n /**\n * Retrieve locales by localeCode from Locales collection\n */\n getLocale(localeCode: string) {\n if (this.hasLocale(localeCode)) {\n const locale = this.find((item) => localeCode.startsWith(item.code));\n if (locale) {\n return locale;\n }\n }\n throw new IllegalArgumentException(\n `Locale configuration for locale ${localeCode} not found`,\n );\n }\n\n /**\n * Retrieve all available locale codes\n */\n get availableLocaleCodes() {\n return this.map((locale) => locale.code);\n }\n\n /**\n * Retrieve preferred locale based on the accept header of a browser\n */\n getPreferredLocale(acceptLanguageHeader: string | null) {\n if (acceptLanguageHeader != null) {\n const acceptLanguages =\n acceptLanguageHeader.match(/[-A-Za-z]{2,10}/gu) || [];\n\n const preferredLocales = acceptLanguages\n .filter((locale) =>\n this.availableLocaleCodes.some((availableLocale) =>\n locale.startsWith(availableLocale),\n ),\n )\n .map((locale) =>\n this.availableLocaleCodes.find((availableLocale) =>\n locale.startsWith(availableLocale),\n ),\n );\n\n if (preferredLocales.length > 0) {\n return preferredLocales[0];\n }\n }\n\n return this.availableLocaleCodes[0];\n }\n\n /**\n * Add or change messages and errors for the given locale.<br>\n * It is not possible to remove messages.\n */\n update(\n locale: string,\n messages: Record<string, string> = {},\n errors: Record<string, string> = {},\n ) {\n if (this.hasLocale(locale)) {\n this.getLocale(locale).update(messages, errors);\n } else {\n this.add(\n new Locale({\n code: locale,\n messages,\n errors,\n }),\n );\n }\n }\n}\n","{\n \"Constraint.Attribute.IncorrectValue\": \"Incorrect value\",\n \"Constraint.Boolean.InvalidValue\": \"Invalid boolean value, only values 'true' or 'false' are valid\",\n \"Constraint.BSN.InvalidFormat\": \"Must be a valid BSN\",\n \"Constraint.Captcha.InvalidToken\": \"The captcha is invalid\",\n \"Constraint.Choice.ConflictingAnswer\": \"Cannot select '${answer-option-key}' because this is not a relevant option, given the other answers\",\n \"Constraint.Choice.ConflictingOptions\": \"Cannot select '${answer-option-key1}' and '${answer-option-key2}' at the same time\",\n \"Constraint.Choice.InvalidOption\": \"Allowed options are: ${options}\",\n \"Constraint.Choice.InvalidOption.General\": \"Value '${value}' is not allowed\",\n \"Constraint.Choice.MultipleNotAllowed\": \"Selecting multiple options is not allowed\",\n \"Constraint.ConfirmCurrentPassword.Invalid\": \"Must match the current password\",\n \"Constraint.Date.AboveMaximum\": \"Must be on or before ${max-date}\",\n \"Constraint.Date.BelowMinimum\": \"Must be on or after ${min-date}\",\n \"Constraint.Date.InvalidFormat\": \"Must be entered in the format ${format}\",\n \"Constraint.Date.NotOnDate\": \"Must be on ${date}\",\n \"Constraint.Date.OutOfRange\": \"Must be between ${min-date} and ${max-date}\",\n \"Constraint.DateRange.InvalidRange\": \"Start date must be before end date\",\n \"Constraint.DateRange.Mandatory\": \"Field is mandatory: must contain at least a start or end date\",\n \"Constraint.DateTime.AboveMaximum\": \"Must be before ${max-date-time}\",\n \"Constraint.DateTime.BelowMinimum\": \"Must be at ${min-date-time} or after\",\n \"Constraint.DateTime.InvalidFormat\": \"Must be entered in the format ${format}\",\n \"Constraint.DateTime.OutOfRange\": \"Must be between ${min-date-time} and ${max-date-time}\",\n \"Constraint.DateTimeRange.InvalidRange\": \"Start date-time must be before end date-time\",\n \"Constraint.DateTimeRange.Mandatory\": \"Field is mandatory: must contain at least a start or end date-time\",\n \"Constraint.Document.MimeTypeNotAllowed\": \"The document mime type is not valid for the selected document type\",\n \"Constraint.Email.InvalidFormat\": \"Must be a valid e-mail address\",\n \"Constraint.File.DataEmpty\": \"File does not exist or has no content\",\n \"Constraint.File.InvalidExtension\": \"Allowed extensions are: ${extensions}\",\n \"Constraint.File.InvalidFormat\": \"Must meet the requirements of the file name\",\n \"Constraint.File.InvalidMimeType\": \"Allowed mime types are: ${mime-types}\",\n \"Constraint.File.MaxFileSizeExceeded\": \"Maximum file upload size is ${max-filesize}\",\n \"Constraint.File.OnlyAllowsOneFile\": \"Only one file is allowed\",\n \"Constraint.IBAN.InvalidFormat\": \"Must be a valid IBAN number\",\n \"Constraint.InvalidLengthBetween\": \"Length must be between ${min-length} and ${max-length} characters\",\n \"Constraint.InvalidLengthExact\": \"Length must be precisely ${length} characters\",\n \"Constraint.InvalidLengthTooLong\": \"Length must not be larger than ${max-length} characters\",\n \"Constraint.InvalidLengthTooShort\": \"Length must be at least ${min-length} characters\",\n \"Constraint.InvalidRegularExpression\": \"The value is not according the given regular expression ${regexp}\",\n \"Constraint.Mandatory\": \"Field is mandatory\",\n \"Constraint.Missing\": \"Field is mandatory\",\n \"Constraint.Number.AboveMaximum\": \"Must be at most ${max-number}\",\n \"Constraint.Number.BelowMinimum\": \"Must be at least ${min-number}\",\n \"Constraint.Number.InvalidDecimal\": \"Must be a number with up to ${max-digits} decimal places\",\n \"Constraint.Number.InvalidInteger\": \"Must be a whole number\",\n \"Constraint.Number.InvalidLong\": \"Must be a whole number\",\n \"Constraint.Number.OutOfRange\": \"Must be between ${min-number} and ${max-number}\",\n \"Constraint.NumberRange.BothFieldsMandatory\": \"Must contain start and end value\",\n \"Constraint.NumberRange.InvalidRange\": \"Start value must be less than the end value\",\n \"Constraint.NumberRange.Mandatory\": \"Field is mandatory: must contain at least a start or end value\",\n \"Constraint.Password.AlreadyUsed\": \"Must not have been used before\",\n \"Constraint.Password.LowerAndUpperCaseMandatory\": \"Must contain both upper and lowercase characters\",\n \"Constraint.Password.MinNumericCharactersMandatory\": \"Must contain ${min-numeric} or more numerical characters\",\n \"Constraint.Password.MinSpecialCharactersMandatory\": \"Must contain ${min-special} or more special characters\",\n \"Constraint.Password.ThreeConsecutiveCharactersNotAllowed\": \"Must not contain any character more than twice consecutively\",\n \"Constraint.Password.Unchanged\": \"Must not be the same as the old password\",\n \"Constraint.Password.UserNameSubstringNotAllowed\": \"Must not have 5 consecutive characters from username\",\n \"Constraint.SortParameter.InvalidValue\": \"Invalid sort parameter. Allowed values: field+[asc|desc]\",\n \"Constraint.Time.InvalidFormat\": \"Must be entered in the format ${format}\",\n \"Constraint.TimeRange.InvalidRange\": \"Start time must be before end time\",\n \"Constraint.TimeRange.Mandatory\": \"Field is mandatory: must contain at least a start or end time\",\n \"Constraint.TimeStamp.AboveMaximum\": \"Must be on or before ${max-date}\",\n \"Constraint.TimeStamp.BelowMinimum\": \"Must be on or after ${min-date}\",\n \"Constraint.Timestamp.InvalidFormat\": \"Must be entered in the format ${format}\",\n \"Constraint.TimeStampRange.InvalidRange\": \"Start value must be before end value\",\n \"Constraint.TimeStampRange.Mandatory\": \"Field is mandatory: must contain at least a start or end value\",\n \"Constraint.XML.InvalidFormat\": \"Must be well-formed XML\",\n \"Constraint.ZipCode.InvalidFormat\": \"Must be a valid Dutch ZIP code, e.g. 1234AB\",\n \"Error.AcceptHeaderRequired\": \"The 'Accept' request-header field must be provided\",\n \"Error.Authentication.BlockedUser\": \"You have been logged out, because your account has been blocked\",\n \"Error.Authentication.ConcurrentUser\": \"You have been logged out, since your username has been used at a different location.\",\n \"Error.Authentication.InvalidCredentials\": \"Authentication failed\",\n \"Error.Authentication.InvalidUsername\": \"You have been logged out, because your username is not valid anymore\",\n \"Error.Authentication.Required\": \"Authentication is required\",\n \"Error.Case.ConcurrentModification\": \"Another user has updated a case used in this task. As a result, this task can not be completed.\",\n \"Error.ChangePasswordRequired\": \"User password is initial or expired, and must be changed \",\n \"Error.CodemapLookup.InvalidToken\": \"Token for codemap lookup is not valid\",\n \"Error.DataStore.ConcurrentModification\": \"Another user has updated a record used in this task\",\n \"Error.DataStore.RecordAlreadyExists\": \"\",\n \"Error.DataStore.RowCannotBeLocked\": \"Another user has already locked a record used in this task\",\n \"Error.Form.DataNotAvailableForId\": \"Service can not be completed, data not available for mandatory element ${elementid}\",\n \"Error.Form.ObjectNotAllowed\": \"Object '${objectid}' is not allowed\",\n \"Error.Form.ReadOnlyElementId\": \"Element '${elementid}' is read only\",\n \"Error.Form.TooManyObjects\": \"Too many objects '${objectid}' provided\",\n \"Error.Form.UndefinedElementId\": \"Undefined element '${elementid}'\",\n \"Error.Form.UndefinedObject\": \"Undefined object(s) '${objectid}'\",\n \"Error.GeneralError\": \"An unexpected error occurred\",\n \"Error.MethodNotAllowed\": \"The given HTTP method is not allowed for this resource\",\n \"Error.Parameter.InvalidValue\": \"The parameter contains characters that are not allowed\",\n \"Error.Parameter.Mandatory\": \"Parameter ${parameter} is mandatory\",\n \"Error.Parameter.NotAllowed\": \"Parameter '${parameter}' is not allowed\",\n \"Error.ResourceNotFound\": \"The requested resource cannot be found\",\n \"Validation.StandardCreateAndUpdateUserTask.PasswordsDoNotMatch\": \"Password and password confirmation do not match.\",\n \"Validation.StandardCreateAndUpdateUserTask.UserEmailAlreadyExists\": \"A user with email address '${Email}' already exists\",\n \"Validation.StandardCreateAndUpdateUserTask.UserNameAlreadyExists\": \"A user with username '${Username}' already exists\",\n \"Validation.StandardCreateOrganizationTask.OrganizationAlreadyExists\": \"An organization with id '${ID}' already exists\"\n}\n","{\n \"Constraint.Attribute.IncorrectValue\": \"Ongeldige waarde\",\n \"Constraint.Boolean.InvalidValue\": \"Waarde voldoet niet aan het boolean formaat, alleen waarden 'true' en 'false' zijn toegestaan\",\n \"Constraint.BSN.InvalidFormat\": \"Moet een geldig BSN zijn\",\n \"Constraint.Captcha.InvalidToken\": \"Captcha is niet correct\",\n \"Constraint.Choice.ConflictingAnswer\": \"'${answer-option-key}' kan niet worden gekozen omdat dit geen relevante optie is, gegeven de andere antwoorden\",\n \"Constraint.Choice.ConflictingOptions\": \"'${answer-option-key1}' and '${answer-option-key2}' kunnen niet tegelijkertijd worden gekozen\",\n \"Constraint.Choice.InvalidOption\": \"Toegestane waarden zijn: ${options}\",\n \"Constraint.Choice.InvalidOption.General\": \"Waarde '${value}' is niet toegestaan\",\n \"Constraint.Choice.MultipleNotAllowed\": \"Meerdere opties selecteren is niet toegestaan\",\n \"Constraint.ConfirmCurrentPassword.Invalid\": \"Moet overeenkomen met het huidige wachtwoord\",\n \"Constraint.Date.AboveMaximum\": \"Moet op of voor ${max-date} liggen\",\n \"Constraint.Date.BelowMinimum\": \"Moet op of na ${min-date} liggen\",\n \"Constraint.Date.InvalidFormat\": \"Moet worden opgegeven in het formaat ${format}\",\n \"Constraint.Date.NotOnDate\": \"Moet op ${date} liggen\",\n \"Constraint.Date.OutOfRange\": \"Moet tussen ${min-date} en ${max-date} liggen\",\n \"Constraint.DateRange.InvalidRange\": \"De begindatum dient voor de einddatum te liggen\",\n \"Constraint.DateRange.Mandatory\": \"Veld is verplicht: moet tenminste begin- of einddatum bevatten\",\n \"Constraint.DateTime.AboveMaximum\": \"Moet voor ${max-date-time} liggen\",\n \"Constraint.DateTime.BelowMinimum\": \"Moet op ${min-date-time} of later liggen\",\n \"Constraint.DateTime.InvalidFormat\": \"Moet worden opgegeven in het formaat ${format}\",\n \"Constraint.DateTime.OutOfRange\": \"Moet tussen ${min-date-time} en ${max-date-time} liggen\",\n \"Constraint.DateTimeRange.InvalidRange\": \"De begindatumtijd dient voor de einddatumtijd te liggen\",\n \"Constraint.DateTimeRange.Mandatory\": \"Veld is verplicht: moet tenminste begin- of einddatumtijd bevatten\",\n \"Constraint.Document.MimeTypeNotAllowed\": \"Het document mime type voldoet niet aan het document type\",\n \"Constraint.Email.InvalidFormat\": \"Moet een geldig emailadres zijn\",\n \"Constraint.File.DataEmpty\": \"Bestand bestaat niet of heeft geen inhoud\",\n \"Constraint.File.InvalidExtension\": \"Toegestane extensies zijn: ${extensions}\",\n \"Constraint.File.InvalidFormat\": \"Voldoet niet aan de voorwaarden van een bestandsnaam\",\n \"Constraint.File.InvalidMimeType\": \"Toegestane mime-types zijn: ${mime-types}\",\n \"Constraint.File.MaxFileSizeExceeded\": \"De maximum file grootte voor upload is ${max-filesize}\",\n \"Constraint.File.OnlyAllowsOneFile\": \"Er is slechts één bestand toegestaan\",\n \"Constraint.IBAN.InvalidFormat\": \"Moet een geldig IBAN nummer zijn\",\n \"Constraint.InvalidLengthBetween\": \"Lengte moet tussen ${min-length} en ${max-length} karakters liggen\",\n \"Constraint.InvalidLengthExact\": \"Lengte moet precies ${length} karakters zijn\",\n \"Constraint.InvalidLengthTooLong\": \"Lengte mag niet langer dan ${max-length} karakters zijn\",\n \"Constraint.InvalidLengthTooShort\": \"Lengte moet tenminste ${min-length} karakters zijn\",\n \"Constraint.InvalidRegularExpression\": \"De waarde voldoet niet aan de reguliere expressie ${regexp}\",\n \"Constraint.Mandatory\": \"Veld is verplicht\",\n \"Constraint.Missing\": \"Veld is verplicht\",\n \"Constraint.Number.AboveMaximum\": \"Mag niet groter dan ${max-number} zijn\",\n \"Constraint.Number.BelowMinimum\": \"Moet minstens ${min-number} zijn\",\n \"Constraint.Number.InvalidDecimal\": \"Moet een getal zijn met maximaal ${max-digits} decimalen\",\n \"Constraint.Number.InvalidInteger\": \"Moet een geheel getal zijn\",\n \"Constraint.Number.InvalidLong\": \"Moet een geheel getal zijn\",\n \"Constraint.Number.OutOfRange\": \"Moet tussen ${min-number} en ${max-number} liggen\",\n \"Constraint.NumberRange.BothFieldsMandatory\": \"Moet zowel een begin- als een eindwaarde bevatten\",\n \"Constraint.NumberRange.InvalidRange\": \"De beginwaarde dient kleiner te zijn dan de eindwaarde\",\n \"Constraint.NumberRange.Mandatory\": \"Veld is verplicht: moet tenminste begin- of eindwaarde bevatten\",\n \"Constraint.Password.AlreadyUsed\": \"Mag niet eerder zijn gebruikt\",\n \"Constraint.Password.LowerAndUpperCaseMandatory\": \"Moet zowel hoofdletters als kleine letters bevatten\",\n \"Constraint.Password.MinNumericCharactersMandatory\": \"Moet ${min-numeric} of meer numerieke karakters bevatten\",\n \"Constraint.Password.MinSpecialCharactersMandatory\": \"Moet ${min-special} of meer speciale karakters bevatten\",\n \"Constraint.Password.ThreeConsecutiveCharactersNotAllowed\": \"Mag niet meer dan twee dezelfde karakters achter elkaar bevatten\",\n \"Constraint.Password.Unchanged\": \"Mag niet hetzelfde zijn als het oude wachtwoord\",\n \"Constraint.Password.UserNameSubstringNotAllowed\": \"Mag niet vijf opeenvolgende karakters van de gebruikersnaam bevatten\",\n \"Constraint.SortParameter.InvalidValue\": \"Ongeldige sorteerparameter. Toegestane waardes: veld+[asc|desc]\",\n \"Constraint.Time.InvalidFormat\": \"Moet worden opgegeven in het formaat ${format}\",\n \"Constraint.TimeRange.InvalidRange\": \"De begintijd dient voor de eindtijd te liggen\",\n \"Constraint.TimeRange.Mandatory\": \"Veld is verplicht: moet tenminste begin- of eindtijd bevatten\",\n \"Constraint.TimeStamp.AboveMaximum\": \"Moet op of voor ${max-date} liggen\",\n \"Constraint.TimeStamp.BelowMinimum\": \"Moet op of na ${min-date} liggen\",\n \"Constraint.Timestamp.InvalidFormat\": \"Moet worden opgegeven in het formaat ${format}\",\n \"Constraint.TimeStampRange.InvalidRange\": \"De beginwaarde dient voor de eindwaarde te liggen\",\n \"Constraint.TimeStampRange.Mandatory\": \"Veld is verplicht: moet tenminste begin- of eindwaarde bevatten\",\n \"Constraint.XML.InvalidFormat\": \"Moet geldige XML zijn\",\n \"Constraint.ZipCode.InvalidFormat\": \"Moet een geldige postcode zijn, bijvoorbeeld 1234AB\",\n \"Error.AcceptHeaderRequired\": \"De 'Accept' request-header moet worden meegegeven\",\n \"Error.Authentication.BlockedUser\": \"U bent uitgelogd omdat uw account geblokkeerd is\",\n \"Error.Authentication.ConcurrentUser\": \"U bent uitgelogd omdat uw gebruikersnaam op een andere locatie is gebruikt om in te loggen.\",\n \"Error.Authentication.InvalidCredentials\": \"Inloggen is mislukt\",\n \"Error.Authentication.InvalidUsername\": \"U bent uitgelogd omdat uw gebruikersnaam niet meer geldig is\",\n \"Error.Authentication.Required\": \"Autorisatie is vereist\",\n \"Error.Case.ConcurrentModification\": \"Een andere gebruiker heeft het dossier aangepast waardoor deze taak nu niet meer is toegestaan\",\n \"Error.ChangePasswordRequired\": \"Gebruikerswachtwoord is initieel of verlopen, en moet worden aangepast\",\n \"Error.CodemapLookup.InvalidToken\": \"Token voor keuzelijst lookup is niet valide\",\n \"Error.DataStore.ConcurrentModification\": \"Een andere gebruiker heeft de rij in de datastore reeds aangepast\",\n \"Error.DataStore.RecordAlreadyExists\": \"\",\n \"Error.DataStore.RowCannotBeLocked\": \"Een andere gebruiker heeft de rij in bewerking en daarom kan deze taak niet worden volbracht.\",\n \"Error.Form.DataNotAvailableForId\": \"Service kan niet worden afgrond, data voor verplicht element ${elementid} is niet beschikbaar\",\n \"Error.Form.ObjectNotAllowed\": \"Object '${objectid}' is niet toegestaan\",\n \"Error.Form.ReadOnlyElementId\": \"Element '${elementid}' is alleen lezen\",\n \"Error.Form.TooManyObjects\": \"Te veel objecten '${objectid}' aangeleverd\",\n \"Error.Form.UndefinedElementId\": \"Element '${elementid}' is ongedefinieerd\",\n \"Error.Form.UndefinedObject\": \"Object(en) '${objectid}' ongedefinieerd\",\n \"Error.GeneralError\": \"Er is een onverwachte fout opgetreden\",\n \"Error.MethodNotAllowed\": \"De opgegeven HTTP methode is niet toegestaan op deze resource\",\n \"Error.Parameter.InvalidValue\": \"De parameter bevat karakters die niet zijn toegestaan\",\n \"Error.Parameter.Mandatory\": \"De parameter ${parameter} is verplicht\",\n \"Error.Parameter.NotAllowed\": \"Parameter '${parameter}' is niet toegestaan\",\n \"Error.ResourceNotFound\": \"De opgevraagde resource kan niet worden gevonden\",\n \"Validation.StandardCreateAndUpdateUserTask.PasswordsDoNotMatch\": \"Het wachtwoord en de wachtwoordbevestiging komen niet overeen\",\n \"Validation.StandardCreateAndUpdateUserTask.UserEmailAlreadyExists\": \"Een gebruiker met e-mailadres '${Email}' bestaat al\",\n \"Validation.StandardCreateAndUpdateUserTask.UserNameAlreadyExists\": \"Een gebruiker met gebruikersnaam '${Username}' bestaat al\",\n \"Validation.StandardCreateOrganizationTask.OrganizationAlreadyExists\": \"Een organisatie met id '${ID}' bestaat al\"\n}\n","import { createAction, createReducer } from \"@reduxjs/toolkit\";\n\nimport { Cache, clearCookie, setCookie } from \"@beinformed/ui/utils\";\n\nimport { Locales } from \"../../i18n/Locales\";\n\nexport interface I18nState {\n locales: Locales;\n locale: string;\n}\n\nexport const receiveLocale = (locale: string) => updateLocale(locale);\n\nexport const updateLocale = createAction(\"UPDATE_LOCALE\", (locale: string) => {\n return { payload: locale };\n});\n\nexport const setLocales = createAction(\n \"SET_LOCALES\",\n (locales: Locales, locale: string) => {\n return { payload: { locales, locale } };\n },\n);\n\nconst getDefaultLocale = () => {\n if (typeof navigator !== \"undefined\" && navigator?.language) {\n return navigator?.language.split(\"-\")[0] || \"en\";\n }\n return \"en\";\n};\n\nconst initialState = {\n locales: new Locales(),\n locale: getDefaultLocale(),\n};\n\nexport const i18nReducer = createReducer<I18nState>(initialState, (builder) => {\n builder\n .addCase(updateLocale, (state, action) => {\n if (state.locales?.length > 1) {\n setCookie(\"locale\", action.payload);\n } else {\n clearCookie(\"locale\");\n }\n\n // clear cache because of cached contributions\n Cache.clear();\n\n state.locale = action.payload;\n })\n .addCase(setLocales, (state, action) => {\n const { locale, locales } = action.payload;\n\n if (state.locales.length > 1) {\n setCookie(\"locale\", locale);\n } else {\n clearCookie(\"locale\");\n }\n\n state.locales = locales;\n if (locale) {\n state.locale = locale;\n }\n });\n});\n","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,EAA6B,CACxC,UAAW,CACT,KAAM,EACN,WAAY,CACd,EACA,IAAK,CACH,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,CACN,EACA,KAAM,CACJ,GAAI,CAAC,OAAQ,MAAM,EACnB,GAAI,CAAC,YAAa,gCAAO,EACzB,GAAI,CAAC,YAAa,WAAW,EAC7B,GAAI,CAAC,OAAQ,OAAO,EACpB,GAAI,CAAC,UAAW,0BAAM,EACtB,GAAI,CAAC,YAAa,aAAU,EAC5B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,EAAiBC,GAAmBC,EAAaD,CAAM,EAEvDC,EAAeC,EAAa,gBAAkBF,IAClD,CAAE,QAASA,CAAO,EAC1B,EAEYG,EAAaD,EACxB,cACA,CAACE,EAAkBJ,KACV,CAAE,QAAS,CAAE,QAAAI,EAAS,OAAAJ,CAAO,CAAE,EAE1C,EAEMK,EAAmB,IACnB,OAAO,UAAc,KAAe,WAAW,UAC1C,WAAW,SAAS,MAAM,GAAG,EAAE,CAAC,GAAK,KAK1CC,EAAe,CACnB,QAAS,IAAIC,EACb,OAAQF,EAAiB,CAC3B,EAEaG,EAAcC,EAAyBH,EAAeI,GAAY,CAC7EA,EACG,QAAQT,EAAc,CAACU,EAAOC,IAAW,CACpCD,EAAM,SAAS,OAAS,EAC1BE,EAAU,SAAUD,EAAO,OAAO,EAElCE,EAAY,QAAQ,EAItBC,EAAM,MAAM,EAEZJ,EAAM,OAASC,EAAO,OACxB,CAAC,EACA,QAAQT,EAAY,CAACQ,EAAOC,IAAW,CACtC,GAAM,CAAE,OAAAZ,EAAQ,QAAAI,CAAQ,EAAIQ,EAAO,QAE/BD,EAAM,QAAQ,OAAS,EACzBE,EAAU,SAAUb,CAAM,EAE1Bc,EAAY,QAAQ,EAGtBH,EAAM,QAAUP,EACZJ,IACFW,EAAM,OAASX,EAEnB,CAAC,CACL,CAAC,EC1DM,IAAMgB,EAAaC,GACjBA,EAAM,MAAM,QAAU,KAMlBC,GAAcD,GAA8BA,EAAM,KAAK","names":["languages","formatMessage","immerable","IllegalStateException","getBooleanSetting","IS_DEV","Locale","immerable","#code","#messages","#errors","#nativeName","locale","formatMessage","languageCode","language","languages","IllegalStateException","message","messages","id","defaultMessage","messageFromLocale","IS_DEV","getBooleanSetting","parameters","errors","IllegalArgumentException","BaseCollection","beinformed_error_messages_en_nl_default","beinformed_error_messages_nl_nl_default","availableLocales","beinformed_error_messages_en_nl_default","beinformed_error_messages_nl_nl_default","createLocalesWithConfiguredErrors","configuredErrors","availableLocale","Locales","_Locales","BaseCollection","locales","locale","Locale","hydatedLocales","localeCode","item","IllegalArgumentException","acceptLanguageHeader","preferredLocales","messages","errors","createAction","createReducer","Cache","clearCookie","setCookie","receiveLocale","locale","updateLocale","createAction","setLocales","locales","getDefaultLocale","initialState","Locales","i18nReducer","createReducer","builder","state","action","setCookie","clearCookie","Cache","getLocale","state","getLocales"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as p}from"./chunk-SPV6MD7J.js";import{e as s}from"./chunk-KZB56W7Q.js";import{b as a}from"./chunk-FW4363Y4.js";var n=a(p(),1);import{ModelResolver as f,ModularUIResponse as h}from"@beinformed/ui/modularui";var l=r=>{let o=h.rehydrate(r),e=f.resolve(o);if(e){let t=new e(o);if(r.childModels){let d=r.childModels.map(c=>l(c)).filter(c=>c!=null);t.addChildModels(d)}return t}},u=r=>r!=null&&typeof r=="object"&&(0,n.default)(r,"data")&&(0,n.default)(r,"contributions")&&(0,n.default)(r,"key")&&typeof r.key=="string"&&(0,n.default)(r,"locale")&&typeof r.locale=="string",y=(r,o)=>Array.isArray(o)?o.map(t=>i(t)):u(o)?l(o):r==="i18n"&&(0,n.default)(o,"locales")&&(0,n.default)(o,"locale")?{locales:s.rehydrate(o.locales),locale:o?.locale}:["preferences","router","progressindicator","modelcatalog"].includes(r)?o:o!==null&&typeof o=="object"?i(o):o,i=r=>{let o={};return Object.keys(r).forEach(e=>{let t=r[e];o[e]=y(e,t)}),o};import{JsonParseException as m}from"@beinformed/ui/exceptions";var k=()=>{let r=document.querySelector('script[type="application/json"][data-app-state="app-json"]');if(r){if(r?.textContent?.trim()==="")return{}}else throw new Error("Error loading state, json not found");let o=r.textContent||"";try{let e=JSON.parse(o);return i(e)}catch{throw new m(`Error parsing content ${o}`)}};export{i as a,k as b};
|
|
2
|
+
//# sourceMappingURL=chunk-KZLW2NHD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/client/rehydrate.ts","../src/redux/dataFromServer.ts"],"sourcesContent":["import has from \"lodash/has\";\n\nimport { ModelResolver, ModularUIResponse } from \"@beinformed/ui/modularui\";\n\nimport { Locales } from \"../i18n/Locales\";\n\nimport type { Contributions, Data } from \"@beinformed/ui/types\";\n\ninterface RehydrateData {\n key: string;\n locale: string;\n data: Data;\n contributions: Contributions;\n origin?: string;\n contextPath?: string;\n childModels?: RehydrateData[];\n}\n\n/**\n * Recreate a model from dehydrated data obtained after a server render.\n */\nconst recreateModel = (data: RehydrateData) => {\n const modelData = ModularUIResponse.rehydrate(data);\n\n const Model = ModelResolver.resolve(modelData);\n\n if (Model) {\n const model = new Model(modelData);\n\n //Todo\n // model.rehydrate(data);\n\n if (data.childModels) {\n const childModels = data.childModels\n .map((childModel: RehydrateData) => recreateModel(childModel))\n .filter((d) => d != null);\n\n model.addChildModels(childModels);\n }\n\n return model;\n }\n\n return undefined;\n};\n\nconst isModularUIModelData = (data: unknown) =>\n data != null &&\n typeof data === \"object\" &&\n has(data, \"data\") &&\n has(data, \"contributions\") &&\n has(data, \"key\") &&\n typeof data.key === \"string\" &&\n has(data, \"locale\") &&\n typeof data.locale === \"string\";\n\nconst rehydratedValue = (stateKey: string, stateValue: unknown) => {\n if (Array.isArray(stateValue)) {\n return stateValue.map((stateItem) => rehydrate(stateItem));\n }\n\n if (isModularUIModelData(stateValue)) {\n return recreateModel(stateValue as RehydrateData);\n }\n\n if (\n stateKey === \"i18n\" &&\n has(stateValue, \"locales\") &&\n has(stateValue, \"locale\")\n ) {\n return {\n locales: Locales.rehydrate(stateValue.locales),\n locale: stateValue?.locale,\n };\n }\n\n const noFurtherRehydration = [\n \"preferences\",\n \"router\",\n \"progressindicator\",\n \"modelcatalog\",\n ];\n if (noFurtherRehydration.includes(stateKey)) {\n return stateValue;\n }\n\n if (stateValue !== null && typeof stateValue === \"object\") {\n return rehydrate(stateValue as Record<string, unknown>);\n }\n\n return stateValue;\n};\n\n/**\n * Maps dehydrated state to models that can be used to rehydrated the application.\n */\nexport const rehydrate = (state: Record<string, unknown>) => {\n const mappedState: Record<string, unknown> = {};\n\n Object.keys(state).forEach((stateKey) => {\n const stateValue = state[stateKey];\n mappedState[stateKey] = rehydratedValue(stateKey, stateValue);\n });\n\n return mappedState;\n};\n","import { JsonParseException } from \"@beinformed/ui/exceptions\";\n\nimport { rehydrate } from \"../client/rehydrate\";\n\nexport const getDataFromServer = () => {\n const dataElement = document.querySelector(\n 'script[type=\"application/json\"][data-app-state=\"app-json\"]',\n );\n\n if (!dataElement) {\n throw new Error(\"Error loading state, json not found\");\n } else if (dataElement?.textContent?.trim() === \"\") {\n return {};\n }\n\n const data = dataElement.textContent || \"\";\n try {\n const json = JSON.parse(data);\n return rehydrate(json);\n } catch (_error) {\n throw new JsonParseException(`Error parsing content ${data}`);\n }\n};\n"],"mappings":"wHAAA,IAAAA,EAAgB,SAEhB,OAAS,iBAAAC,EAAe,qBAAAC,MAAyB,2BAmBjD,IAAMC,EAAiBC,GAAwB,CAC7C,IAAMC,EAAYC,EAAkB,UAAUF,CAAI,EAE5CG,EAAQC,EAAc,QAAQH,CAAS,EAE7C,GAAIE,EAAO,CACT,IAAME,EAAQ,IAAIF,EAAMF,CAAS,EAKjC,GAAID,EAAK,YAAa,CACpB,IAAMM,EAAcN,EAAK,YACtB,IAAKO,GAA8BR,EAAcQ,CAAU,CAAC,EAC5D,OAAQC,GAAMA,GAAK,IAAI,EAE1BH,EAAM,eAAeC,CAAW,CAClC,CAEA,OAAOD,CACT,CAGF,EAEMI,EAAwBT,GAC5BA,GAAQ,MACR,OAAOA,GAAS,aAChB,EAAAU,SAAIV,EAAM,MAAM,MAChB,EAAAU,SAAIV,EAAM,eAAe,MACzB,EAAAU,SAAIV,EAAM,KAAK,GACf,OAAOA,EAAK,KAAQ,aACpB,EAAAU,SAAIV,EAAM,QAAQ,GAClB,OAAOA,EAAK,QAAW,SAEnBW,EAAkB,CAACC,EAAkBC,IACrC,MAAM,QAAQA,CAAU,EACnBA,EAAW,IAAKC,GAAcC,EAAUD,CAAS,CAAC,EAGvDL,EAAqBI,CAAU,EAC1Bd,EAAcc,CAA2B,EAIhDD,IAAa,WACb,EAAAF,SAAIG,EAAY,SAAS,MACzB,EAAAH,SAAIG,EAAY,QAAQ,EAEjB,CACL,QAASG,EAAQ,UAAUH,EAAW,OAAO,EAC7C,OAAQA,GAAY,MACtB,EAG2B,CAC3B,cACA,SACA,oBACA,cACF,EACyB,SAASD,CAAQ,EACjCC,EAGLA,IAAe,MAAQ,OAAOA,GAAe,SACxCE,EAAUF,CAAqC,EAGjDA,EAMIE,EAAaE,GAAmC,CAC3D,IAAMC,EAAuC,CAAC,EAE9C,cAAO,KAAKD,CAAK,EAAE,QAASL,GAAa,CACvC,IAAMC,EAAaI,EAAML,CAAQ,EACjCM,EAAYN,CAAQ,EAAID,EAAgBC,EAAUC,CAAU,CAC9D,CAAC,EAEMK,CACT,ECzGA,OAAS,sBAAAC,MAA0B,4BAI5B,IAAMC,EAAoB,IAAM,CACrC,IAAMC,EAAc,SAAS,cAC3B,4DACF,EAEA,GAAKA,GAEE,GAAIA,GAAa,aAAa,KAAK,IAAM,GAC9C,MAAO,CAAC,MAFR,OAAM,IAAI,MAAM,qCAAqC,EAKvD,IAAMC,EAAOD,EAAY,aAAe,GACxC,GAAI,CACF,IAAME,EAAO,KAAK,MAAMD,CAAI,EAC5B,OAAOE,EAAUD,CAAI,CACvB,MAAiB,CACf,MAAM,IAAIE,EAAmB,yBAAyBH,CAAI,EAAE,CAC9D,CACF","names":["import_has","ModelResolver","ModularUIResponse","recreateModel","data","modelData","ModularUIResponse","Model","ModelResolver","model","childModels","childModel","d","isModularUIModelData","has","rehydratedValue","stateKey","stateValue","stateItem","rehydrate","Locales","state","mappedState","JsonParseException","getDataFromServer","dataElement","data","json","rehydrate","JsonParseException"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as K,c as p,g as $}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as K,c as p,g as $}from"./chunk-HTR32BUX.js";import{a as n}from"./chunk-FW4363Y4.js";var s=n((Mr,c)=>{"use strict";function F(r){return r!=null&&typeof r=="object"}c.exports=F});var u=n((Nr,f)=>{"use strict";var G=Array.isArray;f.exports=G});var a=n((kr,y)=>{"use strict";var Y=p(),Z=s(),_="[object Symbol]";function D(r){return typeof r=="symbol"||Z(r)&&Y(r)==_}y.exports=D});var m=n((vr,b)=>{"use strict";var X=u(),B=a(),H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/;function Q(r,e){if(X(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||B(r)?!0:J.test(r)||!H.test(r)||e!=null&&r in Object(e)}b.exports=Q});var q=n((wr,g)=>{"use strict";var R=$(),U=500;function V(r){var e=R(r,function(i){return t.size===U&&t.clear(),i}),t=e.cache;return e}g.exports=V});var h=n((zr,l)=>{"use strict";var W=q(),rr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,er=/\\(\\)?/g,tr=W(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(rr,function(t,i,o,L){e.push(o?L.replace(er,"$1"):i||t)}),e});l.exports=tr});var I=n((Cr,x)=>{"use strict";function nr(r,e){for(var t=-1,i=r==null?0:r.length,o=Array(i);++t<i;)o[t]=e(r[t],t,r);return o}x.exports=nr});var j=n((Lr,d)=>{"use strict";var A=K(),ir=I(),or=u(),sr=a(),ur=1/0,S=A?A.prototype:void 0,P=S?S.toString:void 0;function T(r){if(typeof r=="string")return r;if(or(r))return ir(r,T)+"";if(sr(r))return P?P.call(r):"";var e=r+"";return e=="0"&&1/r==-ur?"-0":e}d.exports=T});var E=n((Kr,O)=>{"use strict";var ar=j();function pr(r){return r==null?"":ar(r)}O.exports=pr});var gr=n(($r,M)=>{"use strict";var cr=u(),fr=m(),yr=h(),br=E();function mr(r,e){return cr(r)?r:fr(r,e)?[r]:yr(br(r))}M.exports=mr});var k=n((Fr,N)=>{"use strict";var qr=p(),lr=s(),hr="[object Arguments]";function xr(r){return lr(r)&&qr(r)==hr}N.exports=xr});var Tr=n((Gr,z)=>{"use strict";var v=k(),Ir=s(),w=Object.prototype,Ar=w.hasOwnProperty,Sr=w.propertyIsEnumerable,Pr=v((function(){return arguments})())?v:function(r){return Ir(r)&&Ar.call(r,"callee")&&!Sr.call(r,"callee")};z.exports=Pr});var Er=n((Yr,C)=>{"use strict";var dr=a(),jr=1/0;function Or(r){if(typeof r=="string"||dr(r))return r;var e=r+"";return e=="0"&&1/r==-jr?"-0":e}C.exports=Or});export{u as a,s as b,a as c,gr as d,Tr as e,Er as f};
|
|
2
|
+
//# sourceMappingURL=chunk-L7DO7AZT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKey.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_memoizeCapped.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stringToPath.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayMap.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseToString.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toString.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_castPath.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsArguments.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArguments.js","../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toKey.js"],"sourcesContent":["/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** 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/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\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","module","isArray","require_isSymbol","__commonJSMin","exports","module","baseGetTag","isObjectLike","symbolTag","isSymbol","value","require_isKey","__commonJSMin","exports","module","isArray","isSymbol","reIsDeepProp","reIsPlainProp","isKey","value","object","type","require_memoizeCapped","__commonJSMin","exports","module","memoize","MAX_MEMOIZE_SIZE","memoizeCapped","func","result","key","cache","require_stringToPath","__commonJSMin","exports","module","memoizeCapped","rePropName","reEscapeChar","stringToPath","string","result","match","number","quote","subString","require_arrayMap","__commonJSMin","exports","module","arrayMap","array","iteratee","index","length","result","require_baseToString","__commonJSMin","exports","module","Symbol","arrayMap","isArray","isSymbol","INFINITY","symbolProto","symbolToString","baseToString","value","result","require_toString","__commonJSMin","exports","module","baseToString","toString","value","require_castPath","__commonJSMin","exports","module","isArray","isKey","stringToPath","toString","castPath","value","object","require_baseIsArguments","__commonJSMin","exports","module","baseGetTag","isObjectLike","argsTag","baseIsArguments","value","require_isArguments","__commonJSMin","exports","module","baseIsArguments","isObjectLike","objectProto","hasOwnProperty","propertyIsEnumerable","isArguments","value","require_toKey","__commonJSMin","exports","module","isSymbol","INFINITY","toKey","value","result"]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObjectLike.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isArray.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isSymbol.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_isKey.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_memoizeCapped.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_stringToPath.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_arrayMap.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseToString.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/toString.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_castPath.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseIsArguments.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isArguments.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_toKey.js"],"sourcesContent":["/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** 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/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n"],"mappings":"8FAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cAwBA,SAASC,EAAaC,EAAO,CAC3B,OAAOA,GAAS,MAAQ,OAAOA,GAAS,QAC1C,CAEAF,EAAO,QAAUC,IC5BjB,IAAAE,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cAuBA,IAAIC,EAAU,MAAM,QAEpBD,EAAO,QAAUC,ICzBjB,IAAAC,EAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,EAAa,IACbC,EAAe,IAGfC,EAAY,kBAmBhB,SAASC,EAASC,EAAO,CACvB,OAAO,OAAOA,GAAS,UACpBH,EAAaG,CAAK,GAAKJ,EAAWI,CAAK,GAAKF,CACjD,CAEAH,EAAO,QAAUI,IC5BjB,IAAAE,EAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,EAAU,IACVC,EAAW,IAGXC,EAAe,mDACfC,EAAgB,QAUpB,SAASC,EAAMC,EAAOC,EAAQ,CAC5B,GAAIN,EAAQK,CAAK,EACf,MAAO,GAET,IAAIE,EAAO,OAAOF,EAClB,OAAIE,GAAQ,UAAYA,GAAQ,UAAYA,GAAQ,WAChDF,GAAS,MAAQJ,EAASI,CAAK,EAC1B,GAEFF,EAAc,KAAKE,CAAK,GAAK,CAACH,EAAa,KAAKG,CAAK,GACzDC,GAAU,MAAQD,KAAS,OAAOC,CAAM,CAC7C,CAEAP,EAAO,QAAUK,IC5BjB,IAAAI,EAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,EAAU,IAGVC,EAAmB,IAUvB,SAASC,EAAcC,EAAM,CAC3B,IAAIC,EAASJ,EAAQG,EAAM,SAASE,EAAK,CACvC,OAAIC,EAAM,O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AAQ,GACtB,OAAQC,GAAU,KAAQ,EAAID,GAAU,CAACF,GAAY,KAAOG,CAC9D,CAEAL,EAAO,QAAUG","names":["require_isObjectLike","__commonJSMin","exports","module","isObjectLike","value","require_isArray","__commonJSMin","exports","module","isArray","require_isSymbol","__commonJSMin","exports","module","baseGetTag","isObjectLike","symbolTag","isSymbol","value","require_isKey","__commonJSMin","exports","module","isArray","isSymbol","reIsDeepProp","reIsPlainProp","isKey","value","object","type","require_memoizeCapped","__commonJSMin","exports","module","memoize","MAX_MEMOIZE_SIZE","memoizeCapped","func","result","key","cache","require_stringToPath","__commonJSMin","exports","module","memoizeCapped","rePropName","reEscapeChar","stringToPath","string","result","match","number","quote","subString","require_arrayMap","__commonJSMin","exports","module","arrayMap","array","iteratee","index","length","result","require_baseToString","__commonJSMin","exports","module","Symbol","arrayMap","isArray","isSymbol","INFINITY","symbolProto","symbolToString","baseToString","value","result","require_toString","__commonJSMin","exports","module","baseToString","toString","value","require_castPath","__commonJSMin","exports","module","isArray","isKey","stringToPath","toString","castPath","value","object","require_baseIsArguments","__commonJSMin","exports","module","baseGetTag","isObjectLike","argsTag","baseIsArguments","value","require_isArguments","__commonJSMin","exports","module","baseIsArguments","isObjectLike","objectProto","hasOwnProperty","propertyIsEnumerable","isArguments","value","require_toKey","__commonJSMin","exports","module","isSymbol","INFINITY","toKey","value","result"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as _,e as E}from"./chunk-
|
|
1
|
+
import{b as _,e as E}from"./chunk-BV77KA4Y.js";import{a as d,b as U,i as T}from"./chunk-SPV6MD7J.js";import{H as P}from"./chunk-ITSZQHGD.js";import{j as y}from"./chunk-KZB56W7Q.js";import{a as R}from"./chunk-6AKWSGWH.js";import{a as v,b as x}from"./chunk-GD4NSZBN.js";import{b as h,e as c,g as u,h as S,i as g}from"./chunk-FBCZEJSD.js";import{b as M}from"./chunk-FW4363Y4.js";import{ModularUIRequest as L}from"@beinformed/ui/modularui";var I=e=>{try{let t=y(e.getState()),r=new L("/",{locale:t}).fetchSync();r.connectKey=`application(/)(${t})`,e.dispatch(P([{key:`application(/)(${t})`,model:r}]))}catch{}};import{getContextPath as N}from"@beinformed/ui/settings";(function(){typeof __webpack_public_path__<"u"&&(__webpack_public_path__=`${N()}/`)})();var w=e=>{if(e?.contextPath===void 0)throw new Error("Missing contextPath argument");if(e.html===void 0)throw new Error("Missing html for server");let{head:t={}}=e;return`
|
|
2
2
|
<!doctype html>
|
|
3
3
|
<html ${t.htmlAttributes?t.htmlAttributes.toString():""}>
|
|
4
4
|
<head>
|
|
@@ -18,5 +18,5 @@ import{b as _,e as E}from"./chunk-HDOILTJ2.js";import{a as d,b as U,i as T}from"
|
|
|
18
18
|
{JSASSETS:<script src="{CONTEXT_PATH}/{FILE}"></script>:JSASSETS}
|
|
19
19
|
</body>
|
|
20
20
|
</html>
|
|
21
|
-
`.replace(/{CONTEXT_PATH}/g,e.contextPath).trim()};import{
|
|
22
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
`.replace(/{CONTEXT_PATH}/g,e.contextPath).trim()};import{renderToString as O}from"react-dom/server";import{Provider as $}from"react-redux";import{ServerStyleSheet as D,StyleSheetManager as V}from"styled-components";import{getContextPathServer as j}from"@beinformed/ui/settings";var b=e=>{let t=e.getState(),r={};for(let o in t.modularui){let n=t.modularui[o];if(n){let{status:s,model:p,lastModification:m}=n;p?r[o]={status:s,lastModification:m,model:p}:r[o]={status:s,lastModification:m,model:void 0}}}let i={...t,modularui:r};return JSON.stringify(i).replace(/</g,"\\u003c")};import{jsx as l}from"react/jsx-runtime";var k=({store:e,theme:t,UUID:r="",render:i,template:o=w})=>{let n=new D,s=O(l($,{store:e,children:l(V,{sheet:n.instance,children:l(x,{theme:t,children:i()})})})),p=F(n);return o({contextPath:j(),html:s,head:p,state:b(e),UUID:r})},F=(e,t)=>{let r=e.getStyleTags(),i=t?.helmet,o=t?[...i.meta]:[];return t?{...i,style:r,meta:o}:{style:r,meta:o}};var B=M(U(),1);import{createUUID as X}from"@beinformed/ui/utils";var J=(e,t)=>{t.forEach(r=>{if(typeof r=="object"){let{name:i,defaultValue:o,type:n}=r;o&&e.dispatch(c(i,o,n))}else e.dispatch(c(r,null))})},A=(e,t)=>{Array.isArray(t)&&J(e,t),e.dispatch(u()),e.dispatch(g()),e.dispatch(S()),preferencesProvider&&preferencesProvider.isStudioContext&&preferencesProvider.isStudioContext()&&e.dispatch(h("isStudioContext",!0))};var q=e=>{let t=e.getState();if(t.error&&(t.error.shouldThrowOnServer||!(0,B.default)(t.error,"shouldThrowOnServer")))throw t.error},Ee=({request:e,locales:t,customReducers:r,serverPreferences:i=[],theme:o,render:n,template:s,beforeRenderHooks:p,preloadApplication:m=!0})=>{if(e.getHeader("X-BI-Preview-Available"))return"<h1>Preview Available</h1>";let f=X();__webpack_nonce__=f;let C=_(e),a=T({router:{location:C,action:void 0}},r);if(A(a,i),R(a),o){let H=a.getState()?.preferences?.theme;v(H,o)}return E(a,t,e),m&&I(a),q(a),d(p,{store:a,request:e}),k({store:a,theme:o,UUID:f,render:n,template:s})};export{I as a,w as b,b as c,k as d,F as e,J as f,A as g,Ee as h};
|
|
22
|
+
//# sourceMappingURL=chunk-OQK6SSUD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server/application.ts","../src/server/contextPath.ts","../src/server/htmlpage.ts","../src/server/renderSSRMinimal.tsx","../src/server/serverState.ts","../src/server/serverNoSSR.ts","../src/server/serverPreferences.ts"],"sourcesContent":["import { ModularUIRequest } from \"@beinformed/ui/modularui\";\n\nimport { getLocale } from \"../redux/i18n/i18nSelectors\";\nimport { initModels } from \"../redux/modularui/modelActions\";\n\nimport type { BEIStore } from \"../redux/store\";\n\nexport const setApplication = (store: BEIStore) => {\n try {\n const locale = getLocale(store.getState());\n const application = new ModularUIRequest(\"/\", {\n locale: locale,\n }).fetchSync();\n\n application.connectKey = `application(/)(${locale})`;\n\n store.dispatch(\n initModels([\n {\n key: `application(/)(${locale})`,\n model: application,\n },\n ]),\n );\n } catch (_e) {\n // swallow error, in this case we just don't pre-cache the webapplication,\n // which has not much difference for the end user\n }\n};\n","import { getContextPath } from \"@beinformed/ui/settings\";\n\ndeclare let __webpack_public_path__: string;\n\n(function x() {\n if (typeof __webpack_public_path__ !== \"undefined\") {\n __webpack_public_path__ = `${getContextPath()}/`; // NOSONAR\n }\n})();\n\nexport {};\n","export interface TemplateProps {\n contextPath: string;\n html: string;\n head: Record<string, unknown>;\n state: string;\n UUID: string;\n}\n\nexport const htmlpage = (props?: Partial<TemplateProps>): string => {\n if (props?.contextPath === undefined) {\n throw new Error(\"Missing contextPath argument\");\n }\n if (props.html === undefined) {\n throw new Error(\"Missing html for server\");\n }\n\n const { head = {} } = props;\n\n const template = `\n <!doctype html>\n <html ${head.htmlAttributes ? head.htmlAttributes.toString() : \"\"}>\n <head>\n <meta charset=\"utf-8\" />\n ${Object.keys(head)\n .filter((key) => key !== \"htmlAttributes\")\n .map((key) => String(head[key]))\n .join(\"\")}\n {CSSASSETS:<link rel=\"stylesheet\" type=\"text/css\" href=\"{CONTEXT_PATH}/{FILE}\" />:CSSASSETS}\n </head>\n <body class=\"nojs\">\n <div id=\"application\">${props.html}</div>\n <div id=\"portal\"></div>\n <script\n type=\"application/json\"\n data-app-state=\"app-json\"\n data-app-contextpath=\"{CONTEXT_PATH}\"\n data-app-filepath=\"{FILEPATH}\"\n data-app-nonce=\"${props.UUID ?? \"\"}\">${props.state ?? \"\"}</script>\n {JSASSETS:<script src=\"{CONTEXT_PATH}/{FILE}\"></script>:JSASSETS}\n </body>\n </html>\n`;\n\n // It is important to replace the context afterwards,\n // the JSASSESTS and CSSASSETS parts act as a small template for all generated javascript and css files\n // these templates must be pure strings to make it possible to add the context path in all situations\n return template.replace(/{CONTEXT_PATH}/g, props.contextPath).trim();\n};\n","import { renderToString } from \"react-dom/server\";\nimport { Provider } from \"react-redux\";\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\n\nimport { getContextPathServer } from \"@beinformed/ui/settings\";\n\nimport { ThemeProvider } from \"../theme/ThemeProvider\";\n\nimport { htmlpage } from \"./htmlpage\";\nimport { dehydrate } from \"./serverState\";\n\nimport type React from \"react\";\nimport type { BEIStore } from \"../redux/store\";\nimport type { Theme } from \"../theme/types\";\nimport type { TemplateProps } from \"./htmlpage\";\n\ninterface Props {\n store: BEIStore;\n theme?: Theme | Theme[];\n UUID: string;\n render: () => React.ReactNode;\n template?: (arg0: TemplateProps) => string;\n}\n\nexport const renderSSRMinimal = ({\n store,\n theme,\n UUID = \"\",\n render,\n template = htmlpage,\n}: Props): string => {\n const sheet = new ServerStyleSheet();\n\n const appHTML = renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>{render()}</ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n );\n\n const head = createHead(sheet);\n return template({\n contextPath: getContextPathServer(),\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n};\n\nexport const createHead = (\n sheet: ServerStyleSheet,\n helmetContext?: Record<string, unknown>,\n): Record<string, unknown> => {\n const style = sheet.getStyleTags();\n const helmet = helmetContext?.helmet as {\n meta: Record<string, unknown>[];\n };\n const meta = helmetContext ? [...helmet.meta] : [];\n\n if (helmetContext) {\n return {\n ...helmet,\n style,\n meta,\n };\n }\n\n return {\n style,\n meta,\n };\n};\n","import type { ModularUIModel } from \"@beinformed/ui/models\";\nimport type { BEIStore } from \"../redux/store\";\n\nexport const dehydrate = (store: BEIStore): string => {\n const state = store.getState();\n\n const modularui: Record<\n string,\n {\n status: string;\n lastModification: number;\n model: ModularUIModel | undefined;\n }\n > = {};\n\n for (const key in state.modularui) {\n const modelEntry = state.modularui[key];\n if (modelEntry) {\n const { status, model, lastModification } = modelEntry;\n\n if (model) {\n modularui[key] = {\n status,\n lastModification,\n model,\n };\n } else {\n modularui[key] = {\n status,\n lastModification,\n model: undefined,\n };\n }\n }\n }\n\n const filteredState = {\n ...state,\n modularui,\n };\n\n return JSON.stringify(filteredState).replace(/</g, \"\\\\u003c\");\n};\n","import \"./contextPath\";\n\nimport has from \"lodash/has\";\n\nimport { createUUID } from \"@beinformed/ui/utils\";\n\nimport { setI18n } from \"../i18n/serverI18n\";\nimport { handleBeforeRenderHooks } from \"../redux/beforeRenderHooks\";\nimport { setupStore } from \"../redux/store\";\nimport { createTheme } from \"../theme/createTheme\";\nimport { setConfigurationTheme } from \"../theme/serverTheme\";\n\nimport { setApplication } from \"./application\";\nimport { renderSSRMinimal } from \"./renderSSRMinimal\";\nimport { getFullRequestLocation } from \"./requestInformation\";\nimport { setServerPreferences } from \"./serverPreferences\";\n\nimport type { Reducer } from \"@reduxjs/toolkit\";\nimport type React from \"react\";\nimport type { LocaleConfiguration } from \"../i18n/types\";\nimport type { BeforeRenderHook } from \"../redux/beforeRenderHooks\";\nimport type { BEIStore } from \"../redux/store\";\nimport type { Theme } from \"../theme/types\";\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { ServerPreferenceValue } from \"./serverPreferences\";\nimport type { HttpServletRequestJava } from \"./types\";\n\ndeclare let __webpack_nonce__: string;\n\ninterface serverProps {\n request: HttpServletRequestJava;\n locales?: LocaleConfiguration[];\n customReducers?: Record<string, Reducer>;\n theme?: Theme | Theme[];\n serverPreferences?: (string | ServerPreferenceValue)[];\n render: () => React.ReactNode;\n template?: (arg0: TemplateProps) => string;\n beforeRenderHooks?: BeforeRenderHook[];\n preloadApplication?: boolean;\n}\n\nconst handleErrors = (s: BEIStore) => {\n const state = s.getState();\n\n if (\n state.error &&\n (state.error.shouldThrowOnServer ||\n !has(state.error, \"shouldThrowOnServer\"))\n ) {\n throw state.error;\n }\n};\n\nexport const serverNoSSR = ({\n request,\n locales,\n customReducers,\n serverPreferences = [],\n theme,\n render,\n template,\n beforeRenderHooks,\n preloadApplication = true,\n}: serverProps): string => {\n const isPreviewCheck = request.getHeader(\"X-BI-Preview-Available\");\n if (isPreviewCheck) {\n return \"<h1>Preview Available</h1>\";\n }\n\n const UUID = createUUID();\n __webpack_nonce__ = UUID; // NOSONAR\n\n const location = getFullRequestLocation(request);\n const reduxStore = setupStore(\n { router: { location, action: undefined } },\n customReducers,\n );\n\n setServerPreferences(reduxStore, serverPreferences);\n setConfigurationTheme(reduxStore);\n\n if (theme) {\n const storedTheme = reduxStore.getState()?.preferences\n ?.theme as unknown as Theme;\n createTheme(storedTheme, theme);\n }\n\n setI18n(reduxStore, locales, request);\n\n if (preloadApplication) {\n setApplication(reduxStore);\n }\n\n handleErrors(reduxStore);\n\n handleBeforeRenderHooks(beforeRenderHooks, { store: reduxStore, request });\n\n return renderSSRMinimal({ store: reduxStore, theme, UUID, render, template });\n};\n","import {\n setAllContentInDataSetting,\n setDateTimeSettings,\n setLoginPreferences,\n setServerPreference,\n} from \"../redux/preferences/preferencesActions\";\nimport { setPreference } from \"../redux/preferences/preferencesReducer\";\n\nimport type { BEIStore } from \"../redux/store\";\n\nexport interface ServerPreferenceValue {\n name: string;\n defaultValue?: string | null;\n type?: string;\n}\n\nexport const setServerPreferencesFromArray = (\n store: BEIStore,\n serverPreferences: (string | ServerPreferenceValue)[],\n) => {\n serverPreferences.forEach((serverPreference) => {\n if (typeof serverPreference === \"object\") {\n const { name, defaultValue, type } = serverPreference;\n if (defaultValue) {\n store.dispatch(setServerPreference(name, defaultValue, type));\n }\n } else {\n store.dispatch(setServerPreference(serverPreference, null));\n }\n });\n};\n\n/**\n * Server preferences can be suplied by an array of preference names,\n * or an array of objects which has the name, an optional default value and an optional type.<br>\n * When the type is set to string, a comma separated value is not converted to an array:\n *\n * @example\n * // value becomes an array [default1, default2]\n * { name: \"prefName\", defaultValue: \"default1, default2\" }\n * // value remains a string \"default1, default2\"\n * { name: \"prefName\", defaultValue: \"default1, default2\", type: \"string\" }\n *\n * @param store\n * @param serverPreferences\n */\nexport const setServerPreferences = (\n store: BEIStore,\n serverPreferences: (string | ServerPreferenceValue)[],\n) => {\n if (Array.isArray(serverPreferences)) {\n setServerPreferencesFromArray(store, serverPreferences);\n }\n\n store.dispatch(setAllContentInDataSetting());\n store.dispatch(setLoginPreferences());\n store.dispatch(setDateTimeSettings());\n\n if (\n preferencesProvider &&\n preferencesProvider.isStudioContext &&\n preferencesProvider.isStudioContext()\n ) {\n store.dispatch(setPreference(\"isStudioContext\", true));\n }\n};\n"],"mappings":"wXAAA,OAAS,oBAAAA,MAAwB,2BAO1B,IAAMC,EAAkBC,GAAoB,CACjD,GAAI,CACF,IAAMC,EAASC,EAAUF,EAAM,SAAS,CAAC,EACnCG,EAAc,IAAIC,EAAiB,IAAK,CAC5C,OAAQH,CACV,CAAC,EAAE,UAAU,EAEbE,EAAY,WAAa,kBAAkBF,CAAM,IAEjDD,EAAM,SACJK,EAAW,CACT,CACE,IAAK,kBAAkBJ,CAAM,IAC7B,MAAOE,CACT,CACF,CAAC,CACH,CACF,MAAa,CAGb,CACF,EC5BA,OAAS,kBAAAG,MAAsB,2BAI9B,UAAa,CACR,OAAO,wBAA4B,MACrC,wBAA0B,GAAGA,EAAe,CAAC,IAEjD,GAAG,ECAI,IAAMC,EAAYC,GAA2C,CAClE,GAAIA,GAAO,cAAgB,OACzB,MAAM,IAAI,MAAM,8BAA8B,EAEhD,GAAIA,EAAM,OAAS,OACjB,MAAM,IAAI,MAAM,yBAAyB,EAG3C,GAAM,CAAE,KAAAC,EAAO,CAAC,CAAE,EAAID,EA8BtB,MA5BiB;AAAA;AAAA,UAETC,EAAK,eAAiBA,EAAK,eAAe,SAAS,EAAI,EAAE;AAAA;AAAA;AAAA,QAG3D,OAAO,KAAKA,CAAI,EACf,OAAQC,GAAQA,IAAQ,gBAAgB,EACxC,IAAKA,GAAQ,OAAOD,EAAKC,CAAG,CAAC,CAAC,EAC9B,KAAK,EAAE,CAAC;AAAA;AAAA;AAAA;AAAA,8BAIaF,EAAM,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAOdA,EAAM,MAAQ,EAAE,KAAKA,EAAM,OAAS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,UAAU,wBAAwB,EAE/D,MAAO,6BAGT,IAAMS,EAAOC,EAAW,EACxB,kBAAoBD,EAEpB,IAAME,EAAWC,EAAuBZ,CAAO,EACzCa,EAAaC,EACjB,CAAE,OAAQ,CAAE,SAAAH,EAAU,OAAQ,MAAU,CAAE,EAC1CT,CACF,EAKA,GAHAa,EAAqBF,EAAYV,CAAiB,EAClDa,EAAsBH,CAAU,EAE5BT,EAAO,CACT,IAAMa,EAAcJ,EAAW,SAAS,GAAG,aACvC,MACJK,EAAYD,EAAab,CAAK,CAChC,CAEA,OAAAe,EAAQN,EAAYZ,EAASD,CAAO,EAEhCQ,GACFY,EAAeP,CAAU,EAG3BlB,EAAakB,CAAU,EAEvBQ,EAAwBd,EAAmB,CAAE,MAAOM,EAAY,QAAAb,CAAQ,CAAC,EAElEsB,EAAiB,CAAE,MAAOT,EAAY,MAAAT,EAAO,KAAAK,EAAM,OAAAJ,EAAQ,SAAAC,CAAS,CAAC,CAC9E","names":["ModularUIRequest","setApplication","store","locale","getLocale","application","ModularUIRequest","initModels","getContextPath","htmlpage","props","head","key","renderToString","Provider","ServerStyleSheet","StyleSheetManager","getContextPathServer","dehydrate","store","state","modularui","key","modelEntry","status","model","lastModification","filteredState","jsx","renderSSRMinimal","store","theme","UUID","render","template","htmlpage","sheet","ServerStyleSheet","appHTML","renderToString","Provider","StyleSheetManager","ThemeProvider","head","createHead","getContextPathServer","dehydrate","helmetContext","style","helmet","meta","import_has","createUUID","setServerPreferencesFromArray","store","serverPreferences","serverPreference","name","defaultValue","type","setServerPreference","setServerPreferences","setAllContentInDataSetting","setLoginPreferences","setDateTimeSettings","setPreference","handleErrors","s","state","has","serverNoSSR","request","locales","customReducers","serverPreferences","theme","render","template","beforeRenderHooks","preloadApplication","UUID","createUUID","location","getFullRequestLocation","reduxStore","setupStore","setServerPreferences","setConfigurationTheme","storedTheme","createTheme","setI18n","setApplication","handleBeforeRenderHooks","renderSSRMinimal"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$ as a,A as w,D,F as H,G as x,H as k,I as E,J as P,K as b,L as B,f as l,h as J,j as c,k as p,l as u,m,n as f,r as y,u as S,v as I,w as h,x as M,y as g}from"./chunk-ITSZQHGD.js";import{i as C}from"./chunk-KZB56W7Q.js";import{d as R}from"./chunk-FBCZEJSD.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((nt,_)=>{"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{createBrowserHistory as z}from"history";import{getContextPathServer as $}from"@beinformed/ui/settings";var i=null,O=null;function v(){if(typeof window>"u")throw new Error("getBrowserHistory can only be used in a browser environment.");let e=$();return(!i||e!==O)&&(i=z({basename:e}),O=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}})),U=V(X,e=>{e.addCase(Y,(t,o)=>{t.location=o.payload.location,t.action=o.payload.action})});import{createReducer as Z}from"@reduxjs/toolkit";import{ApplicationModel as ee}from"@beinformed/ui/models";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"}},ne=(e,t)=>{let{payload:o}=t;for(let{key:r,model:n}of o)e[r]={status:"FINISHED",lastModification:Date.now(),model:n}},F=(e,t)=>{let o=t.payload,r=Object.keys(e).find(n=>e[n]?.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.`)},ae=(e,t)=>{delete e[t.payload]},de=e=>{for(let t in e)e[t]?.model instanceof ee||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:n}=t.payload,d=r;n&&(d=n(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=Z(te,e=>{e.addCase(H,oe).addCase(x,re).addCase(k,ne).addCase(E,F).addCase(P,F).addCase(b,ae).addCase(B,de).addCase(a.pending,ie).addCase(a.fulfilled,se).addCase(a.rejected,le)});import{createReducer as ce}from"@reduxjs/toolkit";var pe={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}},ue=e=>({...e,count:0,timestamp:Date.now(),percentComplete:0}),j=ce(pe,e=>{e.addCase(p,A).addCase(u,L).addCase(m,t=>({...t,count:0})).addCase(f,(t,o)=>({...t,percentComplete:o.payload?.percentComplete})).addCase(a.pending,A).addCase(a.fulfilled,L).addCase(a.rejected,ue)});var N=e=>t=>o=>r=>{if(S.match(r)){let{location:n,state:d}=r.payload;e.push(n,d)}else if(I.match(r)){let{location:n,state:d}=r.payload;e.replace(n,d)}else if(h.match(r)){let{delta:n}=r.payload;e.go(n)}else M.match(r)?e.goBack():g.match(r)&&e.goForward();return o(r)};import{combineReducers as K,configureStore as me}from"@reduxjs/toolkit";var q={router:U,preferences:R,modularui:T,i18n:C,auth:l,error:w,modals:D,modelcatalog:c,notification:y,progressindicator:j},fe=K(q),tt=(e,t,o=v())=>{let r=t?K({...q,...t}):fe;return me({reducer:r,middleware:n=>n({serializableCheck:!1}).concat(N(o)),preloadedState:e})};export{we as a,ge as b,v as c,Y as d,U as e,T as f,j as g,N as h,tt as i};
|
|
2
|
+
//# sourceMappingURL=chunk-SPV6MD7J.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseHas.js","../../../node_modules/.pnpm/lodash@4.17.23/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 { createBrowserHistory } from \"history\";\n\nimport { getContextPathServer } from \"@beinformed/ui/settings\";\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, LocationDescriptorObject } from \"history\";\n\ninterface LocationState {\n from?: string;\n modal?: boolean;\n formdata?: string | undefined | null;\n [key: string]: unknown;\n}\n\nexport type RouterLocation = LocationDescriptorObject<LocationState>;\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 { createReducer } from \"@reduxjs/toolkit\";\n\nimport { ApplicationModel } from \"@beinformed/ui/models\";\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\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\";\n\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":"gTAAA,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,UAErC,OAAS,wBAAAC,MAA4B,0BAIrC,IAAIC,EAA+C,KAC/CC,EAAoC,KAMjC,SAASC,GAAmC,CACjD,GAAI,OAAO,OAAW,IACpB,MAAM,IAAI,MACR,8DACF,EAGF,IAAMC,EAAoBJ,EAAqB,EAC/C,OAAI,CAACC,GAA0BG,IAAsBF,KACnDD,EAAyBF,EAAqB,CAC5C,SAAUK,CACZ,CAAC,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JSMin","exports","module","objectProto","hasOwnProperty","baseHas","object","key","require_has","__commonJSMin","exports","module","baseHas","hasPath","has","object","path","handleBeforeRenderHooks","beforeRenderHooks","props","beforeRenderHook","createBrowserHistory","getContextPathServer","browserHistoryInstance","historyContextPath","getBrowserHistory","contextPathServer","createAction","createReducer","initialState","locationChange","location","action","routerReducer","builder","state","createReducer","ApplicationModel","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 +1,2 @@
|
|
|
1
|
-
import{J as u,L as w,
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{$ as b,J as u,L as w,U as C,V as p,a as B,b as M,c as k,k as f,l,u as _,x as q}from"./chunk-ITSZQHGD.js";import{c as bt}from"./chunk-L7DO7AZT.js";import{a as ft,d as U}from"./chunk-HTR32BUX.js";import{a as g,b as R}from"./chunk-FW4363Y4.js";var W=g((Re,K)=>{"use strict";var Ot=ft(),Mt=function(){return Ot.Date.now()};K.exports=Mt});var G=g((Be,$)=>{"use strict";var At=/\s/;function Et(t){for(var e=t.length;e--&&At.test(t.charAt(e)););return e}$.exports=Et});var z=g((ke,X)=>{"use strict";var Tt=G(),It=/^\s+/;function St(t){return t&&t.slice(0,Tt(t)+1).replace(It,"")}X.exports=St});var Z=g((Ue,Y)=>{"use strict";var vt=z(),J=U(),Dt=bt(),Q=NaN,jt=/^[-+]0x[0-9a-f]+$/i,xt=/^0b[01]+$/i,Pt=/^0o[0-7]+$/i,Rt=parseInt;function Bt(t){if(typeof t=="number")return t;if(Dt(t))return Q;if(J(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=J(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=vt(t);var o=xt.test(t);return o||Pt.test(t)?Rt(t.slice(2),o?2:8):jt.test(t)?Q:+t}Y.exports=Bt});var S=g((_e,et)=>{"use strict";var kt=U(),I=W(),tt=Z(),Ut="Expected a function",_t=Math.max,qt=Math.min;function wt(t,e,o){var r,i,s,m,a,c,h=0,D=!1,F=!1,A=!0;if(typeof t!="function")throw new TypeError(Ut);e=tt(e)||0,kt(o)&&(D=!!o.leading,F="maxWait"in o,s=F?_t(tt(o.maxWait)||0,e):s,A="trailing"in o?!!o.trailing:A);function E(n){var d=r,y=i;return r=i=void 0,h=n,m=t.apply(y,d),m}function ct(n){return h=n,a=setTimeout(O,e),D?E(n):m}function dt(n){var d=n-c,y=n-h,P=e-d;return F?qt(P,s-y):P}function j(n){var d=n-c,y=n-h;return c===void 0||d>=e||d<0||F&&y>=s}function O(){var n=I();if(j(n))return x(n);a=setTimeout(O,dt(n))}function x(n){return a=void 0,A&&r?E(n):(r=i=void 0,m)}function lt(){a!==void 0&&clearTimeout(a),h=0,r=c=i=a=void 0}function pt(){return a===void 0?m:x(I())}function T(){var n=I(),d=j(n);if(r=arguments,i=this,c=n,d){if(a===void 0)return ct(c);if(F)return clearTimeout(a),a=setTimeout(O,e),E(c)}return a===void 0&&(a=setTimeout(O,e)),m}return T.cancel=lt,T.flush=pt,T}et.exports=wt});import{createAsyncThunk as L}from"@reduxjs/toolkit";import{CHANGEPASSWORD_PATH as ht}from"@beinformed/ui/constants";import{Authenticate as Ft}from"@beinformed/ui/modularui";import{Cache as H}from"@beinformed/ui/utils";var N=t=>k(t),V=L("auth/change_pass",(t,{getState:e})=>{let o=e().router.location?.state?.modal,r=e().router.location?.state?.from;return _(ht,{from:r||e().router.location,modal:o})}),Ae=L("auth/login",async({username:t,password:e},{dispatch:o,getState:r})=>{o(f());try{await new Ft().login(t,e),await o(p()),H.addItem("auth",!0),C(r())?.userMustChangePassword?o(V()):o(B()),o(l())}catch(i){typeof i=="object"&&i!=null&&"id"in i&&typeof i.id=="string"?i.id==="Error.ChangePasswordRequired"?(H.addItem("auth",!0),await o(p()),o(V())):o(N(i.id)):i instanceof Error&&o(N(i.message)),o(l())}});import{createAsyncThunk as yt}from"@reduxjs/toolkit";import{Authenticate as gt}from"@beinformed/ui/modularui";var xe=yt("auth/logout",async(t,{dispatch:e})=>{e(f()),await new gt().logout(),e(w()),e(p()),e(M()),e(l())});var rt=R(S(),1);import{HTTP_METHODS as Ct}from"@beinformed/ui/constants";import{FormModel as Ht}from"@beinformed/ui/models";import{ModularUIRequest as Nt}from"@beinformed/ui/modularui";import{getNumberSetting as Vt}from"@beinformed/ui/settings";var Lt=(o=>(o[o.START=0]="START",o[o.FINISHED=1]="FINISHED",o))(Lt||{}),ot=(t,e)=>({type:"UPDATE_AUTOSAVE_STATUS",payload:{status:t,model:e}}),Kt=(t,e)=>{t(ot(0,e));let o=e.getFormData(!0,!1);new Nt(e.selfhref.setParameter("commit","true"),{method:Ct.POST,data:o,childmodels:!1,locale:e.locale}).fetch().then(r=>{r instanceof Ht&&(e.lastServerUpdate=r.lastServerUpdate,t(u(e)),t(ot(1,r)))})},Wt=(0,rt.default)((t,e)=>{Kt(t,e)},Vt("VALIDATE_DEBOUNCE_TIMEOUT",500)),it=t=>e=>Wt(e,t);import{produce as $t}from"immer";import{HTTP_METHODS as Gt}from"@beinformed/ui/constants";import{FormModel as Xt}from"@beinformed/ui/models";var at=(t,e,o=!1)=>{for(;t.allObjects.length>0&&(!t.currentFormObject||!t.currentFormObject.hasAttributeByKey(e.key));)t.setPreviousObject();return t.isChanged()||o?b({key:t.connectKey||t.key,href:t.selfhref,options:{method:Gt.POST,data:t.formdata,updateHandler:r=>r instanceof Xt?$t(t,i=>{i.update(r)}):r}}):null};import{produce as zt}from"immer";import{HTTP_METHODS as Jt}from"@beinformed/ui/constants";import{FormModel as Qt}from"@beinformed/ui/models";var nt=(t,e)=>{for(;t.allObjects.length>0&&(!t.currentFormObject||!t.currentFormObject.hasAttributeByKey(e.key));)t.setPreviousObject();return t.isChanged()?b({key:t.connectKey||t.key,href:t.selfhref.setParameter("commit","false"),options:{method:Jt.POST,data:t.formdata,updateHandler:o=>o instanceof Qt?zt(t,r=>{r.updateCurrentFormObject(o)}):o}}):null};var mt=R(S(),1);import{createAsyncThunk as Yt}from"@reduxjs/toolkit";import{produce as Zt}from"immer";import{HTTP_METHODS as te}from"@beinformed/ui/constants";import{FormModel as st}from"@beinformed/ui/models";import{ModularUIRequest as ee}from"@beinformed/ui/modularui";import{getNumberSetting as oe}from"@beinformed/ui/settings";var re=Yt("",({form:t,formWithValidations:e},{dispatch:o,getState:r})=>{if(t.connectKey){let i=r().modularui[t.connectKey];if(i){let s=i.model;if(s instanceof st){let m=Zt(s,a=>{a.updateValidations(e.data)});o(u(m))}}}}),ie=(0,mt.default)((t,e)=>{new ee(e.selfhref.setParameter("commit","false"),{method:te.POST,data:e.validationData,childmodels:!1,isValidationRequest:!0,locale:e.locale}).fetch().then(o=>{o instanceof st&&t(re({form:e,formWithValidations:o}))})},oe("VALIDATE_DEBOUNCE_TIMEOUT",500),{leading:!0,trailing:!0}),ut=t=>e=>ie(e,t);import{createAsyncThunk as ae}from"@reduxjs/toolkit";import{produce as ne}from"immer";import{getBooleanSetting as me}from"@beinformed/ui/settings";var ho=ae("form/attribute",async({form:t,formObject:e,attribute:o,inputvalue:r,options:i={autosubmit:!1,autosave:!1,autoupdate:!1,forceUpdate:!1,validate:!0}},{dispatch:s})=>{i.validate===void 0&&(i.validate=!0);let m=ne(t,a=>{a.currentFormObject?.equals(e)?a.currentFormObject.updateAttribute(o,r):a.completedFormObjects.forEach(c=>{c.equals(e)&&c.updateAttribute(o,r)})});if(i.autosubmit&&m.isValid){let a=at(m,o,i.forceUpdate);if(a){s(a);return}}if(i.autoupdate&&m.isValid){let a=nt(m,o);if(a){s(a);return}}se(s,m,i),ue(s,m,i),s(u(m))}),se=(t,e,o)=>{o.autosave&&e.isValid&&e.isChanged()&&t(it(e))},ue=(t,e,o)=>{o.validate&&e.currentFormObject?.hasDynamicValidations&&me("USE_INSTANT_SERVER_VALIDATION",!1)&&t(ut(e))};import{createAsyncThunk as ce}from"@reduxjs/toolkit";import{produce as de}from"immer";import{Authenticate as le}from"@beinformed/ui/modularui";var So=t=>{let e=de(t,o=>{o.setPreviousObject()});return u(e)},vo=ce("form/cancel",async(t,{dispatch:e,getState:o})=>(t.key==="ChangePassword"&&o().auth.mustChangePassword&&(e(f()),await new le().logout(),e(M()),e(p()),e(l())),q()));import{produce as v}from"immer";var Po=t=>{let e=v(t,o=>{o.addEmptyFormObject()});return u(e)},Ro=(t,e)=>{let o=v(t,r=>{r.addEmptyFormObject(),r.removeFormObject(e)});return u(o)},Bo=(t,e)=>{let o=v(t,r=>{r.removeFormObject(e)});return u(o)};var Uo=t=>{if(t.modelcatalog?.entryDate)return t.modelcatalog?.entryDate;let e=new Date().toISOString();return e.split("T")[0]||e};var wo=(t,e)=>b({key:t.connectKey||"",href:t.selfhref||"",options:{...e,isReload:!0}});export{N as a,V as b,Ae as c,xe as d,Lt as e,it as f,at as g,nt as h,ut as i,ho as j,So as k,vo as l,Po as m,Ro as n,Bo as o,Uo as p,wo as q};
|
|
2
|
+
//# sourceMappingURL=chunk-TAWZ2VIM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/now.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_trimmedEndIndex.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseTrim.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/toNumber.js","../../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/debounce.js","../src/redux/auth/signinActions.ts","../src/redux/auth/signoutActions.ts","../src/redux/form/autosaveActions.ts","../src/redux/form/autosubmitActions.ts","../src/redux/form/autoupdateActions.ts","../src/redux/form/validateActions.ts","../src/redux/form/attributeActions.ts","../src/redux/form/formActions.ts","../src/redux/form/formAttributesetRepeatable.ts","../src/redux/modelcatalog/modelCatalogSelectors.ts","../src/redux/modularui/reloadModel.ts"],"sourcesContent":["var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","import { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport { CHANGEPASSWORD_PATH } from \"@beinformed/ui/constants\";\nimport { Authenticate } from \"@beinformed/ui/modularui\";\nimport { Cache } from \"@beinformed/ui/utils\";\n\nimport { reloadApplication } from \"../application/applicationActions\";\nimport { getApplication } from \"../application/applicationSelectors\";\nimport {\n finishProgress,\n startProgress,\n} from \"../progressindicator/progressIndicatorActions\";\nimport { push } from \"../router/routerActions\";\n\nimport { loginSuccess, sendAuthenticationError } from \"./authReducer\";\n\nimport type { PayloadAction } from \"@reduxjs/toolkit\";\nimport type { LocationState } from \"history\";\nimport type { RouterLocation } from \"../router/routerReducer\";\nimport type { BEIDispatch, RootState } from \"../store\";\n\nexport const loginFailed = (errorMessage: string) =>\n sendAuthenticationError(errorMessage);\n\nexport const changePassword = createAsyncThunk<\n PayloadAction<{ location: string | RouterLocation; state: LocationState }>,\n void,\n { state: RootState }\n>(\"auth/change_pass\", (_, { getState }) => {\n const isModal = getState().router.location?.state?.modal;\n const locationFrom = getState().router.location?.state?.from;\n return push(CHANGEPASSWORD_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n modal: isModal,\n });\n});\n\nexport const login = createAsyncThunk<\n void,\n { username: string; password: string },\n { state: RootState; dispatch: BEIDispatch }\n>(\"auth/login\", async ({ username, password }, { dispatch, getState }) => {\n dispatch(startProgress());\n\n try {\n await new Authenticate().login(username, password);\n await dispatch(reloadApplication());\n\n Cache.addItem(\"auth\", true);\n const application = getApplication(getState());\n if (application?.userMustChangePassword) {\n dispatch(changePassword());\n } else {\n dispatch(loginSuccess());\n }\n dispatch(finishProgress());\n } catch (error) {\n if (\n typeof error === \"object\" &&\n error != null &&\n \"id\" in error &&\n typeof error.id === \"string\"\n ) {\n if (error.id === \"Error.ChangePasswordRequired\") {\n Cache.addItem(\"auth\", true);\n await dispatch(reloadApplication());\n dispatch(changePassword());\n } else {\n dispatch(loginFailed(error.id));\n }\n } else if (error instanceof Error) {\n dispatch(loginFailed(error.message));\n }\n\n dispatch(finishProgress());\n }\n});\n","import { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport { Authenticate } from \"@beinformed/ui/modularui\";\n\nimport { reloadApplication } from \"../application/applicationActions\";\nimport { resetModularUI } from \"../modularui/modelActions\";\nimport {\n finishProgress,\n startProgress,\n} from \"../progressindicator/progressIndicatorActions\";\n\nimport { logoutSuccess } from \"./authReducer\";\n\nimport type { BEIDispatch } from \"../store\";\n\nexport const logout = createAsyncThunk<void, void, { dispatch: BEIDispatch }>(\n \"auth/logout\",\n async (_, { dispatch }) => {\n dispatch(startProgress());\n\n await new Authenticate().logout();\n\n dispatch(resetModularUI());\n dispatch(reloadApplication());\n\n dispatch(logoutSuccess());\n dispatch(finishProgress());\n },\n);\n","import debounce from \"lodash/debounce\";\n\nimport { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { FormModel } from \"@beinformed/ui/models\";\nimport { ModularUIRequest } from \"@beinformed/ui/modularui\";\nimport { getNumberSetting } from \"@beinformed/ui/settings\";\n\nimport { updateForm } from \"../modularui/modelActions\";\n\nimport type { BEIDispatch } from \"../store\";\n\n/**\n * POSSIBLE AUTOSAVE STATUSSES\n * @type {{START: string, FINISHED: string}}\n */\nexport enum AUTOSAVE_STATUS {\n START,\n FINISHED,\n}\n\n/**\n * Update validations of the form currently in the reducer\n * because of the debounce timeout there might have been an update on the form during validation\n */\nconst updateAutosave = (status: AUTOSAVE_STATUS, model: FormModel) => ({\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status,\n model,\n },\n});\n\n/**\n */\nconst autosave = (dispatch: BEIDispatch, form: FormModel) => {\n dispatch(updateAutosave(AUTOSAVE_STATUS.START, form));\n\n const formdata = form.getFormData(true, false);\n\n new ModularUIRequest(form.selfhref.setParameter(\"commit\", \"true\"), {\n method: HTTP_METHODS.POST,\n data: formdata,\n childmodels: false,\n locale: form.locale,\n })\n .fetch()\n .then((savedForm) => {\n if (savedForm instanceof FormModel) {\n // update last server update to indicate an update has happened\n // send the existing form to prevent updates in the ui based on autosave results\n form.lastServerUpdate = savedForm.lastServerUpdate;\n\n dispatch(updateForm(form));\n dispatch(updateAutosave(AUTOSAVE_STATUS.FINISHED, savedForm));\n }\n });\n};\n\n/**\n * Validates form objects debounced to prevent overloading the (form) service\n * When a form with new errors (or complete) arrives, we send the validations\n * to the current form model where the errors are processed\n * A new form with the new constraints is send to the store\n */\nconst debouncedAutosave = debounce(\n (dispatch, form) => {\n autosave(dispatch, form);\n },\n getNumberSetting(\"VALIDATE_DEBOUNCE_TIMEOUT\", 500),\n);\n\nexport const autosaveFormObject =\n (form: FormModel) => (dispatch: BEIDispatch) =>\n debouncedAutosave(dispatch, form);\n","import { produce } from \"immer\";\n\nimport { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { FormModel } from \"@beinformed/ui/models\";\n\nimport { fetchModel } from \"../modularui/fetchModel\";\n\nimport type { AttributeModel } from \"@beinformed/ui/models\";\n\nexport const autosubmitFormObject = (\n form: FormModel,\n attribute: AttributeModel,\n forceUpdate = false,\n) => {\n // As long as we have form objects,\n // and the current attribute is not found in the current form object, go back.\n // When a form has a result, the current form object is null\n while (\n form.allObjects.length > 0 &&\n (!form.currentFormObject ||\n !form.currentFormObject.hasAttributeByKey(attribute.key))\n ) {\n form.setPreviousObject();\n }\n\n if (form.isChanged() || forceUpdate) {\n return fetchModel({\n key: form.connectKey || form.key,\n href: form.selfhref,\n options: {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateHandler: (newModel) => {\n if (newModel instanceof FormModel) {\n return produce(form, (draft) => {\n draft.update(newModel);\n });\n }\n return newModel;\n },\n },\n });\n }\n\n return null;\n};\n","import { produce } from \"immer\";\n\nimport { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { FormModel } from \"@beinformed/ui/models\";\n\nimport { fetchModel } from \"../modularui/fetchModel\";\n\nimport type { AttributeModel } from \"@beinformed/ui/models\";\n\nexport const autoupdateFormObject = (\n form: FormModel,\n attribute: AttributeModel,\n) => {\n // As long as we have form objects,\n // and the current attribute is not found in the current form object, go back.\n // When a form has a result, the current form object is null\n while (\n form.allObjects.length > 0 &&\n (!form.currentFormObject ||\n !form.currentFormObject.hasAttributeByKey(attribute.key))\n ) {\n form.setPreviousObject();\n }\n\n if (form.isChanged()) {\n return fetchModel({\n key: form.connectKey || form.key,\n href: form.selfhref.setParameter(\"commit\", \"false\"),\n options: {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateHandler: (newModel) => {\n if (newModel instanceof FormModel) {\n return produce(form, (draft) => {\n draft.updateCurrentFormObject(newModel);\n });\n }\n return newModel;\n },\n },\n });\n }\n\n return null;\n};\n","import { createAsyncThunk } from \"@reduxjs/toolkit\";\nimport { produce } from \"immer\";\nimport debounce from \"lodash/debounce\";\n\nimport { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { FormModel } from \"@beinformed/ui/models\";\nimport { ModularUIRequest } from \"@beinformed/ui/modularui\";\nimport { getNumberSetting } from \"@beinformed/ui/settings\";\n\nimport { updateForm } from \"../modularui/modelActions\";\n\nimport type { BEIDispatch, RootState } from \"../store\";\n\n/**\n * Update validations of the form currently in the reducer\n * because of the debounce timeout there might have been an update on the form during validation\n */\nconst updateValidations = createAsyncThunk<\n void,\n { form: FormModel; formWithValidations: FormModel },\n { dispatch: BEIDispatch; state: RootState }\n>(\"\", ({ form, formWithValidations }, { dispatch, getState }) => {\n if (form.connectKey) {\n const currentFormEntry = getState().modularui[form.connectKey];\n\n if (currentFormEntry) {\n const currentForm = currentFormEntry.model;\n if (currentForm instanceof FormModel) {\n const validatedForm = produce(currentForm, (draft) => {\n draft.updateValidations(formWithValidations.data);\n });\n dispatch(updateForm(validatedForm));\n }\n }\n }\n});\n\n/**\n * Validates form objects debounced to prevent overloading the (form) service\n * When a form with new errors (or complete) arrives, we send the validations\n * to the current form model where the errors are processed\n * A new form with the new constraints is send to the store\n */\nconst debouncedValidateFormObject = debounce<\n (dispatch: BEIDispatch, form: FormModel) => void\n>(\n (dispatch, form: FormModel) => {\n new ModularUIRequest(form.selfhref.setParameter(\"commit\", \"false\"), {\n method: HTTP_METHODS.POST,\n data: form.validationData,\n childmodels: false,\n isValidationRequest: true,\n locale: form.locale,\n })\n .fetch()\n .then((formWithValidations) => {\n if (formWithValidations instanceof FormModel) {\n dispatch(updateValidations({ form, formWithValidations }));\n }\n });\n },\n getNumberSetting(\"VALIDATE_DEBOUNCE_TIMEOUT\", 500),\n {\n leading: true,\n trailing: true,\n },\n);\n\nexport const validateFormObject =\n (form: FormModel) => (dispatch: BEIDispatch) =>\n debouncedValidateFormObject(dispatch, form);\n","import { createAsyncThunk } from \"@reduxjs/toolkit\";\nimport { produce } from \"immer\";\n\nimport { getBooleanSetting } from \"@beinformed/ui/settings\";\n\nimport { updateForm } from \"../modularui/modelActions\";\n\nimport { autosaveFormObject } from \"./autosaveActions\";\nimport { autosubmitFormObject } from \"./autosubmitActions\";\nimport { autoupdateFormObject } from \"./autoupdateActions\";\nimport { validateFormObject } from \"./validateActions\";\n\nimport type {\n AttributeModel,\n FormModel,\n FormObjectModel,\n} from \"@beinformed/ui/models\";\nimport type { UpdateFormOptions } from \"../../hooks/useForm\";\nimport type { BEIDispatch } from \"../store\";\n\nexport const updateFormAttribute = createAsyncThunk<\n void,\n {\n form: FormModel;\n formObject: FormObjectModel;\n attribute: AttributeModel;\n inputvalue: string;\n options?: UpdateFormOptions;\n },\n { dispatch: BEIDispatch }\n>(\n \"form/attribute\",\n async (\n {\n form,\n formObject,\n attribute,\n inputvalue,\n options = {\n autosubmit: false,\n autosave: false, // autosave commits the form in the background\n autoupdate: false, // autoupdate does not commit and updates the form with for example a new dynamicschema (work-around for form-tree iq)\n forceUpdate: false,\n validate: true,\n },\n },\n { dispatch },\n ) => {\n if (options.validate === undefined) {\n options.validate = true;\n }\n\n const newForm = produce(form, (draft) => {\n if (draft.currentFormObject?.equals(formObject)) {\n draft.currentFormObject.updateAttribute(attribute, inputvalue);\n } else {\n draft.completedFormObjects.forEach((completeObject) => {\n if (completeObject.equals(formObject)) {\n completeObject.updateAttribute(attribute, inputvalue);\n }\n });\n }\n });\n\n if (options.autosubmit && newForm.isValid) {\n const autosubmitAction = autosubmitFormObject(\n newForm,\n attribute,\n options.forceUpdate,\n );\n if (autosubmitAction) {\n dispatch(autosubmitAction);\n return;\n }\n }\n\n if (options.autoupdate && newForm.isValid) {\n const autoupdateAction = autoupdateFormObject(newForm, attribute);\n if (autoupdateAction) {\n dispatch(autoupdateAction);\n return;\n }\n }\n\n handleAutoSave(dispatch, newForm, options);\n\n handleValidate(dispatch, newForm, options);\n\n dispatch(updateForm(newForm));\n },\n);\n\nconst handleAutoSave = (\n dispatch: BEIDispatch,\n newForm: FormModel,\n options: UpdateFormOptions,\n) => {\n if (options.autosave && newForm.isValid && newForm.isChanged()) {\n dispatch(autosaveFormObject(newForm));\n }\n};\n\nconst handleValidate = (\n dispatch: BEIDispatch,\n newForm: FormModel,\n options: UpdateFormOptions,\n) => {\n if (\n options.validate &&\n newForm.currentFormObject?.hasDynamicValidations &&\n getBooleanSetting(\"USE_INSTANT_SERVER_VALIDATION\", false)\n ) {\n // server form validations happens async, don't wait for the form to return\n dispatch(validateFormObject(newForm));\n }\n};\n","import { createAsyncThunk } from \"@reduxjs/toolkit\";\nimport { produce } from \"immer\";\n\nimport { Authenticate } from \"@beinformed/ui/modularui\";\n\nimport { reloadApplication } from \"../application/applicationActions\";\nimport { logoutSuccess } from \"../auth/authReducer\";\nimport { updateForm } from \"../modularui/modelActions\";\nimport {\n finishProgress,\n startProgress,\n} from \"../progressindicator/progressIndicatorActions\";\nimport { goBack } from \"../router/routerActions\";\n\nimport type { FormModel } from \"@beinformed/ui/models\";\nimport type { PayloadAction } from \"@reduxjs/toolkit\";\nimport type { BEIDispatch, RootState } from \"../store\";\n\nexport const previousObject = (form: FormModel) => {\n const newForm = produce(form, (draft) => {\n draft.setPreviousObject();\n });\n\n return updateForm(newForm);\n};\n\nexport const cancelForm = createAsyncThunk<\n PayloadAction<undefined, string>,\n FormModel,\n { dispatch: BEIDispatch; state: RootState }\n>(\"form/cancel\", async (form, { dispatch, getState }) => {\n if (form.key === \"ChangePassword\" && getState().auth.mustChangePassword) {\n dispatch(startProgress());\n\n await new Authenticate().logout();\n\n dispatch(logoutSuccess());\n dispatch(reloadApplication());\n dispatch(finishProgress());\n }\n\n return goBack();\n});\n","import { produce } from \"immer\";\n\nimport { updateForm } from \"../modularui/modelActions\";\n\nimport type { FormModel, FormObjectModel } from \"@beinformed/ui/models\";\n\nexport const addRepeatableAttributeSet = (form: FormModel) => {\n const newForm = produce(form, (draft) => {\n draft.addEmptyFormObject();\n });\n return updateForm(newForm);\n};\n\nexport const cancelRepeatableAttributeSet = (\n form: FormModel,\n formObject: FormObjectModel,\n) => {\n const newForm = produce(form, (draft) => {\n draft.addEmptyFormObject();\n draft.removeFormObject(formObject);\n });\n return updateForm(newForm);\n};\n\nexport const removeRepeatableAttributeSet = (\n form: FormModel,\n formObject: FormObjectModel,\n) => {\n const newForm = produce(form, (draft) => {\n draft.removeFormObject(formObject);\n });\n return updateForm(newForm);\n};\n","import type { ISO_DATE } from \"@beinformed/ui/types\";\nimport type { RootState } from \"../store\";\n\n/**\n * Retrieve entrydate for the model catalog\n */\nexport const getEntryDate = (state: RootState): ISO_DATE => {\n if (state.modelcatalog?.entryDate) {\n return state.modelcatalog?.entryDate;\n }\n\n const isoDate = new Date().toISOString();\n return isoDate.split(\"T\")[0] || isoDate;\n};\n","import { fetchModel } from \"./fetchModel\";\n\nimport type { ModularUIModel } from \"@beinformed/ui/models\";\nimport type { ModularUIRequestOptions } from \"@beinformed/ui/utils\";\n\nexport const reloadModel = (\n model: ModularUIModel,\n options?: ModularUIRequestOptions,\n) =>\n fetchModel({\n key: model.connectKey || \"\",\n href: model.selfhref || \"\",\n options: {\n ...options,\n isReload: true,\n },\n });\n"],"mappings":"wPAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,GAAO,KAkBPC,GAAM,UAAW,CACnB,OAAOD,GAAK,KAAK,IAAI,CACvB,EAEAD,EAAO,QAAUE,KCtBjB,IAAAC,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cACA,IAAIC,GAAe,KAUnB,SAASC,GAAgBC,EAAQ,CAG/B,QAFIC,EAAQD,EAAO,OAEZC,KAAWH,GAAa,KAAKE,EAAO,OAAOC,CAAK,CAAC,GAAG,CAC3D,OAAOA,CACT,CAEAJ,EAAO,QAAUE,KClBjB,IAAAG,EAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,GAAkB,IAGlBC,GAAc,OASlB,SAASC,GAASC,EAAQ,CACxB,OAAOA,GACHA,EAAO,MAAM,EAAGH,GAAgBG,CAAM,EAAI,CAAC,EAAE,QAAQF,GAAa,EAAE,CAE1E,CAEAF,EAAO,QAAUG,KClBjB,IAAAE,EAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,GAAW,IACXC,EAAW,IACXC,GAAW,KAGXC,EAAM,IAGNC,GAAa,qBAGbC,GAAa,aAGbC,GAAY,cAGZC,GAAe,SAyBnB,SAASC,GAASC,EAAO,CACvB,GAAI,OAAOA,GAAS,SAClB,OAAOA,EAET,GAAIP,GAASO,CAAK,EAChB,OAAON,EAET,GAAIF,EAASQ,CAAK,EAAG,CACnB,IAAIC,EAAQ,OAAOD,EAAM,SAAW,WAAaA,EAAM,QAAQ,EAAIA,EACnEA,EAAQR,EAASS,CAAK,EAAKA,EAAQ,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C1CD,OAAS,WAAAC,MAAe,QAMjB,IAAMC,GAA6BC,GAAoB,CAC5D,IAAMC,EAAUC,EAAQF,EAAOG,GAAU,CACvCA,EAAM,mBAAmB,CAC3B,CAAC,EACD,OAAOC,EAAWH,CAAO,CAC3B,EAEaI,GAA+B,CAC1CL,EACAM,IACG,CACH,IAAML,EAAUC,EAAQF,EAAOG,GAAU,CACvCA,EAAM,mBAAmB,EACzBA,EAAM,iBAAiBG,CAAU,CACnC,CAAC,EACD,OAAOF,EAAWH,CAAO,CAC3B,EAEaM,GAA+B,CAC1CP,EACAM,IACG,CACH,IAAML,EAAUC,EAAQF,EAAOG,GAAU,CACvCA,EAAM,iBAAiBG,CAAU,CACnC,CAAC,EACD,OAAOF,EAAWH,CAAO,CAC3B,EC1BO,IAAMO,GAAgBC,GAA+B,CAC1D,GAAIA,EAAM,cAAc,UACtB,OAAOA,EAAM,cAAc,UAG7B,IAAMC,EAAU,IAAI,KAAK,EAAE,YAAY,EACvC,OAAOA,EAAQ,MAAM,GAAG,EAAE,CAAC,GAAKA,CAClC,ECRO,IAAMC,GAAc,CACzBC,EACAC,IAEAC,EAAW,CACT,IAAKF,EAAM,YAAc,GACzB,KAAMA,EAAM,UAAY,GACxB,QAAS,CACP,GAAGC,EACH,SAAU,EACZ,CACF,CAAC","names":["require_now","__commonJSMin","exports","module","root","now","require_trimmedEndIndex","__commonJSMin","exports","module","reWhitespace","trimmedEndIndex","string","index","require_baseTrim","__commonJSMin","exports","module","trimmedEndIndex","reTrimStart","baseTrim","string","require_toNumber","__commonJSMin","exports","module","baseTrim","isObject","isSymbol","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","value","other","isBinary","require_debounce","__commonJSMin","exports","module","isObject","now","toNumber","FUNC_ERROR_TEXT","nativeMax","nativeMin","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","args","thisArg","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","createAsyncThunk","CHANGEPASSWORD_PATH","Authenticate","Cache","loginFailed","errorMessage","sendAuthenticationError","changePassword","createAsyncThunk","_","getState","isModal","locationFrom","push","CHANGEPASSWORD_PATH","login","username","password","dispatch","startProgress","Authenticate","reloadApplication","Cache","getApplication","loginSuccess","finishProgress","error","createAsyncThunk","Authenticate","logout","createAsyncThunk","_","dispatch","startProgress","Authenticate","resetModularUI","reloadApplication","logoutSuccess","finishProgress","import_debounce","HTTP_METHODS","FormModel","ModularUIRequest","getNumberSetting","AUTOSAVE_STATUS","updateAutosave","status","model","autosave","dispatch","form","formdata","ModularUIRequest","HTTP_METHODS","savedForm","FormModel","updateForm","debouncedAutosave","debounce","getNumberSetting","autosaveFormObject","produce","HTTP_METHODS","FormModel","autosubmitFormObject","form","attribute","forceUpdate","fetchModel","HTTP_METHODS","newModel","FormModel","produce","draft","produce","HTTP_METHODS","FormModel","autoupdateFormObject","form","attribute","fetchModel","HTTP_METHODS","newModel","FormModel","produce","draft","import_debounce","createAsyncThunk","produce","HTTP_METHODS","FormModel","ModularUIRequest","getNumberSetting","updateValidations","createAsyncThunk","form","formWithValidations","dispatch","getState","currentFormEntry","currentForm","FormModel","validatedForm","produce","draft","updateForm","debouncedValidateFormObject","debounce","ModularUIRequest","HTTP_METHODS","getNumberSetting","validateFormObject","createAsyncThunk","produce","getBooleanSetting","updateFormAttribute","createAsyncThunk","form","formObject","attribute","inputvalue","options","dispatch","newForm","produce","draft","completeObject","autosubmitAction","autosubmitFormObject","autoupdateAction","autoupdateFormObject","handleAutoSave","handleValidate","updateForm","autosaveFormObject","getBooleanSetting","validateFormObject","createAsyncThunk","produce","Authenticate","previousObject","form","newForm","produce","draft","updateForm","cancelForm","createAsyncThunk","dispatch","getState","startProgress","Authenticate","logoutSuccess","reloadApplication","finishProgress","goBack","produce","addRepeatableAttributeSet","form","newForm","produce","draft","updateForm","cancelRepeatableAttributeSet","formObject","removeRepeatableAttributeSet","getEntryDate","state","isoDate","reloadModel","model","options","fetchModel"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u,e as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u,e as y}from"./chunk-L7DO7AZT.js";import{b as w}from"./chunk-HTR32BUX.js";import{a as f}from"./chunk-FW4363Y4.js";var b=f((k,s)=>{"use strict";function A(n,i){for(var r=-1,t=i.length,e=n.length;++r<t;)n[e+r]=i[r];return n}s.exports=A});var q=f((p,l)=>{"use strict";var g=w(),P=y(),S=u(),a=g?g.isConcatSpreadable:void 0;function d(n){return S(n)||P(n)||!!(a&&n&&n[a])}l.exports=d});var j=f((z,m)=>{"use strict";var C=b(),c=q();function x(n,i,r,t,e){var h=-1,F=n.length;for(r||(r=c),e||(e=[]);++h<F;){var o=n[h];i>0&&r(o)?i>1?x(o,i-1,r,t,e):C(e,o):t||(e[e.length]=o)}return e}m.exports=x});export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-TDYPCNQI.js.map
|