@arkitektum/altinn-studio-custom-components 11.5.0 → 11.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +1 -1
- package/package.json +1 -1
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-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,t){for(let s in t)e.style[s]=t[s]}function r(e){const t=e?.resourceValues?.emptyFieldText;return t||""}function i(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 a(e,t){const r=document.createElement("div"),i=document.createElement("div");return i.appendChild(e),r.appendChild(i),n(r,{...s(t)?{flexGrow:"0",maxWidth:"50%",flexBasis:"50%"}:{flexBasis:"100%",maxWidth:"100%"},padding:"0.75rem 0px"}),r}function o(){return"undefined"!=typeof window&&window.textResources?window.textResources:[]}function l(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 u(e){const t="true"===e.getAttribute("isChildComponent"),s=e?.parentElement?.parentElement;return t?e:s||null}function d(e){const t=o(),s=t?.resources?.find(t=>t.id===e)?.value;return s||e}function c(e){const t={};for(const s in e)t[s]=d(e[s]);return t}function m(e){return e.isChildComponent?e.resourceValues?.data:e.formData?.simpleBinding||e.formData?.data}function h(e,t){return s(e?.resourceValues?.[t])?e.resourceValues?.[t]:d(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");n(s,t?.styleOverride),this.innerHTML="",this.appendChild(s)}});class g{constructor(e){this.effekt=e?.effekt}}class f{constructor(e){this.effekt=e?.effekt}}class y{constructor(e){this.hensynBakBestemmelsen=e?.hensynBakBestemmelsen,this.vurderingHensynBakBestemmelsen=e?.vurderingHensynBakBestemmelsen,this.vurderingHensynOverordnet=e?.vurderingHensynOverordnet,this.fordeler=e?.fordeler&&new g(e.fordeler),this.ulemper=e?.ulemper&&new f(e.ulemper),this.samletBegrunnelse=e?.samletBegrunnelse}}class k{constructor(e){this.kodebeskrivelse=e?.kodebeskrivelse}}class v{constructor(e){this.dispensasjonTittel=e?.dispensasjonTittel&&new k(e.dispensasjonTittel),this.inngangsbeskrivelse=e?.inngangsbeskrivelse&&new k(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 T{constructor(e){this.navn=e?.navn,this.nasjonalArealplanId=e?.nasjonalArealplanId&&new b(e.nasjonalArealplanId),this.planbestemmelse=e?.planbestemmelse&&new C(e.planbestemmelse)}}class V{constructor(e){this.bestemmelserType=e?.bestemmelserType&&new k(e.bestemmelserType),this.dispensasjonPlanBestemmelse=e?.dispensasjonPlanBestemmelse&&new T(e.dispensasjonPlanBestemmelse),this.lovbestemmelse=e?.lovbestemmelse}}class B{constructor(e){this.adresselinje1=e?.adresselinje1,this.adresselinje2=e?.adresselinje2,this.adresselinje3=e?.adresselinje3,this.postnr=e?.postnr,this.poststed=e?.poststed}}class E{constructor(e){this.gaardsnummer=e?.gaardsnummer,this.bruksnummer=e?.bruksnummer,this.seksjonsnummer=e?.seksjonsnummer,this.festenummer=e?.festenummer}}class w{constructor(e){this.adresse=e?.adresse&&new B(e.adresse),this.eiendomsidentifikasjon=e?.eiendomsidentifikasjon&&new E(e.eiendomsidentifikasjon),this.bolignummer=e?.bolignummer,this.bygningsnummer=e?.bygningsnummer}}class x{constructor(e){this.eiendom=e?.eiendom&&e.eiendom.map(e=>new w(e))}}class F{constructor(e){this.saksaar=e?.saksaar,this.sakssekvensnummer=e?.sakssekvensnummer}}class j{constructor(e){this.ftbId=e?.ftbId,this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class M{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 B(e.adresse)}}class H{constructor(e){this.koordinatsystem=e?.koordinatsystem&&new k(e.koordinatsystem),this.koordinater=e?.koordinater}}class L{constructor(e){this.posisjon=e?.posisjon&&new H(e.posisjon),this.vertikalnivaa=e?.vertikalnivaa&&new k(e.vertikalnivaa)}}class D{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 k(e)):null}}class A{constructor(e){this.oenskesVarigDispensasjon=e?.oenskesVarigDispensasjon,this.oensketVarighetTil=e?.oensketVarighetTil}}class I{constructor(e){this.dispensasjonBeskrivelse=e?.dispensasjonBeskrivelse&&new v(e.dispensasjonBeskrivelse),this.dispensasjonReferanse=e?.dispensasjonReferanse,this.soeknadstype=e?.soeknadstype&&new k(e.soeknadstype),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new F(e.kommunensSaksnummer),this.metadata=e?.metadata&&new j(e.metadata),this.eiendomByggested=e?.eiendomByggested&&new x(e.eiendomByggested),this.tiltakstyper=e?.tiltakstyper&&new D(e.tiltakstyper),this.tiltakshaver=e?.tiltakshaver&&new M(e.tiltakshaver),this.dispensasjonFra=e?.dispensasjonFra&&new V(e.dispensasjonFra),this.stedfesting=e?.stedfesting&&new L(e.stedfesting),this.varighet=e?.varighet&&new A(e.varighet),this.begrunnelse=e?.begrunnelse&&new y(e.begrunnelse),this.generelleVilkaar=e?.generelleVilkaar}}class S{constructor(e){this.error=e?.error||[],this.warning=e?.warning||[],this.info=e?.info||[],this.success=e?.success||[],this.default=e?.default||[]}}function N(e){return!!e&&Object.values(e).some(e=>e.length>0)}function O(e,t,s=new S){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 P 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=N(i),this.resourceBindings=s,this.resourceValues={data:n?h(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){return s(e?.formData)&&new I(e.formData)}getValidationMessages(e){return O("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 m(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 m(e)}}class $ 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 m(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=m(e);return new S(t)}}class U extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class J extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:h(e,"title"),data:s?h(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=m(e),s=new B(t);return this.formatAdresse(s)}hasContent(e){return s(e)}}class G extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:h(e,"title"),data:s?h(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=m(e),n=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}".`)})}(n,0,t),!0===s||"true"===s?void 0!==n?.trueData&&null!==n.trueData?n.trueData:"":!1===s||"false"===s?void 0!==n?.falseData&&null!==n.falseData?n.falseData:"":n?.defaultData?n.defaultData:""}}class Z extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:h(e,"title"),data:s?h(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=e?.id||"custom-field-boolean-text",s=m(e),n=function(e){return{trueText:e.resourceValues?.trueText||d(e?.resourceBindings?.trueText),falseText:e.resourceValues?.falseText||d(e?.resourceBindings?.falseText),defaultText:e.resourceValues?.defaultText||d(e?.resourceBindings?.defaultText)}}(e),r={trueText:"Ja",falseText:"Nei",defaultText:""};return l(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 W extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&h(e,"title"),data:s?h(e,"emptyFieldText"):t}}hasContent(e){return"number"==typeof(t=e)&&t>0;var t}getValueFromFormData(e){const t=m(e);return t&&Array.isArray(t)?t.length:0}}class q extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&h(e,"title"),data:s?h(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){return m(e)}}class Q extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:h(e,"title"),data:s?h(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=m(e),s=new F(t);return this.formatKommunensSaksnummer(s)}}class X extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:d(e?.resourceBindings?.title),data:s?d(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=m(e),s=new M(t);return this.formatName(s,this.hideOrgNr)}hasContent(e){return s(e)}}class Y{constructor(e){this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class _ 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:d(e?.resourceBindings?.title),data:s?d(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 Y(e?.formData?.data);return this.formatProsjekt(t)}}class ee{constructor(e){this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer}}class te extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:d(e?.resourceBindings?.title),data:s?d(e?.resourceBindings?.emptyFieldText):t}}formatPhoneNumbers(e){return[e.telefonnummer,e.mobilnummer].filter(e=>e?.length).join("\n")}getValueFromFormData(e){const t=m(e),s=new ee(t);return this.formatPhoneNumbers(s)}hasContent(e){return s(e)}}class se{constructor(e){this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart}}class ne 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=N(r),this.resourceValues={title:d(t?.utfallSvarStatus?.title),data:n?h(e,"emptyFieldText"):s}}hasContent(e){return s(e)}getValidationMessages(e){return O(o(),e)}getStatusText(e,t,s){const n=c(t),r={erUtfallBesvaresSenere:"Besvares senere",erUtfallBesvart:"Svar innsendt tidligere",status:"Besvares nå"};return l(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=m(e),n=new se(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 re extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:s?h(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return O(o(),e)}getValueFromFormData(e){return m(e)}}class ie{constructor(e){this.kodeverdi=e?.kodeverdi}}class ae{constructor(e){this.filnavn=e?.filnavn,this.vedleggstype=e?.vedleggstype&&new k(e.vedleggstype)}}class oe{constructor(e){this.vedlegg=e?.vedlegg?e.vedlegg.map(e=>new ae(e)):void 0}}class le{constructor(e){this.beskrivelse=e?.beskrivelse,this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart,this.kommentar=e?.kommentar,this.tema=e?.tema?new k(e.tema):void 0,this.tittel=e?.tittel,this.utfallType=e?.utfallType?new ie(e.utfallType):void 0,this.vedleggsliste=e?.vedleggsliste?new oe(e.vedleggsliste):void 0}}class ue extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&h(e,"title"),data:s?h(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return O(o(),e)}getValueFromFormData(e){const t=m(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 le(t)),e):e},{}):{}}}class de 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=N(r),this.resourceBindings=s?.utfallSvar||{},this.resourceValues={data:n?h(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return O(o(),e)}getValueFromFormData(e){return m(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 ce 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=N(r),this.resourceValues={title:!e?.hideTitle&&d(s?.utfallSvarType?.title),data:n?h(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return O(o(),e)}getValueFromFormData(e){return m(e)}getResourceBindings(e){const t=e?.resourceValues?.utfallType;return{utfallSvarType:{title:`resource.utfallBesvarelse.utfallSvar.${t?.toLowerCase()}.header`}}}}class me 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 he extends e{constructor(e){super(e),this.size=e?.size,this.resourceValues={title:h(e,"title")}}}class pe 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 ge extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:h(e,"title"),data:s?h(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=m(e);return s(e?.itemKey)?this.getListItemsFromKey(t,e?.itemKey):t}}class fe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:h(e,"title"),data:s?h(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 ae(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=m(e);return this.getAttachmentListItems(t)}}class ye extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues}hasContent(e){return s(e?.resourceValues?.title)}}class ke extends e{constructor(e){super(e),this.resourceValues={title:h(e,"title")}}}class ve extends e{constructor(e){super(e),this.resourceValues={title:h(e,"title")}}}class be extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class Ce 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=N(n),this.resourceValues={title:d(e?.resourceBindings?.title),data:s?d(e?.resourceBindings?.emptyFieldText):t}}getValueFromFormData(e){const t=m(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:d(t),props:e.props}})}(t);var n;return e.showRowNumbers&&s.unshift({text:(n=e,d(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=d(i),o={resourceBindings:e.resourceBindings,resourceValues:{data:r},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 S){const s=o();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=>Je(e));return t.filter(e=>!e?.isEmpty).length>0?t:null}).filter(e=>null!==e)}hasContent(e){return s(e)}}class Te extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=N(r),this.resourceValues={title:d(s?.part?.title),data:n?d(e?.resourceBindings?.emptyFieldText):t}}getValueFromFormData(e){const t=m(e);return this.getEiendomListFromData(t)}getEiendomListFromData(e){if(s(e))return e.map(e=>new w(e)).filter(e=>this.hasEiendomValue(e))}getValidationMessages(e){return O("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(){return{eiendomByggested:{title:"resource.eiendomByggested.eiendom.title"}}}}class Ve extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e.partType),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.partType=e?.partType,this.validationMessages=r,this.hasValidationMessages=N(r),this.resourceValues={title:d(s?.part?.title),data:n?d(e?.resourceBindings?.emptyFieldText):t}}getPartTypeFromElementAttributes(e){return e.getAttribute("parttype")||"tiltakshaver"}getValueFromFormData(e){const t=m(e);if(!s(t))return;const n=new M(t);return this.hasPartValue(n)?n:void 0}getValidationMessages(e){return O("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="tiltakshaver"){return{part:{title:`resource.${e}.header`}}}}const Be=["h1","h2","h3","h4","h5","h6"];function Ee(e){return s(e)&&Be.includes(e.toLowerCase())}function we(e){const t=JSON.parse(e?.getAttribute("formdata"));return s(t)&&t}function xe(e){const t=e?.getAttribute("tagName")||e?.tagName?.toLowerCase();return s(t)&&t}function Fe(e){const t=e?.getAttribute("text");return s(t)&&t}function je(e){const t=JSON.parse(e?.getAttribute("texts"));return s(t)&&t}function Me(e){return"true"===e?.getAttribute("inline")}function He(e){return"true"===e?.getAttribute("hideTitle")}function Le(e){const t=e?.getAttribute("size");return Ee(t)?t?.toString().toLowerCase():void 0}function De(e){return"true"===e?.getAttribute("hideIfEmpty")}function Ae(e){const t=JSON.parse(e?.getAttribute("styleOverride")||"{}");return s(t)&&t}function Ie(e){return"true"===e?.getAttribute("isChildComponent")}function Se(e){const t=e?.getAttribute("feedbackType");return s(t)&&t}function Ne(e){const t=e?.getAttribute("itemKey");return s(t)&&t}function Oe(e){return"true"===e?.getAttribute("hideOrgNr")}function Pe(e){const t=e?.getAttribute("format");return s(t)&&t}function Re(e){const t=JSON.parse(e?.getAttribute("tableColumns"));return s(t)&&t}function Ke(e){return"true"===e?.getAttribute("showRowNumbers")}function $e(e){const t=JSON.parse(e?.getAttribute("resourceBindings"));return s(t)&&t}function ze(e){const t=JSON.parse(e?.getAttribute("resourceValues"));return s(t)&&t}function Ue(e){const t=e?.getAttribute("partType");return s(t)?t:"tiltakshaver"}function Je(t){const s=t instanceof HTMLElement?function(e){return{formData:we(e),tagName:xe(e),text:Fe(e),texts:je(e),inline:Me(e),hideTitle:He(e),size:Le(e),hideIfEmpty:De(e),styleOverride:Ae(e),isChildComponent:Ie(e),feedbackType:Se(e),itemKey:Ne(e),hideOrgNr:Oe(e),format:Pe(e),tableColumns:Re(e),showRowNumbers:Ke(e),resourceBindings:$e(e),resourceValues:ze(e),partType:Ue(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 P(s);case"custom-feedback":return new R(s);case"custom-feedback-data":return new K(s);case"custom-feedbacklist-data":return new $(s);case"custom-feedbacklist-validation-messages":return new z(s);case"custom-field":return new U(s);case"custom-field-adresse":return new J(s);case"custom-field-boolean-data":return new G(s);case"custom-field-boolean-text":return new Z(s);case"custom-field-count-data":return new W(s);case"custom-field-data":return new q(s);case"custom-field-kommunens-saksnummer":return new Q(s);case"custom-field-part-navn":return new X(s);case"custom-field-prosjekt":return new _(s);case"custom-field-telefonnummer":return new te(s);case"custom-field-utfall-svar-status":return new ne(s);case"custom-group-utfall-svar":return new de(s);case"custom-group-utfall-svar-type":return new ce(s);case"custom-grouplist-utfall-svar":return new re(s);case"custom-grouplist-utfall-svar-type":return new ue(s);case"custom-header":return new me(s);case"custom-header-text":return new he(s);case"custom-list":return new pe(s);case"custom-list-data":return new ge(s);case"custom-list-vedlegg":return new fe(s);case"custom-paragraph":return new ye(s);case"custom-paragraph-text":return new ke(s);case"custom-subheader-text":return new ve(s);case"custom-table":return new be(s);case"custom-table-data":return new Ce(s);case"custom-table-eiendom":return new Te(s);case"custom-table-part":return new Ve(s);default:return console.warn(`Unknown component type: ${n}`),null}}function Ge(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=Je(this),t=u(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=Je(this),t=u(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,r){r={returnHtml:!0,inline:!1,styleOverride:{},...r};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,r.inline)),r?.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),n(i,{...r.styleOverride}),r.returnHtml?i.outerHTML:i}(e?.resourceValues?.title,e?.resourceValues?.data,t)}}}),customElements.define("custom-header",class extends HTMLElement{connectedCallback(){const e=Je(this);e?.isEmpty||(this.innerHTML=function(e,t){const s=document.createElement(Ee(t)?t:"h2");return s.innerHTML=e,s.outerHTML}(e?.resourceValues?.title,e?.size),n(this,e?.styleOverride))}}),customElements.define("custom-list",class extends HTMLElement{connectedCallback(){const e=new Je(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=Ge(t,s,!1);return e?.length&&r.classList.add("has-title"),n.appendChild(r),n.outerHTML}(e?.resourceValues?.title,e?.resourceValues?.data):Ge(e?.resourceValues?.data),n(this,e?.styleOverride)}}),customElements.define("custom-paragraph",class extends HTMLElement{connectedCallback(){const e=Je(this);e?.isEmpty||(this.innerHTML=function(e){const t=document.createElement("p");return t.innerHTML=e,t.outerHTML}(e?.resourceValues?.title),n(this,e?.styleOverride))}});class Ze{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),p=this.getFeedbackTypeAttributeFromProps(e),g=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),p&&(this.feedbackType=p),g&&(this.hideOrgNr=g),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 Ee(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 We(e){const t=e?.resourceValues?.data,s=e?.styleOverride,a=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,n(t,e?.props?.styleOverride),t}(e))}),o.appendChild(l),a.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 Ze(e);return t.innerHTML=i("custom-field-data",s).outerHTML,t}(e))}),t}(t))}),a.appendChild(e)}else{const t=r(e);if(t?.length){const e=document.createElement("tr"),s=document.createElement("td");s.textContent=t,e.appendChild(s),a.appendChild(e)}}return n(a,s),a}function qe(e,t){switch(e){case"error":return`Errors (${t})`;case"warning":return`Warnings (${t})`;case"info":return`Information (${t})`;default:return`Messages (${t})`}}function Qe(e){return i("custom-feedbacklist-validation-messages",new Ze({isChildComponent:!0,resourceValues:{data:e}}))}function Xe(e){return i("custom-group-utfall-svar",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:e}}))}function Ye(e,t="h1"){const n=e?.resourceValues?.data,r=n?.dispensasjonBeskrivelse?.dispensasjonTittel?.kodebeskrivelse;return s(r)?i("custom-header-text",new Ze({isChildComponent:!0,size:t,resourceValues:{title:r}})):null}customElements.define("custom-table",class extends HTMLElement{async connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e,t){const s=new Ze({size:t,resourceValues:{title:e}});if(e)return i("custom-header",s)}(e?.resourceValues?.title,e?.size),s=We(e);this.innerHTML="",t&&this.appendChild(t),this.appendChild(s)}}}),customElements.define("custom-feedback-data",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this);if(e.isEmpty&&t)t.style.display="none";else{const t=new Ze(e);this.innerHTML=i("custom-feedback",t).outerHTML}}}),customElements.define("custom-feedbacklist-data",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this),s=e?.resourceValues?.data,r=e?.resourceValues?.title||"Messages";e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e,t,s,r){const a=document.createElement("details");a.classList.add("feedback-details"),a.classList.add(s),a.setAttribute("open",!0),n(r);const o=document.createElement("summary");o.classList.add("feedback-summary"),o.innerHTML=e,a.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 Ze({isChildComponent:!0,feedbackType:"default",resourceValues:{data:e}});t.appendChild(i("custom-feedback-data",s)),l.appendChild(t)}),a.appendChild(l),a.outerHTML}(r,s,e?.feedbackType,e?.styleOverride)}}),customElements.define("custom-feedbacklist-validation-messages",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this),s=new S(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=i("custom-feedbacklist-data",new Ze({isChildComponent:!0,feedbackType:s,resourceValues:{title:qe(s,n.length),data:n}}));t.appendChild(e)}}),t.outerHTML}(s)}}),customElements.define("custom-field-adresse",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=r(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new Ze(e);this.innerHTML=i("custom-field",s).outerHTML}}}),customElements.define("custom-field-part-navn",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=r(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new Ze(e);this.innerHTML=i("custom-field",s).outerHTML}}}),customElements.define("custom-field-boolean-data",class extends HTMLElement{async connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ze(e);this.innerHTML=i("custom-field",t).outerHTML}}}),customElements.define("custom-field-boolean-text",class extends HTMLElement{async connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ze(e);this.innerHTML=i("custom-field",t).outerHTML}}}),customElements.define("custom-field-count-data",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ze(e);this.innerHTML=i("custom-field",t).outerHTML}}}),customElements.define("custom-field-data",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ze(e);this.innerHTML=i("custom-field",t).outerHTML}}}),customElements.define("custom-field-kommunens-saksnummer",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ze(e);this.innerHTML=i("custom-field",t).outerHTML}}}),customElements.define("custom-field-prosjekt",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ze(e);this.innerHTML=i("custom-field",t).outerHTML}}}),customElements.define("custom-field-telefonnummer",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=r(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new Ze(e);this.innerHTML=i("custom-field",s).outerHTML}}}),customElements.define("custom-field-utfall-svar-status",class extends HTMLElement{async connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ze(e);this.innerHTML=i("custom-field",t).outerHTML;const s=e.hasValidationMessages&&Qe(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-grouplist-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=Je(this),t=u(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 i("custom-group-utfall-svar-type",new Ze({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=Je(this);if(!e.isEmpty){const t=function(e,t="h2"){return i("custom-header-text",new Ze({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.title}}))}(e);this.appendChild(t);const s=function(e){return i("custom-grouplist-utfall-svar",new Ze({isChildComponent:!0,resourceValues:{data:e?.resourceValues?.data}}))}(e);this.appendChild(s);const n=e.hasValidationMessages&&Qe(e?.validationMessages);n&&this.appendChild(n)}}}),customElements.define("custom-grouplist-utfall-svar",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else for(const t of e?.resourceValues?.data){const e=Xe(t);this.appendChild(e);const s=i("custom-divider");this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar",class extends HTMLElement{async connectedCallback(){const e=Je(this),t=u(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=document.createElement("div");t.appendChild(function(e,t="h3"){return i("custom-header-text",new Ze({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.data?.tittel}}))}(e,"h3")),t.appendChild(function(e){const t=e?.resourceValues?.data;return a(i("custom-field-data",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:t?.beskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return a(i("custom-field-utfall-svar-status",new Ze({isChildComponent:!0,resourceBindings:{title:e?.resourceBindings?.["status.title"]},resourceValues:{data:t}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return a(i("custom-field-data",new Ze({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 a(i("custom-field-data",new Ze({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 a(i("custom-list-vedlegg",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&Qe(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-header-text",class extends HTMLElement{connectedCallback(){const e=new Je(this);e?.isChildComponent||n(u(this),{padding:"0 0.75rem"});const t=new Ze(e);this.innerHTML=i("custom-header",t).outerHTML}}),customElements.define("custom-list-data",class extends HTMLElement{connectedCallback(){const e=new Je(this),t=u(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 Ze(e),s=e.isEmpty?"custom-field":"custom-list";this.innerHTML=i(s,t).outerHTML}}}),customElements.define("custom-list-vedlegg",class extends HTMLElement{connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=new Ze(e);this.innerHTML=i("custom-field",t).outerHTML}else{const t=new Ze(e);this.innerHTML=i("custom-list",t).outerHTML}}}),customElements.define("custom-paragraph-text",class extends HTMLElement{connectedCallback(){const e=Je(this),t=new Ze(e);this.innerHTML=i("custom-paragraph",t).outerHTML}}),customElements.define("custom-subheader-text",class extends HTMLElement{connectedCallback(){const e=Je(this),t=new Ze(e);this.innerHTML=i("custom-paragraph",t).outerHTML}}),customElements.define("custom-table-data",class extends HTMLElement{async connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&Qe(e?.validationMessages),s=function(e){return i("custom-table",new Ze(e))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-eiendom",class extends HTMLElement{async connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&Qe(e?.validationMessages),s=function(e){return i("custom-table-data",new Ze({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,tableColumns:[{dataKey:"adresse",tagName:"custom-field-adresse",resourceBindings:{title:"resource.eiendomByggested.eiendom.adresse.title",emptyFieldText:"resource.eiendomByggested.eiendom.adresse.emptyFieldText"},props:{styleOverride:{width:"116px"}}},{dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.gaardsnummer.title",emptyFieldText:"resource.emptyFieldText.default"}},{dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.bruksnummer.title",emptyFieldText:"resource.emptyFieldText.default"}},{dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.seksjonsnummer.title",emptyFieldText:"resource.emptyFieldText.default"}},{dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.festenummer.title",emptyFieldText:"resource.emptyFieldText.default"}},{titleResourceKey:"col-6",dataKey:"bolignummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.bolignummer.title",emptyFieldText:"resource.emptyFieldText.default"}},{titleResourceKey:"col-7",dataKey:"bygningsnummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.bygningsnummer.title",emptyFieldText:"resource.emptyFieldText.default"}}]}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-part",class extends HTMLElement{async connectedCallback(){const e=Je(this),t=u(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&Qe(e?.validationMessages),s=function(e){const t=[{tagName:"custom-field-part-navn",resourceBindings:{title:`resource.${e?.partType}.navn.title`,emptyFieldText:"resource.emptyFieldText.default"}},{tagName:"custom-field-telefonnummer",resourceBindings:{title:`resource.${e?.partType}.telefonnummer.title`,emptyFieldText:"resource.emptyFieldText.default"}},{tagName:"custom-field-data",dataKey:"epost",resourceBindings:{title:`resource.${e?.partType}.epost.title`,emptyFieldText:"resource.emptyFieldText.default"}}];return i("custom-table-data",new Ze({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-dispensasjon",class extends HTMLElement{async connectedCallback(){const e=Je(this),t=u(this);if(e.isEmpty&&t)t.style.display="none";else{const t=function(){const e=document.createElement("div");return n(e,{display:"flex",flexFlow:"wrap",justifyContent:"start",alignItems:"flex-start"}),e}(),r=Ye(e),o=function(e){const t=e?.resourceValues?.data,s={xs:6};return a(i("custom-field-data",new Ze({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 a(i("custom-field-data",new Ze({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 a(i("custom-field-kommunens-saksnummer",new Ze({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.kommunensSaksnummer?.title},resourceValues:{data:t?.kommunensSaksnummer}})),s)}(e),d=function(e,t="h2"){return i("custom-header-text",new Ze({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.soeknadGjelderHeader?.title}}))}(e),c=function(e){const t=e?.resourceValues?.data;return i("custom-table-eiendom",new Ze({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?i("custom-header-text",new Ze({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeHeader?.title}})):null}(e),h=function(e){const t=e?.resourceValues?.data;return a(i("custom-list-data",new Ze({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 i("custom-table-part",new Ze({isChildComponent:!0,partType:"tiltakshaver",hideIfEmpty:!0,resourceValues:{data:t?.tiltakshaver}}))}(e),f=function(e){const t=e?.resourceValues?.data;return a(i("custom-field-adresse",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.tiltakshaverAdresse?.title},resourceValues:{data:t?.tiltakshaver?.adresse}})))}(e),y=Ye(e,"h2"),k=function(e){const t=e?.resourceValues?.data;return s(t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse)||s(t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse)?a(i("custom-field-boolean-data",new Ze({formData:{simpleBinding:"Annet"===t?.soeknadstype?.kodebeskrivelse,trueData:t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse,falseData:t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse,defaultData:t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse},hideIfEmpty:!0}))):null}(e),v=function(e){const t=e?.resourceValues?.data;return i("custom-field-data",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonBeskrivelseBeskrivelse?.title},resourceValues:{data:t?.dispensasjonBeskrivelse?.beskrivelse}}))}(e),b=function(e,t="h2"){return i("custom-header-text",new Ze({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.dispensasjonFraHeader?.title}}))}(e),C=function(e){const t=e?.resourceValues?.data;return a(i("custom-field-data",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonPlanBestemmelseNavn?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.navn}})))}(e),T=function(e){const t=e?.resourceValues?.data;return a(i("custom-field-data",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.nasjonalArealplanIdPlanIdentifikasjon?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.nasjonalArealplanId?.planidentifikasjon}})))}(e),V=function(e){const t=e?.resourceValues?.data;return a(i("custom-field-data",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.bestemmelserType?.title},resourceValues:{data:e.isPlanBestemmelseType?t?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse:t?.dispensasjonFra?.lovbestemmelse}})))}(e),B=function(e){const t=e?.resourceValues?.data;return a(i("custom-field-data",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.planBestemmelseNummerering?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering}})))}(e),E=function(e){return i("custom-header-text",new Ze({isChildComponent:!0,size:"h2",resourceBindings:{title:e.resourceBindings?.stedfestingHeader?.title}}))}(e),w=function(e){const t=e?.resourceValues?.data;return a(i("custom-field-data",new Ze({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 a(i("custom-field-data",new Ze({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 a(i("custom-field-data",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingVertikalnivaa?.title},resourceValues:{data:t?.stedfesting?.vertikalnivaa?.kodebeskrivelse}})))}(e),j=function(e,t="h2"){return i("custom-header-text",new Ze({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.varighetHeader?.title}}))}(e),M=function(e){const t=e?.resourceValues?.data;return t?.varighet?.oenskesVarigDispensasjon?a(i("custom-paragraph-text",new Ze({isChildComponent:!0,resourceBindings:{title:e.resourceBindings?.varighetOenskesVarigDispensasjon?.trueText}}))):s(t?.varighet?.oensketVarighetTil)?a(i("custom-field-data",new Ze({isChildComponent:!0,formData:{simpleBinding:dispensasjon?.varighet?.oensketVarighetTil},format:"date",resourceBindings:{title:e.resourceBindings?.varighetOensketVarighetTil?.title},resourceValues:{data:t?.varighet?.oensketVarighetTil}}))):null}(e),H=function(e,t="h2"){return i("custom-header-text",new Ze({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.begrunnelseHeader?.title}}))}(e),L=function(e){const t=e?.resourceValues?.data;return a(i("custom-field-data",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.hensynBakBestemmelsen}})))}(e),D=function(e){const t=e?.resourceValues?.data;return a(i("custom-field-data",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynBakBestemmelsen}})))}(e),A=function(e){const t=e?.resourceValues?.data;return a(i("custom-field-data",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynOverordnet?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynOverordnet}})))}(e),I=function(e){const t=e?.resourceValues?.data;return a(i("custom-list-data",new Ze({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 a(i("custom-list-data",new Ze({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 a(i("custom-field-data",new Ze({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?i("custom-header-text",new Ze({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.title}})):null}(e),P=function(e){const t=e?.resourceValues?.data;return a(i("custom-field-boolean-text",new Ze({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{trueText:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.trueText,falseText:"",defaultText:""},resourceValues:{data:t?.generelleVilkaar?.norskSvenskDansk}})))}(e),R=Qe(e?.validationMessages);p(t,[r,o,l,u]),p(t,[d,c,m,h]),p(t,[g,f]),p(t,[y,k,v]),e.isPlanBestemmelseType?p(t,[b,C,T,V,B]):p(t,[b,V]),p(t,[E,w,x,F]),p(t,[j,M]),p(t,[H,L,D,A,I,S,N]),p(t,[O,P]),p(t,[R]),this.appendChild(t)}}});class _e{constructor(e){this.eiendomByggested=e?.eiendomByggested&&new x(e.eiendomByggested),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new F(e.kommunensSaksnummer),this.metadata=e?.metadata&&new j(e.metadata),this.versjon=e?.versjon}}function et(e){return c(e)}const tt={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 _e({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=O(e,tt),r=u(this);if(!s(t)&&r)r.style.display="none";else{const s=function(e,t){return i("custom-field-data",{formData:{simpleBinding:e?.versjon},text:d(t),emptyFieldText:"(gjennomfoeringsplanNummer mangler)"})}(t,e),r=function(e,t){return i("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:et(t),styleOverride:{tableLayout:"fixed"}})}(t?.eiendomByggested?.eiendom,e),a=Qe(n);this.appendChild(s),this.appendChild(r),this.appendChild(a)}}}),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-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-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 p(e,t){return s(e?.resourceValues?.[t])?e.resourceValues?.[t]:c(e?.resourceBindings?.[t])}function g(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 C{constructor(e){this.planidentifikasjon=e?.planidentifikasjon}}class T{constructor(e){this.nummerering=e?.nummerering}}class V{constructor(e){this.navn=e?.navn,this.nasjonalArealplanId=e?.nasjonalArealplanId&&new C(e.nasjonalArealplanId),this.planbestemmelse=e?.planbestemmelse&&new T(e.planbestemmelse)}}class B{constructor(e){this.bestemmelserType=e?.bestemmelserType&&new v(e.bestemmelserType),this.dispensasjonPlanBestemmelse=e?.dispensasjonPlanBestemmelse&&new V(e.dispensasjonPlanBestemmelse),this.lovbestemmelse=e?.lovbestemmelse}}class E{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 E(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 E(e.adresse)}}class L{constructor(e){this.koordinatsystem=e?.koordinatsystem&&new v(e.koordinatsystem),this.koordinater=e?.koordinater}}class D{constructor(e){this.posisjon=e?.posisjon&&new L(e.posisjon),this.vertikalnivaa=e?.vertikalnivaa&&new v(e.vertikalnivaa)}}class A{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 I{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 A(e.tiltakstyper),this.tiltakshaver=e?.tiltakshaver&&new H(e.tiltakshaver),this.dispensasjonFra=e?.dispensasjonFra&&new B(e.dispensasjonFra),this.stedfesting=e?.stedfesting&&new D(e.stedfesting),this.varighet=e?.varighet&&new I(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?p(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 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 $ 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:p(e,"title"),data:s?p(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 E(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:p(e,"title"),data:s?p(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:p(e,"title"),data:s?p(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 q extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&p(e,"title"),data:s?p(e,"emptyFieldText"):t}}hasContent(e){return n(e)}getValueFromFormData(e){const t=h(e);return t&&Array.isArray(t)?t.length:0}}class Q extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&p(e,"title"),data:s?p(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){return h(e)}}class X extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:p(e,"title"),data:s?p(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 Y 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 _{constructor(e){this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class ee 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 _(e?.formData?.data);return this.formatProsjekt(t)}}class te{constructor(e){this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer}}class se 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 te(t);return this.formatPhoneNumbers(s)}hasContent(e){return s(e)}}class ne{constructor(e){this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart}}class re 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?p(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 ne(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 ie extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:s?p(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return P(l(),e)}getValueFromFormData(e){return h(e)}}class ae{constructor(e){this.kodeverdi=e?.kodeverdi}}class oe{constructor(e){this.filnavn=e?.filnavn,this.vedleggstype=e?.vedleggstype&&new v(e.vedleggstype)}}class le{constructor(e){this.vedlegg=e?.vedlegg?e.vedlegg.map(e=>new oe(e)):void 0}}class ue{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 ae(e.utfallType):void 0,this.vedleggsliste=e?.vedleggsliste?new le(e.vedleggsliste):void 0}}class de extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&p(e,"title"),data:s?p(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 ue(t)),e):e},{}):{}}}class ce 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?p(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 me 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?p(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 he 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 pe extends e{constructor(e){super(e),this.size=e?.size,this.resourceValues={title:p(e,"title")}}}class ge 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 fe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:p(e,"title"),data:s?p(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 ye extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:p(e,"title"),data:s?p(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 oe(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 ke extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues}hasContent(e){return s(e?.resourceValues?.title)}}class ve extends e{constructor(e){super(e),this.resourceValues={title:p(e,"title")}}}class be extends e{constructor(e){super(e),this.resourceValues={title:p(e,"title")}}}class Ce extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class Te 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},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=>Ge(e));return t.filter(e=>!e?.isEmpty).length>0?t:null}).filter(e=>null!==e)}hasContent(e){return s(e)}}class Ve extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceValues={title:c(s?.part?.title),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(){return{eiendomByggested:{title:"resource.eiendomByggested.eiendom.title"}}}}class Be extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e.partType),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.partType=e?.partType,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceValues={title:c(s?.part?.title),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="tiltakshaver"){return{part:{title:`resource.${e}.header`}}}}const Ee=["h1","h2","h3","h4","h5","h6"];function we(e){return s(e)&&Ee.includes(e.toLowerCase())}function xe(e){const t=JSON.parse(e?.getAttribute("formdata"));return s(t)&&t}function Fe(e){const t=e?.getAttribute("tagName")||e?.tagName?.toLowerCase();return s(t)&&t}function je(e){const t=e?.getAttribute("text");return s(t)&&t}function Me(e){const t=JSON.parse(e?.getAttribute("texts"));return s(t)&&t}function He(e){return"true"===e?.getAttribute("inline")}function Le(e){return"true"===e?.getAttribute("hideTitle")}function De(e){const t=e?.getAttribute("size");return we(t)?t?.toString().toLowerCase():void 0}function Ae(e){return"true"===e?.getAttribute("hideIfEmpty")}function Ie(e){const t=JSON.parse(e?.getAttribute("styleOverride")||"{}");return s(t)&&t}function Se(e){return"true"===e?.getAttribute("isChildComponent")}function Ne(e){const t=e?.getAttribute("feedbackType");return s(t)&&t}function Oe(e){const t=e?.getAttribute("itemKey");return s(t)&&t}function Pe(e){return"true"===e?.getAttribute("hideOrgNr")}function Re(e){const t=e?.getAttribute("format");return s(t)&&t}function Ke(e){const t=JSON.parse(e?.getAttribute("tableColumns"));return s(t)&&t}function $e(e){return"true"===e?.getAttribute("showRowNumbers")}function ze(e){const t=JSON.parse(e?.getAttribute("resourceBindings"));return s(t)&&t}function Ue(e){const t=JSON.parse(e?.getAttribute("resourceValues"));return s(t)&&t}function Je(e){const t=e?.getAttribute("partType");return s(t)?t:"tiltakshaver"}function Ge(t){const s=t instanceof HTMLElement?function(e){return{formData:xe(e),tagName:Fe(e),text:je(e),texts:Me(e),inline:He(e),hideTitle:Le(e),size:De(e),hideIfEmpty:Ae(e),styleOverride:Ie(e),isChildComponent:Se(e),feedbackType:Ne(e),itemKey:Oe(e),hideOrgNr:Pe(e),format:Re(e),tableColumns:Ke(e),showRowNumbers:$e(e),resourceBindings:ze(e),resourceValues:Ue(e),partType:Je(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 K(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 q(s);case"custom-field-data":return new Q(s);case"custom-field-kommunens-saksnummer":return new X(s);case"custom-field-part-navn":return new Y(s);case"custom-field-prosjekt":return new ee(s);case"custom-field-telefonnummer":return new se(s);case"custom-field-utfall-svar-status":return new re(s);case"custom-group-utfall-svar":return new ce(s);case"custom-group-utfall-svar-type":return new me(s);case"custom-grouplist-utfall-svar":return new ie(s);case"custom-grouplist-utfall-svar-type":return new de(s);case"custom-header":return new he(s);case"custom-header-text":return new pe(s);case"custom-list":return new ge(s);case"custom-list-data":return new fe(s);case"custom-list-vedlegg":return new ye(s);case"custom-paragraph":return new ke(s);case"custom-paragraph-text":return new ve(s);case"custom-subheader-text":return new be(s);case"custom-table":return new Ce(s);case"custom-table-data":return new Te(s);case"custom-table-eiendom":return new Ve(s);case"custom-table-part":return new Be(s);default:return console.warn(`Unknown component type: ${n}`),null}}function Ze(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=Ge(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=Ge(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=Ge(this);e?.isEmpty||(this.innerHTML=function(e,t){const s=document.createElement(we(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 Ge(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=Ze(t,s,!1);return e?.length&&r.classList.add("has-title"),n.appendChild(r),n.outerHTML}(e?.resourceValues?.title,e?.resourceValues?.data):Ze(e?.resourceValues?.data),r(this,e?.styleOverride)}}),customElements.define("custom-paragraph",class extends HTMLElement{connectedCallback(){const e=Ge(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 We{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),p=this.getFeedbackTypeAttributeFromProps(e),g=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),p&&(this.feedbackType=p),g&&(this.hideOrgNr=g),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 we(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 qe(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 We(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 Qe(e,t){switch(e){case"error":return`Errors (${t})`;case"warning":return`Warnings (${t})`;case"info":return`Information (${t})`;default:return`Messages (${t})`}}function Xe(e){return a("custom-feedbacklist-validation-messages",new We({isChildComponent:!0,resourceValues:{data:e}}))}function Ye(e){return a("custom-group-utfall-svar",new We({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:e}}))}function _e(e,t="h1"){const n=e?.resourceValues?.data,r=n?.dispensasjonBeskrivelse?.dispensasjonTittel?.kodebeskrivelse;return s(r)?a("custom-header-text",new We({isChildComponent:!0,size:t,resourceValues:{title:r}})):null}customElements.define("custom-table",class extends HTMLElement{async connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e,t){const s=new We({size:t,resourceValues:{title:e}});if(e)return a("custom-header",s)}(e?.resourceValues?.title,e?.size),s=qe(e);this.innerHTML="",t&&this.appendChild(t),this.appendChild(s)}}}),customElements.define("custom-feedback-data",class extends HTMLElement{connectedCallback(){const e=Ge(this),t=d(this);if(e.isEmpty&&t)t.style.display="none";else{const t=new We(e);this.innerHTML=a("custom-feedback",t).outerHTML}}}),customElements.define("custom-feedbacklist-data",class extends HTMLElement{connectedCallback(){const e=Ge(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 We({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=Ge(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 We({isChildComponent:!0,feedbackType:s,resourceValues:{title:Qe(s,n.length),data:n}}));t.appendChild(e)}}),t.outerHTML}(s)}}),customElements.define("custom-field-adresse",class extends HTMLElement{connectedCallback(){const e=Ge(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 We(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-part-navn",class extends HTMLElement{connectedCallback(){const e=Ge(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 We(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-boolean-data",class extends HTMLElement{async connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new We(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-boolean-text",class extends HTMLElement{async connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new We(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-count-data",class extends HTMLElement{connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new We(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-data",class extends HTMLElement{connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new We(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-kommunens-saksnummer",class extends HTMLElement{connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new We(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-prosjekt",class extends HTMLElement{connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new We(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-telefonnummer",class extends HTMLElement{connectedCallback(){const e=Ge(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 We(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-utfall-svar-status",class extends HTMLElement{async connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new We(e);this.innerHTML=a("custom-field",t).outerHTML;const s=e.hasValidationMessages&&Xe(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-grouplist-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=Ge(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 We({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=Ge(this);if(!e.isEmpty){const t=function(e,t="h2"){return a("custom-header-text",new We({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.title}}))}(e);this.appendChild(t);const s=function(e){return a("custom-grouplist-utfall-svar",new We({isChildComponent:!0,resourceValues:{data:e?.resourceValues?.data}}))}(e);this.appendChild(s);const n=e.hasValidationMessages&&Xe(e?.validationMessages);n&&this.appendChild(n)}}}),customElements.define("custom-grouplist-utfall-svar",class extends HTMLElement{connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else for(const t of e?.resourceValues?.data){const e=Ye(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=Ge(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 We({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 We({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 We({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 We({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 We({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 We({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&Xe(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-header-text",class extends HTMLElement{connectedCallback(){const e=new Ge(this);e?.isChildComponent||r(d(this),{padding:"0 0.75rem"});const t=new We(e);this.innerHTML=a("custom-header",t).outerHTML}}),customElements.define("custom-list-data",class extends HTMLElement{connectedCallback(){const e=new Ge(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 We(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=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=new We(e);this.innerHTML=a("custom-field",t).outerHTML}else{const t=new We(e);this.innerHTML=a("custom-list",t).outerHTML}}}),customElements.define("custom-paragraph-text",class extends HTMLElement{connectedCallback(){const e=Ge(this),t=new We(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}),customElements.define("custom-subheader-text",class extends HTMLElement{connectedCallback(){const e=Ge(this),t=new We(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}),customElements.define("custom-table-data",class extends HTMLElement{async connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&Xe(e?.validationMessages),s=function(e){return a("custom-table",new We(e))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-eiendom",class extends HTMLElement{async connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&Xe(e?.validationMessages),s=function(e){return a("custom-table-data",new We({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,tableColumns:[{dataKey:"adresse",tagName:"custom-field-adresse",resourceBindings:{title:"resource.eiendomByggested.eiendom.adresse.title",emptyFieldText:"resource.eiendomByggested.eiendom.adresse.emptyFieldText"},props:{styleOverride:{width:"116px"}}},{dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.gaardsnummer.title",emptyFieldText:"resource.emptyFieldText.default"}},{dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.bruksnummer.title",emptyFieldText:"resource.emptyFieldText.default"}},{dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.seksjonsnummer.title",emptyFieldText:"resource.emptyFieldText.default"}},{dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.festenummer.title",emptyFieldText:"resource.emptyFieldText.default"}},{titleResourceKey:"col-6",dataKey:"bolignummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.bolignummer.title",emptyFieldText:"resource.emptyFieldText.default"}},{titleResourceKey:"col-7",dataKey:"bygningsnummer",tagName:"custom-field-data",resourceBindings:{title:"resource.eiendomByggested.eiendom.bygningsnummer.title",emptyFieldText:"resource.emptyFieldText.default"}}]}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-part",class extends HTMLElement{async connectedCallback(){const e=Ge(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&Xe(e?.validationMessages),s=function(e){const t=[{tagName:"custom-field-part-navn",resourceBindings:{title:`resource.${e?.partType}.navn.title`,emptyFieldText:"resource.emptyFieldText.default"}},{tagName:"custom-field-telefonnummer",resourceBindings:{title:`resource.${e?.partType}.telefonnummer.title`,emptyFieldText:"resource.emptyFieldText.default"}},{tagName:"custom-field-data",dataKey:"epost",resourceBindings:{title:`resource.${e?.partType}.epost.title`,emptyFieldText:"resource.emptyFieldText.default"}}];return a("custom-table-data",new We({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-dispensasjon",class extends HTMLElement{async connectedCallback(){const e=Ge(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=_e(e),i=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-data",new We({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 We({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 We({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 We({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 We({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 We({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 We({isChildComponent:!0,hideIfEmpty:!0,itemKey:"kodebeskrivelse",resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeKode?.title},resourceValues:{data:t?.tiltakstyper?.type?.kode}})))}(e),p=function(e){const t=e?.resourceValues?.data;return a("custom-table-part",new We({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 We({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.tiltakshaverAdresse?.title},resourceValues:{data:t?.tiltakshaver?.adresse}})))}(e),y=_e(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 We({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 We({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 We({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.dispensasjonFraHeader?.title}}))}(e),C=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new We({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonPlanBestemmelseNavn?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.navn}})))}(e),T=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new We({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.nasjonalArealplanIdPlanIdentifikasjon?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.nasjonalArealplanId?.planidentifikasjon}})))}(e),V=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new We({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.bestemmelserType?.title},resourceValues:{data:e.isPlanBestemmelseType?t?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse:t?.dispensasjonFra?.lovbestemmelse}})))}(e),B=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new We({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.planBestemmelseNummerering?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering}})))}(e),E=function(e){return a("custom-header-text",new We({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 We({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 We({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 We({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 We({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 We({isChildComponent:!0,resourceBindings:{title:e.resourceBindings?.varighetOenskesVarigDispensasjon?.trueText}}))):s(t?.varighet?.oensketVarighetTil)?o(a("custom-field-data",new We({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 We({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.begrunnelseHeader?.title}}))}(e),L=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new We({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.hensynBakBestemmelsen}})))}(e),D=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new We({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynBakBestemmelsen}})))}(e),A=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new We({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynOverordnet?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynOverordnet}})))}(e),I=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new We({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 We({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 We({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 We({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 We({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{trueText:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.trueText,falseText:"",defaultText:""},resourceValues:{data:t?.generelleVilkaar?.norskSvenskDansk}})))}(e),R=Xe(e?.validationMessages);g(t,[n,i,l,u]),g(t,[d,c,m,h]),g(t,[p,f]),g(t,[y,k,v]),e.isPlanBestemmelseType?g(t,[b,C,T,V,B]):g(t,[b,V]),g(t,[E,w,x,F]),g(t,[j,M]),g(t,[H,L,D,A,I,S,N]),g(t,[O,P]),g(t,[R]),this.appendChild(t)}}});class et{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 tt(e){return m(e)}const st={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 et({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,st),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:tt(t),styleOverride:{tableLayout:"fixed"}})}(t?.eiendomByggested?.eiendom,e),i=Xe(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.")}})})();
|