@arkitektum/altinn-studio-custom-components 11.7.0 → 11.9.0
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/README.md +6 -3
- package/dist/main.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,15 +45,15 @@ To integrate these components into your Altinn Studio application, follow these
|
|
|
45
45
|
|
|
46
46
|
4. Add the following configuration to your `/views/Home/index.cshtml` file:
|
|
47
47
|
|
|
48
|
-
Make sure you replace `[APP NAME]` with the actual
|
|
48
|
+
Make sure you replace `[ORG NAME]` and `[APP NAME]` with the actual names
|
|
49
49
|
|
|
50
50
|
```html
|
|
51
51
|
<html>
|
|
52
52
|
<head>
|
|
53
|
-
<link rel="stylesheet" type="text/css" href="/
|
|
53
|
+
<link rel="stylesheet" type="text/css" href="/[ORG NAME]/[APP NAME]/altinn-studio-custom-components/main.css">
|
|
54
54
|
</head>
|
|
55
55
|
<body>
|
|
56
|
-
<script type="module" src="/
|
|
56
|
+
<script type="module" src="/[ORG NAME]/[APP NAME]/altinn-studio-custom-components/main.js"></script>
|
|
57
57
|
</body>
|
|
58
58
|
</html>
|
|
59
59
|
```
|
|
@@ -78,10 +78,12 @@ These components are tailored to display specific data types consistently across
|
|
|
78
78
|
- [Header](src/components/data-components/custom-header-text/) – Displays a title with text from a resource.
|
|
79
79
|
- [Subheader](src/components/data-components/custom-subheader-text) – Displays a title with text from a resource.
|
|
80
80
|
- [Paragraph](src/components/data-components/custom-paragraph-text/) – Displays a paragraph with text from a resource.
|
|
81
|
+
- [Paragraph Text Data](src/components/data-components/custom-paragraph-text-data/) – Displays a paragraph with text from a resource combined with text from data.
|
|
81
82
|
- **Fields**
|
|
82
83
|
- [Data](src/components/data-components/custom-field-data/) – Displays a data field with a label.
|
|
83
84
|
- [Boolean Data](src/components/data-components/custom-field-boolean-data/) – Displays different data model values based on a boolean value.
|
|
84
85
|
- [Boolean Text](src/components/data-components/custom-field-boolean-text/) – Displays different text resources based on a boolean value.
|
|
86
|
+
- [Count Data](src/components/data-components/custom-field-count-data/) – Displays the number of items in an array.
|
|
85
87
|
- [Feedback](src/components/data-components/custom-feedback-data/) – Displays a single feedback message.
|
|
86
88
|
- [Adresse](src/components/data-components/custom-field-adresse/) – Displays a complete address object
|
|
87
89
|
- [Part-navn](src/components/data-components/custom-field-part-navn/) – Displays a part's name, optionally with an organization number.
|
|
@@ -95,6 +97,7 @@ These components are tailored to display specific data types consistently across
|
|
|
95
97
|
- [Feedback](src/components/data-components/custom-feedbacklist-data/) – Displays a list of feedback messages for a feedback type.
|
|
96
98
|
- [ValidationMessages](src/components/data-components/custom-feedbacklist-validation-messages/) – Displays lists of feedback messages for all feedback types.
|
|
97
99
|
- **Group lists**
|
|
100
|
+
- [Ettersending](src/components/data-components/custom-grouplist-ettersending/) – Displays a list of [`Ettersending`](src/classes/data-classes/Ettersending.js) component groups.
|
|
98
101
|
- [Utfall svar](src/components/data-components/custom-grouplist-utfall-svar-type/) – Displays a list of [`Utfallsvar`](src/classes/data-classes/UtfallSvar.js) component groups.
|
|
99
102
|
- **Tables**
|
|
100
103
|
- [Data](src/components/data-components/custom-table-data/) – Displays data table with customizable columns and rows.
|
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";class e{constructor(e){e?.tagName&&(this.tagName=e.tagName),e?.inline&&(this.inline=e.inline),e?.hideTitle&&(this.hideTitle=e.hideTitle),e?.size&&(this.size=e.size),e?.hideIfEmpty&&(this.hideIfEmpty=e.hideIfEmpty),e?.styleOverride&&(this.styleOverride=e.styleOverride),e?.isChildComponent&&(this.isChildComponent=e.isChildComponent),e?.feedbackType&&(this.feedbackType=e.feedbackType),e?.hideOrgNr&&(this.hideOrgNr=e.hideOrgNr),e?.format&&(this.format=e.format)}}const t=["custom-divider","custom-feedback","custom-field","custom-header","custom-list","custom-paragraph","custom-table","custom-feedback-data","custom-feedbacklist-data","custom-feedbacklist-validation-messages","custom-field-adresse","custom-field-boolean-data","custom-field-boolean-text","custom-field-count-data","custom-field-data","custom-field-kommunens-saksnummer","custom-field-part-navn","custom-field-prosjekt","custom-field-telefonnummer","custom-field-utfall-svar-status","custom-grouplist-utfall-svar-type","custom-group-utfall-svar-type","custom-grouplist-utfall-svar","custom-group-utfall-svar","custom-header-text","custom-list-data","custom-list-vedlegg","custom-paragraph-text","custom-paragraph-text-data","custom-subheader-text","custom-table-data","custom-table-eiendom","custom-table-part","custom-dispensasjon","custom-gjennomfoeringsplan"];function s(e){if(null==e)return!1;if("string"==typeof e)return e.length>0;if("number"==typeof e)return!1===isNaN(e);if("boolean"==typeof e)return!0===e;if(Array.isArray(e))return e.length>0;for(let t in e)if(!!e?.[t]?.toString().length>0)return!0;return!1}function n(e){const t="number"==typeof e?e:Number(e);return"number"==typeof t&&!isNaN(t)&&t>0}function r(e,t){for(let s in t)e.style[s]=t[s]}function i(e){const t=e?.resourceValues?.emptyFieldText;return t||""}function a(e,s){if(!function(e){return t.includes(e)}(e))throw new Error(`Invalid tag name ${e}. Must be one of: ${t.join(", ")}`);const n=document.createElement(e);return function(e,t){for(const s in t)e.setAttribute(s,t[s])}(n,{...s,tagName:e}),n}function o(e,t){const n=document.createElement("div"),i=document.createElement("div");return i.appendChild(e),n.appendChild(i),r(n,{...s(t)?{flexGrow:"0",maxWidth:"50%",flexBasis:"50%"}:{flexBasis:"100%",maxWidth:"100%"},padding:"0.75rem 0px"}),n}function l(){return"undefined"!=typeof window&&window.textResources?window.textResources:[]}function u(e,t,s,n){s.forEach(s=>{void 0!==e[s]&&null!==e[s]||(null!=t?.[s]?console.warn(`Missing textResourceBindings.${s} for "${n}". Using fallback text: "${t[s]}"`):console.warn(`Missing textResourceBindings.${s} for "${n}".`))})}function d(e){const t="true"===e.getAttribute("isChildComponent"),s=e?.parentElement?.parentElement;return t?e:s||null}function c(e){const t=l(),s=t?.resources?.find(t=>t.id===e)?.value;return s||e}function m(e){const t={};for(const s in e)t[s]=c(e[s]);return t}function h(e){return e.isChildComponent?e.resourceValues?.data:e.formData?.simpleBinding||e.formData?.data}function g(e,t){return s(e?.resourceValues?.[t])?e.resourceValues?.[t]:c(e?.resourceBindings?.[t])}function p(e,t){return t.filter(e=>!!e).forEach(t=>{t instanceof HTMLElement?e.appendChild(t):e.innerHTML+=t}),e}customElements.define("custom-divider",class extends HTMLElement{connectedCallback(){const t=new e(this),s=document.createElement("hr");r(s,t?.styleOverride),this.innerHTML="",this.appendChild(s)}});class f{constructor(e){this.effekt=e?.effekt}}class y{constructor(e){this.effekt=e?.effekt}}class k{constructor(e){this.hensynBakBestemmelsen=e?.hensynBakBestemmelsen,this.vurderingHensynBakBestemmelsen=e?.vurderingHensynBakBestemmelsen,this.vurderingHensynOverordnet=e?.vurderingHensynOverordnet,this.fordeler=e?.fordeler&&new f(e.fordeler),this.ulemper=e?.ulemper&&new y(e.ulemper),this.samletBegrunnelse=e?.samletBegrunnelse}}class v{constructor(e){this.kodebeskrivelse=e?.kodebeskrivelse}}class b{constructor(e){this.dispensasjonTittel=e?.dispensasjonTittel&&new v(e.dispensasjonTittel),this.inngangsbeskrivelse=e?.inngangsbeskrivelse&&new v(e.inngangsbeskrivelse),this.annenInngangsbeskrivelse=e?.annenInngangsbeskrivelse,this.beskrivelse=e?.beskrivelse}}class T{constructor(e){this.planidentifikasjon=e?.planidentifikasjon}}class B{constructor(e){this.nummerering=e?.nummerering}}class C{constructor(e){this.navn=e?.navn,this.nasjonalArealplanId=e?.nasjonalArealplanId&&new T(e.nasjonalArealplanId),this.planbestemmelse=e?.planbestemmelse&&new B(e.planbestemmelse)}}class E{constructor(e){this.bestemmelserType=e?.bestemmelserType&&new v(e.bestemmelserType),this.dispensasjonPlanBestemmelse=e?.dispensasjonPlanBestemmelse&&new C(e.dispensasjonPlanBestemmelse),this.lovbestemmelse=e?.lovbestemmelse}}class V{constructor(e){this.adresselinje1=e?.adresselinje1,this.adresselinje2=e?.adresselinje2,this.adresselinje3=e?.adresselinje3,this.postnr=e?.postnr,this.poststed=e?.poststed}}class w{constructor(e){this.gaardsnummer=e?.gaardsnummer,this.bruksnummer=e?.bruksnummer,this.seksjonsnummer=e?.seksjonsnummer,this.festenummer=e?.festenummer}}class x{constructor(e){this.adresse=e?.adresse&&new V(e.adresse),this.eiendomsidentifikasjon=e?.eiendomsidentifikasjon&&new w(e.eiendomsidentifikasjon),this.bolignummer=e?.bolignummer,this.bygningsnummer=e?.bygningsnummer}}class F{constructor(e){this.eiendom=e?.eiendom&&e.eiendom.map(e=>new x(e))}}class j{constructor(e){this.saksaar=e?.saksaar,this.sakssekvensnummer=e?.sakssekvensnummer}}class M{constructor(e){this.ftbId=e?.ftbId,this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class H{constructor(e){const t=this.getAdresse(e);this.navn=e?.navn,this.organisasjonsnummer=e?.organisasjonsnummer,this.epost=e?.epost,this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer,t&&(this.adresse=t)}getAdresse(e){if(s(e?.adresse))return new V(e.adresse)}}class D{constructor(e){this.koordinatsystem=e?.koordinatsystem&&new v(e.koordinatsystem),this.koordinater=e?.koordinater}}class L{constructor(e){this.posisjon=e?.posisjon&&new D(e.posisjon),this.vertikalnivaa=e?.vertikalnivaa&&new v(e.vertikalnivaa)}}class I{constructor(e){const t=e?this.getTypeFromProps(e):null;t&&(this.type=t)}getTypeFromProps(e){return e&&s(e?.type)?{kode:this.getKodeFromType(e.type)}:null}getKodeFromType(e){return Array.isArray(e?.kode)&&e?.kode?.length?e?.kode?.map(e=>new v(e)):null}}class A{constructor(e){this.oenskesVarigDispensasjon=e?.oenskesVarigDispensasjon,this.oensketVarighetTil=e?.oensketVarighetTil}}class S{constructor(e){this.dispensasjonBeskrivelse=e?.dispensasjonBeskrivelse&&new b(e.dispensasjonBeskrivelse),this.dispensasjonReferanse=e?.dispensasjonReferanse,this.soeknadstype=e?.soeknadstype&&new v(e.soeknadstype),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new j(e.kommunensSaksnummer),this.metadata=e?.metadata&&new M(e.metadata),this.eiendomByggested=e?.eiendomByggested&&new F(e.eiendomByggested),this.tiltakstyper=e?.tiltakstyper&&new I(e.tiltakstyper),this.tiltakshaver=e?.tiltakshaver&&new H(e.tiltakshaver),this.dispensasjonFra=e?.dispensasjonFra&&new E(e.dispensasjonFra),this.stedfesting=e?.stedfesting&&new L(e.stedfesting),this.varighet=e?.varighet&&new A(e.varighet),this.begrunnelse=e?.begrunnelse&&new k(e.begrunnelse),this.generelleVilkaar=e?.generelleVilkaar}}class N{constructor(e){this.error=e?.error||[],this.warning=e?.warning||[],this.info=e?.info||[],this.success=e?.success||[],this.default=e?.default||[]}}function O(e){return!!e&&Object.values(e).some(e=>e.length>0)}function P(e,t,s=new N){for(const n in t)for(const r in t[n]){const i=t[n][r],a=e?.resources?.find(e=>e.id===i);a?""===a.value&&s.info.push(`Empty text resource for "${r}" with id: "${i}" in component "${n}"`):s.error.push(`Missing text resource for "${r}" with id: "${i}" in component "${n}"`)}return s}class R extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(),n=!this.hasContent(t),r=this.dataIsPlanBestemmelseType(t),i=this.getValidationMessages(s);this.isEmpty=n,this.isPlanBestemmelseType=r,this.validationMessages=i,this.hasValidationMessages=O(i),this.resourceBindings=s,this.resourceValues={data:n?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){return s(e?.formData)&&new S(e.formData)}getValidationMessages(e){return P("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}dataIsPlanBestemmelseType(e){return["reguleringsplan","kommuneplan","kommunedelplan"].includes(e?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse?.toLowerCase())}getResourceBindings(){return{dispensasjonReferanse:{title:"resource.dispensasjon.dispensasjonReferanse.title"},metadataFtbId:{title:"resource.metadata.ftbId.title"},kommunensSaksnummer:{title:"resource.kommunensSaksnummer.title"},soeknadGjelderHeader:{title:"resource.soeknadGjelder.header"},tiltakstyperTypeHeader:{title:"resource.tiltakstyper.type.header"},tiltakstyperTypeKode:{title:"resource.tiltakstyper.type.kode.title"},tiltakshaverAdresse:{title:"resource.tiltakshaver.adresse.title"},dispensasjonBeskrivelseBeskrivelse:{title:"resource.dispensasjonBeskrivelse.beskrivelse.title"},dispensasjonFraHeader:{title:"resource.dispensasjonFra.header"},dispensasjonPlanBestemmelseNavn:{title:"resource.dispensasjonFra.dispensasjonPlanBestemmelse.navn.title"},nasjonalArealplanIdPlanIdentifikasjon:{title:"resource.dispensasjonFra.nasjonalArealplanId.planidentifikasjon.title"},bestemmelserType:{title:"resource.dispensasjonFra.bestemmelserType.title"},planBestemmelseNummerering:{title:"resource.dispensasjonFra.dispensasjonPlanBestemmelse.planbestemmelse.nummerering.title"},stedfestingHeader:{title:"resource.stedfesting.header"},stedfestingPosisjonKoordinatsystem:{title:"resource.stedfesting.posisjon.koordinatsystem.title"},stedfestingPosisjonKoordinater:{title:"resource.stedfesting.posisjon.koordinater.title"},stedfestingVertikalnivaa:{title:"resource.stedfesting.vertikalnivaa.title"},varighetHeader:{title:"resource.varighet.header"},varighetOenskesVarigDispensasjon:{trueText:"resource.varighet.oenskesVarigDispensasjon.true.title"},varighetOensketVarighetTil:{title:"resource.varighet.oensketVarighetTil.title"},begrunnelseHeader:{title:"resource.begrunnelse.header"},begrunnelseHensynBakBestemmelsen:{title:"resource.begrunnelse.hensynBakBestemmelsen.title"},begrunnelseVurderingHensynBakBestemmelsen:{title:"resource.begrunnelse.vurderingHensynBakBestemmelsen.title"},begrunnelseVurderingHensynOverordnet:{title:"resource.begrunnelse.vurderingHensynOverordnet.title"},begrunnelseFordeler:{title:"resource.begrunnelse.fordeler.title"},begrunnelseUlemper:{title:"resource.begrunnelse.ulemper.title"},begrunnelseSamletBegrunnelse:{title:"resource.begrunnelse.samletBegrunnelse.title"},generelleVilkaarNorskSvenskDansk:{title:"resource.generelleVilkaar.norskSvenskDansk.header",trueText:"resource.generelleVilkaar.norskSvenskDansk.true.title"}}}}class $ extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return h(e)}}class K extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return h(e)}}class U extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:e?.resourceValues?.title||"Messages",data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return h(e)}}class z extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=h(e);return new N(t)}}class J extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class G extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}formatAdresselinje(e){return[e.adresselinje1,e.adresselinje2,e.adresselinje3].filter(e=>e?.length).join("\n")}formatZipCity(e){return[e.postnr,e.poststed].filter(e=>e?.length).join(" ")}formatAdresse(e){const t=this.formatAdresselinje(e),s=this.formatZipCity(e);return t?.length?`${t}\n${s}`:s}getValueFromFormData(e){const t=h(e),s=new V(t);return this.formatAdresse(s)}hasContent(e){return s(e)}}class Z extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=e?.id?.length&&"string"==typeof e?.id?e.id:"custom-field-boolean-data",s=h(e),r=n(s),i=function(e){return e.isChildComponent?{trueData:e.resourceValues?.trueData,falseData:e.resourceValues?.falseData,defaultData:e.resourceValues?.defaultData}:{trueData:e.formData?.trueData,falseData:e.formData?.falseData,defaultData:e.formData?.defaultData}}(e);return function(e,t,s){["trueData","falseData","defaultData"].forEach(t=>{void 0!==e[t]&&null!==e[t]||console.warn(`Missing dataModelBindings.${t} for "${s}".`)})}(i,0,t),!0===s||"true"===s||r?void 0!==i?.trueData&&null!==i.trueData?i.trueData:"":!1===s||"false"===s?void 0!==i?.falseData&&null!==i.falseData?i.falseData:"":i?.defaultData?i.defaultData:""}}class W extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=e?.id||"custom-field-boolean-text",s=h(e),n=function(e){return{trueText:e.resourceValues?.trueText||c(e?.resourceBindings?.trueText),falseText:e.resourceValues?.falseText||c(e?.resourceBindings?.falseText),defaultText:e.resourceValues?.defaultText||c(e?.resourceBindings?.defaultText)}}(e),r={trueText:"Ja",falseText:"Nei",defaultText:""};return u(n,r,["trueText","falseText","defaultText"],t),!0===s||"true"===s?void 0!==n?.trueText&&null!==n.trueText?n.trueText:r.trueText:!1===s||"false"===s?void 0!==n?.falseText&&null!==n.falseText?n.falseText:r.falseText:n?.defaultText?n.defaultText:r.defaultText}}class Y extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return n(e)}getValueFromFormData(e){const t=h(e);return t&&Array.isArray(t)?t.length:0}}const q=["default"],Q={dateTime:{default:{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}},date:{default:{day:"2-digit",month:"2-digit",year:"numeric"}},time:{default:{hour:"2-digit",minute:"2-digit",second:"2-digit"}}},X={dateTime:{default:"no-NO"},date:{default:"no-NO"},time:{default:"no-NO"}},_=["h1","h2","h3","h4","h5","h6"];function ee(e){return q.includes(e)?e:"default"}function te(e){const t=new Date(e);return!!e&&!isNaN(t.getTime())}function se(e,t,s="default"){switch(t){case"dateTime":return function(e,t="default"){if(!te(e))return"Ugyldig datoformat";t=ee(t),e.includes("T")||(e+="T00:00:00");const s=X.dateTime[t],n=Q.dateTime[s]||Q.dateTime.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);case"date":return function(e,t="default"){te(e)||(e=function(e){const t=e.match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!t)return null;const s=parseInt(t[1],10),n=parseInt(t[2],10)-1,r=parseInt(t[3],10),i=new Date(r,n,s);return i.getFullYear()===r&&i.getMonth()===n&&i.getDate()===s?i.toISOString():null}(e)),t=ee(t);const s=X.date[t],n=Q.date[s]||Q.date.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);case"time":return function(e,t="default"){e.includes("T")||(e="1970-01-01T"+e),te(e)||(e=function(e){const t=e.match(/^(\d{2}):(\d{2})(?::(\d{2}))?$/);if(!t)return null;const s=parseInt(t[1],10),n=parseInt(t[2],10),r=t[3]?parseInt(t[3],10):0;return s<0||s>23||n<0||n>59||r<0||r>59?null:new Date(1970,0,1,s,n,r).toISOString()}(e)),t=ee(t);const s=X.time[t],n=Q.time[s]||Q.time.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);default:return e}}function ne(e){return s(e)&&_.includes(e.toLowerCase())}class re extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){return se(h(e),e?.format)}}class ie extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}formatKommunensSaksnummer(e){return[e?.saksaar?.toString(),e?.sakssekvensnummer?.toString()].filter(e=>e?.length).join("/")}getValueFromFormData(e){const t=h(e),s=new j(t);return this.formatKommunensSaksnummer(s)}}class ae extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}formatName(e,t){if(!e?.navn)return"";let s=e.navn;return!t&&e.organisasjonsnummer&&(s+=`\nOrganisasjonsnummer: ${e.organisasjonsnummer}`),s}getValueFromFormData(e){const t=h(e),s=new H(t);return this.formatName(s,this.hideOrgNr)}hasContent(e){return s(e)}}class oe{constructor(e){this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class le extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}hasContent(e){return s(e)}formatProsjekt(e){const t=s(e?.prosjektnr)&&`(${e.prosjektnr?.toString()})`;return[e?.prosjektnavn?.toString(),t].filter(e=>e?.length).join(" ")}getValueFromFormData(e){const t=new oe(e?.formData?.data);return this.formatProsjekt(t)}}class ue{constructor(e){this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer}}class de extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}formatPhoneNumbers(e){return[e.telefonnummer,e.mobilnummer].filter(e=>e?.length).join("\n")}getValueFromFormData(e){const t=h(e),s=new ue(t);return this.formatPhoneNumbers(s)}hasContent(e){return s(e)}}class ce{constructor(e){this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart}}class me extends e{constructor(e){super(e);const t=this.getResourceBindings(e),s=this.getValueFromFormData(e,t?.utfallSvarStatus),n=!this.hasContent(s),r=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceValues={title:c(t?.utfallSvarStatus?.title),data:n?g(e,"emptyFieldText"):s}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getStatusText(e,t,s){const n=m(t),r={erUtfallBesvaresSenere:"Besvares senere",erUtfallBesvart:"Svar innsendt tidligere",status:"Besvares nå"};return u(n,r,["erUtfallBesvaresSenere","erUtfallBesvart","status"],s),e?.erUtfallBesvaresSenere?null!=n?.erUtfallBesvaresSenere?n.erUtfallBesvaresSenere:r.erUtfallBesvaresSenere:e?.erUtfallBesvart?null!=n?.erUtfallBesvart?n.erUtfallBesvart:r.erUtfallBesvart:n?.status?n.status:r.status}getValueFromFormData(e,t){const s=h(e),n=new ce(s);return this.getStatusText(n,t,e?.id)}getResourceBindings(e){return{utfallSvarStatus:{title:e?.resourceBindings?.title||"resource.utfallBesvarelse.utfallSvar.status.title",erUtfallBesvaresSenere:"resource.utfallBesvarelse.utfallSvar.erUtfallBesvaresSenere",erUtfallBesvart:"resource.utfallBesvarelse.utfallSvar.erUtfallBesvart",status:"resource.utfallBesvarelse.utfallSvar.status"}}}}class he extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getValueFromFormData(e){return h(e)}}class ge{constructor(e){this.kodeverdi=e?.kodeverdi}}class pe{constructor(e){this.filnavn=e?.filnavn,this.vedleggstype=e?.vedleggstype&&new v(e.vedleggstype)}}class fe{constructor(e){this.vedlegg=e?.vedlegg?e.vedlegg.map(e=>new pe(e)):void 0}}class ye{constructor(e){this.beskrivelse=e?.beskrivelse,this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart,this.kommentar=e?.kommentar,this.tema=e?.tema?new v(e.tema):void 0,this.tittel=e?.tittel,this.utfallType=e?.utfallType?new ge(e.utfallType):void 0,this.vedleggsliste=e?.vedleggsliste?new fe(e.vedleggsliste):void 0}}class ke extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getValueFromFormData(e){const t=h(e);return this.groupArrayItemsByUtfallType(t)}groupArrayItemsByUtfallType(e){return s(e)?e.reduce((e,t)=>{const s=t?.utfallType?.kodeverdi;return s?.length?(e[s]||(e[s]=[]),e[s].push(new ye(t)),e):e},{}):{}}}class ve extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceBindings=s?.utfallSvar||{},this.resourceValues={data:n?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getValueFromFormData(e){return h(e)}getResourceBindings(){return{utfallSvar:{"status.title":"resource.utfallBesvarelse.utfallSvar.status.title","tema.kodebeskrivelse.title":"resource.utfallBesvarelse.utfallSvar.tema.kodebeskrivelse.title","kommentar.title":"resource.utfallBesvarelse.utfallSvar.kommentar.title","vedleggsliste.vedlegg.title":"resource.utfallBesvarelse.utfallSvar.vedleggsliste.vedlegg.title"}}}}class be extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceValues={title:!e?.hideTitle&&c(s?.utfallSvarType?.title),data:n?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getValueFromFormData(e){return h(e)}getResourceBindings(e){const t=e?.resourceValues?.utfallType;return{utfallSvarType:{title:`resource.utfallBesvarelse.utfallSvar.${t?.toLowerCase()}.header`}}}}class Te extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues,this.size=e?.size}hasContent(e){return s(e?.resourceValues?.title)}}class Be extends e{constructor(e){super(e),this.size=e?.size,this.resourceValues={title:g(e,"title")}}}class Ce extends e{constructor(e){super(e),this.isEmpty=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class Ee extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getListItemsFromKey(e,t){return Array.isArray(e)&&e.length?e.map(e=>e?.[t]):[]}getValueFromFormData(e){const t=h(e);return s(e?.itemKey)?this.getListItemsFromKey(t,e?.itemKey):t}}class Ve extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getAttachmentFileName(e){return e?.filnavn}getAttachmentDescription(e){return e?.vedleggstype?.kodebeskrivelse}getAttachmentListItems(e){return e&&Array.isArray(e)&&e?.length?e.map(e=>{const t=new pe(e),s=this.getAttachmentDescription(t),n=this.getAttachmentFileName(t);return s?.length&&n?.length?`${s} (${n})`:s?.length?s:n?.length?n:null}).filter(e=>e):[]}getValueFromFormData(e){const t=h(e);return this.getAttachmentListItems(t)}}class we extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues}hasContent(e){return s(e?.resourceValues?.title)}}class xe extends e{constructor(e){super(e),this.resourceValues={title:g(e,"title")}}}class Fe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=g(e,"body"),n=this.getTextDataCombination(t,s),r=!this.hasContent(t);this.isEmpty=r,this.resourceValues={title:r?g(e,"emptyFieldText"):n}}hasContent(e){return s(e)}getTextDataCombination(e,t){const s=`${t} ${e}`.trim();return s?.length>0?`${s}.`:""}getValueFromFormData(e){return se(h(e),e?.format)}}class je extends e{constructor(e){super(e),this.resourceValues={title:g(e,"title")}}}class Me extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class He extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t),n=this.getValidationMessagesFromProps(e);this.isEmpty=s,this.validationMessages=n,this.hasValidationMessages=O(n),this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}getValueFromFormData(e){const t=h(e);return{tableHeaders:this.getTableHeadersFromProps(e),tableRows:this.getTableRowsFromProps(e,t)}}getTableHeadersFromProps(e){const t=e?.tableColumns||[];if(0===t.length)return[];const s=function(e){return e.map(e=>{const t=e?.resourceBindings?.title;return{text:c(t),props:e.props}})}(t);var n;return e.showRowNumbers&&s.unshift({text:(n=e,c(n?.resourceBindings?.rowNumberTitle)||"#")}),s}getTableRowsFromProps(e,t){const n=function(e,t){return!Array.isArray(t)&&(t=[t]),t.map(t=>{const n=[];return e.forEach(e=>{const r=function(e,t){return t?null==e||/(\.\.|^\.)/.test(t)?void 0:t.split(/\.|\[|\]/).filter(Boolean).reduce((e,t)=>e&&e[t],e):e}(t,e.dataKey),i=e?.resourceBindings?.emptyFieldText,a=c(i),o={resourceBindings:e.resourceBindings,resourceValues:{data:r},format:e.format,hideTitle:!0,tagName:e.tagName,isChildComponent:!0};s(a)&&(o.resourceValues.emptyFieldText=a),n.push(o)}),n})}(e?.tableColumns||[],t),r=this.removeEmptyTableRows(n);return e.showRowNumbers?r.map((e,t)=>[{tagName:"custom-field-data",hideTitle:!0,isChildComponent:!0,resourceValues:{data:t+1}},...e]):r}getValidationMessagesFromProps(e){return function(e,t=new N){const s=l();return e.forEach((e,n)=>{Object.keys(e?.textResourceBindings||{}).forEach(r=>{const i=s?.resources?.find(t=>t.id===e.textResourceBindings[r]);i?""===i.value&&t.info.push(`Empty text resource binding with id: "${e.textResourceBindings[r]}" for "${r}" at table column [${n}]`):t.error.push(`Missing text resource binding with id: "${e.textResourceBindings[r]}" for "${r}" at table column [${n}]`)})}),t}(e?.tableColumns)}removeEmptyTableRows(e){return e.map(e=>{const t=e.map(e=>_e(e));return t.filter(e=>!e?.isEmpty).length>0?t:null}).filter(e=>null!==e)}hasContent(e){return s(e)}}class De extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceBindings=s,this.resourceValues={data:n?c(e?.resourceBindings?.emptyFieldText):t}}getValueFromFormData(e){const t=h(e);return this.getEiendomListFromData(t)}getEiendomListFromData(e){if(s(e))return e.map(e=>new x(e)).filter(e=>this.hasEiendomValue(e))}getValidationMessages(e){return P("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return s(e)}hasZipCodeOrCity(e){return s(e?.adresse?.postnr)||s(e?.adresse?.poststed)}hasAdresseLinje(e){return s(e?.adresse?.adresselinje1)||s(e?.adresse?.adresselinje2)||s(e?.adresse?.adresselinje3)}hasAdresse(e){return this.hasAdresseLinje(e)||this.hasZipCodeOrCity(e)}hasEiendomNummerField(e){return s(e?.bolignummer)||s(e?.bygningsnummer)||s(e?.eiendomsidentifikasjon?.gaardsnummer)||s(e?.eiendomsidentifikasjon?.bruksnummer)||s(e?.eiendomsidentifikasjon?.seksjonsnummer)||s(e?.eiendomsidentifikasjon?.festenummer)}hasEiendomValue(e){return this.hasAdresse(e)||this.hasEiendomNummerField(e)}getTextResourceBindings(e){const t={adresse:{title:e?.resourceBindings?.adresse?.title||"resource.eiendomByggested.eiendom.adresse.title",emptyFieldText:e?.resourceBindings?.adresse?.emptyFieldText||"resource.eiendomByggested.eiendom.adresse.emptyFieldText"},eiendomsidentifikasjonGaardsnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.gaardsnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.gaardsnummer.title"},eiendomsidentifikasjonBruksnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.bruksnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.bruksnummer.title"},eiendomsidentifikasjonSeksjonsnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.seksjonsnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.seksjonsnummer.title"},eiendomsidentifikasjonFestenummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.festenummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.festenummer.title"},bolignummer:{title:e?.resourceBindings?.bolignummer?.title||"resource.eiendomByggested.eiendom.bolignummer.title"},bygningsnummer:{title:e?.resourceBindings?.bygningsnummer?.title||"resource.eiendomByggested.eiendom.bygningsnummer.title"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.eiendomByggested={title:e?.resourceBindings?.title||"resource.eiendomByggested.eiendom.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.eiendomByggested={...t.eiendomByggested,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class Le extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.partType=e?.partType,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceBindings=s,this.resourceValues={data:n?c(e?.resourceBindings?.emptyFieldText):t}}getPartTypeFromElementAttributes(e){return e.getAttribute("parttype")||"tiltakshaver"}getValueFromFormData(e){const t=h(e);if(!s(t))return;const n=new H(t);return this.hasPartValue(n)?n:void 0}getValidationMessages(e){return P("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return s(e)}hasNavnOrOrganisasjonsnummer(e){return s(e?.navn)||s(e?.organisasjonsnummer)}hasTelefonnummer(e){return s(e?.telefonnummer)||s(e?.mobilnummer)}hasEpost(e){return s(e?.epost)}hasPartValue(e){return this.hasNavnOrOrganisasjonsnummer(e)||this.hasTelefonnummer(e)||this.hasEpost(e)}getTextResourceBindings(e){const t=e?.partType||"tiltakshaver",s={navn:{title:e?.resourceBindings?.navn?.title||`resource.${t}.navn.title`},telefonnummer:{title:e?.resourceBindings?.telefonnummer?.title||`resource.${t}.telefonnummer.title`},epost:{title:e?.resourceBindings?.epost?.title||`resource.${t}.epost.title`}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(s.part={title:e?.resourceBindings?.title||`resource.${t}.header`}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(s.part={...s.part,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),s}}function Ie(e){const t=JSON.parse(e?.getAttribute("formdata"));return s(t)&&t}function Ae(e){const t=e?.getAttribute("tagName")||e?.tagName?.toLowerCase();return s(t)&&t}function Se(e){const t=e?.getAttribute("text");return s(t)&&t}function Ne(e){const t=JSON.parse(e?.getAttribute("texts"));return s(t)&&t}function Oe(e){return"true"===e?.getAttribute("inline")}function Pe(e){return"true"===e?.getAttribute("hideTitle")}function Re(e){const t=e?.getAttribute("size");return ne(t)?t?.toString().toLowerCase():void 0}function $e(e){return"true"===e?.getAttribute("hideIfEmpty")}function Ke(e){const t=JSON.parse(e?.getAttribute("styleOverride")||"{}");return s(t)&&t}function Ue(e){return"true"===e?.getAttribute("isChildComponent")}function ze(e){const t=e?.getAttribute("feedbackType");return s(t)&&t}function Je(e){const t=e?.getAttribute("itemKey");return s(t)&&t}function Ge(e){return"true"===e?.getAttribute("hideOrgNr")}function Ze(e){const t=e?.getAttribute("format");return s(t)&&t}function We(e){const t=JSON.parse(e?.getAttribute("tableColumns"));return s(t)&&t}function Ye(e){return"true"===e?.getAttribute("showRowNumbers")}function qe(e){const t=JSON.parse(e?.getAttribute("resourceBindings"));return s(t)&&t}function Qe(e){const t=JSON.parse(e?.getAttribute("resourceValues"));return s(t)&&t}function Xe(e){const t=e?.getAttribute("partType");return s(t)?t:"tiltakshaver"}function _e(t){const s=t instanceof HTMLElement?function(e){return{formData:Ie(e),tagName:Ae(e),text:Se(e),texts:Ne(e),inline:Oe(e),hideTitle:Pe(e),size:Re(e),hideIfEmpty:$e(e),styleOverride:Ke(e),isChildComponent:Ue(e),feedbackType:ze(e),itemKey:Je(e),hideOrgNr:Ge(e),format:Ze(e),tableColumns:We(e),showRowNumbers:Ye(e),resourceBindings:qe(e),resourceValues:Qe(e),partType:Xe(e)}}(t):t,n=s?.tagName||s?.getAttribute("tagname")||"custom-component";switch(n?.toLowerCase()){case"custom-component":return new e(s);case"custom-dispensasjon":return new R(s);case"custom-feedback":return new $(s);case"custom-feedback-data":return new K(s);case"custom-feedbacklist-data":return new U(s);case"custom-feedbacklist-validation-messages":return new z(s);case"custom-field":return new J(s);case"custom-field-adresse":return new G(s);case"custom-field-boolean-data":return new Z(s);case"custom-field-boolean-text":return new W(s);case"custom-field-count-data":return new Y(s);case"custom-field-data":return new re(s);case"custom-field-kommunens-saksnummer":return new ie(s);case"custom-field-part-navn":return new ae(s);case"custom-field-prosjekt":return new le(s);case"custom-field-telefonnummer":return new de(s);case"custom-field-utfall-svar-status":return new me(s);case"custom-group-utfall-svar":return new ve(s);case"custom-group-utfall-svar-type":return new be(s);case"custom-grouplist-utfall-svar":return new he(s);case"custom-grouplist-utfall-svar-type":return new ke(s);case"custom-header":return new Te(s);case"custom-header-text":return new Be(s);case"custom-list":return new Ce(s);case"custom-list-data":return new Ee(s);case"custom-list-vedlegg":return new Ve(s);case"custom-paragraph":return new we(s);case"custom-paragraph-text":return new xe(s);case"custom-paragraph-text-data":return new Fe(s);case"custom-subheader-text":return new je(s);case"custom-table":return new Me(s);case"custom-table-data":return new He(s);case"custom-table-eiendom":return new De(s);case"custom-table-part":return new Le(s);default:return console.warn(`Unknown component type: ${n}`),null}}function et(e,t,s=!0){const n=document.createElement(t||"ul");return e.forEach(e=>{const t=document.createElement("li");t.innerHTML=e,n.appendChild(t)}),s?n.outerHTML:n}customElements.define("custom-feedback",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this),s=e?.resourceValues?.data;e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e,t){const s=document.createElement("p");return s.innerHTML=e,s.classList.add(t),s.outerHTML}(s,e?.feedbackType)}}),customElements.define("custom-field",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t={inline:e?.inline,styleOverride:e?.styleOverride};this.innerHTML=function(e,t,n){n={returnHtml:!0,inline:!1,styleOverride:{},...n};const i=document.createElement("div");i.classList.add("field"),e?.length&&i.appendChild(function(e,t){const s=document.createElement("label");return s.innerText=`${e}${t?":":""}`,s}(e,n.inline)),n?.inline&&i.classList.add("inline");const a=function(e){const t=document.createElement("span");return Array.isArray(e)&&(e=e.join(", ")),"object"==typeof e&&(e=JSON.stringify(e,null,2)),t.innerHTML=s(e)?e:"",t}(t);return e?.length&&a.classList.add("has-title"),i.appendChild(a),r(i,{...n.styleOverride}),n.returnHtml?i.outerHTML:i}(e?.resourceValues?.title,e?.resourceValues?.data,t)}}}),customElements.define("custom-header",class extends HTMLElement{connectedCallback(){const e=_e(this);e?.isEmpty||(this.innerHTML=function(e,t){const s=document.createElement(ne(t)?t:"h2");return s.innerHTML=e,s.outerHTML}(e?.resourceValues?.title,e?.size),r(this,e?.styleOverride))}}),customElements.define("custom-list",class extends HTMLElement{connectedCallback(){const e=new _e(this);this.innerHTML=e?.resourceValues?.title?.length?function(e,t,s){const n=document.createElement("div");n.classList.add("field"),e?.length&&n.appendChild(function(e){const t=document.createElement("label");return t.innerText=e,t}(e));const r=et(t,s,!1);return e?.length&&r.classList.add("has-title"),n.appendChild(r),n.outerHTML}(e?.resourceValues?.title,e?.resourceValues?.data):et(e?.resourceValues?.data),r(this,e?.styleOverride)}}),customElements.define("custom-paragraph",class extends HTMLElement{connectedCallback(){const e=_e(this);e?.isEmpty||(this.innerHTML=function(e){const t=document.createElement("p");return t.innerHTML=e,t.outerHTML}(e?.resourceValues?.title),r(this,e?.styleOverride))}});class tt{constructor(e){const t=this.getIsChildComponentAttributeFromProps(e),s=this.getFormDataAttributeFromProps(e),n=this.getTagNameAttributeFromProps(e),r=this.getSizeAttributeFromProps(e),i=this.getHideTitleAttributeFromProps(e),a=this.getHideIfEmptyAttributeFromProps(e),o=this.getIsEmptyAttributeFromProps(e),l=this.getInlineAttributeFromProps(e),u=this.getStyleOverrideAttributeFromProps(e),d=this.getGridAttributeFromProps(e),c=this.getTableColumnsAttributeFromProps(e),m=this.getItemKeyAttributeFromProps(e),h=this.getIdAttributeFromProps(e),g=this.getFeedbackTypeAttributeFromProps(e),p=this.getHideOrgNr(e),f=this.getFormatAttributeFromProps(e),y=this.getShowRowNumbersAttributeFromProps(e),k=this.getPartTypeAttributeFromProps(e),v=this.getResourceBindingsFromProps(e),b=this.getResourceValuesFromProps(e);t&&(this.isChildComponent=t),s&&(this.formData=s),n&&(this.tagName=n),r&&(this.size=r),i&&(this.hideTitle=i),a&&(this.hideIfEmpty=a),o&&(this.isEmpty=o),l&&(this.inline=l),u&&(this.styleOverride=u),d&&(this.grid=d),c&&(this.tableColumns=c),m&&(this.itemKey=m),h&&(this.id=h),g&&(this.feedbackType=g),p&&(this.hideOrgNr=p),f&&(this.format=f),y&&(this.showRowNumbers=y),k&&(this.partType=k),v&&(this.resourceBindings=v),b&&(this.resourceValues=b)}getFormDataAttributeFromProps(e){if(!s(e?.formData))return null;if("string"==typeof e?.formData){const t=e?.formData;return JSON.stringify(t)}if("number"==typeof e?.formData){const t=e?.formData.toString();return JSON.stringify(t)}if("object"==typeof e?.formData){const t={};return Object.keys(e.formData).forEach(s=>{t[s]=e.formData[s]}),JSON.stringify(t)}}getIsChildComponentAttributeFromProps(e){return e?.isChildComponent?"true":void 0}getTagNameAttributeFromProps(e){return e?.tagName?e?.tagName.toString():void 0}getSizeAttributeFromProps(e){return ne(e?.size)?e?.size?.toString().toLowerCase():void 0}getHideTitleAttributeFromProps(e){return"true"===e?.hideTitle?.toString()?"true":void 0}getHideIfEmptyAttributeFromProps(e){return"true"===e?.hideIfEmpty?.toString()?"true":void 0}getIsEmptyAttributeFromProps(e){return"true"===e?.isEmpty?.toString()?"true":void 0}getInlineAttributeFromProps(e){return"true"===e?.inline?.toString()?"true":void 0}getStyleOverrideAttributeFromProps(e){return s(e?.styleOverride)?JSON.stringify(e?.styleOverride):void 0}getGridAttributeFromProps(e){return s(e?.grid)&&JSON.stringify(e?.grid)}getTableColumnsAttributeFromProps(e){return s(e?.tableColumns)&&JSON.stringify(e?.tableColumns)}getItemKeyAttributeFromProps(e){return s(e?.itemKey)&&e?.itemKey}getIdAttributeFromProps(e){return s(e?.id)&&e?.id}getFeedbackTypeAttributeFromProps(e){return s(e?.feedbackType)?["error","warning","success","info","default"].includes(e?.feedbackType)?e?.feedbackType:"default":null}getHideOrgNr(e){return"true"===e?.hideOrgNr?.toString()?"true":void 0}getFormatAttributeFromProps(e){return s(e?.format)&&e?.format?.toString()}getShowRowNumbersAttributeFromProps(e){return"true"===e?.showRowNumbers?.toString()?"true":void 0}getPartTypeAttributeFromProps(e){return s(e?.partType)&&e?.partType}getResourceBindingsFromProps(e){return s(e?.resourceBindings)&&JSON.stringify(e?.resourceBindings)}getResourceValuesFromProps(e){return s(e?.resourceValues)?JSON.stringify(e?.resourceValues):null}}function st(e){const t=e?.resourceValues?.data,s=e?.styleOverride,n=document.createElement("table"),o=document.createElement("thead"),l=document.createElement("tr");if(t?.tableHeaders?.length&&t?.tableRows?.length){t.tableHeaders.forEach(e=>{l.appendChild(function(e){const t=document.createElement("th");return t.textContent=e.text,r(t,e?.props?.styleOverride),t}(e))}),o.appendChild(l),n.appendChild(o);const e=document.createElement("tbody");t.tableRows.forEach(t=>{e.appendChild(function(e){const t=document.createElement("tr");return e.forEach(e=>{t.appendChild(function(e){const t=document.createElement("td"),s=new tt(e);return t.innerHTML=a("custom-field-data",s).outerHTML,t}(e))}),t}(t))}),n.appendChild(e)}else{const t=i(e);if(t?.length){const e=document.createElement("tr"),s=document.createElement("td");s.textContent=t,e.appendChild(s),n.appendChild(e)}}return r(n,s),n}function nt(e,t){switch(e){case"error":return`Errors (${t})`;case"warning":return`Warnings (${t})`;case"info":return`Information (${t})`;default:return`Messages (${t})`}}function rt(e){return a("custom-feedbacklist-validation-messages",new tt({isChildComponent:!0,resourceValues:{data:e}}))}function it(e){return a("custom-group-utfall-svar",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:e}}))}function at(e,t="h1"){const n=e?.resourceValues?.data,r=n?.dispensasjonBeskrivelse?.dispensasjonTittel?.kodebeskrivelse;return s(r)?a("custom-header-text",new tt({isChildComponent:!0,size:t,resourceValues:{title:r}})):null}customElements.define("custom-table",class extends HTMLElement{async connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e,t){const s=new tt({size:t,resourceValues:{title:e}});if(e)return a("custom-header",s)}(e?.resourceValues?.title,e?.size),s=st(e);this.innerHTML="",t&&this.appendChild(t),this.appendChild(s)}}}),customElements.define("custom-feedback-data",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e.isEmpty&&t)t.style.display="none";else{const t=new tt(e);this.innerHTML=a("custom-feedback",t).outerHTML}}}),customElements.define("custom-feedbacklist-data",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this),s=e?.resourceValues?.data,n=e?.resourceValues?.title||"Messages";e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e,t,s,n){const i=document.createElement("details");i.classList.add("feedback-details"),i.classList.add(s),i.setAttribute("open",!0),r(n);const o=document.createElement("summary");o.classList.add("feedback-summary"),o.innerHTML=e,i.appendChild(o);const l=document.createElement("div");return l.classList.add("feedback-list"),t.forEach(e=>{const t=document.createElement("div");t.classList.add("feedback-list-item");const s=new tt({isChildComponent:!0,feedbackType:"default",resourceValues:{data:e}});t.appendChild(a("custom-feedback-data",s)),l.appendChild(t)}),i.appendChild(l),i.outerHTML}(n,s,e?.feedbackType,e?.styleOverride)}}),customElements.define("custom-feedbacklist-validation-messages",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this),s=new N(e?.resourceValues?.data);e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e){const t=document.createElement("div");return t.classList.add("validation-messages-container"),Object.keys(e).forEach(s=>{const n=e[s];if(n?.length){const e=a("custom-feedbacklist-data",new tt({isChildComponent:!0,feedbackType:s,resourceValues:{title:nt(s,n.length),data:n}}));t.appendChild(e)}}),t.outerHTML}(s)}}),customElements.define("custom-field-adresse",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=i(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new tt(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-part-navn",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=i(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new tt(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-boolean-data",class extends HTMLElement{async connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new tt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-boolean-text",class extends HTMLElement{async connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new tt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-count-data",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new tt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-data",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new tt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-kommunens-saksnummer",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new tt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-prosjekt",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new tt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-telefonnummer",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=i(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new tt(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-utfall-svar-status",class extends HTMLElement{async connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new tt(e);this.innerHTML=a("custom-field",t).outerHTML;const s=e.hasValidationMessages&&rt(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-grouplist-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=_e(this),t=d(this);e?.hideIfEmpty&&e.isEmpty&&t?t.style.display="none":e?.resourceValues?.data&&Object.keys(e?.resourceValues?.data).forEach(t=>{const s=function(e,t){const s=e?.resourceValues?.data[t];return a("custom-group-utfall-svar-type",new tt({isChildComponent:!0,resourceValues:{data:s,utfallType:t}}))}(e,t);this.appendChild(s)})}}),customElements.define("custom-group-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=_e(this);if(!e.isEmpty){const t=function(e,t="h2"){return a("custom-header-text",new tt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.title}}))}(e);this.appendChild(t);const s=function(e){return a("custom-grouplist-utfall-svar",new tt({isChildComponent:!0,resourceValues:{data:e?.resourceValues?.data}}))}(e);this.appendChild(s);const n=e.hasValidationMessages&&rt(e?.validationMessages);n&&this.appendChild(n)}}}),customElements.define("custom-grouplist-utfall-svar",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else for(const t of e?.resourceValues?.data){const e=it(t);this.appendChild(e);const s=a("custom-divider");this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar",class extends HTMLElement{async connectedCallback(){const e=_e(this),t=d(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=document.createElement("div");t.appendChild(function(e,t="h3"){return a("custom-header-text",new tt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.data?.tittel}}))}(e,"h3")),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:t?.beskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-utfall-svar-status",new tt({isChildComponent:!0,resourceBindings:{title:e?.resourceBindings?.["status.title"]},resourceValues:{data:t}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["tema.kodebeskrivelse.title"]},resourceValues:{data:t?.tema?.kodebeskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!1,resourceBindings:{title:e?.resourceBindings?.["kommentar.title"]},resourceValues:{data:t?.kommentar,emptyFieldText:"-"}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-list-vedlegg",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&rt(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-header-text",class extends HTMLElement{connectedCallback(){const e=new _e(this);e?.isChildComponent||r(d(this),{padding:"0 0.75rem"});const t=new tt(e);this.innerHTML=a("custom-header",t).outerHTML}}),customElements.define("custom-list-data",class extends HTMLElement{connectedCallback(){const e=new _e(this),t=d(this);var s,n;if(e?.itemKey?.length&&(s=e?.formData?.data,n=e?.itemKey,Array.isArray(s)&&s.length&&s.map(e=>e?.[n])),e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new tt(e),s=e.isEmpty?"custom-field":"custom-list";this.innerHTML=a(s,t).outerHTML}}}),customElements.define("custom-list-vedlegg",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=new tt(e);this.innerHTML=a("custom-field",t).outerHTML}else{const t=new tt(e);this.innerHTML=a("custom-list",t).outerHTML}}}),customElements.define("custom-paragraph-text",class extends HTMLElement{connectedCallback(){const e=_e(this),t=new tt(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}),customElements.define("custom-paragraph-text-data",class extends HTMLElement{connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new tt(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}}),customElements.define("custom-subheader-text",class extends HTMLElement{connectedCallback(){const e=_e(this),t=new tt(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}),customElements.define("custom-table-data",class extends HTMLElement{async connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&rt(e?.validationMessages),s=function(e){return a("custom-table",new tt(e))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-eiendom",class extends HTMLElement{async connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&rt(e?.validationMessages),s=function(e){const t=[{dataKey:"adresse",tagName:"custom-field-adresse",resourceBindings:{title:e?.resourceBindings?.adresse?.title,emptyFieldText:e?.resourceBindings?.adresse?.emptyFieldText},props:{styleOverride:{width:"116px"}}},{dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonGaardsnummer?.title,emptyFieldText:e?.resourceBindings?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonBruksnummer?.title,emptyFieldText:e?.resourceBindings?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonSeksjonsnummer?.title,emptyFieldText:e?.resourceBindings?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonFestenummer?.title,emptyFieldText:e?.resourceBindings?.emptyFieldText}},{dataKey:"bolignummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.bolignummer?.title,emptyFieldText:e?.resourceBindings?.emptyFieldText}},{dataKey:"bygningsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.bygningsnummer?.title,emptyFieldText:e?.resourceBindings?.emptyFieldText}}];return a("custom-table-data",new tt({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.eiendomByggested?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-part",class extends HTMLElement{async connectedCallback(){const e=_e(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&rt(e?.validationMessages),s=function(e){const t=[{tagName:"custom-field-part-navn",resourceBindings:{title:e?.resourceBindings?.navn?.title,emptyFieldText:e?.resourceBindings?.emptyFieldText}},{tagName:"custom-field-telefonnummer",resourceBindings:{title:e?.resourceBindings?.telefonnummer?.title,emptyFieldText:e?.resourceBindings?.emptyFieldText}},{tagName:"custom-field-data",dataKey:"epost",resourceBindings:{title:e?.resourceBindings?.epost?.title,emptyFieldText:e?.resourceBindings?.emptyFieldText}}];return a("custom-table-data",new tt({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.part?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-dispensasjon",class extends HTMLElement{async connectedCallback(){const e=_e(this),t=d(this);if(e.isEmpty&&t)t.style.display="none";else{const t=function(){const e=document.createElement("div");return r(e,{display:"flex",flexFlow:"wrap",justifyContent:"start",alignItems:"flex-start"}),e}(),n=at(e),i=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.dispensasjonReferanse?.title},resourceValues:{data:t?.dispensasjonReferanse}})),s)}(e),l=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.metadataFtbId?.title},resourceValues:{data:t?.metadata?.ftbId}})),s)}(e),u=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-kommunens-saksnummer",new tt({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.kommunensSaksnummer?.title},resourceValues:{data:t?.kommunensSaksnummer}})),s)}(e),d=function(e,t="h2"){return a("custom-header-text",new tt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.soeknadGjelderHeader?.title}}))}(e),c=function(e){const t=e?.resourceValues?.data;return a("custom-table-eiendom",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.eiendomByggested?.title},resourceValues:{data:t?.eiendomByggested?.eiendom}}))}(e),m=function(e,t="h3"){const s=e?.resourceValues?.data;return s?.tiltakstyper?.type?.kode?.length>0?a("custom-header-text",new tt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeHeader?.title}})):null}(e),h=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new tt({isChildComponent:!0,hideIfEmpty:!0,itemKey:"kodebeskrivelse",resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeKode?.title},resourceValues:{data:t?.tiltakstyper?.type?.kode}})))}(e),g=function(e){const t=e?.resourceValues?.data;return a("custom-table-part",new tt({isChildComponent:!0,partType:"tiltakshaver",hideIfEmpty:!0,resourceValues:{data:t?.tiltakshaver}}))}(e),f=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-adresse",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.tiltakshaverAdresse?.title},resourceValues:{data:t?.tiltakshaver?.adresse}})))}(e),y=at(e,"h2"),k=function(e){const t=e?.resourceValues?.data;return s(t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse)||s(t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse)?o(a("custom-field-boolean-data",new tt({isChildComponent:!0,hideIfEmpty:!1,resourceValues:{data:"Annet"===t?.soeknadstype?.kodebeskrivelse,trueData:t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse,falseData:t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse,defaultData:t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse}}))):null}(e),v=function(e){const t=e?.resourceValues?.data;return a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonBeskrivelseBeskrivelse?.title},resourceValues:{data:t?.dispensasjonBeskrivelse?.beskrivelse}}))}(e),b=function(e,t="h2"){return a("custom-header-text",new tt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.dispensasjonFraHeader?.title}}))}(e),T=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonPlanBestemmelseNavn?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.navn}})))}(e),B=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.nasjonalArealplanIdPlanIdentifikasjon?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.nasjonalArealplanId?.planidentifikasjon}})))}(e),C=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.bestemmelserType?.title},resourceValues:{data:e.isPlanBestemmelseType?t?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse:t?.dispensasjonFra?.lovbestemmelse}})))}(e),E=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.planBestemmelseNummerering?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering}})))}(e),V=function(e){return a("custom-header-text",new tt({isChildComponent:!0,size:"h2",resourceBindings:{title:e.resourceBindings?.stedfestingHeader?.title}}))}(e),w=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinatsystem?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinatsystem?.kodebeskrivelse}})))}(e),x=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinater?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinater?.koordinat}})))}(e),F=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingVertikalnivaa?.title},resourceValues:{data:t?.stedfesting?.vertikalnivaa?.kodebeskrivelse}})))}(e),j=function(e,t="h2"){return a("custom-header-text",new tt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.varighetHeader?.title}}))}(e),M=function(e){const t=e?.resourceValues?.data;return t?.varighet?.oenskesVarigDispensasjon?o(a("custom-paragraph-text",new tt({isChildComponent:!0,resourceBindings:{title:e.resourceBindings?.varighetOenskesVarigDispensasjon?.trueText}}))):s(t?.varighet?.oensketVarighetTil)?o(a("custom-field-data",new tt({isChildComponent:!0,format:"date",resourceBindings:{title:e.resourceBindings?.varighetOensketVarighetTil?.title},resourceValues:{data:t?.varighet?.oensketVarighetTil}}))):null}(e),H=function(e,t="h2"){return a("custom-header-text",new tt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.begrunnelseHeader?.title}}))}(e),D=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.hensynBakBestemmelsen}})))}(e),L=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynBakBestemmelsen}})))}(e),I=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynOverordnet?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynOverordnet}})))}(e),A=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseFordeler?.title},resourceValues:{data:t?.begrunnelse?.fordeler?.effekt}})))}(e),S=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseUlemper?.title},resourceValues:{data:t?.begrunnelse?.ulemper?.effekt}})))}(e),N=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseSamletBegrunnelse?.title},resourceValues:{data:t?.begrunnelse?.samletBegrunnelse}})))}(e),O=function(e,t="h2"){const s=e?.resourceValues?.data,n=s?.generelleVilkaar?.norskSvenskDansk;return n?a("custom-header-text",new tt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.title}})):null}(e),P=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-boolean-text",new tt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{trueText:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.trueText,falseText:"",defaultText:""},resourceValues:{data:t?.generelleVilkaar?.norskSvenskDansk}})))}(e),R=rt(e?.validationMessages);p(t,[n,i,l,u]),p(t,[d,c,m,h]),p(t,[g,f]),p(t,[y,k,v]),e.isPlanBestemmelseType?p(t,[b,T,B,C,E]):p(t,[b,C]),p(t,[V,w,x,F]),p(t,[j,M]),p(t,[H,D,L,I,A,S,N]),p(t,[O,P]),p(t,[R]),this.appendChild(t)}}});class ot{constructor(e){this.eiendomByggested=e?.eiendomByggested&&new F(e.eiendomByggested),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new j(e.kommunensSaksnummer),this.metadata=e?.metadata&&new M(e.metadata),this.versjon=e?.versjon}}function lt(e){return m(e)}const ut={eiendomTable:{title:"resource.eiendomByggested.eiendom.title","col-1":"resource.eiendomByggested.eiendom.adresse.title","col-2":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.gaardsnummer.title","col-3":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.bruksnummer.title","col-4":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.seksjonsnummer.title","col-5":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.festenummer.title","col-6":"resource.eiendomByggested.eiendom.bolignummer.title","col-7":"resource.eiendomByggested.eiendom.bygningsnummer.title"},gjenomfoeringsplanNummer:{title:"resource.gjennomfoeringsplan.versjon.title"}};customElements.define("custom-gjennomfoeringsplan",class extends HTMLElement{async connectedCallback(){const e=JSON.parse(this.getAttribute("textResources")),t=function(e){const t=JSON.parse(e.getAttribute("formdata"));return new ot({eiendomByggested:s(t?.eiendomByggested)?t.eiendomByggested:null,kommunensSaksnummer:s(t?.kommunensSaksnummer)?t.kommunensSaksnummer:null,metadata:s(t?.metadata)?t.metadata:null,versjon:t?.versjon?t.versjon:null})}(this),n=P(e,ut),r=d(this);if(!s(t)&&r)r.style.display="none";else{const s=function(e,t){return a("custom-field-data",{formData:{simpleBinding:e?.versjon},text:c(t),emptyFieldText:"(gjennomfoeringsplanNummer mangler)"})}(t,e),r=function(e,t){return a("custom-table-data",{formData:{data:e},text:"Eiendom/Byggested",hideIfEmpty:!0,size:"h3",tableColumns:[{titleResourceKey:"col-1",dataKey:"adresse",tagName:"custom-field-adresse",props:{emptyFieldText:"(adresse mangler)",styleOverride:{}}},{titleResourceKey:"col-2",dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-3",dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-4",dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"96px"}}},{titleResourceKey:"col-5",dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-6",dataKey:"bolignummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"120px"}}},{titleResourceKey:"col-7",dataKey:"bygningsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"96px"}}}],texts:lt(t),styleOverride:{tableLayout:"fixed"}})}(t?.eiendomByggested?.eiendom,e),i=rt(n);this.appendChild(s),this.appendChild(r),this.appendChild(i)}}}),window.addEventListener("load",async()=>{const e=window.location.pathname.split("/"),t=window.location.origin,n=e?.[1],r=e?.[2];if(![t?.length,n?.length,r?.length].every(Boolean))return void console.error("Could not determine the origin, organization, or application from the URL.");const i=`${t}/${n}/${r}/api/v1/profile/user`,a=await fetch(i).then(e=>e.json());if(!a?.profileSettingPreference?.language)return void console.error("Could not determine the user's language preference.");const o=a?.profileSettingPreference?.language;window.selectedLanguage=o;const l=`${t}/${n}/${r}/api/v1/texts/${o}`,u=await fetch(l).then(e=>e.json());if(s(u))window.textResources=u;else{console.error("Could not retrieve text resources for the selected language.");const e=`${t}/${n}/${r}/api/v1/texts/nb`,i=await fetch(e).then(e=>e.json());if(window.textResources=i,!s(i))return void console.error("Could not retrieve text resources for the fallback language.")}})})();
|
|
1
|
+
(()=>{"use strict";class e{constructor(e){e?.tagName&&(this.tagName=e.tagName),e?.inline&&(this.inline=e.inline),e?.hideTitle&&(this.hideTitle=e.hideTitle),e?.size&&(this.size=e.size),e?.hideIfEmpty&&(this.hideIfEmpty=e.hideIfEmpty),e?.styleOverride&&(this.styleOverride=e.styleOverride),e?.isChildComponent&&(this.isChildComponent=e.isChildComponent),e?.feedbackType&&(this.feedbackType=e.feedbackType),e?.hideOrgNr&&(this.hideOrgNr=e.hideOrgNr),e?.format&&(this.format=e.format)}}const t=["custom-divider","custom-feedback","custom-field","custom-header","custom-list","custom-paragraph","custom-table","custom-feedback-data","custom-feedbacklist-data","custom-feedbacklist-validation-messages","custom-field-adresse","custom-field-boolean-data","custom-field-boolean-text","custom-field-count-data","custom-field-data","custom-field-list-data","custom-field-kommunens-saksnummer","custom-field-part-navn","custom-field-prosjekt","custom-field-telefonnummer","custom-field-utfall-svar-status","custom-grouplist-ettersending","custom-grouplist-utfall-svar-type","custom-grouplist-utfall-svar","custom-group-ettersending","custom-group-utfall-svar-type","custom-group-utfall-svar","custom-header-text","custom-list-data","custom-list-vedlegg","custom-paragraph-text","custom-paragraph-text-data","custom-subheader-text","custom-table-data","custom-table-eiendom","custom-table-part","custom-dispensasjon","custom-gjennomfoeringsplan"];function s(e){if(null==e)return!1;if("string"==typeof e)return e.length>0;if("number"==typeof e)return!1===isNaN(e);if("boolean"==typeof e)return!0===e;if(Array.isArray(e))return e.length>0;for(let t in e)if(!!e?.[t]?.toString().length>0)return!0;return!1}function n(e){const t="number"==typeof e?e:Number(e);return"number"==typeof t&&!isNaN(t)&&t>0}function r(e,t){for(let s in t)e.style[s]=t[s]}function i(e){const t=e?.resourceValues?.emptyFieldText;return t||""}function a(e,s){if(!function(e){return t.includes(e)}(e))throw new Error(`Invalid tag name ${e}. Must be one of: ${t.join(", ")}`);const n=document.createElement(e);return function(e,t){for(const s in t)e.setAttribute(s,t[s])}(n,{...s,tagName:e}),n}function o(e,t){const n=document.createElement("div"),i=document.createElement("div");return i.appendChild(e),n.appendChild(i),r(n,{...s(t)?{flexGrow:"0",maxWidth:"50%",flexBasis:"50%"}:{flexBasis:"100%",maxWidth:"100%"},padding:"0.75rem 0px"}),n}function l(){return"undefined"!=typeof window&&window.textResources?window.textResources:[]}function u(e,t,s,n){s.forEach(s=>{void 0!==e[s]&&null!==e[s]||(null!=t?.[s]?console.warn(`Missing textResourceBindings.${s} for "${n}". Using fallback text: "${t[s]}"`):console.warn(`Missing textResourceBindings.${s} for "${n}".`))})}function d(e){const t="true"===e.getAttribute("isChildComponent"),s=e?.parentElement?.parentElement;return t?e:s||null}function c(e){const t=l(),s=t?.resources?.find(t=>t.id===e)?.value;return s||e}function m(e){const t={};for(const s in e)t[s]=c(e[s]);return t}function h(e){return e.isChildComponent?e.resourceValues?.data:e.formData?.simpleBinding||e.formData?.data}function g(e,t){return s(e?.resourceValues?.[t])?e.resourceValues?.[t]:c(e?.resourceBindings?.[t])}function p(e,t){return t.filter(e=>!!e).forEach(t=>{t instanceof HTMLElement?e.appendChild(t):e.innerHTML+=t}),e}customElements.define("custom-divider",class extends HTMLElement{connectedCallback(){const t=new e(this),s=document.createElement("hr");r(s,t?.styleOverride),this.innerHTML="",this.appendChild(s)}});class f{constructor(e){this.effekt=e?.effekt}}class y{constructor(e){this.effekt=e?.effekt}}class k{constructor(e){this.hensynBakBestemmelsen=e?.hensynBakBestemmelsen,this.vurderingHensynBakBestemmelsen=e?.vurderingHensynBakBestemmelsen,this.vurderingHensynOverordnet=e?.vurderingHensynOverordnet,this.fordeler=e?.fordeler&&new f(e.fordeler),this.ulemper=e?.ulemper&&new y(e.ulemper),this.samletBegrunnelse=e?.samletBegrunnelse}}class v{constructor(e){this.kodebeskrivelse=e?.kodebeskrivelse}}class T{constructor(e){this.dispensasjonTittel=e?.dispensasjonTittel&&new v(e.dispensasjonTittel),this.inngangsbeskrivelse=e?.inngangsbeskrivelse&&new v(e.inngangsbeskrivelse),this.annenInngangsbeskrivelse=e?.annenInngangsbeskrivelse,this.beskrivelse=e?.beskrivelse}}class b{constructor(e){this.planidentifikasjon=e?.planidentifikasjon}}class C{constructor(e){this.nummerering=e?.nummerering}}class B{constructor(e){this.navn=e?.navn,this.nasjonalArealplanId=e?.nasjonalArealplanId&&new b(e.nasjonalArealplanId),this.planbestemmelse=e?.planbestemmelse&&new C(e.planbestemmelse)}}class F{constructor(e){this.bestemmelserType=e?.bestemmelserType&&new v(e.bestemmelserType),this.dispensasjonPlanBestemmelse=e?.dispensasjonPlanBestemmelse&&new B(e.dispensasjonPlanBestemmelse),this.lovbestemmelse=e?.lovbestemmelse}}class V{constructor(e){this.adresselinje1=e?.adresselinje1,this.adresselinje2=e?.adresselinje2,this.adresselinje3=e?.adresselinje3,this.postnr=e?.postnr,this.poststed=e?.poststed}}class x{constructor(e){this.gaardsnummer=e?.gaardsnummer,this.bruksnummer=e?.bruksnummer,this.seksjonsnummer=e?.seksjonsnummer,this.festenummer=e?.festenummer}}class E{constructor(e){this.adresse=e?.adresse&&new V(e.adresse),this.eiendomsidentifikasjon=e?.eiendomsidentifikasjon&&new x(e.eiendomsidentifikasjon),this.bolignummer=e?.bolignummer,this.bygningsnummer=e?.bygningsnummer}}class w{constructor(e){this.eiendom=e?.eiendom&&e.eiendom.map(e=>new E(e))}}class j{constructor(e){this.saksaar=e?.saksaar,this.sakssekvensnummer=e?.sakssekvensnummer}}class M{constructor(e){this.ftbId=e?.ftbId,this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class I{constructor(e){const t=this.getAdresse(e);this.navn=e?.navn,this.organisasjonsnummer=e?.organisasjonsnummer,this.epost=e?.epost,this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer,t&&(this.adresse=t)}getAdresse(e){if(s(e?.adresse))return new V(e.adresse)}}class D{constructor(e){this.koordinatsystem=e?.koordinatsystem&&new v(e.koordinatsystem),this.koordinater=e?.koordinater}}class H{constructor(e){this.posisjon=e?.posisjon&&new D(e.posisjon),this.vertikalnivaa=e?.vertikalnivaa&&new v(e.vertikalnivaa)}}class L{constructor(e){const t=e?this.getTypeFromProps(e):null;t&&(this.type=t)}getTypeFromProps(e){return e&&s(e?.type)?{kode:this.getKodeFromType(e.type)}:null}getKodeFromType(e){return Array.isArray(e?.kode)&&e?.kode?.length?e?.kode?.map(e=>new v(e)):null}}class A{constructor(e){this.oenskesVarigDispensasjon=e?.oenskesVarigDispensasjon,this.oensketVarighetTil=e?.oensketVarighetTil}}class S{constructor(e){this.dispensasjonBeskrivelse=e?.dispensasjonBeskrivelse&&new T(e.dispensasjonBeskrivelse),this.dispensasjonReferanse=e?.dispensasjonReferanse,this.soeknadstype=e?.soeknadstype&&new v(e.soeknadstype),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new j(e.kommunensSaksnummer),this.metadata=e?.metadata&&new M(e.metadata),this.eiendomByggested=e?.eiendomByggested&&new w(e.eiendomByggested),this.tiltakstyper=e?.tiltakstyper&&new L(e.tiltakstyper),this.tiltakshaver=e?.tiltakshaver&&new I(e.tiltakshaver),this.dispensasjonFra=e?.dispensasjonFra&&new F(e.dispensasjonFra),this.stedfesting=e?.stedfesting&&new H(e.stedfesting),this.varighet=e?.varighet&&new A(e.varighet),this.begrunnelse=e?.begrunnelse&&new k(e.begrunnelse),this.generelleVilkaar=e?.generelleVilkaar}}class N{constructor(e){this.error=e?.error||[],this.warning=e?.warning||[],this.info=e?.info||[],this.success=e?.success||[],this.default=e?.default||[]}}function O(e){return!!e&&Object.values(e).some(e=>e.length>0)}function P(e,t,s=new N){for(const n in t)for(const r in t[n]){const i=t[n][r],a=e?.resources?.find(e=>e.id===i);a?""===a.value&&s.info.push(`Empty text resource for "${r}" with id: "${i}" in component "${n}"`):s.error.push(`Missing text resource for "${r}" with id: "${i}" in component "${n}"`)}return s}class K extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(),n=!this.hasContent(t),r=this.dataIsPlanBestemmelseType(t),i=this.getValidationMessages(s);this.isEmpty=n,this.isPlanBestemmelseType=r,this.validationMessages=i,this.hasValidationMessages=O(i),this.resourceBindings=s,this.resourceValues={data:n?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){return s(e?.formData)&&new S(e.formData)}getValidationMessages(e){return P("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}dataIsPlanBestemmelseType(e){return["reguleringsplan","kommuneplan","kommunedelplan"].includes(e?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse?.toLowerCase())}getResourceBindings(){return{dispensasjonReferanse:{title:"resource.dispensasjon.dispensasjonReferanse.title"},metadataFtbId:{title:"resource.metadata.ftbId.title"},kommunensSaksnummer:{title:"resource.kommunensSaksnummer.title"},soeknadGjelderHeader:{title:"resource.soeknadGjelder.header"},tiltakstyperTypeHeader:{title:"resource.tiltakstyper.type.header"},tiltakstyperTypeKode:{title:"resource.tiltakstyper.type.kode.title"},tiltakshaverAdresse:{title:"resource.tiltakshaver.adresse.title"},dispensasjonBeskrivelseBeskrivelse:{title:"resource.dispensasjonBeskrivelse.beskrivelse.title"},dispensasjonFraHeader:{title:"resource.dispensasjonFra.header"},dispensasjonPlanBestemmelseNavn:{title:"resource.dispensasjonFra.dispensasjonPlanBestemmelse.navn.title"},nasjonalArealplanIdPlanIdentifikasjon:{title:"resource.dispensasjonFra.nasjonalArealplanId.planidentifikasjon.title"},bestemmelserType:{title:"resource.dispensasjonFra.bestemmelserType.title"},planBestemmelseNummerering:{title:"resource.dispensasjonFra.dispensasjonPlanBestemmelse.planbestemmelse.nummerering.title"},stedfestingHeader:{title:"resource.stedfesting.header"},stedfestingPosisjonKoordinatsystem:{title:"resource.stedfesting.posisjon.koordinatsystem.title"},stedfestingPosisjonKoordinater:{title:"resource.stedfesting.posisjon.koordinater.title"},stedfestingVertikalnivaa:{title:"resource.stedfesting.vertikalnivaa.title"},varighetHeader:{title:"resource.varighet.header"},varighetOenskesVarigDispensasjon:{trueText:"resource.varighet.oenskesVarigDispensasjon.true.title"},varighetOensketVarighetTil:{title:"resource.varighet.oensketVarighetTil.title"},begrunnelseHeader:{title:"resource.begrunnelse.header"},begrunnelseHensynBakBestemmelsen:{title:"resource.begrunnelse.hensynBakBestemmelsen.title"},begrunnelseVurderingHensynBakBestemmelsen:{title:"resource.begrunnelse.vurderingHensynBakBestemmelsen.title"},begrunnelseVurderingHensynOverordnet:{title:"resource.begrunnelse.vurderingHensynOverordnet.title"},begrunnelseFordeler:{title:"resource.begrunnelse.fordeler.title"},begrunnelseUlemper:{title:"resource.begrunnelse.ulemper.title"},begrunnelseSamletBegrunnelse:{title:"resource.begrunnelse.samletBegrunnelse.title"},generelleVilkaarNorskSvenskDansk:{title:"resource.generelleVilkaar.norskSvenskDansk.header",trueText:"resource.generelleVilkaar.norskSvenskDansk.true.title"}}}}class R extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return h(e)}}class $ extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return h(e)}}class z extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:e?.resourceValues?.title||"Messages",data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return h(e)}}class U extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=h(e);return new N(t)}}class J extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class G extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}formatAdresselinje(e){return[e.adresselinje1,e.adresselinje2,e.adresselinje3].filter(e=>e?.length).join("\n")}formatZipCity(e){return[e.postnr,e.poststed].filter(e=>e?.length).join(" ")}formatAdresse(e){const t=this.formatAdresselinje(e),s=this.formatZipCity(e);return t.length&&s.length?`${t}\n${s}`:t.length?t:s.length?s:""}getValueFromFormData(e){const t=h(e),s=new V(t);return this.formatAdresse(s)}hasContent(e){return s(e)}}class Z extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=e?.id?.length&&"string"==typeof e?.id?e.id:"custom-field-boolean-data",s=h(e),r=n(s),i=function(e){return e.isChildComponent?{trueData:e.resourceValues?.trueData,falseData:e.resourceValues?.falseData,defaultData:e.resourceValues?.defaultData}:{trueData:e.formData?.trueData,falseData:e.formData?.falseData,defaultData:e.formData?.defaultData}}(e);return function(e,t,s){["trueData","falseData","defaultData"].forEach(t=>{void 0!==e[t]&&null!==e[t]||console.warn(`Missing dataModelBindings.${t} for "${s}".`)})}(i,0,t),!0===s||"true"===s||r?void 0!==i?.trueData&&null!==i.trueData?i.trueData:"":!1===s||"false"===s?void 0!==i?.falseData&&null!==i.falseData?i.falseData:"":i?.defaultData?i.defaultData:""}}class W extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=e?.id||"custom-field-boolean-text",s=h(e),n=function(e){return{trueText:e.resourceValues?.trueText||c(e?.resourceBindings?.trueText),falseText:e.resourceValues?.falseText||c(e?.resourceBindings?.falseText),defaultText:e.resourceValues?.defaultText||c(e?.resourceBindings?.defaultText)}}(e),r={trueText:"Ja",falseText:"Nei",defaultText:""};return u(n,r,["trueText","falseText","defaultText"],t),!0===s||"true"===s?void 0!==n?.trueText&&null!==n.trueText?n.trueText:r.trueText:!1===s||"false"===s?void 0!==n?.falseText&&null!==n.falseText?n.falseText:r.falseText:n?.defaultText?n.defaultText:r.defaultText}}class Y extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return n(e)}getValueFromFormData(e){const t=h(e);return t&&Array.isArray(t)?t.length:0}}const _=["default"],q={dateTime:{default:{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}},date:{default:{day:"2-digit",month:"2-digit",year:"numeric"}},time:{default:{hour:"2-digit",minute:"2-digit",second:"2-digit"}}},Q={dateTime:{default:"no-NO"},date:{default:"no-NO"},time:{default:"no-NO"}},X=["h1","h2","h3","h4","h5","h6"];function ee(e){return _.includes(e)?e:"default"}function te(e){const t=new Date(e);return!!e&&!isNaN(t.getTime())}function se(e,t,s="default"){switch(t){case"dateTime":return function(e,t="default"){if(!te(e))return"Ugyldig datoformat";t=ee(t),e.includes("T")||(e+="T00:00:00");const s=Q.dateTime[t],n=q.dateTime[s]||q.dateTime.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);case"date":return function(e,t="default"){te(e)||(e=function(e){const t=e.match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!t)return null;const s=parseInt(t[1],10),n=parseInt(t[2],10)-1,r=parseInt(t[3],10),i=new Date(Date.UTC(r,n,s));return i.getFullYear()===r&&i.getMonth()===n&&i.getDate()===s?i.toISOString():null}(e)),t=ee(t);const s=Q.date[t],n=q.date[s]||q.date.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);case"time":return function(e,t="default"){e.includes("T")||(e="1970-01-01T"+e),te(e)||(e=function(e){const t=e.match(/^(\d{2}):(\d{2})(?::(\d{2}))?$/);if(!t)return null;const s=parseInt(t[1],10),n=parseInt(t[2],10),r=t[3]?parseInt(t[3],10):0;return s<0||s>23||n<0||n>59||r<0||r>59?null:new Date(Date.UTC(1970,0,1,s,n,r)).toISOString()}(e)),t=ee(t);const s=Q.time[t],n=q.time[s]||q.time.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);default:return e}}function ne(e){return s(e)&&X.includes(e.toLowerCase())}class re extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=function(e){if(null!=e.formData?.dataTitle)return e.formData?.dataTitle}(e),n=!this.hasContent(t),r=!this.hasContent(s);this.isEmpty=n,this.resourceValues={title:!e?.hideTitle&&(!r&&s||g(e,"title")),data:n?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){return se(h(e),e?.format)}}class ie extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}formatKommunensSaksnummer(e){return[e?.saksaar?.toString(),e?.sakssekvensnummer?.toString()].filter(e=>e?.length).join("/")}getValueFromFormData(e){const t=h(e),s=new j(t);return this.formatKommunensSaksnummer(s)}}class ae extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,Array.isArray(t)&&t.length&&(this.resourceValues={data:t})}hasContent(e){return s(e)}getListItemsFromKey(e,t){if(!Array.isArray(e)||!e.length)return[];const s=t.split(".");return e.map(e=>s.reduce((e,t)=>e?.[t],e))}getValueFromFormData(e){const t=this.hasContent(e?.dataItemKey),n=this.hasContent(e?.dataTitleItemKey),r=h(e);if(t&&n){const t=s(e?.dataTitleItemKey)?this.getListItemsFromKey(r,e?.dataTitleItemKey):r,n=s(e?.dataItemKey)?this.getListItemsFromKey(r,e?.dataItemKey):r,i=Math.min(t.length,n.length);return Array.from({length:i},(e,s)=>({title:t[s],data:n[s]}))}}}class oe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}formatName(e,t){if(!e?.navn)return"";let s=e.navn;return!t&&e.organisasjonsnummer&&(s+=`\nOrganisasjonsnummer: ${e.organisasjonsnummer}`),s}getValueFromFormData(e){const t=h(e),s=new I(t);return this.formatName(s,this.hideOrgNr)}hasContent(e){return s(e)}}class le{constructor(e){this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class ue extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}hasContent(e){return s(e)}formatProsjekt(e){const t=s(e?.prosjektnr)&&`(${e.prosjektnr?.toString()})`;return[e?.prosjektnavn?.toString(),t].filter(e=>e?.length).join(" ")}getValueFromFormData(e){const t=new le(e?.formData?.data);return this.formatProsjekt(t)}}class de{constructor(e){this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer}}class ce extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}formatPhoneNumbers(e){return[e.telefonnummer,e.mobilnummer].filter(e=>e?.length).join("\n")}getValueFromFormData(e){const t=h(e),s=new de(t);return this.formatPhoneNumbers(s)}hasContent(e){return s(e)}}class me{constructor(e){this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart}}class he extends e{constructor(e){super(e);const t=this.getResourceBindings(e),s=this.getValueFromFormData(e,t?.utfallSvarStatus),n=!this.hasContent(s),r=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceValues={title:c(t?.utfallSvarStatus?.title),data:n?g(e,"emptyFieldText"):s}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getStatusText(e,t,s){const n=m(t),r={erUtfallBesvaresSenere:"Besvares senere",erUtfallBesvart:"Svar innsendt tidligere",status:"Besvares nå"};return u(n,r,["erUtfallBesvaresSenere","erUtfallBesvart","status"],s),e?.erUtfallBesvaresSenere?null!=n?.erUtfallBesvaresSenere?n.erUtfallBesvaresSenere:r.erUtfallBesvaresSenere:e?.erUtfallBesvart?null!=n?.erUtfallBesvart?n.erUtfallBesvart:r.erUtfallBesvart:n?.status?n.status:r.status}getValueFromFormData(e,t){const s=h(e),n=new me(s);return this.getStatusText(n,t,e?.id)}getResourceBindings(e){return{utfallSvarStatus:{title:e?.resourceBindings?.title||"resource.utfallBesvarelse.utfallSvar.status.title",erUtfallBesvaresSenere:"resource.utfallBesvarelse.utfallSvar.erUtfallBesvaresSenere",erUtfallBesvart:"resource.utfallBesvarelse.utfallSvar.erUtfallBesvart",status:"resource.utfallBesvarelse.utfallSvar.status"}}}}class ge{constructor(e){this.filnavn=e?.filnavn,this.vedleggstype=e?.vedleggstype&&new v(e.vedleggstype)}}class pe{constructor(e){this.vedlegg=e?.vedlegg?e.vedlegg.map(e=>new ge(e)):void 0}}class fe{constructor(e){this.kommentar=e?.kommentar,this.tema=e?.tema?new v(e.tema):void 0,this.tittel=e?.tittel,this.vedleggsliste=e?.vedleggsliste?new pe(e.vedleggsliste):void 0}}class ye extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceBindings=s?.ettersending||{},this.resourceValues={data:n?c(s?.ettersending?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getValueFromFormData(e){const t=h(e);return new fe(t)}getResourceBindings(e){const t={"tema.kodebeskrivelse.title":"resource.ettersendinger.ettersending.tema.kodebeskrivelse.title","kommentar.title":"resource.ettersendinger.ettersending.kommentar.title","vedleggsliste.vedlegg.title":"resource.ettersendinger.ettersending.vedleggsliste.vedlegg.title"};return 1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{ettersending:t}}}class ke extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceValues={title:c(s?.ettersendinger?.title),data:n?c(s?.ettersendinger?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getValueFromFormData(e){return h(e)}getResourceBindings(e){const t={};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.title=e?.resourceBindings?.title||"resource.ettersendinger.title"),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{ettersendinger:t}}}class ve extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceValues={title:c(s?.utfallSvar?.title),data:n?c(s?.utfallSvar?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getValueFromFormData(e){return h(e)}getResourceBindings(e){const t={};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.title=e?.resourceBindings?.title),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{utfallSvar:t}}}class Te{constructor(e){this.kodeverdi=e?.kodeverdi}}class be{constructor(e){this.beskrivelse=e?.beskrivelse,this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart,this.kommentar=e?.kommentar,this.tema=e?.tema?new v(e.tema):void 0,this.tittel=e?.tittel,this.utfallType=e?.utfallType?new Te(e.utfallType):void 0,this.vedleggsliste=e?.vedleggsliste?new pe(e.vedleggsliste):void 0}}class Ce extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getValueFromFormData(e){const t=h(e);return this.groupArrayItemsByUtfallType(t)}groupArrayItemsByUtfallType(e){return s(e)?e.reduce((e,t)=>{const s=t?.utfallType?.kodeverdi;return s?.length?(e[s]||(e[s]=[]),e[s].push(new be(t)),e):e},{}):{}}}class Be extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceBindings=s?.utfallSvar||{},this.resourceValues={data:n?c(s?.utfallSvar?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getValueFromFormData(e){const t=h(e);return new be(t)}getResourceBindings(e){const t={"status.title":"resource.utfallBesvarelse.utfallSvar.status.title","tema.kodebeskrivelse.title":"resource.utfallBesvarelse.utfallSvar.tema.kodebeskrivelse.title","kommentar.title":"resource.utfallBesvarelse.utfallSvar.kommentar.title","vedleggsliste.vedlegg.title":"resource.utfallBesvarelse.utfallSvar.vedleggsliste.vedlegg.title"};return 1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{utfallSvar:t}}}class Fe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceBindings={title:s?.utfallSvarType?.title},this.resourceValues={data:n?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getValueFromFormData(e){return h(e)}getResourceBindings(e){const t=e?.resourceValues?.utfallType;return{utfallSvarType:{title:`resource.utfallBesvarelse.utfallSvar.${t?.toLowerCase()}.header`}}}}class Ve extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues,this.size=e?.size}hasContent(e){return s(e?.resourceValues?.title)}}class xe extends e{constructor(e){super(e),this.size=e?.size,this.resourceValues={title:g(e,"title")}}}class Ee extends e{constructor(e){super(e),this.isEmpty=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class we extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getListItemsFromKey(e,t){return Array.isArray(e)&&e.length?e.map(e=>e?.[t]):[]}getValueFromFormData(e){const t=h(e);return s(e?.itemKey)?this.getListItemsFromKey(t,e?.itemKey):t}}class je extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getAttachmentFileName(e){return e?.filnavn}getAttachmentDescription(e){return e?.vedleggstype?.kodebeskrivelse}getAttachmentListItems(e){return e&&Array.isArray(e)&&e?.length?e.map(e=>{const t=new ge(e),s=this.getAttachmentDescription(t),n=this.getAttachmentFileName(t);return s?.length&&n?.length?`${s} (${n})`:s?.length?s:n?.length?n:null}).filter(e=>e):[]}getValueFromFormData(e){const t=h(e);return this.getAttachmentListItems(t)}}class Me extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues}hasContent(e){return s(e?.resourceValues?.title)}}class Ie extends e{constructor(e){super(e),this.resourceValues={title:g(e,"title")}}}class De extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=g(e,"body"),n=this.getTextDataCombination(t,s),r=!this.hasContent(t);this.isEmpty=r,this.resourceValues={title:r?g(e,"emptyFieldText"):n}}hasContent(e){return s(e)}getTextDataCombination(e,t){const s=`${t} ${e}`.trim();return s?.length>0?`${s}.`:""}getValueFromFormData(e){return se(h(e),e?.format)}}class He extends e{constructor(e){super(e),this.resourceValues={title:g(e,"title")}}}class Le extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class Ae extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t),n=this.getValidationMessagesFromProps(e);this.isEmpty=s,this.validationMessages=n,this.hasValidationMessages=O(n),this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}getValueFromFormData(e){const t=h(e);return{tableHeaders:this.getTableHeadersFromProps(e),tableRows:this.getTableRowsFromProps(e,t)}}getTableHeadersFromProps(e){const t=e?.tableColumns||[];if(0===t.length)return[];const s=function(e){return e.map(e=>{const t=e?.resourceBindings?.title;return{text:c(t),props:e.props}})}(t);var n;return e.showRowNumbers&&s.unshift({text:(n=e,c(n?.resourceBindings?.rowNumberTitle)||"#")}),s}getTableRowsFromProps(e,t){const n=function(e,t){return!Array.isArray(t)&&(t=[t]),t.map(t=>{const n=[];return e.forEach(e=>{const r=function(e,t){return t?null==e||/(\.\.|^\.)/.test(t)?void 0:t.split(/\.|\[|\]/).filter(Boolean).reduce((e,t)=>e&&e[t],e):e}(t,e.dataKey),i=e?.resourceBindings?.emptyFieldText,a=c(i),o={resourceBindings:e.resourceBindings,resourceValues:{data:r},format:e.format,hideTitle:!0,tagName:e.tagName,isChildComponent:!0};s(a)&&(o.resourceValues.emptyFieldText=a),n.push(o)}),n})}(e?.tableColumns||[],t),r=this.removeEmptyTableRows(n);return e.showRowNumbers?r.map((e,t)=>[{tagName:"custom-field-data",hideTitle:!0,isChildComponent:!0,resourceValues:{data:t+1}},...e]):r}getValidationMessagesFromProps(e){return function(e,t=new N){const s=l();return e.forEach((e,n)=>{Object.keys(e?.textResourceBindings||{}).forEach(r=>{const i=s?.resources?.find(t=>t.id===e.textResourceBindings[r]);i?""===i.value&&t.info.push(`Empty text resource binding with id: "${e.textResourceBindings[r]}" for "${r}" at table column [${n}]`):t.error.push(`Missing text resource binding with id: "${e.textResourceBindings[r]}" for "${r}" at table column [${n}]`)})}),t}(e?.tableColumns)}removeEmptyTableRows(e){return Array.isArray(e)?e.map(e=>{const t=e.map(e=>it(e));return t.filter(e=>!e?.isEmpty).length>0?t:null}).filter(e=>null!==e):[]}hasContent(e){return s(e)}}class Se extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceBindings=s,this.resourceValues={data:n?c(s?.eiendomByggested?.emptyFieldText):t}}getValueFromFormData(e){const t=h(e);return this.getEiendomListFromData(t)}getEiendomListFromData(e){if(s(e))return e.map(e=>new E(e)).filter(e=>this.hasEiendomValue(e))}getValidationMessages(e){return P("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return s(e)}hasZipCodeOrCity(e){return s(e?.adresse?.postnr)||s(e?.adresse?.poststed)}hasAdresseLinje(e){return s(e?.adresse?.adresselinje1)||s(e?.adresse?.adresselinje2)||s(e?.adresse?.adresselinje3)}hasAdresse(e){return this.hasAdresseLinje(e)||this.hasZipCodeOrCity(e)}hasEiendomNummerField(e){return s(e?.bolignummer)||s(e?.bygningsnummer)||s(e?.eiendomsidentifikasjon?.gaardsnummer)||s(e?.eiendomsidentifikasjon?.bruksnummer)||s(e?.eiendomsidentifikasjon?.seksjonsnummer)||s(e?.eiendomsidentifikasjon?.festenummer)}hasEiendomValue(e){return this.hasAdresse(e)||this.hasEiendomNummerField(e)}getTextResourceBindings(e){const t={adresse:{title:e?.resourceBindings?.adresse?.title||"resource.eiendomByggested.eiendom.adresse.title",emptyFieldText:e?.resourceBindings?.adresse?.emptyFieldText||"resource.eiendomByggested.eiendom.adresse.emptyFieldText"},eiendomsidentifikasjonGaardsnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.gaardsnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.gaardsnummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.gaardsnummer?.emptyFieldText||"resource.emptyFieldText.default"},eiendomsidentifikasjonBruksnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.bruksnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.bruksnummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.bruksnummer?.emptyFieldText||"resource.emptyFieldText.default"},eiendomsidentifikasjonSeksjonsnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.seksjonsnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.seksjonsnummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.seksjonsnummer?.emptyFieldText||"resource.emptyFieldText.default"},eiendomsidentifikasjonFestenummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.festenummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.festenummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.festenummer?.emptyFieldText||"resource.emptyFieldText.default"},bolignummer:{title:e?.resourceBindings?.bolignummer?.title||"resource.eiendomByggested.eiendom.bolignummer.title",emptyFieldText:e?.resourceBindings?.bolignummer?.emptyFieldText||"resource.emptyFieldText.default"},bygningsnummer:{title:e?.resourceBindings?.bygningsnummer?.title||"resource.eiendomByggested.eiendom.bygningsnummer.title",emptyFieldText:e?.resourceBindings?.bygningsnummer?.emptyFieldText||"resource.emptyFieldText.default"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.eiendomByggested={title:e?.resourceBindings?.title||"resource.eiendomByggested.eiendom.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.eiendomByggested={...t.eiendomByggested,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class Ne extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.partType=e?.partType,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceBindings=s,this.resourceValues={data:n?c(e?.resourceBindings?.emptyFieldText):t}}getPartTypeFromElementAttributes(e){return e.getAttribute("parttype")||"tiltakshaver"}getValueFromFormData(e){const t=h(e);if(!s(t))return;const n=new I(t);return this.hasPartValue(n)?n:void 0}getValidationMessages(e){return P("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return s(e)}hasNavnOrOrganisasjonsnummer(e){return s(e?.navn)||s(e?.organisasjonsnummer)}hasTelefonnummer(e){return s(e?.telefonnummer)||s(e?.mobilnummer)}hasEpost(e){return s(e?.epost)}hasPartValue(e){return this.hasNavnOrOrganisasjonsnummer(e)||this.hasTelefonnummer(e)||this.hasEpost(e)}getTextResourceBindings(e){const t=e?.partType||"tiltakshaver",s={navn:{title:e?.resourceBindings?.navn?.title||`resource.${t}.navn.title`,emptyFieldText:e?.resourceBindings?.navn?.emptyFieldText||"resource.emptyFieldText.default"},telefonnummer:{title:e?.resourceBindings?.telefonnummer?.title||`resource.${t}.telefonnummer.title`,emptyFieldText:e?.resourceBindings?.telefonnummer?.emptyFieldText||"resource.emptyFieldText.default"},epost:{title:e?.resourceBindings?.epost?.title||`resource.${t}.epost.title`,emptyFieldText:e?.resourceBindings?.epost?.emptyFieldText||"resource.emptyFieldText.default"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(s.part={title:e?.resourceBindings?.title||`resource.${t}.header`}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(s.part={...s.part,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),s}}function Oe(e){const t=JSON.parse(e?.getAttribute("formdata"));return s(t)&&t}function Pe(e){const t=e?.getAttribute("tagName")||e?.tagName?.toLowerCase();return s(t)&&t}function Ke(e){const t=e?.getAttribute("text");return s(t)&&t}function Re(e){const t=JSON.parse(e?.getAttribute("texts"));return s(t)&&t}function $e(e){return"true"===e?.getAttribute("inline")}function ze(e){return"true"===e?.getAttribute("hideTitle")}function Ue(e){const t=e?.getAttribute("size");return ne(t)?t?.toString().toLowerCase():void 0}function Je(e){return"true"===e?.getAttribute("hideIfEmpty")}function Ge(e){const t=JSON.parse(e?.getAttribute("styleOverride")||"{}");return s(t)&&t}function Ze(e){return"true"===e?.getAttribute("isChildComponent")}function We(e){const t=e?.getAttribute("feedbackType");return s(t)&&t}function Ye(e){const t=e?.getAttribute("itemKey");return s(t)&&t}function _e(e){const t=e?.getAttribute("dataItemKey");return s(t)&&t}function qe(e){const t=e?.getAttribute("dataTitleItemKey");return s(t)&&t}function Qe(e){return"true"===e?.getAttribute("hideOrgNr")}function Xe(e){const t=e?.getAttribute("format");return s(t)&&t}function et(e){const t=JSON.parse(e?.getAttribute("tableColumns"));return s(t)&&t}function tt(e){return"true"===e?.getAttribute("showRowNumbers")}function st(e){const t=JSON.parse(e?.getAttribute("resourceBindings"));return s(t)&&t}function nt(e){const t=JSON.parse(e?.getAttribute("resourceValues"));return s(t)&&t}function rt(e){const t=e?.getAttribute("partType");return s(t)?t:"tiltakshaver"}function it(t){const s=t instanceof HTMLElement?function(e){return{formData:Oe(e),tagName:Pe(e),text:Ke(e),texts:Re(e),inline:$e(e),hideTitle:ze(e),size:Ue(e),hideIfEmpty:Je(e),styleOverride:Ge(e),isChildComponent:Ze(e),feedbackType:We(e),itemKey:Ye(e),dataItemKey:_e(e),dataTitleItemKey:qe(e),hideOrgNr:Qe(e),format:Xe(e),tableColumns:et(e),showRowNumbers:tt(e),resourceBindings:st(e),resourceValues:nt(e),partType:rt(e)}}(t):t,n=s?.tagName||s?.getAttribute("tagname")||"custom-component";switch(n?.toLowerCase()){case"custom-component":return new e(s);case"custom-dispensasjon":return new K(s);case"custom-feedback":return new R(s);case"custom-feedback-data":return new $(s);case"custom-feedbacklist-data":return new z(s);case"custom-feedbacklist-validation-messages":return new U(s);case"custom-field":return new J(s);case"custom-field-adresse":return new G(s);case"custom-field-boolean-data":return new Z(s);case"custom-field-boolean-text":return new W(s);case"custom-field-count-data":return new Y(s);case"custom-field-data":return new re(s);case"custom-field-list-data":return new ae(s);case"custom-field-kommunens-saksnummer":return new ie(s);case"custom-field-part-navn":return new oe(s);case"custom-field-prosjekt":return new ue(s);case"custom-field-telefonnummer":return new ce(s);case"custom-field-utfall-svar-status":return new he(s);case"custom-group-ettersending":return new ye(s);case"custom-group-utfall-svar":return new Be(s);case"custom-group-utfall-svar-type":return new Fe(s);case"custom-grouplist-ettersending":return new ke(s);case"custom-grouplist-utfall-svar":return new ve(s);case"custom-grouplist-utfall-svar-type":return new Ce(s);case"custom-header":return new Ve(s);case"custom-header-text":return new xe(s);case"custom-list":return new Ee(s);case"custom-list-data":return new we(s);case"custom-list-vedlegg":return new je(s);case"custom-paragraph":return new Me(s);case"custom-paragraph-text":return new Ie(s);case"custom-paragraph-text-data":return new De(s);case"custom-subheader-text":return new He(s);case"custom-table":return new Le(s);case"custom-table-data":return new Ae(s);case"custom-table-eiendom":return new Se(s);case"custom-table-part":return new Ne(s);default:return console.warn(`Unknown component type: ${n}`),null}}function at(e,t,n){n={returnHtml:!0,inline:!1,styleOverride:{},...n};const i=document.createElement("div");i.classList.add("field"),e?.length&&i.appendChild(function(e,t){const s=document.createElement("label");return s.innerText=`${e}${t?":":""}`,s}(e,n.inline)),n?.inline&&i.classList.add("inline");const a=function(e){const t=document.createElement("span");Array.isArray(e)&&(e=e.join(", ")),"object"==typeof e&&(e=JSON.stringify(e,null,2));const n=s(e)?function(e){const t="(?:https?:\\/\\/(?:www\\.)?[a-zA-Z0-9][a-zA-Z0-9-]*\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]*\\.[^\\s]{2,})",s=new RegExp(`(${t})`,"g"),n=new RegExp(`^${t}$`),r=e=>String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");return e.toString().split(s).map(e=>{if(!e)return"";if(n.test(e)){const t=e.match(/^(.*?)([).,!?:;]+)?$/),s=t[1],n=t[2]??"";return`<a href="${s.startsWith("http")?s:`https://${s}`}" target="_blank" rel="noopener noreferrer">${s}</a>${r(n)}`}return r(e)}).join("")}(e):"";return t.innerHTML=n,t}(t);return e?.length&&a.classList.add("has-title"),i.appendChild(a),r(i,{...n.styleOverride}),n.returnHtml?i.outerHTML:i}function ot(e,t,s=!0){const n=document.createElement(t||"ul");return e.forEach(e=>{const t=document.createElement("li");t.innerHTML=e,n.appendChild(t)}),s?n.outerHTML:n}customElements.define("custom-feedback",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this),s=e?.resourceValues?.data;e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e,t){const s=document.createElement("p");return s.innerHTML=e,s.classList.add(t),s.outerHTML}(s,e?.feedbackType)}}),customElements.define("custom-field",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t={inline:e?.inline,styleOverride:e?.styleOverride};this.innerHTML=at(e?.resourceValues?.title,e?.resourceValues?.data,t)}}}),customElements.define("custom-header",class extends HTMLElement{connectedCallback(){const e=it(this);e?.isEmpty||(this.innerHTML=function(e,t){const s=document.createElement(ne(t)?t:"h2");return s.innerHTML=e,s.outerHTML}(e?.resourceValues?.title,e?.size),r(this,e?.styleOverride))}}),customElements.define("custom-list",class extends HTMLElement{connectedCallback(){const e=new it(this);this.innerHTML=e?.resourceValues?.title?.length?function(e,t,s){const n=document.createElement("div");n.classList.add("field"),e?.length&&n.appendChild(function(e){const t=document.createElement("label");return t.innerText=e,t}(e));const r=ot(t,s,!1);return e?.length&&r.classList.add("has-title"),n.appendChild(r),n.outerHTML}(e?.resourceValues?.title,e?.resourceValues?.data):ot(e?.resourceValues?.data),r(this,e?.styleOverride)}}),customElements.define("custom-paragraph",class extends HTMLElement{connectedCallback(){const e=it(this);e?.isEmpty||(this.innerHTML=function(e){const t=document.createElement("p");return t.innerHTML=e,t.outerHTML}(e?.resourceValues?.title),r(this,e?.styleOverride))}});class lt{constructor(e){const t=this.getIsChildComponentAttributeFromProps(e),s=this.getFormDataAttributeFromProps(e),n=this.getTagNameAttributeFromProps(e),r=this.getSizeAttributeFromProps(e),i=this.getHideTitleAttributeFromProps(e),a=this.getHideIfEmptyAttributeFromProps(e),o=this.getIsEmptyAttributeFromProps(e),l=this.getInlineAttributeFromProps(e),u=this.getStyleOverrideAttributeFromProps(e),d=this.getGridAttributeFromProps(e),c=this.getTableColumnsAttributeFromProps(e),m=this.getItemKeyAttributeFromProps(e),h=this.getDataItemKeyAttributeFromProps(e),g=this.getDataTitleItemKeyAttributeFromProps(e),p=this.getIdAttributeFromProps(e),f=this.getFeedbackTypeAttributeFromProps(e),y=this.getHideOrgNr(e),k=this.getFormatAttributeFromProps(e),v=this.getShowRowNumbersAttributeFromProps(e),T=this.getPartTypeAttributeFromProps(e),b=this.getResourceBindingsFromProps(e),C=this.getResourceValuesFromProps(e);t&&(this.isChildComponent=t),s&&(this.formData=s),n&&(this.tagName=n),r&&(this.size=r),i&&(this.hideTitle=i),a&&(this.hideIfEmpty=a),o&&(this.isEmpty=o),l&&(this.inline=l),u&&(this.styleOverride=u),d&&(this.grid=d),c&&(this.tableColumns=c),m&&(this.itemKey=m),h&&(this.dataItemKey=h),g&&(this.dataTitleItemKey=g),p&&(this.id=p),f&&(this.feedbackType=f),y&&(this.hideOrgNr=y),k&&(this.format=k),v&&(this.showRowNumbers=v),T&&(this.partType=T),b&&(this.resourceBindings=b),C&&(this.resourceValues=C)}getFormDataAttributeFromProps(e){if(!s(e?.formData))return null;if("string"==typeof e?.formData){const t=e?.formData;return JSON.stringify(t)}if("number"==typeof e?.formData){const t=e?.formData.toString();return JSON.stringify(t)}if("object"==typeof e?.formData){const t={};return Object.keys(e.formData).forEach(s=>{t[s]=e.formData[s]}),JSON.stringify(t)}}getIsChildComponentAttributeFromProps(e){return e?.isChildComponent?"true":void 0}getTagNameAttributeFromProps(e){return e?.tagName?e?.tagName.toString():void 0}getSizeAttributeFromProps(e){return ne(e?.size)?e?.size?.toString().toLowerCase():void 0}getHideTitleAttributeFromProps(e){return"true"===e?.hideTitle?.toString()?"true":void 0}getHideIfEmptyAttributeFromProps(e){return"true"===e?.hideIfEmpty?.toString()?"true":void 0}getIsEmptyAttributeFromProps(e){return"true"===e?.isEmpty?.toString()?"true":void 0}getInlineAttributeFromProps(e){return"true"===e?.inline?.toString()?"true":void 0}getStyleOverrideAttributeFromProps(e){return s(e?.styleOverride)?JSON.stringify(e?.styleOverride):void 0}getGridAttributeFromProps(e){return s(e?.grid)&&JSON.stringify(e?.grid)}getTableColumnsAttributeFromProps(e){return s(e?.tableColumns)&&JSON.stringify(e?.tableColumns)}getItemKeyAttributeFromProps(e){return s(e?.itemKey)&&e?.itemKey}getDataItemKeyAttributeFromProps(e){return s(e?.dataItemKey)&&e?.dataItemKey}getDataTitleItemKeyAttributeFromProps(e){return s(e?.dataTitleItemKey)&&e?.dataTitleItemKey}getIdAttributeFromProps(e){return s(e?.id)&&e?.id}getFeedbackTypeAttributeFromProps(e){return s(e?.feedbackType)?["error","warning","success","info","default"].includes(e?.feedbackType)?e?.feedbackType:"default":null}getHideOrgNr(e){return"true"===e?.hideOrgNr?.toString()?"true":void 0}getFormatAttributeFromProps(e){return s(e?.format)&&e?.format?.toString()}getShowRowNumbersAttributeFromProps(e){return"true"===e?.showRowNumbers?.toString()?"true":void 0}getPartTypeAttributeFromProps(e){return s(e?.partType)&&e?.partType}getResourceBindingsFromProps(e){return s(e?.resourceBindings)&&JSON.stringify(e?.resourceBindings)}getResourceValuesFromProps(e){return s(e?.resourceValues)?JSON.stringify(e?.resourceValues):null}}function ut(e){const t=e?.resourceValues?.data,s=e?.styleOverride,n=document.createElement("table"),o=document.createElement("thead"),l=document.createElement("tr");if(t?.tableHeaders?.length&&t?.tableRows?.length){t.tableHeaders.forEach(e=>{l.appendChild(function(e){const t=document.createElement("th");return t.textContent=e.text,r(t,e?.props?.styleOverride),t}(e))}),o.appendChild(l),n.appendChild(o);const e=document.createElement("tbody");t.tableRows.forEach(t=>{e.appendChild(function(e){const t=document.createElement("tr");return e.forEach(e=>{t.appendChild(function(e){const t=document.createElement("td"),s=new lt(e);return t.innerHTML=a("custom-field-data",s).outerHTML,t}(e))}),t}(t))}),n.appendChild(e)}else{const t=i(e);if(t?.length){const e=document.createElement("tr"),s=document.createElement("td");s.textContent=t,e.appendChild(s),n.appendChild(e)}}return r(n,s),n}function dt(e,t){switch(e){case"error":return`Errors (${t})`;case"warning":return`Warnings (${t})`;case"info":return`Information (${t})`;default:return`Messages (${t})`}}function ct(e){return a("custom-feedbacklist-validation-messages",new lt({isChildComponent:!0,resourceValues:{data:e}}))}function mt(e){return a("custom-group-ettersending",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:e}}))}function ht(e){return a("custom-group-utfall-svar",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:e}}))}function gt(e,t="h1"){const n=e?.resourceValues?.data,r=n?.dispensasjonBeskrivelse?.dispensasjonTittel?.kodebeskrivelse;return s(r)?a("custom-header-text",new lt({isChildComponent:!0,size:t,resourceValues:{title:r}})):null}customElements.define("custom-table",class extends HTMLElement{async connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e,t){const s=new lt({size:t,resourceValues:{title:e}});if(e)return a("custom-header",s)}(e?.resourceValues?.title,e?.size),s=ut(e);this.innerHTML="",t&&this.appendChild(t),this.appendChild(s)}}}),customElements.define("custom-feedback-data",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e.isEmpty&&t)t.style.display="none";else{const t=new lt(e);this.innerHTML=a("custom-feedback",t).outerHTML}}}),customElements.define("custom-feedbacklist-data",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this),s=e?.resourceValues?.data,n=e?.resourceValues?.title||"Messages";e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e,t,s,n){const i=document.createElement("details");i.classList.add("feedback-details"),i.classList.add(s),i.setAttribute("open",!0),r(n);const o=document.createElement("summary");o.classList.add("feedback-summary"),o.innerHTML=e,i.appendChild(o);const l=document.createElement("div");return l.classList.add("feedback-list"),t.forEach(e=>{const t=document.createElement("div");t.classList.add("feedback-list-item");const s=new lt({isChildComponent:!0,feedbackType:"default",resourceValues:{data:e}});t.appendChild(a("custom-feedback-data",s)),l.appendChild(t)}),i.appendChild(l),i.outerHTML}(n,s,e?.feedbackType,e?.styleOverride)}}),customElements.define("custom-feedbacklist-validation-messages",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this),s=new N(e?.resourceValues?.data);e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e){const t=document.createElement("div");return t.classList.add("validation-messages-container"),Object.keys(e).forEach(s=>{const n=e[s];if(n?.length){const e=a("custom-feedbacklist-data",new lt({isChildComponent:!0,feedbackType:s,resourceValues:{title:dt(s,n.length),data:n}}));t.appendChild(e)}}),t.outerHTML}(s)}}),customElements.define("custom-field-adresse",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=i(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new lt(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-part-navn",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=i(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new lt(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-boolean-data",class extends HTMLElement{async connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new lt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-boolean-text",class extends HTMLElement{async connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new lt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-count-data",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new lt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-data",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new lt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-list-data",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e){const t=document.createElement("div");return e?.resourceValues?.data?.forEach(e=>{t.appendChild(o(a("custom-field-data",new lt({isChildComponent:!0,resourceValues:e}))))}),t}(e);this.innerHTML=t.outerHTML}}}),customElements.define("custom-field-kommunens-saksnummer",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new lt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-prosjekt",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new lt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-telefonnummer",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=i(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new lt(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-utfall-svar-status",class extends HTMLElement{async connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new lt(e);this.innerHTML=a("custom-field",t).outerHTML;const s=e.hasValidationMessages&&ct(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-grouplist-ettersending",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return a("custom-paragraph",new lt({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{this.appendChild(function(e,t="h2"){return a("custom-header-text",new lt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.title}}))}(e,"h2"));for(const t of e?.resourceValues?.data){const e=mt(t);this.appendChild(e);const s=a("custom-divider");this.appendChild(s)}const t=e.hasValidationMessages&&ct(e?.validationMessages);t&&this.appendChild(t)}}}),customElements.define("custom-grouplist-utfall-svar",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return a("custom-paragraph",new lt({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{this.appendChild(function(e,t="h2"){return a("custom-header-text",new lt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.title}}))}(e,"h2"));for(const t of e?.resourceValues?.data){const e=ht(t);this.appendChild(e);const s=a("custom-divider");this.appendChild(s)}const t=e.hasValidationMessages&&ct(e?.validationMessages);t&&this.appendChild(t)}}}),customElements.define("custom-grouplist-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=it(this),t=d(this);e?.hideIfEmpty&&e.isEmpty&&t?t.style.display="none":e?.resourceValues?.data&&Object.keys(e?.resourceValues?.data).forEach(t=>{const s=function(e,t){const s=e?.resourceValues?.data[t];return a("custom-group-utfall-svar-type",new lt({isChildComponent:!0,resourceValues:{data:s,utfallType:t}}))}(e,t);this.appendChild(s)})}}),customElements.define("custom-group-ettersending",class extends HTMLElement{async connectedCallback(){const e=it(this),t=d(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return a("custom-paragraph",new lt({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{const t=document.createElement("div");t.appendChild(function(e,t="h3"){return a("custom-header-text",new lt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.data?.tittel}}))}(e,"h3")),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["tema.kodebeskrivelse.title"]},resourceValues:{data:t?.tema?.kodebeskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!1,resourceBindings:{title:e?.resourceBindings?.["kommentar.title"]},resourceValues:{data:t?.kommentar,emptyFieldText:"-"}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-list-vedlegg",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&ct(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar",class extends HTMLElement{async connectedCallback(){const e=it(this),t=d(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=document.createElement("div");t.appendChild(function(e,t="h3"){return a("custom-header-text",new lt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.data?.tittel}}))}(e,"h3")),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:t?.beskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-utfall-svar-status",new lt({isChildComponent:!0,resourceBindings:{title:e?.resourceBindings?.["status.title"]},resourceValues:{data:t}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["tema.kodebeskrivelse.title"]},resourceValues:{data:t?.tema?.kodebeskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!1,resourceBindings:{title:e?.resourceBindings?.["kommentar.title"]},resourceValues:{data:t?.kommentar,emptyFieldText:"-"}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-list-vedlegg",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&ct(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=it(this);if(!e.isEmpty){const t=function(e){return a("custom-grouplist-utfall-svar",new lt({isChildComponent:!0,resourceBindings:{title:e?.resourceBindings?.title},resourceValues:{data:e?.resourceValues?.data,title:e?.resourceValues?.title}}))}(e);this.appendChild(t);const s=e.hasValidationMessages&&ct(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-header-text",class extends HTMLElement{connectedCallback(){const e=new it(this);e?.isChildComponent||r(d(this),{padding:"0 0.75rem"});const t=new lt(e);this.innerHTML=a("custom-header",t).outerHTML}}),customElements.define("custom-list-data",class extends HTMLElement{connectedCallback(){const e=new it(this),t=d(this);var s,n;if(e?.itemKey?.length&&(s=e?.formData?.data,n=e?.itemKey,Array.isArray(s)&&s.length&&s.map(e=>e?.[n])),e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new lt(e),s=e.isEmpty?"custom-field":"custom-list";this.innerHTML=a(s,t).outerHTML}}}),customElements.define("custom-list-vedlegg",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=new lt(e);this.innerHTML=a("custom-field",t).outerHTML}else{const t=new lt(e);this.innerHTML=a("custom-list",t).outerHTML}}}),customElements.define("custom-paragraph-text",class extends HTMLElement{connectedCallback(){const e=it(this),t=new lt(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}),customElements.define("custom-paragraph-text-data",class extends HTMLElement{connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new lt(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}}),customElements.define("custom-subheader-text",class extends HTMLElement{connectedCallback(){const e=it(this),t=new lt(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}),customElements.define("custom-table-data",class extends HTMLElement{async connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&ct(e?.validationMessages),s=function(e){return a("custom-table",new lt(e))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-eiendom",class extends HTMLElement{async connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&ct(e?.validationMessages),s=function(e){const t=[{dataKey:"adresse",tagName:"custom-field-adresse",resourceBindings:{title:e?.resourceBindings?.adresse?.title,emptyFieldText:e?.resourceBindings?.adresse?.emptyFieldText},props:{styleOverride:{width:"116px"}}},{dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonGaardsnummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonGaardsnummer?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonBruksnummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonBruksnummer?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonSeksjonsnummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonSeksjonsnummer?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonFestenummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonFestenummer?.emptyFieldText}},{dataKey:"bolignummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.bolignummer?.title,emptyFieldText:e?.resourceBindings?.bolignummer?.emptyFieldText}},{dataKey:"bygningsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.bygningsnummer?.title,emptyFieldText:e?.resourceBindings?.bygningsnummer?.emptyFieldText}}];return a("custom-table-data",new lt({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.eiendomByggested?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-part",class extends HTMLElement{async connectedCallback(){const e=it(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&ct(e?.validationMessages),s=function(e){const t=[{tagName:"custom-field-part-navn",resourceBindings:{title:e?.resourceBindings?.navn?.title,emptyFieldText:e?.resourceBindings?.navn?.emptyFieldText}},{tagName:"custom-field-telefonnummer",resourceBindings:{title:e?.resourceBindings?.telefonnummer?.title,emptyFieldText:e?.resourceBindings?.telefonnummer?.emptyFieldText}},{tagName:"custom-field-data",dataKey:"epost",resourceBindings:{title:e?.resourceBindings?.epost?.title,emptyFieldText:e?.resourceBindings?.epost?.emptyFieldText}}];return a("custom-table-data",new lt({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.part?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-dispensasjon",class extends HTMLElement{async connectedCallback(){const e=it(this),t=d(this);if(e.isEmpty&&t)t.style.display="none";else{const t=function(){const e=document.createElement("div");return r(e,{display:"flex",flexFlow:"wrap",justifyContent:"start",alignItems:"flex-start"}),e}(),n=gt(e),i=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.dispensasjonReferanse?.title},resourceValues:{data:t?.dispensasjonReferanse}})),s)}(e),l=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.metadataFtbId?.title},resourceValues:{data:t?.metadata?.ftbId}})),s)}(e),u=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-kommunens-saksnummer",new lt({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.kommunensSaksnummer?.title},resourceValues:{data:t?.kommunensSaksnummer}})),s)}(e),d=function(e,t="h2"){return a("custom-header-text",new lt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.soeknadGjelderHeader?.title}}))}(e),c=function(e){const t=e?.resourceValues?.data;return a("custom-table-eiendom",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.eiendomByggested?.title},resourceValues:{data:t?.eiendomByggested?.eiendom}}))}(e),m=function(e,t="h3"){const s=e?.resourceValues?.data;return s?.tiltakstyper?.type?.kode?.length>0?a("custom-header-text",new lt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeHeader?.title}})):null}(e),h=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new lt({isChildComponent:!0,hideIfEmpty:!0,itemKey:"kodebeskrivelse",resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeKode?.title},resourceValues:{data:t?.tiltakstyper?.type?.kode}})))}(e),g=function(e){const t=e?.resourceValues?.data;return a("custom-table-part",new lt({isChildComponent:!0,partType:"tiltakshaver",hideIfEmpty:!0,resourceValues:{data:t?.tiltakshaver}}))}(e),f=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-adresse",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.tiltakshaverAdresse?.title},resourceValues:{data:t?.tiltakshaver?.adresse}})))}(e),y=gt(e,"h2"),k=function(e){const t=e?.resourceValues?.data;return s(t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse)||s(t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse)?o(a("custom-field-boolean-data",new lt({isChildComponent:!0,hideIfEmpty:!1,resourceValues:{data:"Annet"===t?.soeknadstype?.kodebeskrivelse,trueData:t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse,falseData:t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse,defaultData:t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse}}))):null}(e),v=function(e){const t=e?.resourceValues?.data;return a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonBeskrivelseBeskrivelse?.title},resourceValues:{data:t?.dispensasjonBeskrivelse?.beskrivelse}}))}(e),T=function(e,t="h2"){return a("custom-header-text",new lt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.dispensasjonFraHeader?.title}}))}(e),b=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonPlanBestemmelseNavn?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.navn}})))}(e),C=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.nasjonalArealplanIdPlanIdentifikasjon?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.nasjonalArealplanId?.planidentifikasjon}})))}(e),B=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.bestemmelserType?.title},resourceValues:{data:e.isPlanBestemmelseType?t?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse:t?.dispensasjonFra?.lovbestemmelse}})))}(e),F=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.planBestemmelseNummerering?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering}})))}(e),V=function(e){return a("custom-header-text",new lt({isChildComponent:!0,size:"h2",resourceBindings:{title:e.resourceBindings?.stedfestingHeader?.title}}))}(e),x=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinatsystem?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinatsystem?.kodebeskrivelse}})))}(e),E=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinater?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinater?.koordinat}})))}(e),w=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingVertikalnivaa?.title},resourceValues:{data:t?.stedfesting?.vertikalnivaa?.kodebeskrivelse}})))}(e),j=function(e,t="h2"){return a("custom-header-text",new lt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.varighetHeader?.title}}))}(e),M=function(e){const t=e?.resourceValues?.data;return t?.varighet?.oenskesVarigDispensasjon?o(a("custom-paragraph-text",new lt({isChildComponent:!0,resourceBindings:{title:e.resourceBindings?.varighetOenskesVarigDispensasjon?.trueText}}))):s(t?.varighet?.oensketVarighetTil)?o(a("custom-field-data",new lt({isChildComponent:!0,format:"date",resourceBindings:{title:e.resourceBindings?.varighetOensketVarighetTil?.title},resourceValues:{data:t?.varighet?.oensketVarighetTil}}))):null}(e),I=function(e,t="h2"){return a("custom-header-text",new lt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.begrunnelseHeader?.title}}))}(e),D=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.hensynBakBestemmelsen}})))}(e),H=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynBakBestemmelsen}})))}(e),L=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynOverordnet?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynOverordnet}})))}(e),A=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseFordeler?.title},resourceValues:{data:t?.begrunnelse?.fordeler?.effekt}})))}(e),S=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseUlemper?.title},resourceValues:{data:t?.begrunnelse?.ulemper?.effekt}})))}(e),N=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseSamletBegrunnelse?.title},resourceValues:{data:t?.begrunnelse?.samletBegrunnelse}})))}(e),O=function(e,t="h2"){const s=e?.resourceValues?.data,n=s?.generelleVilkaar?.norskSvenskDansk;return n?a("custom-header-text",new lt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.title}})):null}(e),P=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-boolean-text",new lt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{trueText:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.trueText,falseText:"",defaultText:""},resourceValues:{data:t?.generelleVilkaar?.norskSvenskDansk}})))}(e),K=ct(e?.validationMessages);p(t,[n,i,l,u]),p(t,[d,c,m,h]),p(t,[g,f]),p(t,[y,k,v]),e.isPlanBestemmelseType?p(t,[T,b,C,B,F]):p(t,[T,B]),p(t,[V,x,E,w]),p(t,[j,M]),p(t,[I,D,H,L,A,S,N]),p(t,[O,P]),p(t,[K]),this.appendChild(t)}}});class pt{constructor(e){this.eiendomByggested=e?.eiendomByggested&&new w(e.eiendomByggested),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new j(e.kommunensSaksnummer),this.metadata=e?.metadata&&new M(e.metadata),this.versjon=e?.versjon}}function ft(e){return m(e)}const yt={eiendomTable:{title:"resource.eiendomByggested.eiendom.title","col-1":"resource.eiendomByggested.eiendom.adresse.title","col-2":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.gaardsnummer.title","col-3":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.bruksnummer.title","col-4":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.seksjonsnummer.title","col-5":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.festenummer.title","col-6":"resource.eiendomByggested.eiendom.bolignummer.title","col-7":"resource.eiendomByggested.eiendom.bygningsnummer.title"},gjenomfoeringsplanNummer:{title:"resource.gjennomfoeringsplan.versjon.title"}};customElements.define("custom-gjennomfoeringsplan",class extends HTMLElement{async connectedCallback(){const e=JSON.parse(this.getAttribute("textResources")),t=function(e){const t=JSON.parse(e.getAttribute("formdata"));return new pt({eiendomByggested:s(t?.eiendomByggested)?t.eiendomByggested:null,kommunensSaksnummer:s(t?.kommunensSaksnummer)?t.kommunensSaksnummer:null,metadata:s(t?.metadata)?t.metadata:null,versjon:t?.versjon?t.versjon:null})}(this),n=P(e,yt),r=d(this);if(!s(t)&&r)r.style.display="none";else{const s=function(e,t){return a("custom-field-data",{formData:{simpleBinding:e?.versjon},text:c(t),emptyFieldText:"(gjennomfoeringsplanNummer mangler)"})}(t,e),r=function(e,t){return a("custom-table-data",{formData:{data:e},text:"Eiendom/Byggested",hideIfEmpty:!0,size:"h3",tableColumns:[{titleResourceKey:"col-1",dataKey:"adresse",tagName:"custom-field-adresse",props:{emptyFieldText:"(adresse mangler)",styleOverride:{}}},{titleResourceKey:"col-2",dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-3",dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-4",dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"96px"}}},{titleResourceKey:"col-5",dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-6",dataKey:"bolignummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"120px"}}},{titleResourceKey:"col-7",dataKey:"bygningsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"96px"}}}],texts:ft(t),styleOverride:{tableLayout:"fixed"}})}(t?.eiendomByggested?.eiendom,e),i=ct(n);this.appendChild(s),this.appendChild(r),this.appendChild(i)}}}),window.addEventListener("load",async()=>{const e=window.location.pathname.split("/"),t=window.location.origin,n=e?.[1],r=e?.[2];if(![t?.length,n?.length,r?.length].every(Boolean))return void console.error("Could not determine the origin, organization, or application from the URL.");const i=`${t}/${n}/${r}/api/v1/profile/user`,a=await fetch(i).then(e=>e.json());if(!a?.profileSettingPreference?.language)return void console.error("Could not determine the user's language preference.");const o=a?.profileSettingPreference?.language;window.selectedLanguage=o;const l=`${t}/${n}/${r}/api/v1/texts/${o}`,u=await fetch(l).then(e=>e.json());if(s(u))window.textResources=u;else{console.error("Could not retrieve text resources for the selected language.");const e=`${t}/${n}/${r}/api/v1/texts/nb`,i=await fetch(e).then(e=>e.json());if(window.textResources=i,!s(i))return void console.error("Could not retrieve text resources for the fallback language.")}})})();
|