@arkitektum/altinn-studio-custom-components 9.4.0 → 9.5.1

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.css CHANGED
@@ -1 +1 @@
1
- custom-divider{display:block;page-break-before:avoid;& hr{background-color:var(--color-divider-default);border:none;display:block;height:1px;margin:20px 0;page-break-before:avoid;&:before{content:"";display:block;height:50px;margin-top:-50px}}}custom-feedback{display:block;& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);margin-block:0;&.error{color:var(--color-error-default)}&.success{color:var(--color-success-default)}&.warning{color:var(--color-warning-default)}&.info{color:var(--color-info-default)}}}custom-field{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& .field{&.inline{align-items:baseline;display:flex;flex-direction:row;gap:.5rem}& label{display:block;font-weight:700;page-break-after:avoid;page-break-inside:avoid;&:after{content:"";display:block;height:50px;margin-bottom:-50px}}& span{display:block;white-space:pre-line}&:not(.inline){& span{&.has-title{page-break-before:avoid}}}}}custom-header{color:var(--color-text-default);display:block;font-family:var(--font-family-default);font-weight:var(--font-weight-default);page-break-after:avoid;page-break-inside:avoid;width:100%;&:after{content:"";display:block;height:100px;margin-bottom:-100px}& h1,& h2,& h3,& h4{display:inline-block;line-height:1.1em;margin-block-end:0;margin-block-start:1em;page-break-after:avoid}& h1{font-size:var(--font-size-h1);font-weight:var(--font-weight-semibold)}& h2{font-size:var(--font-size-h2)}& h2,& h3{font-weight:var(--font-weight-default)}& h3{font-size:var(--font-size-h3)}& h4{font-size:var(--font-size-h4);font-weight:var(--font-weight-semibold)}}custom-list{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& .field{& label{display:block;font-weight:700;page-break-after:avoid;page-break-inside:avoid;&:after{content:"";display:block;height:50px;margin-bottom:-50px}}}& ul{display:block;margin-block:0;padding-inline-start:0;padding-left:1.5em;&.has-title{page-break-before:avoid}}}custom-paragraph{display:block;& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);margin-block:0}}custom-table{color:var(--color-text-default);display:block;font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& table{border:1px solid var(--color-default-dark);border-radius:6px;border-spacing:0;margin:.75rem 0;overflow:hidden;width:100%;& tr{page-break-inside:avoid}& td,& th{padding:8px 12px;page-break-inside:avoid;&:after{content:"";display:block;height:30px;margin-bottom:-30px}}& thead{& th{background-color:var(--color-default-default);border-bottom:1px solid var(--color-border-default);font-weight:500;line-height:var(--line-height-table-header);page-break-after:avoid;text-align:left}}& tbody{& tr{&:nth-child(2n){background-color:var(--color-default-muted)}}& tr:not(:last-of-type){& td{border-bottom:1px solid var(--color-border-default)}}}}}custom-feedbacklist-data{@media screen{display:block}@media print{display:none}color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& details.feedback-details{border-radius:6px;margin:.75rem 0;overflow:hidden;& summary{cursor:pointer;padding:8px 16px;transition:var(--background-transition-default)}& .feedback-list{& .feedback-list-item{border-block-style:inset;border-bottom:1px solid rgba(0,0,0,.075);border-top:1px solid hsla(0,0%,100%,.075);padding:8px 16px;&:last-child{border-bottom:none}}}&.error{background-color:var(--color-error-muted);& summary{background-color:var(--color-error-default);color:#fff;&:hover{background-color:var(--color-error-light)}}}&.warning{background-color:var(--color-warning-muted);& summary{background-color:var(--color-warning-default);color:#fff;&:hover{background-color:var(--color-warning-light)}}}&.info{background-color:var(--color-info-muted);& summary{background-color:var(--color-info-default);color:#fff;&:hover{background-color:var(--color-info-light)}}}&.success{background-color:var(--color-success-muted);& summary{background-color:var(--color-success-default);color:#fff;&:hover{background-color:var(--color-success-light)}}}&.default{background-color:var(--color-default-muted);border:1px solid var(--color-default-dark);& summary{background-color:var(--color-default-default);color:var(--color-text-default);&:hover{background-color:var(--color-default-light)}}& .feedback-list{& .feedback-list-item{border-bottom:1px solid var(--color-border-default);border-top:none;&:nth-child(odd){background-color:#fff}&:last-child{border-bottom:none}}}}}}custom-feedbacklist-validation-messages{@media screen{display:block;width:100%}@media print{display:none}}custom-field-adresse,custom-header-text{display:block;page-break-inside:avoid}custom-header-text{page-break-after:avoid;width:100%}custom-subheader-text{display:block;margin-top:-32px}custom-table-data,custom-table-eiendom,custom-table-tiltakshaver{display:block;width:100%}@font-face{font-family:Roboto Flex;src:url(49c816770b639989d28b.woff2) format("woff2")}:root{--font-family-default:"Roboto Flex",Arial,sans-serif;--color-text-default:#1c1b1d;--background-muted:#f7f4f4;--color-divider-default:#cdcaca;--color-border-default:#e6e4e4;--color-error-muted:#ef535030;--color-error-light:#ef5350;--color-error-default:#d32f2f;--color-error-dark:#c62828;--color-warning-muted:#ff980030;--color-warning-light:#ff9800;--color-warning-default:#ed6c02;--color-warning-dark:#e65100;--color-success-muted:#4caf5030;--color-success-light:#4caf50;--color-success-default:#2e7d32;--color-success-dark:#1b5e20;--color-info-muted:#03a9f430;--color-info-light:#03a9f4;--color-info-default:#0288d1;--color-info-dark:#01579b;--color-default-muted:#fdfbfb;--color-default-light:#f9f7f7;--color-default-default:#f7f4f4;--color-default-dark:#e7e4e4;--font-size-default:16px;--font-size-h1:34px;--font-size-h2:28px;--font-size-h3:22px;--font-size-h4:18px;--font-weight-default:400;--font-weight-semibold:500;--line-height-default:24px;--line-height-heading:1.1em;--line-height-table-header:20px;--margin-block-start-heading:1em;--margin-block-end-heading:0;--background-transition-default:background-color 150ms}body{background-color:#fff;color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);letter-spacing:normal;line-height:var(--line-height-default);-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;& main{& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);line-height:var(--line-height-default);&[class^=fds-]{font-family:var(--font-family-default)}}& .fds-label{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-h2);font-weight:var(--font-weight-default);line-height:var(--line-height-heading);margin-block-end:var(--margin-block-end-heading);margin-block-start:var(--margin-block-start-heading);page-break-after:avoid;page-break-inside:avoid}& .fds-table{border:1px solid var(--color-default-dark);border-radius:6px;border-spacing:0;overflow:hidden;width:100%;& tr{page-break-inside:avoid}& td,& th{padding:8px 12px;page-break-inside:avoid;&:after{content:"";display:block;height:30px;margin-bottom:-30px}}& thead{& th{background-color:var(--color-default-default);border-bottom:1px solid var(--color-border-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:500;line-height:var(--line-height-table-header);page-break-after:avoid;text-align:left;&:first-of-type{border-top-left-radius:5px}&:last-of-type{border-top-right-radius:5px}}}& tbody{& tr{&:nth-child(2n){background-color:var(--color-default-muted)}&:not(:last-of-type){& td{border-bottom:1px solid var(--color-border-default)}}&:last-of-type{& td{border-bottom:none;&:first-of-type{border-bottom-left-radius:5px}&:last-of-type{border-bottom-right-radius:5px}}}& td{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default)}}}}}& h1,& h2,& h3,& h4,& h5,& h6{color:var(--color-text-default);display:inline-block;line-height:var(--line-height-heading);margin-block-end:var(--margin-block-end-heading);margin-block-start:var(--margin-block-start-heading);page-break-after:avoid;&[class^=fds-]{font-family:var(--font-family-default)}}& h1{font-size:var(--font-size-h1);font-weight:var(--font-weight-semibold)}& h2{font-size:var(--font-size-h2)}& h2,& h3{font-weight:var(--font-weight-default)}& h3{font-size:var(--font-size-h3)}& h4{font-size:var(--font-size-h4);font-weight:var(--font-weight-semibold)}& div[data-componenttype=AttachmentList] ul{margin-top:.3em;& li{margin-bottom:0;& [class^=fds-],& a,& span{color:var(--color-text-default);cursor:default;font-family:var(--font-family-default);font-size:1.1rem;font-weight:var(--font-weight-default);line-height:var(--line-height-default);pointer-events:none}}}}@media print{html{font-size:inherit!important}}@page{size:A4 portrait;margin-bottom:1.5cm;margin-left:1.25cm;margin-right:1.25cm;margin-top:1cm}#pdfView{&>h1:first-of-type{min-height:68px}&>div[data-testid=pdf-logo]{display:block;margin-bottom:0;min-height:68px;& h1{margin-top:0}& img{height:auto;position:absolute;right:0;top:0;width:85px}&:after{content:"";display:block}}}
1
+ custom-divider{display:block;page-break-before:avoid;& hr{background-color:var(--color-divider-default);border:none;display:block;height:1px;margin:20px 0;page-break-before:avoid;&:before{content:"";display:block;height:50px;margin-top:-50px}}}custom-feedback{display:block;& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);margin-block:0;&.error{color:var(--color-error-default)}&.success{color:var(--color-success-default)}&.warning{color:var(--color-warning-default)}&.info{color:var(--color-info-default)}}}custom-field{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& .field{&.inline{align-items:baseline;display:flex;flex-direction:row;gap:.5rem}& label{display:block;font-weight:700;page-break-after:avoid;page-break-inside:avoid;&:after{content:"";display:block;height:50px;margin-bottom:-50px}}& span{display:block;white-space:pre-line}&:not(.inline){& span{&.has-title{page-break-before:avoid}}}}}custom-header{color:var(--color-text-default);display:block;font-family:var(--font-family-default);font-weight:var(--font-weight-default);page-break-after:avoid;page-break-inside:avoid;width:100%;&:after{content:"";display:block;height:100px;margin-bottom:-100px}& h1,& h2,& h3,& h4{display:inline-block;line-height:1.1em;margin-block-end:0;margin-block-start:1em;page-break-after:avoid}& h1{font-size:var(--font-size-h1);font-weight:var(--font-weight-semibold)}& h2{font-size:var(--font-size-h2)}& h2,& h3{font-weight:var(--font-weight-default)}& h3{font-size:var(--font-size-h3)}& h4{font-size:var(--font-size-h4);font-weight:var(--font-weight-semibold)}}custom-list{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& .field{& label{display:block;font-weight:700;page-break-after:avoid;page-break-inside:avoid;&:after{content:"";display:block;height:50px;margin-bottom:-50px}}}& ul{display:block;margin-block:0;padding-inline-start:0;padding-left:1.5em;&.has-title{page-break-before:avoid}}}custom-paragraph{display:block;& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);margin-block:0}}custom-table{color:var(--color-text-default);display:block;font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& table{border:1px solid var(--color-default-dark);border-radius:6px;border-spacing:0;margin:.75rem 0;overflow:hidden;width:100%;& tr{page-break-inside:avoid}& td,& th{padding:8px 10px;page-break-inside:avoid;&:after{content:"";display:block;height:30px;margin-bottom:-30px}}& thead{& th{background-color:var(--color-default-default);border-bottom:1px solid var(--color-border-default);font-weight:500;line-height:var(--line-height-table-header);page-break-after:avoid;text-align:left}}& tbody{& tr{&:nth-child(2n){background-color:var(--color-default-muted)}}& tr:not(:last-of-type){& td{border-bottom:1px solid var(--color-border-default)}}}}}custom-feedbacklist-data{@media screen{display:block}@media print{display:none}color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& details.feedback-details{border-radius:6px;margin:.75rem 0;overflow:hidden;& summary{cursor:pointer;padding:8px 16px;transition:var(--background-transition-default)}& .feedback-list{& .feedback-list-item{border-block-style:inset;border-bottom:1px solid rgba(0,0,0,.075);border-top:1px solid hsla(0,0%,100%,.075);padding:8px 16px;&:last-child{border-bottom:none}}}&.error{background-color:var(--color-error-muted);& summary{background-color:var(--color-error-default);color:#fff;&:hover{background-color:var(--color-error-light)}}}&.warning{background-color:var(--color-warning-muted);& summary{background-color:var(--color-warning-default);color:#fff;&:hover{background-color:var(--color-warning-light)}}}&.info{background-color:var(--color-info-muted);& summary{background-color:var(--color-info-default);color:#fff;&:hover{background-color:var(--color-info-light)}}}&.success{background-color:var(--color-success-muted);& summary{background-color:var(--color-success-default);color:#fff;&:hover{background-color:var(--color-success-light)}}}&.default{background-color:var(--color-default-muted);border:1px solid var(--color-default-dark);& summary{background-color:var(--color-default-default);color:var(--color-text-default);&:hover{background-color:var(--color-default-light)}}& .feedback-list{& .feedback-list-item{border-bottom:1px solid var(--color-border-default);border-top:none;&:nth-child(odd){background-color:#fff}&:last-child{border-bottom:none}}}}}}custom-feedbacklist-validation-messages{@media screen{display:block;width:100%}@media print{display:none}}custom-field-adresse,custom-header-text{display:block;page-break-inside:avoid}custom-header-text{page-break-after:avoid;width:100%}custom-subheader-text{display:block;margin-top:-32px}custom-table-data,custom-table-eiendom,custom-table-tiltakshaver{display:block;width:100%}@font-face{font-family:Roboto Flex;src:url(49c816770b639989d28b.woff2) format("woff2")}:root{--font-family-default:"Roboto Flex",Arial,sans-serif;--color-text-default:#1c1b1d;--background-muted:#f7f4f4;--color-divider-default:#cdcaca;--color-border-default:#e6e4e4;--color-error-muted:#ef535030;--color-error-light:#ef5350;--color-error-default:#d32f2f;--color-error-dark:#c62828;--color-warning-muted:#ff980030;--color-warning-light:#ff9800;--color-warning-default:#ed6c02;--color-warning-dark:#e65100;--color-success-muted:#4caf5030;--color-success-light:#4caf50;--color-success-default:#2e7d32;--color-success-dark:#1b5e20;--color-info-muted:#03a9f430;--color-info-light:#03a9f4;--color-info-default:#0288d1;--color-info-dark:#01579b;--color-default-muted:#fdfbfb;--color-default-light:#f9f7f7;--color-default-default:#f7f4f4;--color-default-dark:#e7e4e4;--font-size-default:16px;--font-size-h1:34px;--font-size-h2:28px;--font-size-h3:22px;--font-size-h4:18px;--font-weight-default:400;--font-weight-semibold:500;--line-height-default:24px;--line-height-heading:1.1em;--line-height-table-header:20px;--margin-block-start-heading:1em;--margin-block-end-heading:0;--background-transition-default:background-color 150ms}body{background-color:#fff;color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);letter-spacing:normal;line-height:var(--line-height-default);-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;& main{& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);line-height:var(--line-height-default);&[class^=fds-]{font-family:var(--font-family-default)}}& .fds-label{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-h3);font-weight:var(--font-weight-default);line-height:var(--line-height-heading);margin-block-end:var(--margin-block-end-heading);margin-block-start:var(--margin-block-start-heading);page-break-after:avoid;page-break-inside:avoid}& .fds-table{border:1px solid var(--color-default-dark);border-radius:6px;border-spacing:0;overflow:hidden;width:100%;& tr{page-break-inside:avoid}& td,& th{padding:8px 12px;page-break-inside:avoid;&:after{content:"";display:block;height:30px;margin-bottom:-30px}}& thead{& th{background-color:var(--color-default-default);border-bottom:1px solid var(--color-border-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:500;line-height:var(--line-height-table-header);page-break-after:avoid;text-align:left;&:first-of-type{border-top-left-radius:5px}&:last-of-type{border-top-right-radius:5px}}}& tbody{& tr{&:nth-child(2n){background-color:var(--color-default-muted)}&:not(:last-of-type){& td{border-bottom:1px solid var(--color-border-default)}}&:last-of-type{& td{border-bottom:none;&:first-of-type{border-bottom-left-radius:5px}&:last-of-type{border-bottom-right-radius:5px}}}& td{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default)}}}}}& h1,& h2,& h3,& h4,& h5,& h6{color:var(--color-text-default);display:inline-block;line-height:var(--line-height-heading);margin-block-end:var(--margin-block-end-heading);margin-block-start:var(--margin-block-start-heading);page-break-after:avoid;&[class^=fds-]{font-family:var(--font-family-default)}}& h1{font-size:var(--font-size-h1);font-weight:var(--font-weight-semibold)}& h2{font-size:var(--font-size-h2)}& h2,& h3{font-weight:var(--font-weight-default)}& h3{font-size:var(--font-size-h3)}& h4{font-size:var(--font-size-h4);font-weight:var(--font-weight-semibold)}& div[data-componenttype=AttachmentList] ul{margin-top:.3em;& li{margin-bottom:0;& [class^=fds-],& a,& span{color:var(--color-text-default);cursor:default;font-family:var(--font-family-default);font-size:1.1rem;font-weight:var(--font-weight-default);line-height:var(--line-height-default);pointer-events:none}}}}@media print{html{font-size:inherit!important;& body{& .fds-label{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-h3);font-weight:var(--font-weight-default);line-height:var(--line-height-heading);margin-block-end:var(--margin-block-end-heading);margin-block-start:var(--margin-block-start-heading);page-break-after:avoid;page-break-inside:avoid}}}}@page{size:A4 portrait;margin-bottom:1.5cm;margin-left:1.25cm;margin-right:1.25cm;margin-top:1cm}#pdfView{&>h1:first-of-type{min-height:68px}&>div[data-testid=pdf-logo]{display:block;margin-bottom:0;min-height:68px;& h1{margin-top:0}& img{height:auto;position:absolute;right:0;top:0;width:85px}&:after{content:"";display:block}}}
package/dist/main.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";const e=["default"],t={dateTime:{default:{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}},date:{default:{day:"2-digit",month:"2-digit",year:"numeric"}},time:{default:{hour:"2-digit",minute:"2-digit",second:"2-digit"}}},s={dateTime:{default:"no-NO"},date:{default:"no-NO"},time:{default:"no-NO"}},n=["h1","h2","h3","h4","h5","h6"],i=["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-tiltakshaver","custom-dispensasjon","custom-gjennomfoeringsplan"];function r(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 a(e){return"number"==typeof e&&e>0}function o(e,t){for(let s in t)e.style[s]=t[s]}async function l(e){let t=e.getAttribute("texts");if(!t)return t=await function(e,t,s=200){return new Promise(((n,i)=>{const r=setTimeout((()=>{i(new Error(`Timeout: ${t} was not set within ${s}ms`))}),s);void 0===e[t]?Object.defineProperty(e,t,{set:s=>{clearTimeout(r),Object.defineProperty(e,t,{value:s}),n(s)},configurable:!0,enumerable:!0}):(clearTimeout(r),n(e[t]))}))}(e,"texts"),t;try{return JSON.parse(t)}catch(e){throw new Error("Invalid JSON")}}function d(e){const t=e?.texts?.emptyFieldText;return t||""}function m(e,t){if(!function(e){return i.includes(e)}(e))throw new Error("Invalid tag name");const s=document.createElement(e);return function(e,t){for(const s in t)e.setAttribute(s,t[s])}(s,t),s}function u(e,t){const s=document.createElement("div"),n=document.createElement("div");return n.appendChild(e),s.appendChild(n),o(s,{...r(t)?{flexGrow:"0",maxWidth:"50%",flexBasis:"50%"}:{flexBasis:"100%",maxWidth:"100%"},padding:"0.75rem 0px"}),s}function c(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 f(e){const t="true"===e.getAttribute("isChildComponent"),s=e?.parentElement?.parentElement;return t?e:s||null}function g(e,t){const s=e?.resources?.find((e=>e.id===t))?.value;return s||t}function h(e,t){const s={};for(const n in t)s[n]=g(e,t[n]);return s}function p(e,t){return t.filter((e=>!!e)).forEach((t=>{t instanceof HTMLElement?e.appendChild(t):e.innerHTML+=t})),e}function y(t){return e.includes(t)?t:"default"}function k(e){const t=new Date(e);return!!e&&!isNaN(t.getTime())}function b(e){return r(e)&&n.includes(e.toLowerCase())}class v{constructor(e){const t=this.getFormDataFromElement(e),s=this.getTextFromElement(e),n=this.getTextsFromElement(e),i=this.getInlineFromElement(e),r=this.getHideTitle(e),a=this.getSize(e),o=this.getHideIfEmpty(e),l=this.getStyleOverride(e),d=this.getIsChildComponent(e),m=this.getTableColumns(e),u=this.getFeedbackType(e),c=this.getItemKey(e),f=this.getHideOrgNr(e),g=this.getFormat(e),h=this.getShowRowNumbers(e);t&&(this.formData=t),s&&(this.text=s),n&&(this.texts=n),i&&(this.inline=i),r&&(this.hideTitle=r),a&&(this.size=a),o&&(this.hideIfEmpty=o),l&&(this.styleOverride=l),d&&(this.isChildComponent=d),m&&(this.tableColumns=m),u&&(this.feedbackType=u),c&&(this.itemKey=c),f&&(this.hideOrgNr=f),g&&(this.format=g),h&&(this.showRowNumbers=h)}getFormDataFromElement(e){const t=JSON.parse(e?.getAttribute("formdata"));return r(t)&&t}getTextFromElement(e){const t=e?.getAttribute("text");return r(t)&&t}getTextsFromElement(e){const t=JSON.parse(e?.getAttribute("texts"));return r(t)&&t}getInlineFromElement(e){return"true"===e?.getAttribute("inline")}getHideTitle(e){return"true"===e?.getAttribute("hideTitle")}getSize(e){const t=e?.getAttribute("size");return b(t)?t?.toString().toLowerCase():void 0}getHideIfEmpty(e){return"true"===e?.getAttribute("hideIfEmpty")}getStyleOverride(e){const t=JSON.parse(e?.getAttribute("styleOverride")||"{}");return r(t)&&t}getIsChildComponent(e){return"true"===e?.getAttribute("isChildComponent")}getTableColumns(e){const t=JSON.parse(e?.getAttribute("tableColumns"));return r(t)&&t}getFeedbackType(e){const t=e?.getAttribute("feedbackType");return r(t)&&t}getItemKey(e){const t=e?.getAttribute("itemKey");return r(t)&&t}getHideOrgNr(e){return"true"===e?.getAttribute("hideOrgNr")}getFormat(e){const t=e?.getAttribute("format");return r(t)&&t}getShowRowNumbers(e){return"true"===e?.getAttribute("showRowNumbers")}setFormData(e){this.formData=e}setTexts(e){this.texts=e}setText(e){this.text=e}}function x(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-divider",class extends HTMLElement{connectedCallback(){const e=new v(this),t=document.createElement("hr");o(t,e?.styleOverride),this.innerHTML="",this.appendChild(t)}}),customElements.define("custom-feedback",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=e?.formData?.simpleBinding;!s&&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=new v(this),t=f(this),s=e?.formData?.simpleBinding;if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t={inline:e?.inline,styleOverride:e?.styleOverride};this.innerHTML=function(e,t,s){s={returnHtml:!0,inline:!1,styleOverride:{},...s};const n=document.createElement("div");n.classList.add("field"),e?.length&&n.appendChild(function(e,t){const s=document.createElement("label");return s.innerText=`${e}${t?":":""}`,s}(e,s.inline)),s?.inline&&n.classList.add("inline");const i=function(e){const t=document.createElement("span");return t.innerHTML=r(e)?e:"",t}(t);return e?.length&&i.classList.add("has-title"),n.appendChild(i),o(n,{...s.styleOverride}),s.returnHtml?n.outerHTML:n}(e?.text,s,t)}}}),customElements.define("custom-header",class extends HTMLElement{connectedCallback(){const e=new v(this);this.innerHTML=function(e,t){const s=document.createElement(b(t)?t:"h2");return s.innerHTML=e,s.outerHTML}(e?.text,e?.size),o(this,e?.styleOverride)}}),customElements.define("custom-list",class extends HTMLElement{connectedCallback(){const e=new v(this);this.innerHTML=e?.text?.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 i=x(t,s,!1);return e?.length&&i.classList.add("has-title"),n.appendChild(i),n.outerHTML}(e?.text,e?.formData?.data):x(e?.formData?.data),o(this,e?.styleOverride)}}),customElements.define("custom-paragraph",class extends HTMLElement{connectedCallback(){const e=new v(this);this.innerHTML=function(e){const t=document.createElement("p");return t.innerHTML=e,t.outerHTML}(e?.text),o(this,e?.styleOverride)}});class w{constructor(e){const t=this.getFormDataAttributeFromProps(e),s=this.getTextAttributeFromProps(e),n=this.getSizeAttributeFromProps(e),i=this.getHideTitleAttributeFromProps(e),r=this.getHideIfEmptyAttributeFromProps(e),a=this.getInlineAttributeFromProps(e),o=this.getStyleOverrideAttributeFromProps(e),l=this.getGridAttributeFromProps(e),d=this.getTextsAttributeFromProps(e),m=this.getTableColumnsAttributeFromProps(e),u=this.getTextResourcesAttributeFromProps(e),c=this.getItemKeyAttributeFromProps(e),f=this.getIdAttributeFromProps(e),g=this.getFeedbackTypeAttributeFromProps(e),h=this.getHideOrgNr(e),p=this.getFormatAttributeFromProps(e),y=this.getShowRowNumbersAttributeFromProps(e);this.isChildComponent="true",t&&(this.formData=t),s&&(this.text=s),n&&(this.size=n),i&&(this.hideTitle=i),r&&(this.hideIfEmpty=r),a&&(this.inline=a),o&&(this.styleOverride=o),l&&(this.grid=l),d&&(this.texts=d),m&&(this.tableColumns=m),u&&(this.textResources=u),c&&(this.itemKey=c),f&&(this.id=f),g&&(this.feedbackType=g),h&&(this.hideOrgNr=h),p&&(this.format=p),y&&(this.showRowNumbers=y)}getFormDataAttributeFromProps(e){if(!r(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)}}getTextAttributeFromProps(e){const t=e?.text?.toString()||e?.texts?.title?.toString()||"";return e?.hideTitle?"":t}getSizeAttributeFromProps(e){return b(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}getInlineAttributeFromProps(e){return"true"===e?.inline?.toString()?"true":void 0}getStyleOverrideAttributeFromProps(e){return r(e?.styleOverride)?JSON.stringify(e?.styleOverride):void 0}getGridAttributeFromProps(e){return r(e?.grid)&&JSON.stringify(e?.grid)}getTextsAttributeFromProps(e){return r(e?.texts)&&JSON.stringify(e?.texts)}getTableColumnsAttributeFromProps(e){return r(e?.tableColumns)&&JSON.stringify(e?.tableColumns)}getTextResourcesAttributeFromProps(e){return r(e?.textResources)&&JSON.stringify(e?.textResources)}getItemKeyAttributeFromProps(e){return r(e?.itemKey)&&e?.itemKey}getIdAttributeFromProps(e){return r(e?.id)&&e?.id}getFeedbackTypeAttributeFromProps(e){return r(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 r(e?.format)&&e?.format?.toString()}getShowRowNumbersAttributeFromProps(e){return"true"===e?.showRowNumbers?.toString()?"true":void 0}}function T(e){const t=e?.formData?.data,s=e?.styleOverride,n=document.createElement("table"),i=document.createElement("thead"),r=document.createElement("tr");if(t?.tableHeaders?.length&&t?.tableRows?.length){if(e?.showRowNumbers){const t=document.createElement("th");t.textContent=function(e){const t=e?.texts?.rowNumberTitle;return t||"#"}(e),r.appendChild(t)}t.tableHeaders.forEach((e=>{r.appendChild(function(e){const t=document.createElement("th");return t.textContent=e.text,o(t,e?.props?.styleOverride),t}(e))})),i.appendChild(r),n.appendChild(i);const s=document.createElement("tbody");t.tableRows.forEach((n=>{if(e?.showRowNumbers){const e={tagName:"custom-field-data",hideTitle:!0,formData:{simpleBinding:t.tableRows.indexOf(n)+1}};n.unshift(e)}s.appendChild(function(e){const t=document.createElement("tr");return e.forEach((e=>{t.appendChild(function(e){const t=document.createElement("td"),s=new w(e);return t.innerHTML=m(e.tagName,s).outerHTML,t}(e))})),t}(n))})),n.appendChild(s)}else{const t=d(e);if(t?.length){const e=document.createElement("tr"),s=document.createElement("td");s.textContent=t,e.appendChild(s),n.appendChild(e)}}return o(n,s),n}customElements.define("custom-table",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this);if(e?.hideIfEmpty&&!e?.formData?.data&&t)t.style.display="none";else{const t=function(e,t){const s=new w({text:e,size:t});if(e)return m("custom-header",s)}(e?.text,e?.size),s=T(e);this.innerHTML="",t&&this.appendChild(t),this.appendChild(s)}}}),customElements.define("custom-feedback-data",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=e?.formData?.simpleBinding;if(!r(s)&&t)t.style.display="none";else{e.setFormData({simpleBinding:s});const t=new w(e);this.innerHTML=m("custom-feedback",t).outerHTML}}}),customElements.define("custom-feedbacklist-data",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=e?.formData?.data,n=e?.text||"Messages";!r(s)&&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),o(n);const r=document.createElement("summary");r.classList.add("feedback-summary"),r.innerHTML=e,i.appendChild(r);const a=document.createElement("div");return a.classList.add("feedback-list"),t.forEach((e=>{const t=document.createElement("div");t.classList.add("feedback-list-item");const s=new w({formData:{simpleBinding:e},feedbackType:"default"});t.appendChild(m("custom-feedback-data",s)),a.appendChild(t)})),i.appendChild(a),i.outerHTML}(n,s,e?.feedbackType,e?.styleOverride)}});class E{constructor(e){this.error=e?.error||[],this.warning=e?.warning||[],this.info=e?.info||[],this.success=e?.success||[],this.default=e?.default||[]}}function j(e,t){switch(e){case"error":return`Errors (${t})`;case"warning":return`Warnings (${t})`;case"info":return`Information (${t})`;default:return`Messages (${t})`}}customElements.define("custom-feedbacklist-validation-messages",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=new E(e?.formData?.data);!r(s)&&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 i=m("custom-feedbacklist-data",new w({formData:{data:e[s]},text:j(s,n.length),feedbackType:s}));t.appendChild(i)}})),t.outerHTML}(s)}});class B{constructor(e){this.adresselinje1=e?.adresselinje1,this.adresselinje2=e?.adresselinje2,this.adresselinje3=e?.adresselinje3,this.postnr=e?.postnr,this.poststed=e?.poststed}}customElements.define("custom-field-adresse",class extends HTMLElement{connectedCallback(){const e=new v(this),t=new B(e?.formData?.data),s=f(this);if(e?.hideIfEmpty&&!r(t)&&s)s.style.display="none";else{const s=function(e){const t=function(e){return[e.adresselinje1,e.adresselinje2,e.adresselinje3].filter((e=>e?.length)).join("\n")}(e),s=function(e){return[e.postnr,e.poststed].filter((e=>e?.length)).join(" ")}(e);return t?.length?`${t}\n${s}`:s}(t),n=d(e);e.setFormData({simpleBinding:s?.length?s:n}),n&&e.setTexts({...e?.texts,emptyFieldText:n});const i=new w(e);this.innerHTML=m("custom-field",i).outerHTML}}});class D{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(r(e?.adresse))return new B(e.adresse)}}function H(e){return r(e?.formData?.simpleBinding)?e?.format?function(e,n,i="default"){switch(n){case"dateTime":return function(e,n="default"){if(!k(e))return"Ugyldig datoformat";n=y(n),e.includes("T")||(e+="T00:00:00");const i=s.dateTime[n],r=t.dateTime[i]||t.dateTime.default;return new Intl.DateTimeFormat(i,r).format(new Date(e))}(e,i);case"date":return function(e,n="default"){if(!k(e))throw new Error("Invalid date input");n=y(n);const i=s.date[n],r=t.date[i]||t.date.default;return new Intl.DateTimeFormat(i,r).format(new Date(e))}(e,i);case"time":return function(e,n="default"){if(e.includes("T")||(e="1970-01-01T"+e),!k(e))throw new Error("Invalid time input");n=y(n);const i=s.time[n],r=t.time[i]||t.time.default;return new Intl.DateTimeFormat(i,r).format(new Date(e))}(e,i);default:return e}}(e?.formData?.simpleBinding,e?.format):e?.formData?.simpleBinding:d(e)}customElements.define("custom-field-part-navn",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=new D(e?.formData?.data);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t=function(e,t){if(!e?.navn)return"";let s=e.navn;return!t&&e.organisasjonsnummer&&(s+=`\nOrganisasjonsnummer: ${e.organisasjonsnummer}`),s}(s,e?.hideOrgNr),n=d(e);e.setFormData({simpleBinding:t?.length?t:n});const i=new w(e);this.innerHTML=m("custom-field",i).outerHTML}}}),customElements.define("custom-field-boolean-data",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=function(e){const t=e?.id?.length&&"string"==typeof e?.id?e.id:"custom-field-boolean-text",s=e?.formData?.simpleBinding,n={trueData:e?.formData?.trueData.toString(),falseData:e?.formData?.falseData.toString(),defaultData:e?.formData?.defaultData.toString()};return function(e,t,s){["trueData","falseData","defaultData"].forEach((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:""}(e);if(e?.hideIfEmpty&&!s?.length&&t)t.style.display="none";else{e.setFormData({simpleBinding:s});const t=new w(e);this.innerHTML=m("custom-field",t).outerHTML}}}),customElements.define("custom-field-boolean-text",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=await async function(e,t){const s=t?.id||"custom-field-boolean-text",n=await l(t),i={trueText:"Ja",falseText:"Nei",defaultText:""};return c(n,i,["trueText","falseText","defaultText"],s),!0===e||"true"===e?void 0!==n?.trueText&&null!==n.trueText?n.trueText:i.trueText:!1===e||"false"===e?void 0!==n?.falseText&&null!==n.falseText?n.falseText:i.falseText:n?.defaultText?n.defaultText:i.defaultText}(e?.formData?.simpleBinding,this);if(e?.hideIfEmpty&&!s?.length&&t)t.style.display="none";else{e.setFormData({simpleBinding:s});const t=new w(e);this.innerHTML=m("custom-field",t).outerHTML}}}),customElements.define("custom-field-count-data",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=function(e){return e?.formData?.data&&Array.isArray(e?.formData?.data)?e.formData.data.length:0}(e);if(e?.hideIfEmpty&&!a(s)&&t)t.style.display="none";else{const t=void 0!==e?.texts?.emptyFieldText?d(e):0;e.setFormData({simpleBinding:a(s)?s:t});const n=new w(e);this.innerHTML=m("custom-field",n).outerHTML}}}),customElements.define("custom-field-data",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this);if(e?.hideIfEmpty&&!e?.formData?.simpleBinding&&t)t.style.display="none";else{e.setFormData({simpleBinding:H(e)});const t=new w(e);this.innerHTML=m("custom-field",t).outerHTML}}});class F{constructor(e){this.saksaar=e?.saksaar,this.sakssekvensnummer=e?.sakssekvensnummer}}customElements.define("custom-field-kommunens-saksnummer",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=new F(e?.formData?.data);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t=function(e){return[e?.saksaar?.toString(),e?.sakssekvensnummer?.toString()].filter((e=>e?.length)).join("/")}(s),n=d(e);e.setFormData({simpleBinding:t?.length?t:n});const i=new w(e);this.innerHTML=m("custom-field",i).outerHTML}}});class C{constructor(e){this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}customElements.define("custom-field-prosjekt",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=new C(e?.formData?.data);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t=function(e){const t=r(e?.prosjektnr)&&`(${e.prosjektnr?.toString()})`;return[e?.prosjektnavn?.toString(),t].filter((e=>e?.length)).join(" ")}(s),n=d(e),i=t?.length?t:n;e.setFormData({simpleBinding:i});const a=new w(e);this.innerHTML=m("custom-field",a).outerHTML}}});class L{constructor(e){this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer}}customElements.define("custom-field-telefonnummer",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=new L(e?.formData?.data);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t=function(e){return[e.telefonnummer,e.mobilnummer].filter((e=>e?.length)).join("\n")}(s),n=d(e),i=t?.length?t:n;e.setFormData({simpleBinding:i});const r=new w(e);this.innerHTML=m("custom-field",r).outerHTML}}});class M{constructor(e){this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart}}customElements.define("custom-field-utfall-svar-status",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=new M(e?.formData?.data),n=await async function(e,t){const s=t.getAttribute("id"),n=await l(t),i={erUtfallBesvaresSenere:"Besvares senere",erUtfallBesvart:"Svar innsendt tidligere",status:"Besvares nå"};return c(n,i,["erUtfallBesvaresSenere","erUtfallBesvart","status"],s),e?.erUtfallBesvaresSenere?null!=n?.erUtfallBesvaresSenere?n.erUtfallBesvaresSenere:i.erUtfallBesvaresSenere:e?.erUtfallBesvart?null!=n?.erUtfallBesvart?n.erUtfallBesvart:i.erUtfallBesvart:n?.status?n.status:i.status}(s,this);if(e?.hideIfEmpty&&!n?.length&&t)t.style.display="none";else{e.setFormData({simpleBinding:n});const t=new w(e);this.innerHTML=m("custom-field",t).outerHTML}}});class I{constructor(e){this.kodebeskrivelse=e?.kodebeskrivelse}}class S{constructor(e){this.kodeverdi=e?.kodeverdi}}class O{constructor(e){this.filnavn=e?.filnavn,this.vedleggstype=e?.vedleggstype&&new I(e.vedleggstype)}}class A{constructor(e){this.vedlegg=e?.vedlegg?e.vedlegg.map((e=>new O(e))):void 0}}class N{constructor(e){this.beskrivelse=e?.beskrivelse,this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart,this.kommentar=e?.kommentar,this.tema=e?.tema?new I(e.tema):void 0,this.tittel=e?.tittel,this.utfallType=e?.utfallType?new S(e.utfallType):void 0,this.vedleggsliste=e?.vedleggsliste?new A(e.vedleggsliste):void 0}}function R(e){return m("custom-feedbacklist-validation-messages",new w({formData:{data:e}}))}function K(e,t,s=new E){for(const n in t)for(const i in t[n]){const r=t[n][i],a=e?.resources?.find((e=>e.id===r));a?""===a.value&&s.info.push(`Empty text resource with id: "${r}"`):s.error.push(`Missing text resource with id: "${r}"`)}return s}function P(e,t,s){return!Array.isArray(s)&&(s=[s]),s.map((s=>{const n=[];return e.forEach((e=>{const i=function(e,t){return t?null==e||/(\.\.|^\.)/.test(t)?void 0:t.split(/\.|\[|\]/).filter(Boolean).reduce(((e,t)=>e&&e[t]),e):e}(s,e.dataKey),a="string"==typeof i||"number"==typeof i?"simpleBinding":"data",o={[a]:i},l=t[e.emptyFieldTextResourceKey],d={...e.props,formData:o,hideTitle:!0,tagName:e.tagName};r(l)&&(d.texts={emptyFieldText:l}),n.push(d)})),n}))}customElements.define("custom-grouplist-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=(n=e?.formData?.data,r(n)?n.reduce(((e,t)=>{const s=t?.utfallType?.kodeverdi;return s?.length?(e[s]||(e[s]=[]),e[s].push(new N(t)),e):e}),{}):{});var n;if(!r(e?.formData?.data)&&t)t.style.display="none";else{const t=await l(this);e.setTexts(t);for(const n of Object.keys(s)){e.setFormData({data:s[n]}),e.setText(t[`${n?.toLowerCase()}.header`]);const i=new w(e),r=await m("custom-group-utfall-svar-type",i);this.appendChild(r)}}}}),customElements.define("custom-group-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=new v(this);if(r(e?.formData?.data)){const t=m("custom-header-text",new w({text:e?.text,size:"h2"}));this.appendChild(t);const s=new w({formData:e?.formData,texts:e?.texts}),n=await m("custom-grouplist-utfall-svar",s);this.appendChild(n)}}}),customElements.define("custom-grouplist-utfall-svar",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this);if(e?.hideIfEmpty&&!r(e?.formData?.data)&&t)t.style.display="none";else for(const t of e?.formData?.data){e.setFormData({data:t});const s=m("custom-group-utfall-svar",new w({formData:e?.formData,texts:e?.texts,hideIfEmpty:!0}));this.appendChild(s);const n=m("custom-divider");this.appendChild(n)}}}),customElements.define("custom-group-utfall-svar",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=e?.texts,n=e?.formData?.data;if(!r(n)&&t)t.style.display="none";else{const e=document.createElement("div"),t=m("custom-header-text",new w({text:n?.tittel,size:"h3"}));e.appendChild(t),e.appendChild(function(e){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.beskrivelse},hideIfEmpty:!0})))}(n)),e.appendChild(function(e,t){return u(m("custom-field-utfall-svar-status",new w({formData:{data:e},texts:t,text:t?.["status.title"]})))}(n,s)),e.appendChild(function(e,t){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.tema?.kodebeskrivelse},text:t?.["tema.kodebeskrivelse.title"],hideIfEmpty:!0})))}(n,s)),e.appendChild(function(e,t){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.kommentar},text:t?.["kommentar.title"],hideIfEmpty:!1,texts:{emptyFieldText:"-"}})))}(n,s)),e.appendChild(function(e,t){return u(m("custom-list-vedlegg",new w({formData:{data:e?.vedleggsliste?.vedlegg},text:t?.["vedleggsliste.vedlegg.title"],hideIfEmpty:!0})))}(n,s)),this.appendChild(e)}}}),customElements.define("custom-header-text",class extends HTMLElement{connectedCallback(){const e=new v(this);e?.isChildComponent||o(f(this),{padding:"0 0.75rem"});const t=new w(e);this.innerHTML=m("custom-header",t).outerHTML}}),customElements.define("custom-list-data",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=e?.itemKey?.length?(n=e?.formData?.data,i=e?.itemKey,Array.isArray(n)&&n.length?n.map((e=>e?.[i])):[]):e?.formData?.data;var n,i;const a=d(e);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else if(a?.length&&!s?.length){e.setFormData({simpleBinding:a});const t=new w(e);this.innerHTML=m("custom-field",t).outerHTML}else{e.setFormData({data:s});const t=new w(e);this.innerHTML=m("custom-list",t).outerHTML}}}),customElements.define("custom-list-vedlegg",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=(n=e?.formData?.data,n&&Array.isArray(n)&&n?.length?n.map((e=>{const t=new O(e),s=function(e){return e?.vedleggstype?.kodebeskrivelse}(t),n=function(e){return e?.filnavn}(t);return s?.length&&n?.length?`${s} (${n})`:s?.length?s:n?.length?n:null})).filter((e=>e)):[]);var n;const i=d(e);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else if(i?.length&&!s?.length){e.setFormData({simpleBinding:i});const t=new w(e);this.innerHTML=m("custom-field",t).outerHTML}else{e.setFormData({data:s});const t=new w(e);this.innerHTML=m("custom-list",t).outerHTML}}}),customElements.define("custom-paragraph-text",class extends HTMLElement{connectedCallback(){const e=new v(this),t=new w(e);this.innerHTML=m("custom-paragraph",t).outerHTML}}),customElements.define("custom-subheader-text",class extends HTMLElement{connectedCallback(){const e=new v(this),t=new w(e);this.innerHTML=m("custom-paragraph",t).outerHTML}}),customElements.define("custom-table-data",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this);if(e?.hideIfEmpty&&!e?.formData?.data&&t)t.style.display="none";else{const t=await l(this);e.setTexts(t);const s=function(e,t,s=new E){return e.forEach((e=>{void 0===t[e.titleResourceKey]?s.error.push(`Missing text resource binding with id: "${e.titleResourceKey}"`):""===t[e.titleResourceKey]&&s.info.push(`Empty text resource binding with id: "${e.titleResourceKey}"`)})),s}(e?.tableColumns,e?.texts),n=function(e){return!!e&&Object.values(e).some((e=>e.length>0))}(s),i=n&&R(s),r=function(e){var t,s;return e.setFormData({data:{tableHeaders:(t=e?.tableColumns,s=e?.texts,t.map((e=>({text:s[e.titleResourceKey],props:e.props})))),tableRows:P(e?.tableColumns,e?.texts,e?.formData?.data)}}),m("custom-table",new w(e))}(e);this.appendChild(r),i&&this.appendChild(i)}}});class ${constructor(e){this.gaardsnummer=e?.gaardsnummer,this.bruksnummer=e?.bruksnummer,this.seksjonsnummer=e?.seksjonsnummer,this.festenummer=e?.festenummer}}class V{constructor(e){this.adresse=e?.adresse&&new B(e.adresse),this.eiendomsidentifikasjon=e?.eiendomsidentifikasjon&&new $(e.eiendomsidentifikasjon),this.bolignummer=e?.bolignummer,this.bygningsnummer=e?.bygningsnummer}}const z={eiendomByggested:{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","emptyFieldText-col-1":"resource.eiendomByggested.eiendom.adresse.emptyFieldText","emptyFieldText-default":"resource.emptyFieldText.default"}};customElements.define("custom-table-eiendom",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=function(e){return r(e?.formData?.data)?e.formData.data.map((e=>new V(e))):void 0}(e),n=window.textResources,i=K(n,z);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const e=function(e,t,s){return m("custom-table-data",new w({formData:{data:e},texts:h(t,s.eiendomByggested),size:"h3",hideIfEmpty:!0,tableColumns:[{titleResourceKey:"col-1",emptyFieldTextResourceKey:"emptyFieldText-col-1",dataKey:"adresse",tagName:"custom-field-adresse",props:{styleOverride:{width:"116px"}}},{titleResourceKey:"col-2",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data"},{titleResourceKey:"col-3",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data"},{titleResourceKey:"col-4",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data"},{titleResourceKey:"col-5",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data"},{titleResourceKey:"col-6",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"bolignummer",tagName:"custom-field-data"},{titleResourceKey:"col-7",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"bygningsnummer",tagName:"custom-field-data"}]}))}(s,n,z);this.appendChild(e),this.appendChild(R(i))}}});const U={tiltakshaver:{title:"resource.tiltakshaver.header","col-1":"resource.tiltakshaver.navn.title","col-2":"resource.tiltakshaver.telefonnummer.title","col-3":"resource.tiltakshaver.epost.title","emptyFieldText-default":"resource.emptyFieldText.default"}};customElements.define("custom-table-tiltakshaver",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=function(e){return r(e?.formData?.data)&&new D(e.formData.data)}(e),n=window.textResources,i=K(n,U);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t=function(e,t,s,n="h3"){return function(e,t,s,n="h3"){return m("custom-table-data",new w({formData:{data:e},texts:h(t,s),size:n,hideIfEmpty:!0,tableColumns:[{titleResourceKey:"col-1",emptyFieldTextResourceKey:"emptyFieldText-default",tagName:"custom-field-part-navn",props:{styleOverride:{width:"250px"}}},{titleResourceKey:"col-2",emptyFieldTextResourceKey:"emptyFieldText-default",tagName:"custom-field-telefonnummer",props:{styleOverride:{width:"120px"}}},{titleResourceKey:"col-3",emptyFieldTextResourceKey:"emptyFieldText-default",tagName:"custom-field-data",dataKey:"epost",props:{styleOverride:{width:"260px"}}}]}))}(e,t,s?.tiltakshaver,n)}(s,n,U,e?.size);this.appendChild(t),this.appendChild(R(i))}}});class J{constructor(e){this.effekt=e?.effekt}}class G{constructor(e){this.effekt=e?.effekt}}class W{constructor(e){this.hensynBakBestemmelsen=e?.hensynBakBestemmelsen,this.vurderingHensynBakBestemmelsen=e?.vurderingHensynBakBestemmelsen,this.vurderingHensynOverordnet=e?.vurderingHensynOverordnet,this.fordeler=e?.fordeler&&new J(e.fordeler),this.ulemper=e?.ulemper&&new G(e.ulemper),this.samletBegrunnelse=e?.samletBegrunnelse}}class q{constructor(e){this.dispensasjonTittel=e?.dispensasjonTittel&&new I(e.dispensasjonTittel),this.inngangsbeskrivelse=e?.inngangsbeskrivelse&&new I(e.inngangsbeskrivelse),this.annenInngangsbeskrivelse=e?.annenInngangsbeskrivelse,this.beskrivelse=e?.beskrivelse}}class Q{constructor(e){this.planidentifikasjon=e?.planidentifikasjon}}class X{constructor(e){this.nummerering=e?.nummerering}}class Y{constructor(e){this.navn=e?.navn,this.nasjonalArealplanId=e?.nasjonalArealplanId&&new Q(e.nasjonalArealplanId),this.planbestemmelse=e?.planbestemmelse&&new X(e.planbestemmelse)}}class Z{constructor(e){this.bestemmelserType=e?.bestemmelserType&&new I(e.bestemmelserType),this.dispensasjonPlanBestemmelse=e?.dispensasjonPlanBestemmelse&&new Y(e.dispensasjonPlanBestemmelse),this.lovbestemmelse=e?.lovbestemmelse}}class _{constructor(e){this.eiendom=e?.eiendom&&e.eiendom.map((e=>new V(e)))}}class ee{constructor(e){this.ftbId=e?.ftbId,this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class te{constructor(e){this.koordinatsystem=e?.koordinatsystem&&new I(e.koordinatsystem),this.koordinater=e?.koordinater}}class se{constructor(e){this.posisjon=e?.posisjon&&new te(e.posisjon),this.vertikalnivaa=e?.vertikalnivaa&&new I(e.vertikalnivaa)}}class ne{constructor(e){this.oenskesVarigDispensasjon=e?.oenskesVarigDispensasjon,this.oensketVarighetTil=e?.oensketVarighetTil}}class ie{constructor(e){this.dispensasjonBeskrivelse=e?.dispensasjonBeskrivelse&&new q(e.dispensasjonBeskrivelse),this.dispensasjonReferanse=e?.dispensasjonReferanse,this.soeknadstype=e?.soeknadstype&&new I(e.soeknadstype),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new F(e.kommunensSaksnummer),this.metadata=e?.metadata&&new ee(e.metadata),this.eiendomByggested=e?.eiendomByggested&&new _(e.eiendomByggested),this.tiltakshaver=e?.tiltakshaver&&new D(e.tiltakshaver),this.dispensasjonFra=e?.dispensasjonFra&&new Z(e.dispensasjonFra),this.stedfesting=e?.stedfesting&&new se(e.stedfesting),this.varighet=e?.varighet&&new ne(e.varighet),this.begrunnelse=e?.begrunnelse&&new W(e.begrunnelse),this.generelleVilkaar=e?.generelleVilkaar}}function re(e){return["reguleringsplan","kommuneplan","kommunedelplan"].includes(e?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse?.toLowerCase())}function ae(e,t="h1"){const s=e?.dispensasjonBeskrivelse?.dispensasjonTittel?.kodebeskrivelse;return r(s)?m("custom-header-text",new w({text:s,size:t})):null}const oe={dispensasjonReferanse:{title:"resource.dispensasjon.dispensasjonReferanse.title"},metadataFtbId:{title:"resource.metadata.ftbId.title"},kommunensSaksnummer:{title:"resource.kommunensSaksnummer.title"},soeknadenGjelderHeader:{title:"resource.soeknadenGjelder.header"},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"}};customElements.define("custom-dispensasjon",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=function(e){return r(e?.formData)&&new ie(e.formData)}(e),n=window.textResources,i=K(n,oe);if(!r(s)&&t)t.style.display="none";else{const e=function(){const e=document.createElement("div");return o(e,{display:"flex",flexFlow:"wrap",justifyContent:"start",alignItems:"flex-start"}),e}(),t=ae(s),a=function(e,t,s){const n={xs:6};return u(m("custom-field-data",new w({formData:{simpleBinding:e?.dispensasjonReferanse},text:g(t,s?.dispensasjonReferanse?.title),hideIfEmpty:!0,grid:n})),n)}(s,n,oe),l=function(e,t,s){const n={xs:6};return u(m("custom-field-data",new w({formData:{simpleBinding:e?.metadata?.ftbId},text:g(t,s?.metadataFtbId?.title),hideIfEmpty:!0,grid:n})),n)}(s,n,oe),d=function(e,t,s){const n={xs:6};return u(m("custom-field-kommunens-saksnummer",new w({formData:{data:e?.kommunensSaksnummer},text:g(t,s?.kommunensSaksnummer?.title),hideIfEmpty:!0,grid:n})),n)}(s,n,oe),c=function(e,t){return m("custom-header-text",new w({text:g(e,t?.soeknadenGjelderHeader?.title),size:"h2"}))}(n,oe),f=function(e,t,s){return m("custom-table-eiendom",new w({formData:{data:e?.eiendomByggested?.eiendom},text:g(t,s?.eiendomByggested?.title),hideIfEmpty:!0}))}(s,n,oe),h=function(e,t,s){return m("custom-table-tiltakshaver",new w({formData:{data:e?.tiltakshaver},text:g(t,s?.tiltakshaver?.title),hideIfEmpty:!0}))}(s,n,oe),y=function(e,t,s){return u(m("custom-field-adresse",new w({formData:{data:e?.tiltakshaver?.adresse},text:g(t,s?.tiltakshaverAdresse?.title),hideIfEmpty:!0})))}(s,n,oe),k=ae(s,"h2"),b=function(e){return r(e?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse)||r(e?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse)?u(m("custom-field-boolean-data",new w({formData:{simpleBinding:"Annet"===e?.soeknadstype?.kodebeskrivelse,trueData:e?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse,falseData:e?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse,defaultData:e?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse},hideIfEmpty:!0}))):null}(s),v=function(e,t,s){return m("custom-field-data",new w({formData:{simpleBinding:e?.dispensasjonBeskrivelse?.beskrivelse},text:g(t,s?.dispensasjonBeskrivelseBeskrivelse?.title),hideIfEmpty:!0}))}(s,n,oe),x=function(e,t){return m("custom-header-text",new w({text:g(e,t?.dispensasjonFraHeader?.title),size:"h2"}))}(n,oe),T=function(e,t,s){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.dispensasjonFra?.dispensasjonPlanBestemmelse?.navn},text:g(t,s?.dispensasjonPlanBestemmelseNavn?.title),hideIfEmpty:!0})))}(s,n,oe),E=function(e,t,s){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.dispensasjonFra?.dispensasjonPlanBestemmelse?.nasjonalArealplanId?.planidentifikasjon},text:g(t,s?.nasjonalArealplanIdPlanIdentifikasjon?.title),hideIfEmpty:!0})))}(s,n,oe),j=function(e,t,s){const n=re(e);return u(m("custom-field-data",new w({formData:{simpleBinding:n?e?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse:e?.dispensasjonFra?.lovbestemmelse},text:g(t,s?.bestemmelserType?.title),hideIfEmpty:!0})))}(s,n,oe),B=function(e,t,s){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering},text:g(t,s?.planBestemmelseNummerering?.title),hideIfEmpty:!0})))}(s,n,oe),D=function(e,t){return m("custom-header-text",new w({text:g(e,t?.stedfestingHeader?.title),size:"h2"}))}(n,oe),H=function(e,t,s){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.stedfesting?.posisjon?.koordinatsystem?.kodebeskrivelse},text:g(t,s?.stedfestingPosisjonKoordinatsystem?.title),hideIfEmpty:!0})))}(s,n,oe),F=function(e,t,s){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.stedfesting?.posisjon?.koordinater},text:g(t,s?.stedfestingPosisjonKoordinater?.title),hideIfEmpty:!0})))}(s,n,oe),C=function(e,t,s){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.stedfesting?.vertikalnivaa?.kodebeskrivelse},text:g(t,s?.stedfestingVertikalnivaa?.title),hideIfEmpty:!0})))}(s,n,oe),L=function(e,t){return m("custom-header-text",new w({text:g(e,t?.varighetHeader?.title),size:"h2"}))}(n,oe),M=function(e,t,s){const n=e?.varighet?.oenskesVarigDispensasjon;return n?u(m("custom-paragraph-text",new w({text:g(t,s?.varighetOenskesVarigDispensasjon?.trueText)}))):r(e?.varighet?.oensketVarighetTil)?u(m("custom-field-data",new w({formData:{simpleBinding:e?.varighet?.oensketVarighetTil},text:g(t,s?.varighetOensketVarighetTil?.title),format:"date"}))):null}(s,n,oe),I=function(e,t){return m("custom-header-text",new w({text:g(e,t?.begrunnelseHeader?.title),size:"h2"}))}(n,oe),S=function(e,t,s){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.begrunnelse?.hensynBakBestemmelsen},text:g(t,s?.begrunnelseHensynBakBestemmelsen?.title),hideIfEmpty:!0})))}(s,n,oe),O=function(e,t,s){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.begrunnelse?.vurderingHensynBakBestemmelsen},text:g(t,s?.begrunnelseVurderingHensynBakBestemmelsen?.title),hideIfEmpty:!0})))}(s,n,oe),A=function(e,t,s){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.begrunnelse?.vurderingHensynOverordnet},text:g(t,s?.begrunnelseVurderingHensynOverordnet?.title),hideIfEmpty:!0})))}(s,n,oe),N=function(e,t,s){return u(m("custom-list-data",new w({formData:{data:e?.begrunnelse?.fordeler?.effekt},text:g(t,s?.begrunnelseFordeler?.title),hideIfEmpty:!0})))}(s,n,oe),K=function(e,t,s){return u(m("custom-list-data",new w({formData:{data:e?.begrunnelse?.ulemper?.effekt},text:g(t,s?.begrunnelseUlemper?.title),hideIfEmpty:!0})))}(s,n,oe),P=function(e,t,s){return u(m("custom-field-data",new w({formData:{simpleBinding:e?.begrunnelse?.samletBegrunnelse},text:g(t,s?.begrunnelseSamletBegrunnelse?.title),hideIfEmpty:!0})))}(s,n,oe),$=function(e,t){return m("custom-header-text",new w({text:g(e,t?.generelleVilkaarNorskSvenskDansk?.title),size:"h2"}))}(n,oe),V=function(e,t,s){return u(m("custom-field-boolean-text",new w({formData:{simpleBinding:e?.generelleVilkaar?.norskSvenskDansk},texts:{trueText:g(t,s?.generelleVilkaarNorskSvenskDansk?.trueText),falseText:"",defaultText:""},hideIfEmpty:!0})))}(s,n,oe),z=R(i);p(e,[t,a,l,d]),p(e,[c,f]),p(e,[h,y]),p(e,[k,b,v]),re(s)?p(e,[x,T,E,j,B]):p(e,[x,j]),p(e,[D,H,F,C]),p(e,[L,M]),p(e,[I,S,O,A,N,K,P]),p(e,[$,V]),p(e,[z]),this.appendChild(e)}}});class le{constructor(e){this.eiendomByggested=e?.eiendomByggested&&new _(e.eiendomByggested),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new F(e.kommunensSaksnummer),this.metadata=e?.metadata&&new ee(e.metadata),this.versjon=e?.versjon}}function de(e){return h(e,{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"})}const me={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 le({eiendomByggested:r(t?.eiendomByggested)?t.eiendomByggested:null,kommunensSaksnummer:r(t?.kommunensSaksnummer)?t.kommunensSaksnummer:null,metadata:r(t?.metadata)?t.metadata:null,versjon:t?.versjon?t.versjon:null})}(this),s=K(e,me),n=f(this);if(!r(t)&&n)n.style.display="none";else{const n=function(e,t){return m("custom-field-data",{formData:{simpleBinding:e?.versjon},text:g(t,"resource.gjennomfoeringsplan.versjon.title"),emptyFieldText:"(gjennomfoeringsplanNummer mangler)"})}(t,e),i=function(e,t){return m("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:de(t),styleOverride:{tableLayout:"fixed"}})}(t?.eiendomByggested?.eiendom,e),r=R(s);this.appendChild(n),this.appendChild(i),this.appendChild(r)}}}),window.addEventListener("load",(async()=>{const e=window.location.pathname.split("/"),t=window.location.origin,s=e?.[1],n=e?.[2];if(![t?.length,s?.length,n?.length].every(Boolean))return void console.error("Could not determine the origin, organization, or application from the URL.");const i=`${t}/${s}/${n}/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}/${s}/${n}/api/v1/texts/${o}`,d=await fetch(l).then((e=>e.json()));if(r(d))window.textResources=d;else{console.error("Could not retrieve text resources for the selected language.");const e=`${t}/${s}/${n}/api/v1/texts/nb`,i=await fetch(e).then((e=>e.json()));if(window.textResources=i,!r(i))return void console.error("Could not retrieve text resources for the fallback language.")}}))})();
1
+ (()=>{"use strict";const e=["default"],t={dateTime:{default:{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}},date:{default:{day:"2-digit",month:"2-digit",year:"numeric"}},time:{default:{hour:"2-digit",minute:"2-digit",second:"2-digit"}}},s={dateTime:{default:"no-NO"},date:{default:"no-NO"},time:{default:"no-NO"}},n=["h1","h2","h3","h4","h5","h6"],i=["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-tiltakshaver","custom-dispensasjon","custom-gjennomfoeringsplan"];function r(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 a(e){return"number"==typeof e&&e>0}function o(e,t){for(let s in t)e.style[s]=t[s]}async function l(e){let t=e.getAttribute("texts");if(!t)return t=await function(e,t,s=200){return new Promise(((n,i)=>{const r=setTimeout((()=>{i(new Error(`Timeout: ${t} was not set within ${s}ms`))}),s);void 0===e[t]?Object.defineProperty(e,t,{set:s=>{clearTimeout(r),Object.defineProperty(e,t,{value:s}),n(s)},configurable:!0,enumerable:!0}):(clearTimeout(r),n(e[t]))}))}(e,"texts"),t;try{return JSON.parse(t)}catch(e){throw new Error("Invalid JSON")}}function d(e){const t=e?.texts?.emptyFieldText;return t||""}function m(e,t){if(!function(e){return i.includes(e)}(e))throw new Error("Invalid tag name");const s=document.createElement(e);return function(e,t){for(const s in t)e.setAttribute(s,t[s])}(s,t),s}function u(e,t){const s=document.createElement("div"),n=document.createElement("div");return n.appendChild(e),s.appendChild(n),o(s,{...r(t)?{flexGrow:"0",maxWidth:"50%",flexBasis:"50%"}:{flexBasis:"100%",maxWidth:"100%"},padding:"0.75rem 0px"}),s}function c(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 f(e){const t="true"===e.getAttribute("isChildComponent"),s=e?.parentElement?.parentElement;return t?e:s||null}function g(e,t){const s=e?.resources?.find((e=>e.id===t))?.value;return s||t}function h(e,t){const s={};for(const n in t)s[n]=g(e,t[n]);return s}function p(e,t){return t.filter((e=>!!e)).forEach((t=>{t instanceof HTMLElement?e.appendChild(t):e.innerHTML+=t})),e}function y(t){return e.includes(t)?t:"default"}function k(e){const t=new Date(e);return!!e&&!isNaN(t.getTime())}function b(e){return r(e)&&n.includes(e.toLowerCase())}class v{constructor(e){const t=this.getFormDataFromElement(e),s=this.getTextFromElement(e),n=this.getTextsFromElement(e),i=this.getInlineFromElement(e),r=this.getHideTitle(e),a=this.getSize(e),o=this.getHideIfEmpty(e),l=this.getStyleOverride(e),d=this.getIsChildComponent(e),m=this.getTableColumns(e),u=this.getFeedbackType(e),c=this.getItemKey(e),f=this.getHideOrgNr(e),g=this.getFormat(e),h=this.getShowRowNumbers(e);t&&(this.formData=t),s&&(this.text=s),n&&(this.texts=n),i&&(this.inline=i),r&&(this.hideTitle=r),a&&(this.size=a),o&&(this.hideIfEmpty=o),l&&(this.styleOverride=l),d&&(this.isChildComponent=d),m&&(this.tableColumns=m),u&&(this.feedbackType=u),c&&(this.itemKey=c),f&&(this.hideOrgNr=f),g&&(this.format=g),h&&(this.showRowNumbers=h)}getFormDataFromElement(e){const t=JSON.parse(e?.getAttribute("formdata"));return r(t)&&t}getTextFromElement(e){const t=e?.getAttribute("text");return r(t)&&t}getTextsFromElement(e){const t=JSON.parse(e?.getAttribute("texts"));return r(t)&&t}getInlineFromElement(e){return"true"===e?.getAttribute("inline")}getHideTitle(e){return"true"===e?.getAttribute("hideTitle")}getSize(e){const t=e?.getAttribute("size");return b(t)?t?.toString().toLowerCase():void 0}getHideIfEmpty(e){return"true"===e?.getAttribute("hideIfEmpty")}getStyleOverride(e){const t=JSON.parse(e?.getAttribute("styleOverride")||"{}");return r(t)&&t}getIsChildComponent(e){return"true"===e?.getAttribute("isChildComponent")}getTableColumns(e){const t=JSON.parse(e?.getAttribute("tableColumns"));return r(t)&&t}getFeedbackType(e){const t=e?.getAttribute("feedbackType");return r(t)&&t}getItemKey(e){const t=e?.getAttribute("itemKey");return r(t)&&t}getHideOrgNr(e){return"true"===e?.getAttribute("hideOrgNr")}getFormat(e){const t=e?.getAttribute("format");return r(t)&&t}getShowRowNumbers(e){return"true"===e?.getAttribute("showRowNumbers")}setFormData(e){this.formData=e}setTexts(e){this.texts=e}setText(e){this.text=e}}function x(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-divider",class extends HTMLElement{connectedCallback(){const e=new v(this),t=document.createElement("hr");o(t,e?.styleOverride),this.innerHTML="",this.appendChild(t)}}),customElements.define("custom-feedback",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=e?.formData?.simpleBinding;!s&&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=new v(this),t=f(this),s=e?.formData?.simpleBinding;if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t={inline:e?.inline,styleOverride:e?.styleOverride};this.innerHTML=function(e,t,s){s={returnHtml:!0,inline:!1,styleOverride:{},...s};const n=document.createElement("div");n.classList.add("field"),e?.length&&n.appendChild(function(e,t){const s=document.createElement("label");return s.innerText=`${e}${t?":":""}`,s}(e,s.inline)),s?.inline&&n.classList.add("inline");const i=function(e){const t=document.createElement("span");return t.innerHTML=r(e)?e:"",t}(t);return e?.length&&i.classList.add("has-title"),n.appendChild(i),o(n,{...s.styleOverride}),s.returnHtml?n.outerHTML:n}(e?.text,s,t)}}}),customElements.define("custom-header",class extends HTMLElement{connectedCallback(){const e=new v(this);this.innerHTML=function(e,t){const s=document.createElement(b(t)?t:"h2");return s.innerHTML=e,s.outerHTML}(e?.text,e?.size),o(this,e?.styleOverride)}}),customElements.define("custom-list",class extends HTMLElement{connectedCallback(){const e=new v(this);this.innerHTML=e?.text?.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 i=x(t,s,!1);return e?.length&&i.classList.add("has-title"),n.appendChild(i),n.outerHTML}(e?.text,e?.formData?.data):x(e?.formData?.data),o(this,e?.styleOverride)}}),customElements.define("custom-paragraph",class extends HTMLElement{connectedCallback(){const e=new v(this);this.innerHTML=function(e){const t=document.createElement("p");return t.innerHTML=e,t.outerHTML}(e?.text),o(this,e?.styleOverride)}});class T{constructor(e){const t=this.getFormDataAttributeFromProps(e),s=this.getTextAttributeFromProps(e),n=this.getSizeAttributeFromProps(e),i=this.getHideTitleAttributeFromProps(e),r=this.getHideIfEmptyAttributeFromProps(e),a=this.getInlineAttributeFromProps(e),o=this.getStyleOverrideAttributeFromProps(e),l=this.getGridAttributeFromProps(e),d=this.getTextsAttributeFromProps(e),m=this.getTableColumnsAttributeFromProps(e),u=this.getTextResourcesAttributeFromProps(e),c=this.getItemKeyAttributeFromProps(e),f=this.getIdAttributeFromProps(e),g=this.getFeedbackTypeAttributeFromProps(e),h=this.getHideOrgNr(e),p=this.getFormatAttributeFromProps(e),y=this.getShowRowNumbersAttributeFromProps(e);this.isChildComponent="true",t&&(this.formData=t),s&&(this.text=s),n&&(this.size=n),i&&(this.hideTitle=i),r&&(this.hideIfEmpty=r),a&&(this.inline=a),o&&(this.styleOverride=o),l&&(this.grid=l),d&&(this.texts=d),m&&(this.tableColumns=m),u&&(this.textResources=u),c&&(this.itemKey=c),f&&(this.id=f),g&&(this.feedbackType=g),h&&(this.hideOrgNr=h),p&&(this.format=p),y&&(this.showRowNumbers=y)}getFormDataAttributeFromProps(e){if(!r(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)}}getTextAttributeFromProps(e){const t=e?.text?.toString()||e?.texts?.title?.toString()||"";return e?.hideTitle?"":t}getSizeAttributeFromProps(e){return b(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}getInlineAttributeFromProps(e){return"true"===e?.inline?.toString()?"true":void 0}getStyleOverrideAttributeFromProps(e){return r(e?.styleOverride)?JSON.stringify(e?.styleOverride):void 0}getGridAttributeFromProps(e){return r(e?.grid)&&JSON.stringify(e?.grid)}getTextsAttributeFromProps(e){return r(e?.texts)&&JSON.stringify(e?.texts)}getTableColumnsAttributeFromProps(e){return r(e?.tableColumns)&&JSON.stringify(e?.tableColumns)}getTextResourcesAttributeFromProps(e){return r(e?.textResources)&&JSON.stringify(e?.textResources)}getItemKeyAttributeFromProps(e){return r(e?.itemKey)&&e?.itemKey}getIdAttributeFromProps(e){return r(e?.id)&&e?.id}getFeedbackTypeAttributeFromProps(e){return r(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 r(e?.format)&&e?.format?.toString()}getShowRowNumbersAttributeFromProps(e){return"true"===e?.showRowNumbers?.toString()?"true":void 0}}function w(e){const t=e?.formData?.data,s=e?.styleOverride,n=document.createElement("table"),i=document.createElement("thead"),r=document.createElement("tr");if(t?.tableHeaders?.length&&t?.tableRows?.length){if(e?.showRowNumbers){const t=document.createElement("th");t.textContent=function(e){const t=e?.texts?.rowNumberTitle;return t||"#"}(e),r.appendChild(t)}t.tableHeaders.forEach((e=>{r.appendChild(function(e){const t=document.createElement("th");return t.textContent=e.text,o(t,e?.props?.styleOverride),t}(e))})),i.appendChild(r),n.appendChild(i);const s=document.createElement("tbody");t.tableRows.forEach((n=>{if(e?.showRowNumbers){const e={tagName:"custom-field-data",hideTitle:!0,formData:{simpleBinding:t.tableRows.indexOf(n)+1}};n.unshift(e)}s.appendChild(function(e){const t=document.createElement("tr");return e.forEach((e=>{t.appendChild(function(e){const t=document.createElement("td"),s=new T(e);return t.innerHTML=m(e.tagName,s).outerHTML,t}(e))})),t}(n))})),n.appendChild(s)}else{const t=d(e);if(t?.length){const e=document.createElement("tr"),s=document.createElement("td");s.textContent=t,e.appendChild(s),n.appendChild(e)}}return o(n,s),n}customElements.define("custom-table",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this);if(e?.hideIfEmpty&&!e?.formData?.data&&t)t.style.display="none";else{const t=function(e,t){const s=new T({text:e,size:t});if(e)return m("custom-header",s)}(e?.text,e?.size),s=w(e);this.innerHTML="",t&&this.appendChild(t),this.appendChild(s)}}}),customElements.define("custom-feedback-data",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=e?.formData?.simpleBinding;if(!r(s)&&t)t.style.display="none";else{e.setFormData({simpleBinding:s});const t=new T(e);this.innerHTML=m("custom-feedback",t).outerHTML}}}),customElements.define("custom-feedbacklist-data",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=e?.formData?.data,n=e?.text||"Messages";!r(s)&&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),o(n);const r=document.createElement("summary");r.classList.add("feedback-summary"),r.innerHTML=e,i.appendChild(r);const a=document.createElement("div");return a.classList.add("feedback-list"),t.forEach((e=>{const t=document.createElement("div");t.classList.add("feedback-list-item");const s=new T({formData:{simpleBinding:e},feedbackType:"default"});t.appendChild(m("custom-feedback-data",s)),a.appendChild(t)})),i.appendChild(a),i.outerHTML}(n,s,e?.feedbackType,e?.styleOverride)}});class E{constructor(e){this.error=e?.error||[],this.warning=e?.warning||[],this.info=e?.info||[],this.success=e?.success||[],this.default=e?.default||[]}}function j(e,t){switch(e){case"error":return`Errors (${t})`;case"warning":return`Warnings (${t})`;case"info":return`Information (${t})`;default:return`Messages (${t})`}}customElements.define("custom-feedbacklist-validation-messages",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=new E(e?.formData?.data);!r(s)&&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 i=m("custom-feedbacklist-data",new T({formData:{data:e[s]},text:j(s,n.length),feedbackType:s}));t.appendChild(i)}})),t.outerHTML}(s)}});class B{constructor(e){this.adresselinje1=e?.adresselinje1,this.adresselinje2=e?.adresselinje2,this.adresselinje3=e?.adresselinje3,this.postnr=e?.postnr,this.poststed=e?.poststed}}customElements.define("custom-field-adresse",class extends HTMLElement{connectedCallback(){const e=new v(this),t=new B(e?.formData?.data),s=f(this);if(e?.hideIfEmpty&&!r(t)&&s)s.style.display="none";else{const s=function(e){const t=function(e){return[e.adresselinje1,e.adresselinje2,e.adresselinje3].filter((e=>e?.length)).join("\n")}(e),s=function(e){return[e.postnr,e.poststed].filter((e=>e?.length)).join(" ")}(e);return t?.length?`${t}\n${s}`:s}(t),n=d(e);e.setFormData({simpleBinding:s?.length?s:n}),n&&e.setTexts({...e?.texts,emptyFieldText:n});const i=new T(e);this.innerHTML=m("custom-field",i).outerHTML}}});class D{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(r(e?.adresse))return new B(e.adresse)}}function F(e){return r(e?.formData?.simpleBinding)?e?.format?function(e,n,i="default"){switch(n){case"dateTime":return function(e,n="default"){if(!k(e))return"Ugyldig datoformat";n=y(n),e.includes("T")||(e+="T00:00:00");const i=s.dateTime[n],r=t.dateTime[i]||t.dateTime.default;return new Intl.DateTimeFormat(i,r).format(new Date(e))}(e,i);case"date":return function(e,n="default"){if(!k(e))throw new Error("Invalid date input");n=y(n);const i=s.date[n],r=t.date[i]||t.date.default;return new Intl.DateTimeFormat(i,r).format(new Date(e))}(e,i);case"time":return function(e,n="default"){if(e.includes("T")||(e="1970-01-01T"+e),!k(e))throw new Error("Invalid time input");n=y(n);const i=s.time[n],r=t.time[i]||t.time.default;return new Intl.DateTimeFormat(i,r).format(new Date(e))}(e,i);default:return e}}(e?.formData?.simpleBinding,e?.format):e?.formData?.simpleBinding:d(e)}customElements.define("custom-field-part-navn",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=new D(e?.formData?.data);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t=function(e,t){if(!e?.navn)return"";let s=e.navn;return!t&&e.organisasjonsnummer&&(s+=`\nOrganisasjonsnummer: ${e.organisasjonsnummer}`),s}(s,e?.hideOrgNr),n=d(e);e.setFormData({simpleBinding:t?.length?t:n});const i=new T(e);this.innerHTML=m("custom-field",i).outerHTML}}}),customElements.define("custom-field-boolean-data",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=function(e){const t=e?.id?.length&&"string"==typeof e?.id?e.id:"custom-field-boolean-text",s=e?.formData?.simpleBinding,n={trueData:e?.formData?.trueData.toString(),falseData:e?.formData?.falseData.toString(),defaultData:e?.formData?.defaultData.toString()};return function(e,t,s){["trueData","falseData","defaultData"].forEach((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:""}(e);if(e?.hideIfEmpty&&!s?.length&&t)t.style.display="none";else{e.setFormData({simpleBinding:s});const t=new T(e);this.innerHTML=m("custom-field",t).outerHTML}}}),customElements.define("custom-field-boolean-text",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=await async function(e,t){const s=t?.id||"custom-field-boolean-text",n=await l(t),i={trueText:"Ja",falseText:"Nei",defaultText:""};return c(n,i,["trueText","falseText","defaultText"],s),!0===e||"true"===e?void 0!==n?.trueText&&null!==n.trueText?n.trueText:i.trueText:!1===e||"false"===e?void 0!==n?.falseText&&null!==n.falseText?n.falseText:i.falseText:n?.defaultText?n.defaultText:i.defaultText}(e?.formData?.simpleBinding,this);if(e?.hideIfEmpty&&!s?.length&&t)t.style.display="none";else{e.setFormData({simpleBinding:s});const t=new T(e);this.innerHTML=m("custom-field",t).outerHTML}}}),customElements.define("custom-field-count-data",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=function(e){return e?.formData?.data&&Array.isArray(e?.formData?.data)?e.formData.data.length:0}(e);if(e?.hideIfEmpty&&!a(s)&&t)t.style.display="none";else{const t=void 0!==e?.texts?.emptyFieldText?d(e):0;e.setFormData({simpleBinding:a(s)?s:t});const n=new T(e);this.innerHTML=m("custom-field",n).outerHTML}}}),customElements.define("custom-field-data",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this);if(e?.hideIfEmpty&&!e?.formData?.simpleBinding&&t)t.style.display="none";else{e.setFormData({simpleBinding:F(e)});const t=new T(e);this.innerHTML=m("custom-field",t).outerHTML}}});class H{constructor(e){this.saksaar=e?.saksaar,this.sakssekvensnummer=e?.sakssekvensnummer}}customElements.define("custom-field-kommunens-saksnummer",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=new H(e?.formData?.data);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t=function(e){return[e?.saksaar?.toString(),e?.sakssekvensnummer?.toString()].filter((e=>e?.length)).join("/")}(s),n=d(e);e.setFormData({simpleBinding:t?.length?t:n});const i=new T(e);this.innerHTML=m("custom-field",i).outerHTML}}});class C{constructor(e){this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}customElements.define("custom-field-prosjekt",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=new C(e?.formData?.data);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t=function(e){const t=r(e?.prosjektnr)&&`(${e.prosjektnr?.toString()})`;return[e?.prosjektnavn?.toString(),t].filter((e=>e?.length)).join(" ")}(s),n=d(e),i=t?.length?t:n;e.setFormData({simpleBinding:i});const a=new T(e);this.innerHTML=m("custom-field",a).outerHTML}}});class L{constructor(e){this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer}}customElements.define("custom-field-telefonnummer",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=new L(e?.formData?.data);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t=function(e){return[e.telefonnummer,e.mobilnummer].filter((e=>e?.length)).join("\n")}(s),n=d(e),i=t?.length?t:n;e.setFormData({simpleBinding:i});const r=new T(e);this.innerHTML=m("custom-field",r).outerHTML}}});class M{constructor(e){this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart}}customElements.define("custom-field-utfall-svar-status",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=new M(e?.formData?.data),n=await async function(e,t){const s=t.getAttribute("id"),n=await l(t),i={erUtfallBesvaresSenere:"Besvares senere",erUtfallBesvart:"Svar innsendt tidligere",status:"Besvares nå"};return c(n,i,["erUtfallBesvaresSenere","erUtfallBesvart","status"],s),e?.erUtfallBesvaresSenere?null!=n?.erUtfallBesvaresSenere?n.erUtfallBesvaresSenere:i.erUtfallBesvaresSenere:e?.erUtfallBesvart?null!=n?.erUtfallBesvart?n.erUtfallBesvart:i.erUtfallBesvart:n?.status?n.status:i.status}(s,this);if(e?.hideIfEmpty&&!n?.length&&t)t.style.display="none";else{e.setFormData({simpleBinding:n});const t=new T(e);this.innerHTML=m("custom-field",t).outerHTML}}});class I{constructor(e){this.kodebeskrivelse=e?.kodebeskrivelse}}class S{constructor(e){this.kodeverdi=e?.kodeverdi}}class A{constructor(e){this.filnavn=e?.filnavn,this.vedleggstype=e?.vedleggstype&&new I(e.vedleggstype)}}class O{constructor(e){this.vedlegg=e?.vedlegg?e.vedlegg.map((e=>new A(e))):void 0}}class N{constructor(e){this.beskrivelse=e?.beskrivelse,this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart,this.kommentar=e?.kommentar,this.tema=e?.tema?new I(e.tema):void 0,this.tittel=e?.tittel,this.utfallType=e?.utfallType?new S(e.utfallType):void 0,this.vedleggsliste=e?.vedleggsliste?new O(e.vedleggsliste):void 0}}function K(e){return m("custom-feedbacklist-validation-messages",new T({formData:{data:e}}))}function R(e,t,s=new E){for(const n in t)for(const i in t[n]){const r=t[n][i],a=e?.resources?.find((e=>e.id===r));a?""===a.value&&s.info.push(`Empty text resource with id: "${r}"`):s.error.push(`Missing text resource with id: "${r}"`)}return s}function P(e,t,s){return!Array.isArray(s)&&(s=[s]),s.map((s=>{const n=[];return e.forEach((e=>{const i=function(e,t){return t?null==e||/(\.\.|^\.)/.test(t)?void 0:t.split(/\.|\[|\]/).filter(Boolean).reduce(((e,t)=>e&&e[t]),e):e}(s,e.dataKey),a="string"==typeof i||"number"==typeof i?"simpleBinding":"data",o={[a]:i},l=t[e.emptyFieldTextResourceKey],d={...e.props,formData:o,hideTitle:!0,tagName:e.tagName};r(l)&&(d.texts={emptyFieldText:l}),n.push(d)})),n}))}customElements.define("custom-grouplist-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=(n=e?.formData?.data,r(n)?n.reduce(((e,t)=>{const s=t?.utfallType?.kodeverdi;return s?.length?(e[s]||(e[s]=[]),e[s].push(new N(t)),e):e}),{}):{});var n;if(!r(e?.formData?.data)&&t)t.style.display="none";else{const t=await l(this);e.setTexts(t);for(const n of Object.keys(s)){e.setFormData({data:s[n]}),e.setText(t[`${n?.toLowerCase()}.header`]);const i=new T(e),r=await m("custom-group-utfall-svar-type",i);this.appendChild(r)}}}}),customElements.define("custom-group-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=new v(this);if(r(e?.formData?.data)){const t=m("custom-header-text",new T({text:e?.text,size:"h2"}));this.appendChild(t);const s=new T({formData:e?.formData,texts:e?.texts}),n=await m("custom-grouplist-utfall-svar",s);this.appendChild(n)}}}),customElements.define("custom-grouplist-utfall-svar",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this);if(e?.hideIfEmpty&&!r(e?.formData?.data)&&t)t.style.display="none";else for(const t of e?.formData?.data){e.setFormData({data:t});const s=m("custom-group-utfall-svar",new T({formData:e?.formData,texts:e?.texts,hideIfEmpty:!0}));this.appendChild(s);const n=m("custom-divider");this.appendChild(n)}}}),customElements.define("custom-group-utfall-svar",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=e?.texts,n=e?.formData?.data;if(!r(n)&&t)t.style.display="none";else{const e=document.createElement("div"),t=m("custom-header-text",new T({text:n?.tittel,size:"h3"}));e.appendChild(t),e.appendChild(function(e){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.beskrivelse},hideIfEmpty:!0})))}(n)),e.appendChild(function(e,t){return u(m("custom-field-utfall-svar-status",new T({formData:{data:e},texts:t,text:t?.["status.title"]})))}(n,s)),e.appendChild(function(e,t){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.tema?.kodebeskrivelse},text:t?.["tema.kodebeskrivelse.title"],hideIfEmpty:!0})))}(n,s)),e.appendChild(function(e,t){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.kommentar},text:t?.["kommentar.title"],hideIfEmpty:!1,texts:{emptyFieldText:"-"}})))}(n,s)),e.appendChild(function(e,t){return u(m("custom-list-vedlegg",new T({formData:{data:e?.vedleggsliste?.vedlegg},text:t?.["vedleggsliste.vedlegg.title"],hideIfEmpty:!0})))}(n,s)),this.appendChild(e)}}}),customElements.define("custom-header-text",class extends HTMLElement{connectedCallback(){const e=new v(this);e?.isChildComponent||o(f(this),{padding:"0 0.75rem"});const t=new T(e);this.innerHTML=m("custom-header",t).outerHTML}}),customElements.define("custom-list-data",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=e?.itemKey?.length?(n=e?.formData?.data,i=e?.itemKey,Array.isArray(n)&&n.length?n.map((e=>e?.[i])):[]):e?.formData?.data;var n,i;const a=d(e);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else if(a?.length&&!s?.length){e.setFormData({simpleBinding:a});const t=new T(e);this.innerHTML=m("custom-field",t).outerHTML}else{e.setFormData({data:s});const t=new T(e);this.innerHTML=m("custom-list",t).outerHTML}}}),customElements.define("custom-list-vedlegg",class extends HTMLElement{connectedCallback(){const e=new v(this),t=f(this),s=(n=e?.formData?.data,n&&Array.isArray(n)&&n?.length?n.map((e=>{const t=new A(e),s=function(e){return e?.vedleggstype?.kodebeskrivelse}(t),n=function(e){return e?.filnavn}(t);return s?.length&&n?.length?`${s} (${n})`:s?.length?s:n?.length?n:null})).filter((e=>e)):[]);var n;const i=d(e);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else if(i?.length&&!s?.length){e.setFormData({simpleBinding:i});const t=new T(e);this.innerHTML=m("custom-field",t).outerHTML}else{e.setFormData({data:s});const t=new T(e);this.innerHTML=m("custom-list",t).outerHTML}}}),customElements.define("custom-paragraph-text",class extends HTMLElement{connectedCallback(){const e=new v(this),t=new T(e);this.innerHTML=m("custom-paragraph",t).outerHTML}}),customElements.define("custom-subheader-text",class extends HTMLElement{connectedCallback(){const e=new v(this),t=new T(e);this.innerHTML=m("custom-paragraph",t).outerHTML}}),customElements.define("custom-table-data",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this);if(e?.hideIfEmpty&&!e?.formData?.data&&t)t.style.display="none";else{const t=await l(this);e.setTexts(t);const s=function(e,t,s=new E){return e.forEach((e=>{void 0===t[e.titleResourceKey]?s.error.push(`Missing text resource binding with id: "${e.titleResourceKey}"`):""===t[e.titleResourceKey]&&s.info.push(`Empty text resource binding with id: "${e.titleResourceKey}"`)})),s}(e?.tableColumns,e?.texts),n=function(e){return!!e&&Object.values(e).some((e=>e.length>0))}(s),i=n&&K(s),r=function(e){var t,s;return e.setFormData({data:{tableHeaders:(t=e?.tableColumns,s=e?.texts,t.map((e=>({text:s[e.titleResourceKey],props:e.props})))),tableRows:P(e?.tableColumns,e?.texts,e?.formData?.data)}}),m("custom-table",new T(e))}(e);this.appendChild(r),i&&this.appendChild(i)}}});class ${constructor(e){this.gaardsnummer=e?.gaardsnummer,this.bruksnummer=e?.bruksnummer,this.seksjonsnummer=e?.seksjonsnummer,this.festenummer=e?.festenummer}}class z{constructor(e){this.adresse=e?.adresse&&new B(e.adresse),this.eiendomsidentifikasjon=e?.eiendomsidentifikasjon&&new $(e.eiendomsidentifikasjon),this.bolignummer=e?.bolignummer,this.bygningsnummer=e?.bygningsnummer}}const V={eiendomByggested:{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","emptyFieldText-col-1":"resource.eiendomByggested.eiendom.adresse.emptyFieldText","emptyFieldText-default":"resource.emptyFieldText.default"}};customElements.define("custom-table-eiendom",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=function(e){return r(e?.formData?.data)?e.formData.data.map((e=>new z(e))):void 0}(e),n=window.textResources,i=R(n,V);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const e=function(e,t,s){return m("custom-table-data",new T({formData:{data:e},texts:h(t,s.eiendomByggested),size:"h3",hideIfEmpty:!0,tableColumns:[{titleResourceKey:"col-1",emptyFieldTextResourceKey:"emptyFieldText-col-1",dataKey:"adresse",tagName:"custom-field-adresse",props:{styleOverride:{width:"116px"}}},{titleResourceKey:"col-2",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data"},{titleResourceKey:"col-3",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data"},{titleResourceKey:"col-4",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data"},{titleResourceKey:"col-5",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data"},{titleResourceKey:"col-6",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"bolignummer",tagName:"custom-field-data"},{titleResourceKey:"col-7",emptyFieldTextResourceKey:"emptyFieldText-default",dataKey:"bygningsnummer",tagName:"custom-field-data"}]}))}(s,n,V);this.appendChild(e),this.appendChild(K(i))}}});const U={tiltakshaver:{title:"resource.tiltakshaver.header","col-1":"resource.tiltakshaver.navn.title","col-2":"resource.tiltakshaver.telefonnummer.title","col-3":"resource.tiltakshaver.epost.title","emptyFieldText-default":"resource.emptyFieldText.default"}};customElements.define("custom-table-tiltakshaver",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=function(e){return r(e?.formData?.data)&&new D(e.formData.data)}(e),n=window.textResources,i=R(n,U);if(e?.hideIfEmpty&&!r(s)&&t)t.style.display="none";else{const t=function(e,t,s,n="h3"){return function(e,t,s,n="h3"){return m("custom-table-data",new T({formData:{data:e},texts:h(t,s),size:n,hideIfEmpty:!0,tableColumns:[{titleResourceKey:"col-1",emptyFieldTextResourceKey:"emptyFieldText-default",tagName:"custom-field-part-navn"},{titleResourceKey:"col-2",emptyFieldTextResourceKey:"emptyFieldText-default",tagName:"custom-field-telefonnummer"},{titleResourceKey:"col-3",emptyFieldTextResourceKey:"emptyFieldText-default",tagName:"custom-field-data",dataKey:"epost"}]}))}(e,t,s?.tiltakshaver,n)}(s,n,U,e?.size);this.appendChild(t),this.appendChild(K(i))}}});class J{constructor(e){this.effekt=e?.effekt}}class G{constructor(e){this.effekt=e?.effekt}}class W{constructor(e){this.hensynBakBestemmelsen=e?.hensynBakBestemmelsen,this.vurderingHensynBakBestemmelsen=e?.vurderingHensynBakBestemmelsen,this.vurderingHensynOverordnet=e?.vurderingHensynOverordnet,this.fordeler=e?.fordeler&&new J(e.fordeler),this.ulemper=e?.ulemper&&new G(e.ulemper),this.samletBegrunnelse=e?.samletBegrunnelse}}class q{constructor(e){this.dispensasjonTittel=e?.dispensasjonTittel&&new I(e.dispensasjonTittel),this.inngangsbeskrivelse=e?.inngangsbeskrivelse&&new I(e.inngangsbeskrivelse),this.annenInngangsbeskrivelse=e?.annenInngangsbeskrivelse,this.beskrivelse=e?.beskrivelse}}class Q{constructor(e){this.planidentifikasjon=e?.planidentifikasjon}}class X{constructor(e){this.nummerering=e?.nummerering}}class Y{constructor(e){this.navn=e?.navn,this.nasjonalArealplanId=e?.nasjonalArealplanId&&new Q(e.nasjonalArealplanId),this.planbestemmelse=e?.planbestemmelse&&new X(e.planbestemmelse)}}class Z{constructor(e){this.bestemmelserType=e?.bestemmelserType&&new I(e.bestemmelserType),this.dispensasjonPlanBestemmelse=e?.dispensasjonPlanBestemmelse&&new Y(e.dispensasjonPlanBestemmelse),this.lovbestemmelse=e?.lovbestemmelse}}class _{constructor(e){this.eiendom=e?.eiendom&&e.eiendom.map((e=>new z(e)))}}class ee{constructor(e){this.ftbId=e?.ftbId,this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class te{constructor(e){const t=e?this.getTypeFromProps(e):null;t&&(this.type=t)}getTypeFromProps(e){return e&&r(e?.type)?{kode:this.getKodeFromType(e.type)}:null}getKodeFromType(e){return Array.isArray(e?.kode)&&e?.kode?.length?e?.kode?.map((e=>new I(e))):null}}class se{constructor(e){this.koordinatsystem=e?.koordinatsystem&&new I(e.koordinatsystem),this.koordinater=e?.koordinater}}class ne{constructor(e){this.posisjon=e?.posisjon&&new se(e.posisjon),this.vertikalnivaa=e?.vertikalnivaa&&new I(e.vertikalnivaa)}}class ie{constructor(e){this.oenskesVarigDispensasjon=e?.oenskesVarigDispensasjon,this.oensketVarighetTil=e?.oensketVarighetTil}}class re{constructor(e){this.dispensasjonBeskrivelse=e?.dispensasjonBeskrivelse&&new q(e.dispensasjonBeskrivelse),this.dispensasjonReferanse=e?.dispensasjonReferanse,this.soeknadstype=e?.soeknadstype&&new I(e.soeknadstype),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new H(e.kommunensSaksnummer),this.metadata=e?.metadata&&new ee(e.metadata),this.eiendomByggested=e?.eiendomByggested&&new _(e.eiendomByggested),this.soeknadGjelder=e?.soeknadGjelder&&new te(e.soeknadGjelder),this.tiltakshaver=e?.tiltakshaver&&new D(e.tiltakshaver),this.dispensasjonFra=e?.dispensasjonFra&&new Z(e.dispensasjonFra),this.stedfesting=e?.stedfesting&&new ne(e.stedfesting),this.varighet=e?.varighet&&new ie(e.varighet),this.begrunnelse=e?.begrunnelse&&new W(e.begrunnelse),this.generelleVilkaar=e?.generelleVilkaar}}function ae(e){return["reguleringsplan","kommuneplan","kommunedelplan"].includes(e?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse?.toLowerCase())}function oe(e,t="h1"){const s=e?.dispensasjonBeskrivelse?.dispensasjonTittel?.kodebeskrivelse;return r(s)?m("custom-header-text",new T({text:s,size:t})):null}const le={dispensasjonReferanse:{title:"resource.dispensasjon.dispensasjonReferanse.title"},metadataFtbId:{title:"resource.metadata.ftbId.title"},kommunensSaksnummer:{title:"resource.kommunensSaksnummer.title"},soeknadGjelderHeader:{title:"resource.soeknadGjelder.header"},soeknadGjelderTypeHeader:{title:"resource.soeknadGjelder.type.header"},soeknadGjelderTypeKode:{title:"resource.soeknadGjelder.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"}};customElements.define("custom-dispensasjon",class extends HTMLElement{async connectedCallback(){const e=new v(this),t=f(this),s=function(e){return r(e?.formData)&&new re(e.formData)}(e),n=window.textResources,i=R(n,le);if(!r(s)&&t)t.style.display="none";else{const e=function(){const e=document.createElement("div");return o(e,{display:"flex",flexFlow:"wrap",justifyContent:"start",alignItems:"flex-start"}),e}(),t=oe(s),a=function(e,t,s){const n={xs:6};return u(m("custom-field-data",new T({formData:{simpleBinding:e?.dispensasjonReferanse},text:g(t,s?.dispensasjonReferanse?.title),hideIfEmpty:!0,grid:n})),n)}(s,n,le),l=function(e,t,s){const n={xs:6};return u(m("custom-field-data",new T({formData:{simpleBinding:e?.metadata?.ftbId},text:g(t,s?.metadataFtbId?.title),hideIfEmpty:!0,grid:n})),n)}(s,n,le),d=function(e,t,s){const n={xs:6};return u(m("custom-field-kommunens-saksnummer",new T({formData:{data:e?.kommunensSaksnummer},text:g(t,s?.kommunensSaksnummer?.title),hideIfEmpty:!0,grid:n})),n)}(s,n,le),c=function(e,t){return m("custom-header-text",new T({text:g(e,t?.soeknadGjelderHeader?.title),size:"h2"}))}(n,le),f=function(e,t,s){return m("custom-table-eiendom",new T({formData:{data:e?.eiendomByggested?.eiendom},text:g(t,s?.eiendomByggested?.title),hideIfEmpty:!0}))}(s,n,le),h=function(e,t){return e?.soeknadGjelder?.type?.kode?.length>0?m("custom-header-text",new T({text:g(t,undefined),size:"h3"})):null}(n,le),y=function(e,t,s){return u(m("custom-list-data",new T({formData:{data:e?.soeknadGjelder?.type?.kode},text:g(t,s?.soeknadGjelderTypeKode?.title),hideIfEmpty:!0,itemKey:"kodebeskrivelse"})))}(s,n,le),k=function(e,t,s){return m("custom-table-tiltakshaver",new T({formData:{data:e?.tiltakshaver},text:g(t,s?.tiltakshaver?.title),hideIfEmpty:!0}))}(s,n,le),b=function(e,t,s){return u(m("custom-field-adresse",new T({formData:{data:e?.tiltakshaver?.adresse},text:g(t,s?.tiltakshaverAdresse?.title),hideIfEmpty:!0})))}(s,n,le),v=oe(s,"h2"),x=function(e){return r(e?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse)||r(e?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse)?u(m("custom-field-boolean-data",new T({formData:{simpleBinding:"Annet"===e?.soeknadstype?.kodebeskrivelse,trueData:e?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse,falseData:e?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse,defaultData:e?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse},hideIfEmpty:!0}))):null}(s),w=function(e,t,s){return m("custom-field-data",new T({formData:{simpleBinding:e?.dispensasjonBeskrivelse?.beskrivelse},text:g(t,s?.dispensasjonBeskrivelseBeskrivelse?.title),hideIfEmpty:!0}))}(s,n,le),E=function(e,t){return m("custom-header-text",new T({text:g(e,t?.dispensasjonFraHeader?.title),size:"h2"}))}(n,le),j=function(e,t,s){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.dispensasjonFra?.dispensasjonPlanBestemmelse?.navn},text:g(t,s?.dispensasjonPlanBestemmelseNavn?.title),hideIfEmpty:!0})))}(s,n,le),B=function(e,t,s){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.dispensasjonFra?.dispensasjonPlanBestemmelse?.nasjonalArealplanId?.planidentifikasjon},text:g(t,s?.nasjonalArealplanIdPlanIdentifikasjon?.title),hideIfEmpty:!0})))}(s,n,le),D=function(e,t,s){const n=ae(e);return u(m("custom-field-data",new T({formData:{simpleBinding:n?e?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse:e?.dispensasjonFra?.lovbestemmelse},text:g(t,s?.bestemmelserType?.title),hideIfEmpty:!0})))}(s,n,le),F=function(e,t,s){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering},text:g(t,s?.planBestemmelseNummerering?.title),hideIfEmpty:!0})))}(s,n,le),H=function(e,t){return m("custom-header-text",new T({text:g(e,t?.stedfestingHeader?.title),size:"h2"}))}(n,le),C=function(e,t,s){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.stedfesting?.posisjon?.koordinatsystem?.kodebeskrivelse},text:g(t,s?.stedfestingPosisjonKoordinatsystem?.title),hideIfEmpty:!0})))}(s,n,le),L=function(e,t,s){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.stedfesting?.posisjon?.koordinater},text:g(t,s?.stedfestingPosisjonKoordinater?.title),hideIfEmpty:!0})))}(s,n,le),M=function(e,t,s){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.stedfesting?.vertikalnivaa?.kodebeskrivelse},text:g(t,s?.stedfestingVertikalnivaa?.title),hideIfEmpty:!0})))}(s,n,le),I=function(e,t){return m("custom-header-text",new T({text:g(e,t?.varighetHeader?.title),size:"h2"}))}(n,le),S=function(e,t,s){const n=e?.varighet?.oenskesVarigDispensasjon;return n?u(m("custom-paragraph-text",new T({text:g(t,s?.varighetOenskesVarigDispensasjon?.trueText)}))):r(e?.varighet?.oensketVarighetTil)?u(m("custom-field-data",new T({formData:{simpleBinding:e?.varighet?.oensketVarighetTil},text:g(t,s?.varighetOensketVarighetTil?.title),format:"date"}))):null}(s,n,le),A=function(e,t){return m("custom-header-text",new T({text:g(e,t?.begrunnelseHeader?.title),size:"h2"}))}(n,le),O=function(e,t,s){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.begrunnelse?.hensynBakBestemmelsen},text:g(t,s?.begrunnelseHensynBakBestemmelsen?.title),hideIfEmpty:!0})))}(s,n,le),N=function(e,t,s){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.begrunnelse?.vurderingHensynBakBestemmelsen},text:g(t,s?.begrunnelseVurderingHensynBakBestemmelsen?.title),hideIfEmpty:!0})))}(s,n,le),R=function(e,t,s){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.begrunnelse?.vurderingHensynOverordnet},text:g(t,s?.begrunnelseVurderingHensynOverordnet?.title),hideIfEmpty:!0})))}(s,n,le),P=function(e,t,s){return u(m("custom-list-data",new T({formData:{data:e?.begrunnelse?.fordeler?.effekt},text:g(t,s?.begrunnelseFordeler?.title),hideIfEmpty:!0})))}(s,n,le),$=function(e,t,s){return u(m("custom-list-data",new T({formData:{data:e?.begrunnelse?.ulemper?.effekt},text:g(t,s?.begrunnelseUlemper?.title),hideIfEmpty:!0})))}(s,n,le),z=function(e,t,s){return u(m("custom-field-data",new T({formData:{simpleBinding:e?.begrunnelse?.samletBegrunnelse},text:g(t,s?.begrunnelseSamletBegrunnelse?.title),hideIfEmpty:!0})))}(s,n,le),V=function(e,t){return m("custom-header-text",new T({text:g(e,t?.generelleVilkaarNorskSvenskDansk?.title),size:"h2"}))}(n,le),U=function(e,t,s){return u(m("custom-field-boolean-text",new T({formData:{simpleBinding:e?.generelleVilkaar?.norskSvenskDansk},texts:{trueText:g(t,s?.generelleVilkaarNorskSvenskDansk?.trueText),falseText:"",defaultText:""},hideIfEmpty:!0})))}(s,n,le),J=K(i);p(e,[t,a,l,d]),p(e,[c,f,h,y]),p(e,[k,b]),p(e,[v,x,w]),ae(s)?p(e,[E,j,B,D,F]):p(e,[E,D]),p(e,[H,C,L,M]),p(e,[I,S]),p(e,[A,O,N,R,P,$,z]),p(e,[V,U]),p(e,[J]),this.appendChild(e)}}});class de{constructor(e){this.eiendomByggested=e?.eiendomByggested&&new _(e.eiendomByggested),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new H(e.kommunensSaksnummer),this.metadata=e?.metadata&&new ee(e.metadata),this.versjon=e?.versjon}}function me(e){return h(e,{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"})}const ue={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 de({eiendomByggested:r(t?.eiendomByggested)?t.eiendomByggested:null,kommunensSaksnummer:r(t?.kommunensSaksnummer)?t.kommunensSaksnummer:null,metadata:r(t?.metadata)?t.metadata:null,versjon:t?.versjon?t.versjon:null})}(this),s=R(e,ue),n=f(this);if(!r(t)&&n)n.style.display="none";else{const n=function(e,t){return m("custom-field-data",{formData:{simpleBinding:e?.versjon},text:g(t,"resource.gjennomfoeringsplan.versjon.title"),emptyFieldText:"(gjennomfoeringsplanNummer mangler)"})}(t,e),i=function(e,t){return m("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:me(t),styleOverride:{tableLayout:"fixed"}})}(t?.eiendomByggested?.eiendom,e),r=K(s);this.appendChild(n),this.appendChild(i),this.appendChild(r)}}}),window.addEventListener("load",(async()=>{const e=window.location.pathname.split("/"),t=window.location.origin,s=e?.[1],n=e?.[2];if(![t?.length,s?.length,n?.length].every(Boolean))return void console.error("Could not determine the origin, organization, or application from the URL.");const i=`${t}/${s}/${n}/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}/${s}/${n}/api/v1/texts/${o}`,d=await fetch(l).then((e=>e.json()));if(r(d))window.textResources=d;else{console.error("Could not retrieve text resources for the selected language.");const e=`${t}/${s}/${n}/api/v1/texts/nb`,i=await fetch(e).then((e=>e.json()));if(window.textResources=i,!r(i))return void console.error("Could not retrieve text resources for the fallback language.")}}))})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkitektum/altinn-studio-custom-components",
3
- "version": "9.4.0",
3
+ "version": "9.5.1",
4
4
  "description": "Custom components for Altinn Studio",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/main.js",