jupiter-dynamic-forms 1.22.1 → 1.22.3
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/core/dynamic-form.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-form.d.ts","sourceRoot":"","sources":["../../src/core/dynamic-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAE5D,OAAO,EACL,cAAc,EACd,QAAQ,EAGR,SAAS,EACT,eAAe,EAOf,gBAAgB,EAIhB,qBAAqB,EAEtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAUrD,OAAO,gBAAgB,CAAC;AACxB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,6BAA6B,CAAC;AACrC,OAAO,kBAAkB,CAAC;AAE1B,qBACa,kBAAmB,SAAQ,UAAU;IACpB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,MAAM,EAAE,eAAe,CAAM;IAC7B,WAAW,EAAE,QAAQ,CAAM;IAC1B,QAAQ,UAAS;IACjB,QAAQ,UAAS;IAK9C,kBAAkB,UAAS;IAO3B,cAAc,UAAS;IAOvB,kBAAkB,UAAS;IACC,eAAe,SAAgB;IAC/B,aAAa,SAAgB;IAC7B,QAAQ,SAAQ;IAChB,iBAAiB,SAAQ;IAOzB,YAAY,SAAM;IAClB,OAAO,EAAE,WAAW,GAAG,WAAW,CAAe;IACjD,IAAI,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,CAAe;IAEnF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAM3B,cAAc,EAAE,gBAAgB,EAAE,C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;IAI5B,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,sBAAsB;IAa9B,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,oBAAoB;IAiB5B,OAAO,CAAC,wBAAwB;IAyBhC,OAAO,CAAC,WAAW;IA2BnB,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,oBAAoB;IA8D5B,OAAO,CAAC,wBAAwB;IA0DnB,eAAe,CAC1B,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EAKpD,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,MAAM,CAAC,EAAE,qBAAqB,CAAA;KAAE,EAMvD,QAAQ,CAAC,EAAE,MAAM,EAOjB,cAAc,CAAC,EAAE,MAAM,EAMvB,IAAI,CAAC,EAAE,MAAM,EAOb,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,GACtC,OAAO,CAAC,IAAI,CAAC;IA6VhB,MAAM;CAyQP"}
|
package/dist/index.js
CHANGED
|
@@ -3898,7 +3898,7 @@ const I={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:x},w=(e=I,t,
|
|
|
3898
3898
|
@click="${this._handleClearAdvancedFilters}"
|
|
3899
3899
|
>${E.t("filter.showAll")}</button>
|
|
3900
3900
|
</div>
|
|
3901
|
-
`}_handleClearAdvancedFilters(){const e=this._lastFocusedFieldIdentity;this._showFactsOnly=!1,this._conceptSearchText="",this.updateComplete.then(async()=>{var t;const i=Array.from((null==(t=this.shadowRoot)?void 0:t.querySelectorAll("jupiter-form-section"))??[]);await Promise.all(i.map(e=>e.updateComplete));const o=i.flatMap(e=>{var t;return Array.from((null==(t=e.shadowRoot)?void 0:t.querySelectorAll("jupiter-concept-tree"))??[])});await Promise.all(o.map(e=>e.updateComplete)),this._scrollActiveRoleIntoView(),e&&this._restoreFieldFocus(e)})}_effectiveNumberLocale(){return this.numberLocale||("nl"===this.language?"nl-NL":"en-US")}_amountScaleFactor(){if("INF"===this.decimals||void 0===this.decimals||null===this.decimals)return null;const e=parseFloat(this.decimals);return isNaN(e)||e<=0?null:Math.pow(10,e)}_amountScaleCaption(){const e=this._amountScaleFactor();if(null===e)return E.t("section.amountScaleBase");const t=new Intl.NumberFormat(this._effectiveNumberLocale()).format(e);return E.t("section.amountScaleFactor",{factor:t})}_sectionHasMonetaryConcepts(e){return e.some(e=>{var t;return(null==(t=e.type)?void 0:t.toLowerCase().includes("monetary"))||e.children&&this._sectionHasMonetaryConcepts(e.children)})}_scrollActiveRoleIntoView(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector(".side-panel-roles-list .side-panel-role-item.active");null==t||t.scrollIntoView({block:"center"})}_restoreFieldFocus(e){var t,i,o,r;const n=(null==(t=this.shadowRoot)?void 0:t.querySelectorAll("jupiter-form-section"))??[];for(const a of Array.from(n)){const t=(null==(i=a.shadowRoot)?void 0:i.querySelectorAll("jupiter-concept-tree"))??[];for(const i of Array.from(t)){const t=(null==(o=i.shadowRoot)?void 0:o.querySelectorAll("jupiter-form-field"))??[];for(const i of Array.from(t))if(i.conceptId===e.conceptId&&i.columnId===e.columnId){const e=null==(r=i.shadowRoot)?void 0:r.querySelector('input:not([type="hidden"]), select, textarea');return void(null==e||e.focus({preventScroll:!0}))}}}}_handleFilterRolesClick(){this._showFilterDialog=!0}_handleAdvancedFilterApply(e){this._showFactsOnly=e.detail.showFactsOnly,this._conceptSearchText=e.detail.conceptSearchText??"",this._showFilterDialog=!1}_handleFilterDialogCancel(){this._showFilterDialog=!1;this._getRoleIdsArray().length;this._allSections.length}_handleFormulaValidationDialogCancel(){this._showFormulaValidationDialog=!1}_handleFormulaConceptClick(e){this._showFormulaValidationDialog=!1,this.scrollToConcept(e.detail.conceptQName,void 0,void 0,e.detail.columnId,e.detail.conceptId)}_handleRoleFilterApply(e){const{selectedRoleIds:t,periodPreferences:i}=e.detail;this._applyRoleSelection(t,i,"filterDialog")}_applyRoleSelection(e,t,i){var o,r;this._selectedRoleIds,this._selectedRoleIds=e,this._periodPreferences=t,this._selectedRoleIds,this._periodPreferences;const n=this._generateSubmissionData(),a=this._draftStorageService.createMetadataSnapshot(this.periodStartDate,this.periodEndDate,this.language,this._selectedRoleIds,this._allSections,this._typedMemberData,this._periodPreferences,this._periodData,this._unitData,this.reportingLanguage,this._repeatCounts,this._decimalsData,void 0,this._getHiddenColumnsForMetadata(),this._totalManuallyEditedData);this._draftStorageService.saveDraft(n,a),this.dynaformsFacts=n,this.dynaformsMetadata=a,this._skipPeriodPreferencesRestore=!0,this._skipDraftLoading=!0,this._initializeForm(),this._skipDraftLoading=!1,this._skipPeriodPreferencesRestore=!1,null==(o=this._currentSchema)||o.sections.length,null==(r=this._currentSchema)||r.sections.map(e=>e.id);const s=this._loadDraftIfExists().then(()=>{this._seedAutoSaveBaseline()}).catch(e=>{console.error("❌ Error restoring form data after reinitialization:",e)});this._showFilterDialog=!1;const l=Array.isArray(this._selectedRoleIds)&&this._selectedRoleIds.length>0?(this._selectedRoleIds[0],this._selectedRoleIds.length):0;return this._allSections.length,this._selectedRoleIds,this.dispatchEvent(new CustomEvent("roles-filter-changed",{detail:{selectedRoleIds:e,totalRoles:this._allSections.length,visibleRoles:l,periodPreferences:t,source:i},bubbles:!0})),s}_confirmRevealHiddenRole(e){var t;return null==(t=this._revealRolePrompt)||t.resolve(!1),new Promise(t=>{this._revealRolePrompt={section:e,resolve:t}})}_settleRevealRolePrompt(e){const t=this._revealRolePrompt;this._revealRolePrompt=null,null==t||t.resolve(e)}_revealRole(e){var t;const i=this._selectedRoleIds;let o;if(i.length>0&&"object"==typeof i[0]){const r=i,n=Math.max(-1,...r.map(e=>e.order))+1;o=[...r,{roleId:e.id,roleURI:(null==(t=e.metadata)?void 0:t.roleURI)||"",order:n}]}else o=[...i,e.id];return this._applyRoleSelection(o,this._periodPreferences,"scrollToConcept")}_haveDimensionSelectionsChanged(e){var t;const i=new Set([...Object.keys(this._periodPreferences||{}),...Object.keys(e||{})]);for(const o of i){const i=null==(t=this._periodPreferences)?void 0:t[o],r=null==e?void 0:e[o],n=(null==i?void 0:i.dimensionSelections)||[],a=(null==r?void 0:r.dimensionSelections)||[];if(JSON.stringify(n.sort((e,t)=>e.dimensionId.localeCompare(t.dimensionId)))!==JSON.stringify(a.sort((e,t)=>e.dimensionId.localeCompare(t.dimensionId))))return!0}return!1}_validateForm(){var e;const t=[],i=this._currentSchema;if(i){for(const o of i.sections)for(const i of o.concepts)for(const o of i.fields){const r=null==(e=this._formData[i.id])?void 0:e[o.columnId],n=$.validateField(o.id,i.id,o.columnId,r,o.type,o.validation||[]);t.push(...n)}t.push(...Array.from(this._calculationWarnings.values())),this._errors=t,this._valid=0===t.filter(e=>"error"===e.severity).length}}_handleCalculationMismatchChanged(e){const{key:t,mismatch:i}=e.detail,o=new Map(this._calculationWarnings);i?o.set(t,{fieldId:`${i.totalConceptId}__${i.columnId}`,conceptId:i.totalConceptId,columnId:i.columnId,message:i.message,severity:"warning",rule:{type:"custom",message:i.message,severity:"warning"},details:i}):o.delete(t),this._calculationWarnings=o,this._validateForm()}_writeFormDataValue(e,t,i){const o={...this._formData};o[e]||(o[e]={});const r=o[e][t];return o[e]={...o[e],[t]:i},this._formData=o,r}_handleFieldChange(e){const{fieldId:t,conceptId:i,columnId:o,value:r}=e.detail,n=this._writeFormDataValue(i,o,r);this._formData[i],this._touched.add(`${i}-${o}`),this._dirty=!0,this.hasUnsavedChanges=!0,this._validateForm(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("field-change",{detail:{fieldId:t,conceptId:i,columnId:o,value:r,oldValue:n},bubbles:!0}))}_handlePeriodChange(e){e.detail;const{conceptId:t,columnId:i,periodType:o,periodStartDate:r,periodEndDate:n,periodInstantDate:a,unit:s}=e.detail,l={...this._periodData};l[t]||(l[t]={}),l[t]={...l[t],[i]:{startDate:r,endDate:n,instantDate:a}},this._periodData=l,this._periodData[t][i],JSON.stringify(this._periodData,null,2),s&&this._storeUnit(t,i,s),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate()}_handleUnitChange(e){e.detail;const{conceptId:t,columnId:i,unit:o}=e.detail;this._storeUnit(t,i,o),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate()}_storeUnit(e,t,i){JSON.stringify(this._unitData,null,2);const o={...this._unitData};o[e]||(o[e]={}),o[e]={...o[e],[t]:i},this._unitData=o,this._unitData[e][t],JSON.stringify(this._unitData,null,2)}_handleDecimalsChange(e){const{conceptId:t,columnId:i,decimals:o}=e.detail;t&&i&&(this._storeDecimals(t,i,o),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate())}_computeEffectiveMasterData(){const e="rj-i_DocumentIntendedRoundingLevel";if("INF"!==this.decimals){const t=parseFloat(this.decimals);if(!isNaN(t))return void(this._effectiveMasterData={...this.masterData||{},[e]:String(-t)})}this._effectiveMasterData=this.masterData?{...this.masterData}:void 0}_initializeGlobalDecimalsFromRoundingData(){if(this._hasValidGlobalDecimals())return;const e=this._findRoundingLevelFactValue(this._allSections)??this._findRoundingLevelValueInFormData(this._formData);if(null==e||""===e)return;const t=parseFloat(String(e));isNaN(t)||(this.decimals=String(Math.abs(t)))}_findRoundingLevelValueInFormData(e){if(e)for(const t of Object.keys(e)){if(!this._isRoundingLevelConcept(t))continue;const i=e[t]||{};for(const e of Object.keys(i)){const t=i[e];if(null!=t&&""!==t)return t}}}_findRoundingLevelFactValue(e){for(const t of e){const e=this._findRoundingLevelFactValueInConcepts(t.concepts||[]);if(null!=e&&""!==e)return e}}_findRoundingLevelFactValueInConcepts(e){for(const t of e){const e=t.originalConceptId||t.id;if(this._isRoundingLevelConcept(e)){const e=t.facts||[];for(const t of e)if(void 0!==(null==t?void 0:t.value)&&null!==(null==t?void 0:t.value)&&""!==(null==t?void 0:t.value))return t.value}if(t.children&&t.children.length>0){const e=this._findRoundingLevelFactValueInConcepts(t.children);if(null!=e&&""!==e)return e}}}_hasValidGlobalDecimals(){if(void 0===this.decimals||null===this.decimals)return!1;if("INF"===this.decimals)return!1;const e=parseFloat(this.decimals);return!isNaN(e)}_isRoundingLevelConcept(e){return!!e&&("rj-i_DocumentIntendedRoundingLevel"===e||e.includes("DocumentIntendedRoundingLevel"))}_findFactValueForField(e,t,i){var o,r;if(!e.facts||0===e.facts.length)return;const n=this._findColumnByIdInSection(t.columnId,i),a=null==(o=this._periodData[e.id])?void 0:o[t.columnId],s=(null==a?void 0:a.startDate)||(null==n?void 0:n.periodStartDate)||t.periodStartDate||this.periodStartDate,l=(null==a?void 0:a.endDate)||(null==n?void 0:n.periodEndDate)||t.periodEndDate||this.periodEndDate,d=(null==a?void 0:a.instantDate)||t.periodInstantDate||l||s,c=null==(r=this._unitData[e.id])?void 0:r[t.columnId],p={conceptId:e.originalConceptId||t.conceptId||e.id,columnId:t.columnId,periodStartDate:s,periodEndDate:l,periodInstantDate:d,periodType:t.periodType,unit:c,dimensionData:null==n?void 0:n.dimensionData},u=De.findMatchingFact(e.facts,p);return null==u?void 0:u.value}_storeDecimals(e,t,i){const o={...this._decimalsData};o[e]||(o[e]={}),o[e]={...o[e],[t]:i??""},this._decimalsData=o}_generateUniqueConceptKey(e,t){return`${e}::${t}`}_extractOriginalConceptId(e){const t=e.split("::");return t.length>1?t[1]:e}_handleAddConceptRepeat(e){const{conceptId:t}=e.detail;this._repeatCounts={...this._repeatCounts,[t]:(this._repeatCounts[t]||0)+1},this._dirty=!0,this.hasUnsavedChanges=!0}_handleRemoveConceptRepeat(e){const{conceptId:t}=e.detail,i=t.match(/^(.+)__repeat_(\d+)$/),o=i?i[1]:t,r=i?parseInt(i[2]):this._repeatCounts[t]||0,n=this._repeatCounts[o]||0;if(n<=0||r<1||r>n)return;const a={...this._formData},s={...this._typedMemberData},l={...this._unitData},d={...this._periodData};for(let u=r;u<n;u++){const e=`${o}__repeat_${u+1}`,t=`${o}__repeat_${u}`;void 0!==a[e]?a[t]=a[e]:delete a[t];const i=`${t}__`,r=`${e}__`,n=Object.keys(s).filter(e=>e.startsWith(r));Object.keys(s).filter(e=>e.startsWith(i)).forEach(e=>delete s[e]),n.forEach(e=>{s[`${t}__${e.slice(r.length)}`]=s[e]}),n.forEach(e=>delete s[e]),void 0!==l[e]?l[t]=l[e]:delete l[t],void 0!==d[e]?d[t]=d[e]:delete d[t]}const c=`${o}__repeat_${n}`;delete a[c],delete l[c],delete d[c];const p=`${c}__`;Object.keys(s).filter(e=>e.startsWith(p)).forEach(e=>delete s[e]),this._formData=a,this._typedMemberData=s,this._unitData=l,this._periodData=d,this._repeatCounts={...this._repeatCounts,[o]:n-1},this._dirty=!0,this.hasUnsavedChanges=!0}_scopedColumnKey(e,t){return`${e}__${t}`}_handleTypedMemberChange(e){const{columnId:t,axisId:i,value:o,conceptId:r,sectionId:n}=e.detail,a=r?`${r}__${t}`:n?this._scopedColumnKey(n,t):t,s={...this._typedMemberData};s[a]||(s[a]={}),s[a]={...s[a],[i]:o},this._typedMemberData=s,this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("typed-member-change",{detail:{columnId:t,axisId:i,value:o},bubbles:!0}))}_handleFieldBlur(e){var t;e.detail;const{fieldId:i,conceptId:o,columnId:r,xbrlValidationErrors:n}=e.detail;let a="";const s=e.composedPath();s.length;for(const l of s){const e=l;if("JUPITER-FORM-SECTION"===e.tagName){a=e.getAttribute("section-id")||"";break}}if(n&&n.length,n&&n.length>0){const e=(null==(t=this._formData[o])?void 0:t[r])||"",s=this._xbrlFormErrors.findIndex(e=>e.fieldId===i&&e.sectionId===a),l={sectionId:a,fieldId:i,conceptId:o,columnId:r,value:e,errors:n};this._xbrlFormErrors=s>=0?[...this._xbrlFormErrors.slice(0,s),l,...this._xbrlFormErrors.slice(s+1)]:[...this._xbrlFormErrors,l]}else{this._xbrlFormErrors.length;this._xbrlFormErrors=this._xbrlFormErrors.filter(e=>!(e.fieldId===i&&e.sectionId===a)),this._xbrlFormErrors.length}this._xbrlFormErrors.length,this._xbrlFormErrors}_getSectionTitle(e){this._allSections.map(e=>({id:e.id,title:e.title}));const t=this._allSections.find(t=>t.id===e),i=(null==t?void 0:t.title)||e||"(Unknown Section)";return i}_roleHasErrors(e){return this._xbrlFormErrors.some(t=>t.sectionId===e)}async _handleErrorFieldClick(e,t,i){this._showErrorPopup=!1,this.requestUpdate(),await this._focusFormField(e,t,i)}async _handleTypedDimensionFactClick(e,t,i){this._showTypedDimensionWarning=!1,this.requestUpdate(),await this._focusFormField(e,t,i)}async _focusFormField(e,t,i){var o,r,n,a,s,l,d;if(await this.updateComplete,!(null==(o=this._currentSchema)?void 0:o.sections.some(e=>e.id===i))){const e=this._allSections.find(e=>e.id===i);if(!e||!(await this._confirmRevealHiddenRole(e)))return;await this._revealRole(e)}(null==(r=this._hiddenColumnIds.get(i))?void 0:r.has(t))&&(this._showColumn(i,t),await this.updateComplete),"sidePanel"===this.display&&this._activeSidePanelRoleId!==i&&(this._activeSidePanelRoleId,this._activeSidePanelRoleId=i,this.requestUpdate(),await this.updateComplete,this._scrollActiveRoleIntoView(),await new Promise(e=>setTimeout(e,500)));const c=null==(n=this.shadowRoot)?void 0:n.querySelectorAll("jupiter-form-section");let p=null;if(null==c||c.forEach(e=>{var t;(null==(t=e.section)?void 0:t.id)===i&&(p=e)}),!p)return void console.warn(`⚠️ Section not found: ${i}`);if(await p.updateComplete,await(null==(a=p.revealConcept)?void 0:a.call(p,e))&&await Promise.all(Array.from((null==(s=p.shadowRoot)?void 0:s.querySelectorAll("jupiter-concept-tree"))??[]).map(e=>e.updateComplete)),await new Promise(e=>setTimeout(e,100)),p.shadowRoot,p.shadowRoot){null==(l=p.shadowRoot.innerHTML)||l.length;const e=p.shadowRoot.querySelectorAll("*");e.length;Array.from(e).filter(e=>{const t=e;return!(!t.tagName||!t.tagName.includes("-"))}).map(e=>e.tagName).join(", ")}const u=`${e}_${t}_field`,h=null==(d=p.shadowRoot)?void 0:d.querySelectorAll("jupiter-concept-tree");let m=null;if(null==h||h.length,h&&h.forEach((i,o)=>{var r;if(m)return;const n=null==(r=i.shadowRoot)?void 0:r.querySelectorAll("jupiter-form-field");null==n||n.length,null==n||n.forEach((i,o)=>{var r;if(!m&&(i.conceptId,i.columnId,i.conceptId===e&&i.columnId===t)){const e=null==(r=i.shadowRoot)?void 0:r.querySelector("input, textarea");e&&(m=e)}})}),!m)return void console.warn(`⚠️ Input field not found for: ${u}`);const f=m;p.scrollIntoView({behavior:"smooth",block:"start"}),await new Promise(e=>setTimeout(e,300)),f.focus(),"INPUT"!==f.tagName&&"TEXTAREA"!==f.tagName||f.select(),f.style.boxShadow="0 0 0 3px rgba(220, 38, 38, 0.5)",setTimeout(()=>{f.style.boxShadow=""},2e3)}_handleSectionExpand(e){this.dispatchEvent(new CustomEvent("section-expand",{detail:e.detail,bubbles:!0}))}_handleConceptExpand(e){this.dispatchEvent(new CustomEvent("concept-expand",{detail:e.detail,bubbles:!0}))}_handleColumnRemove(e){const{columnId:t,sectionId:i}=e.detail;if(this._currentSchema&&i){const e=this._currentSchema.sections.find(e=>e.id===i);e&&e.columns&&(e.columns=e.columns.filter(e=>e.id!==t))}else this._columns=this._columns.filter(e=>e.id!==t),this._currentSchema&&this._currentSchema.sections.forEach(e=>{e.columns&&(e.columns=e.columns.filter(e=>e.id!==t))});this._removeColumnData(t,i),this._dirty=!0,this.hasUnsavedChanges=!0,this._validateForm(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-remove",{detail:{columnId:t,sectionId:i},bubbles:!0}))}_handleColumnHide(e){const{columnId:t,sectionId:i}=e.detail;i&&t&&(this._hiddenColumnIds.has(i)||this._hiddenColumnIds.set(i,new Set),this._hiddenColumnIds.get(i).add(t),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-hide",{detail:{columnId:t,sectionId:i},bubbles:!0})))}_handleColumnShow(e){const{columnId:t,sectionId:i}=e.detail;i&&t&&this._showColumn(i,t)}_showColumn(e,t){var i;null==(i=this._hiddenColumnIds.get(e))||i.delete(t),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-show",{detail:{columnId:t,sectionId:e},bubbles:!0}))}_getColumnsWithHiddenFlags(e){const t=e.columns||this._columns,i=this._hiddenColumnIds.get(e.id);return i&&0!==i.size?t.map(e=>i.has(e.id)?{...e,hidden:!0}:e):t}_getHiddenColumnsForMetadata(){if(0===this._hiddenColumnIds.size)return;const e={};return this._hiddenColumnIds.forEach((t,i)=>{t.size>0&&(e[i]=Array.from(t))}),Object.keys(e).length>0?e:void 0}_handleColumnAddRequest(e){const{sectionId:t,columnRequest:i,insertAfterColumnId:o}=e.detail;this._addColumnFromRequest(i,t,o)}_getAvailableDimensionsForSection(e){var t,i,o;if(!(null==(i=null==(t=this.xbrlInput)?void 0:t.hypercubes)?void 0:i[0]))return[];const r=this.xbrlInput.hypercubes[0].roles.find(t=>t.roleId===e);if(!(null==(o=null==r?void 0:r.items)?void 0:o.length))return[];const n=[],a=this.language||"en",s=(e,t)=>{var i;return(null==(i=(null==e?void 0:e.find(e=>e.lang===a&&"http://www.xbrl.org/2003/role/label"===e.role))||(null==e?void 0:e.find(e=>"en"===e.lang&&"http://www.xbrl.org/2003/role/label"===e.role))||(null==e?void 0:e.find(e=>"http://www.xbrl.org/2003/role/label"===e.role)))?void 0:i.label)||t};return r.items.forEach(e=>{e.dimensions&&e.dimensions.length>0&&e.dimensions.forEach(e=>{if(!n.find(t=>t.id===e.id)){const t=s(e.labels,e.conceptName),i={id:e.id,conceptName:e.conceptName,axisLabel:t};e.members&&e.members.length>0&&(i.members=e.members.map(e=>({id:e.id,label:s(e.labels,e.conceptName||e.id)}))),e.typedMember&&(i.typedMember={id:e.typedMember.id,dataType:e.typedMember.type||"string",validation:e.typedMember.validation}),n.push(i)}})}),n}_formatPeriodDisplay(e,t){if(!e||!t)return`${e||""} / ${t||""}`;const i=e.substring(0,4);return i===t.substring(0,4)?i:`${e} / ${t}`}_resolveSubmissionInstantDate(e,t,i,o){const r=this._getEffectivePeriodRole(e);if(null==r?void 0:r.includes("periodStartLabel")){const e=(null==i?void 0:i.startDate)||(null==o?void 0:o.periodStartDate)||t.periodStartDate||this.periodStartDate,n=(null==i?void 0:i.endDate)||(null==o?void 0:o.periodEndDate)||t.periodEndDate||this.periodEndDate;return this._resolveInstantDate(r,void 0,e,n)}return(null==i?void 0:i.instantDate)||(null==i?void 0:i.endDate)||t.periodInstantDate||(null==o?void 0:o.periodEndDate)||t.periodEndDate||t.periodStartDate||this.periodStartDate}_getEffectivePeriodRole(e){return e.effectivePeriodRole??e.preferredLabel}_resolveInstantDate(e,t,i,o){if(null==e?void 0:e.includes("periodStartLabel")){const e=i||"2025-01-01";try{const t=new Date(e);return t.setDate(t.getDate()-1),t.toISOString().split("T")[0]}catch{return e}}return t||o||i||"2025-01-01"}_correctLegacyPeriodStartInstantDates(){this._allSections.forEach(e=>{this._correctPeriodStartInstantDatesInConcepts(e.concepts,e)})}_correctPeriodStartInstantDatesInConcepts(e,t){e.forEach(e=>{var i,o;(null==(i=this._getEffectivePeriodRole(e))?void 0:i.includes("periodStartLabel"))&&"instant"===e.periodType&&(null==(o=e.fields)?void 0:o.length)&&e.fields.forEach(i=>{this._correctFieldPeriodStartInstantDate(e,i,e.id,t);const o=this._repeatCounts[e.id]||0;for(let r=1;r<=o;r++)this._correctFieldPeriodStartInstantDate(e,i,`${e.id}__repeat_${r}`,t)}),e.children&&this._correctPeriodStartInstantDatesInConcepts(e.children,t)})}_correctFieldPeriodStartInstantDate(e,t,i,o){var r;const n=this._findColumnByIdInSection(t.columnId,o),a=null==(r=this._periodData[i])?void 0:r[t.columnId],s=(null==a?void 0:a.startDate)||(null==n?void 0:n.periodStartDate)||t.periodStartDate||this.periodStartDate,l=(null==a?void 0:a.endDate)||(null==n?void 0:n.periodEndDate)||t.periodEndDate||this.periodEndDate,d=this._resolveInstantDate(this._getEffectivePeriodRole(e),void 0,s,l);a&&a.instantDate!==d&&(t.columnId,a.instantDate,a.instantDate=d),t.periodInstantDate!==d&&(e.id,t.columnId,t.periodInstantDate,t.periodInstantDate=d)}_addColumnFromRequest(e,t,i){var o,r,n,a,s;const l=`col-${Date.now()}`;let d="",c="";"instant"===e.periodType?(d=e.instantDate||"",c=""):"duration"!==e.periodType&&"mixed"!==e.periodType||(d=this._formatPeriodDisplay(e.startDate,e.endDate),c="");let p={dimensionId:"period",memberValue:"instant"===e.periodType?`instant-${e.instantDate}`:`duration-${e.startDate}-${e.endDate}`,memberLabel:d};if(e.selectedDimensions&&e.selectedDimensions.length>0){const t=[],i=[];for(const o of e.selectedDimensions)o.isTyped?(t.push(o.axisLabel),i.push(`${o.axisId}|${o.typedValue||""}`)):o.memberId&&o.memberLabel&&(t.push(o.memberLabel),i.push(`${o.axisId}|${o.memberId}`));t.length>0&&(d=t.join(" | "),c="instant"===e.periodType?e.instantDate||"":this._formatPeriodDisplay(e.startDate,e.endDate),p={dimensionId:l,memberValue:t.join(" | "),memberLabel:t.join(" | "),memberKey:t.join(" | "),dimensionIdKey:i.join("::"),selectedDimensions:e.selectedDimensions},p.memberKey)}else if(null==(r=null==(o=this.xbrlInput)?void 0:o.hypercubes)?void 0:r[0]){const i=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===t);if(1===(null==(n=null==i?void 0:i.items)?void 0:n.length)){const t=i.items[0];if(1===t.dimensions.length){const i=t.dimensions[0];if(i.members&&i.members.length>0){const t=(null==(a=i.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:a.label)||i.conceptName,o=i.members[0],r=(null==(s=o.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:s.label)||o.conceptName;d=r,c="instant"===e.periodType?e.instantDate||"":this._formatPeriodDisplay(e.startDate,e.endDate),p={dimensionId:l,axisId:i.id,memberId:o.id,memberValue:r,memberLabel:r,axis:t,axisLabel:t,memberKey:`${t} | ${r}`,dimensionIdKey:`${i.id} | ${o.id}`},p.memberKey}}}}const u={id:l,title:d,description:c,type:(p.memberKey,"dimension"),order:this._columns.length,removable:!0,dimensionData:p,periodStartDate:"instant"===e.periodType?e.instantDate:e.startDate,periodEndDate:"instant"===e.periodType?e.instantDate:e.endDate};if(e.selectedDimensions&&e.selectedDimensions.length>0){const t={};let i=!1;for(const o of e.selectedDimensions)o.isTyped&&(t[o.axisId]=o.typedValue||"",i=!0);i&&(this._typedMemberData[l]=t,u.dimensionData&&(u.dimensionData.hasTypedMembers=!0,u.dimensionData.typedMembers=e.selectedDimensions.filter(e=>e.isTyped).map(e=>({axisId:e.axisId,axisLabel:e.axisLabel,typedMemberId:e.axisId,memberLabel:e.axisLabel,type:e.dataType,validation:e.validation}))))}if(this._currentSchema){const e=this._currentSchema.sections.find(e=>e.id===t);if(e)if(e.columns||(e.columns=[...this._columns]),i){const t=e.columns.findIndex(e=>e.id===i);e.columns=-1!==t?[...e.columns.slice(0,t+1),u,...e.columns.slice(t+1)]:[...e.columns,u]}else e.columns=[...e.columns,u]}this._replicateFieldsForNewColumn(l,e,t),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-add",{detail:{column:u},bubbles:!0}))}_removeColumnData(e,t){if(this._currentSchema)if(t){const i=this._currentSchema.sections.find(e=>e.id===t);i&&this._removeColumnDataFromConcepts(i.concepts,e)}else for(const i in this._formData)void 0!==this._formData[i][e]&&delete this._formData[i][e]}_removeColumnDataFromConcepts(e,t){e.forEach(e=>{this._formData[e.id]&&void 0!==this._formData[e.id][t]&&delete this._formData[e.id][t],e.fields&&(e.fields=e.fields.filter(e=>e.columnId!==t)),e.children&&this._removeColumnDataFromConcepts(e.children,t)})}_shouldCreateFieldForConcept(e,t){if(e.abstract)return!1;if(!(t.selectedDimensions&&t.selectedDimensions.length>0)&&e.periodType){if("instant"===t.periodType&&"instant"!==e.periodType)return!1;if("duration"===t.periodType&&"duration"!==e.periodType)return!1}return!0}_replicateFieldsForNewColumn(e,t,i){if(!this._currentSchema)return;const o=new k,r=this._currentSchema.sections.find(e=>e.id===i);r&&this._replicateFieldsForSection(r.concepts,e,t,o)}_replicateFieldsForSection(e,t,i,o){e.forEach(e=>{var r;if(this._shouldCreateFieldForConcept(e,i)){const o=null==(r=e.fields)?void 0:r[0];let n;const a="instant"===i.periodType?i.instantDate:i.startDate,s="instant"===i.periodType?i.instantDate:i.endDate,l=this._resolveInstantDate(this._getEffectivePeriodRole(e),i.instantDate,a,s);n=o?{id:`${e.id}_${t}`,conceptId:e.id,columnId:t,type:o.type,label:o.label,placeholder:o.placeholder,required:o.required,disabled:o.disabled,validation:o.validation,defaultValue:o.defaultValue,periodType:e.periodType,conceptType:e.type,periodStartDate:a,periodEndDate:s,periodInstantDate:"instant"===e.periodType?l:void 0}:{id:`${e.id}_${t}`,conceptId:e.id,columnId:t,type:"text",label:e.label||e.name,placeholder:`Enter ${e.name}`,required:!1,disabled:!1,validation:[],defaultValue:"",periodType:e.periodType,conceptType:e.type,periodStartDate:a,periodEndDate:s,periodInstantDate:"instant"===e.periodType?l:void 0},e.fields||(e.fields=[]),e.fields.push(n)}e.children&&this._replicateFieldsForSection(e.children,t,i,o)})}_addColumn(){const e={id:`dim-${Date.now()}`,title:`Dimension ${this._columns.length}`,description:"Additional dimension column",type:"dimension",order:this._columns.length,removable:!0,dimensionData:{dimensionId:"custom",memberValue:"default",memberLabel:"Default Member"}};this._columns=[...this._columns,e],this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-add",{detail:{column:e},bubbles:!0}))}_findMissingTypedDimensionFacts(){var e;const t=[];if(!this._currentSchema)return t;for(const i of this._currentSchema.sections)for(const o of i.columns||[]){const r=null==(e=o.dimensionData)?void 0:e.typedMembers;if(!r||0===r.length)continue;const n=this._typedMemberData[this._scopedColumnKey(i.id,o.id)]||{};r.some(e=>{var t;return!(null==(t=n[e.axisId])?void 0:t.trim())})&&this._collectEnteredFactsForColumn(i.concepts,o,i,t)}return t}_collectEnteredFactsForColumn(e,t,i,o){var r,n;for(const a of e){const e=null==(r=this._formData[a.id])?void 0:r[t.id];null!=e&&""!==String(e).trim()&&o.push({conceptId:a.id,conceptLabel:a.label,columnId:t.id,columnTitle:t.title,sectionId:i.id,sectionTitle:i.title,value:e}),(null==(n=a.children)?void 0:n.length)&&this._collectEnteredFactsForColumn(a.children,t,i,o)}}_groupTypedDimensionWarningFactsByRole(){const e=[],t=new Map;for(const i of this._typedDimensionWarningFacts){let o=t.get(i.sectionId);o||(o={sectionId:i.sectionId,sectionTitle:i.sectionTitle,facts:[]},t.set(i.sectionId,o),e.push(o)),o.facts.push(i)}return e}_handleSubmit(){if(this._submitted=!0,this._submitDisabled=!0,"admin"===this.mode)return this._handleSaveDraft(),this._handleAdminModeSubmit(),void(this._submitDisabled=!1);const e=this._findMissingTypedDimensionFacts();if(e.length>0)return this._typedDimensionWarningFacts=e,this._showTypedDimensionWarning=!0,this._submitDisabled=!1,void this.requestUpdate();this._continueSubmit()}_continueSubmit(){if(this._submitted=!0,this._submitDisabled=!0,this._xbrlFormErrors.length,this._xbrlFormErrors,this._xbrlFormErrors.length>0)return this._xbrlFormErrors,this._showErrorPopup=!0,this._submitDisabled=!1,void this.requestUpdate();if(this._validateForm(),!this._valid)return this._errors,this._showErrorPopup=!0,this._submitDisabled=!1,void this.requestUpdate();this._correctLegacyPeriodStartInstantDates();const e=this._generateSubmissionData();JSON.stringify(e,null,2),e.forEach((e,t)=>{e.conceptId,e.columnId,e.value,e.unit}),this.dispatchEvent(new CustomEvent("form-submit",{detail:{data:this._formData,submissionData:e,valid:this._valid,errors:this._errors,reportingLanguage:this.reportingLanguage},bubbles:!0})),setTimeout(()=>{this._submitDisabled=!1},1e3)}_handleQuickValidate(){"admin"!==this.mode&&this._runFormulaValidationPreflight()}_runFormulaValidationPreflight(){var e,t,i,o,r,n,a,s;if(!this.formulaEnabled)return;const l=null==(i=null==(t=null==(e=this.xbrlInput)?void 0:e.formula)?void 0:t[0])?void 0:i.roles;if(!l||0===l.length)return;const d=(null==(r=null==(o=this._currentSchema)?void 0:o.sections)?void 0:r.length)?this._currentSchema.sections:this._allSections;if(!d||0===d.length)return;const c=new Set(d.map(e=>{var t;return(null==(t=e.metadata)?void 0:t.roleURI)||e.id})),p=l.filter(e=>c.has(e.roleURI));if(0===p.length)return;const u=d.map(e=>{var t;return{roleURI:(null==(t=e.metadata)?void 0:t.roleURI)||e.id,concepts:e.concepts,columns:e.columns}}),h=X(this._formData,this._mergeAllSectionColumns(),u,null==(s=null==(a=null==(n=this.xbrlInput)?void 0:n.hypercubes)?void 0:a[0])?void 0:s.roles,this.periodStartDate,this.periodEndDate,this._typedMemberData),m={...this.xbrlInput,formula:[{...this.xbrlInput.formula[0],roles:p}]},f=this._formulaValidationService.evaluate(m,h,this.language),b=this._formulaValidationService.summarize(f);this._formulaValidationResults=f,this._formulaValidationSummary=b;f.some(e=>!e.skipped&&!e.satisfied)&&(this._showFormulaValidationDialog=!0),this.dispatchEvent(new CustomEvent("formula-validation-complete",{detail:{results:f,summary:b},bubbles:!0,composed:!0}))}_mergeAllSectionColumns(){const e=new Map;return this._columns.forEach(t=>e.set(t.id,t)),this._allSections.forEach(t=>{(t.columns||[]).forEach(t=>e.set(t.id,t))}),Array.from(e.values())}_handleSaveDraft(e="manual"){if(this._xbrlFormErrors.length,this._xbrlFormErrors,this._xbrlFormErrors.length>0)return this._xbrlFormErrors,this._showErrorPopup=!0,void this.requestUpdate();this._formData,this._unitData,this._selectedRoleIds,this._correctLegacyPeriodStartInstantDates();const t=this._generateSubmissionData();t.forEach((e,t)=>{e.conceptId,e.columnId,e.value,e.unit});const i=this._roleCompletedStates.size>0?Object.fromEntries(this._roleCompletedStates):void 0,o=this._draftStorageService.createMetadataSnapshot(this.periodStartDate,this.periodEndDate,this.language,this._selectedRoleIds,this._allSections,this._typedMemberData,this._periodPreferences,this._periodData,this._unitData,this.reportingLanguage,this._repeatCounts,this._decimalsData,i,this._getHiddenColumnsForMetadata(),this._totalManuallyEditedData),r=JSON.stringify({draftData:t,metadata:o});if(r===this._lastSavedDraftSnapshot)return void(this.hasUnsavedChanges=!1);this._lastSavedDraftSnapshot=r,this.hasUnsavedChanges=!1;const n=this._draftStorageService.saveDraft(t,o);o.selectedRoleIds,this.dynaformsFacts=t,this.dynaformsMetadata=o,this.dispatchEvent(new CustomEvent("form-save-draft",{detail:{data:this._formData,draftData:t,metadata:o,saved:n,valid:this._valid,errors:this._errors,dynaformsFacts:t,dynaformsMetadata:o,reportingLanguage:this.reportingLanguage,source:"auto"==e?"auto":"manual"},bubbles:!0,composed:!0}));this._getRoleIdsArray().length;t.length,o.customColumns.length,Array.isArray(this._selectedRoleIds)&&this._selectedRoleIds.length>0&&this._selectedRoleIds[0]}async _loadDraftIfExists(){if(this.dynaformsFacts&&this.dynaformsMetadata){const e={formData:this.dynaformsFacts,metadata:this.dynaformsMetadata};return await this._restoreFromDraft(e),this._draftLoaded=!0,this._draftLoadedAt=this.dynaformsMetadata.savedAt||(new Date).toISOString(),void this.dispatchEvent(new CustomEvent("form-draft-loaded",{detail:{draft:e,source:"external",compatible:!0,warnings:[]},bubbles:!0,composed:!0}))}if(!this._draftStorageService.hasDraft())return;const e=this._draftStorageService.loadDraft();if(!e)return void console.warn("⚠️ Failed to load draft");const{compatible:t,warnings:i}=this._draftStorageService.validateDraftCompatibility(e,this.periodStartDate,this.periodEndDate);i.length>0&&console.warn("⚠️ Draft compatibility warnings:",i),await this._restoreFromDraft(e),this.dispatchEvent(new CustomEvent("form-draft-loaded",{detail:{draft:e,compatible:t,warnings:i},bubbles:!0,composed:!0})),e.formData.length,e.metadata.savedAt,this._draftStorageService.getDraftAge()}async _restoreFromDraft(e){var t;const{formData:i,metadata:o}=e;o.selectedRoleIds&&o.selectedRoleIds.length>0&&(this._selectedRoleIds=o.selectedRoleIds,this._selectedRoleIds.length),o.typedMemberData&&(this._typedMemberData=o.typedMemberData,this._preservedTypedMemberData={}),o.repeatCounts&&(this._repeatCounts=o.repeatCounts,this._repeatCounts),o.periodData&&(this._periodData=o.periodData,Object.keys(this._periodData).length),o.unitData&&(this._unitData=o.unitData,Object.keys(this._unitData).length),o.decimalsData&&(this._decimalsData=o.decimalsData,Object.keys(this._decimalsData).length),o.roleCompletedStates&&(this._roleCompletedStates=new Map(Object.entries(o.roleCompletedStates)),Object.keys(o.roleCompletedStates).length),o.hiddenColumns&&(this._hiddenColumnIds=new Map(Object.entries(o.hiddenColumns).map(([e,t])=>[e,new Set(t)])),this._hiddenColumnIds.size),o.totalManuallyEditedData&&(this._totalManuallyEditedData=o.totalManuallyEditedData,Object.keys(this._totalManuallyEditedData).length),o.periodPreferences?this._skipPeriodPreferencesRestore||(this._periodPreferences=o.periodPreferences,this._periodPreferences,this.xbrlInput&&(this._currentSchema=k.buildFormSchema(this.xbrlInput,this.periodStartDate,this.periodEndDate,this.language,this._periodPreferences),this._allSections=[...this._currentSchema.sections],this._applyCustomPeriodDataToFields(),o.customColumns&&o.customColumns.length>0&&(this._mergeAdditionalCustomColumns(o.customColumns),o.customColumns.length))):o.customColumns&&o.customColumns.length>0&&(this._restoreCustomColumns(o.customColumns),o.customColumns.length);const r={},n={},a={};i.forEach(e=>{let{conceptId:t,draftInstanceId:i,value:o,columnId:s,period:l,unit:d}=e;if(!s&&l&&(s=this._inferColumnIdFromPeriod(l,t),!s))return void console.warn(`⚠️ Could not infer columnId for concept ${t}, skipping...`);const c=i||t,p=c.includes("__repeat_")?c.split("__repeat_")[0]:c,u=this._findActualConceptId(p),h=c.includes("__repeat_")?`${u||p}__repeat_${c.split("__repeat_")[1]}`:u||c;r[h]||(r[h]={}),r[h][s]=o,l&&(n[h]||(n[h]={}),"instant"===l.type?(n[h][s]={instantDate:l.date},l.date):"duration"===l.type&&(n[h][s]={startDate:l.startDate,endDate:l.endDate},l.startDate,l.endDate)),d&&(a[h]||(a[h]={}),a[h][s]=d)}),this._formData={...this._formData,...r},Object.keys(r).length,this._seedLegacyManuallyEditedTotals(r),this._initializeGlobalDecimalsFromRoundingData(),this._periodData={...this._periodData,...o.periodData||{},...n},Object.keys(this._periodData).length,JSON.stringify(this._periodData,null,2),this._unitData={...this._unitData,...o.unitData||{},...a},Object.keys(this._unitData).length,JSON.stringify(this._unitData,null,2),this._correctLegacyPeriodStartInstantDates(),this._selectedRoleIds.length>0&&this._applyRoleFilter(),this._dirty=!0,this._touched.clear(),this._validateForm(),this._allSections=[...this._allSections],this.requestUpdate(),await this.updateComplete,await new Promise(e=>setTimeout(e,100));const s=(null==(t=this.shadowRoot)?void 0:t.querySelectorAll("input, textarea, select").length)||0;s>0?this._populateFieldValues(r):console.error("❌ No fields found in DOM even after updateComplete")}_findActualConceptId(e){for(const t of this._allSections){const i=this._findActualConceptIdInTree(t.concepts,e);if(i)return i}return null}_findActualConceptIdInTree(e,t){for(const i of e){if(i.originalConceptId===t||i.id===t)return i.id;if(i.children){const e=this._findActualConceptIdInTree(i.children,t);if(e)return e}}return null}_inferColumnIdFromPeriod(e,t){for(const i of this._allSections){if(this._findConceptInSection(i.concepts,t)&&i.columns){for(const t of i.columns){const i="instant"===e.type,o="duration"===e.type;if(i&&e.date){if(t.periodStartDate===e.date||t.periodStartDate===t.periodEndDate&&t.periodStartDate===e.date)return t.id,t.id}else if(o&&e.startDate&&e.endDate&&t.periodStartDate===e.startDate&&t.periodEndDate===e.endDate)return t.id,t.id}if("instant"===e.type){const e=i.columns.find(e=>"instant"===e.id);if(e)return e.id}else{const e=i.columns.find(e=>"duration"===e.id);if(e)return e.id}}}return null}_findConceptInSection(e,t){for(const i of e){if(i.id===t||i.originalConceptId===t)return i;if(i.children){const e=this._findConceptInSection(i.children,t);if(e)return e}}return null}_populateFieldValues(e){Object.keys(e).forEach(t=>{const i=e[t];Object.keys(i).forEach(e=>{var o,r;const n=i[e],a=`${t}__${e}`,s=null==(o=this.shadowRoot)?void 0:o.querySelector(`#${CSS.escape(a)}`);s?(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement)&&("checkbox"===s.type?s.checked=Boolean(n):s.value=null!=n?String(n):""):(console.warn(` ❌ Field element NOT FOUND: ${a}`),console.warn(" Available fields in DOM:",Array.from((null==(r=this.shadowRoot)?void 0:r.querySelectorAll("input, textarea, select"))||[]).map(e=>e.id).filter(e=>e.includes(t.split("__")[0]))))})})}_seedLegacyManuallyEditedTotals(e){const t={...this._totalManuallyEditedData};let i=!1;const o=r=>{var n;for(const a of r){if(F(a.preferredLabel)){const o=e[a.id];if(o)for(const e of Object.keys(o)){const r=o[e];null==r||""===r||void 0!==(null==(n=t[a.id])?void 0:n[e])||(t[a.id]={...t[a.id]||{},[e]:!0},i=!0)}}a.children&&a.children.length>0&&o(a.children)}};for(const r of this._allSections)o(r.concepts||[]);i&&(this._totalManuallyEditedData=t)}_restoreCustomColumns(e){const t=new Map;e.forEach(e=>{t.has(e.sectionId)||t.set(e.sectionId,[]),t.get(e.sectionId).push(e)}),this._allSections.forEach(e=>{var i;const o=t.get(e.id);if(o){if(e.columns=o.map(e=>{const t={id:e.columnId,title:e.label,description:e.description,type:e.dimensionData?"dimension":"base",periodStartDate:e.startDate||e.date,periodEndDate:e.endDate||e.date,dimensionData:e.dimensionData,order:0,removable:"duration"!==e.columnId&&"instant"!==e.columnId,periodType:e.periodType};return e.columnId,t}),(null==(i=this.xbrlInput)?void 0:i.datatypes)&&!e.datatypes){const t=Array.isArray(this.xbrlInput.datatypes)?this.xbrlInput.datatypes:this.xbrlInput.datatypes.concepts||[];e.datatypes=t,t.length,e.id}else e.datatypes?(e.id,e.datatypes.length):console.warn(`⚠️ [Draft Restore] No datatypes available for section ${e.id}`);this._regenerateFieldsForSection(e),o.length,e.id}}),this._currentSchema&&(this._currentSchema={...this._currentSchema,sections:this._allSections})}_mergeAdditionalCustomColumns(e){const t=new Map;e.forEach(e=>{e.columnId.startsWith("col-")&&(t.has(e.sectionId)||t.set(e.sectionId,[]),t.get(e.sectionId).push(e))}),this._allSections.forEach(e=>{var i;const o=t.get(e.id);if(o&&o.length>0){if(e.columns||(e.columns=[]),(null==(i=this.xbrlInput)?void 0:i.datatypes)&&!e.datatypes){const t=Array.isArray(this.xbrlInput.datatypes)?this.xbrlInput.datatypes:this.xbrlInput.datatypes.concepts||[];e.datatypes=t,t.length,e.id}else e.datatypes?(e.id,e.datatypes.length):console.warn(`⚠️ [Merge Custom] No datatypes available for section ${e.id}`);o.forEach(t=>{t.columnId,t.startDate,t.endDate,t.date,t.periodType;if(!e.columns.find(e=>e.id===t.columnId)){const i={id:t.columnId,title:t.label,description:t.description,type:t.dimensionData?"dimension":"base",periodStartDate:t.startDate||t.date,periodEndDate:t.endDate||t.date,dimensionData:t.dimensionData,order:e.columns.length,removable:!0,periodType:t.periodType};i.id,i.title,i.description,i.periodStartDate,i.periodEndDate,i.periodType,e.columns.push(i),t.columnId,e.id}}),this._regenerateFieldsForSection(e)}}),this._currentSchema&&(this._currentSchema={...this._currentSchema,sections:this._allSections})}_applyCustomPeriodDataToFields(){if(!this._periodData||0===Object.keys(this._periodData).length)return;const e=t=>{t.forEach(t=>{if(this._periodData[t.id]){const e=this._periodData[t.id];t.fields&&t.fields.forEach(i=>{const o=e[i.columnId];o&&(o.startDate&&(i.periodStartDate=o.startDate),o.endDate&&(i.periodEndDate=o.endDate),o.instantDate&&(i.periodInstantDate=o.instantDate),t.id,i.columnId,i.periodStartDate,i.periodEndDate,i.periodInstantDate)})}t.children&&t.children.length>0&&e(t.children)})};this._allSections.forEach(t=>{t.concepts&&t.concepts.length>0&&e(t.concepts)})}_regenerateFieldsForSection(e){if(!e.columns)return;const t=this._periodPreferences[e.id]||{showDuration:!0,showInstant:!0,showPreviousYear:!1},i=o=>{o.forEach(o=>{o.fields=[];this._shouldShowConceptBasedOnPeriodPreferences(o,t)&&e.columns.forEach(t=>{var i;const r=o.periodType,n=this._inferColumnPeriodType(t);if(o.abstract)return;const a=t.id.startsWith("col-"),s=t.id.startsWith("duration_")||t.id.startsWith("instant_")||t.id.startsWith("typed-"),l=!0===e.showPeriodControl;if(!(!n||"duration"===t.id||"default"===t.id||a&&l||s)&&r&&n&&r!==n)return o.id,void t.id;const d={id:`${o.id}_${t.id}`,conceptId:o.id,columnId:t.id,type:this._mapConceptTypeToFieldType(o.type),label:o.label,periodType:r,conceptType:o.type,periodStartDate:t.periodStartDate,periodEndDate:t.periodEndDate,periodInstantDate:"instant"===r?this._resolveInstantDate(this._getEffectivePeriodRole(o),void 0,t.periodStartDate,t.periodEndDate):void 0};if(null==(i=this._periodData[o.id])?void 0:i[t.id]){const e=this._periodData[o.id][t.id];e.startDate&&(d.periodStartDate=e.startDate),e.endDate&&(d.periodEndDate=e.endDate),e.instantDate&&(d.periodInstantDate=e.instantDate),o.id,t.id,d.periodStartDate,d.periodEndDate,d.periodInstantDate}else o.id,t.id,this._periodData[o.id];(o.id.includes("DescriptionLocationNL")||t.id.startsWith("col-"))&&(o.id,t.id,d.periodStartDate,d.periodEndDate,t.periodStartDate),o.fields.push(d)}),o.children&&i(o.children)})};i(e.concepts)}_shouldShowConceptBasedOnPeriodPreferences(e,t){return!!e.abstract||(!e.periodType||!("duration"===e.periodType&&!t.showDuration)&&!("instant"===e.periodType&&!t.showInstant))}_inferColumnPeriodType(e){return e.periodType?e.periodType:e.periodStartDate&&e.periodEndDate?e.periodStartDate===e.periodEndDate?"instant":"duration":e.periodStartDate&&!e.periodEndDate?"instant":void 0}_mapConceptTypeToFieldType(e){return e?e.includes("monetary")||e.includes("Monetary")?"number":e.includes("date")||e.includes("Date")?"date":e.includes("boolean")||e.includes("Boolean")?"boolean":e.includes("integer")||e.includes("Integer")||e.includes("decimal")||e.includes("Decimal")?"number":"text":"text"}_generateSubmissionData(){const e=[];if(!this._currentSchema)return e;this._currentSchema.sections.forEach(t=>{this._processConceptsForSubmission(t.concepts,e,t)}),this._includePreservedDataInSubmission(e);return this._removeDuplicateSubmissions(e)}_includePreservedDataInSubmission(e){Object.keys(this._preservedFormData).forEach(t=>{const i=this._preservedFormData[t];i&&Object.keys(i).forEach(o=>{const r=i[o];if(null!=r&&""!==r){const i=this._findConceptInAllSections(t);if(i){const n=this._findSectionForConcept(t);this._addConceptDataToSubmission(i,o,r,e,n||void 0)}}})}),e.length}_findConceptInAllSections(e){for(const t of this._allSections){const i=this._findConceptInSection(t.concepts,e);if(i)return i}return null}_findSectionForConcept(e){for(const t of this._allSections){if(this._findConceptInSection(t.concepts,e))return t}return null}_addConceptDataToSubmission(e,t,i,o,r){var n,a,s,l,d;const c=e.fields.find(e=>e.columnId===t);if(!c)return;const p="instant"===e.periodType,u=null==(n=this._periodData[e.id])?void 0:n[t],h=null==(a=this._unitData[e.id])?void 0:a[t],m=this._findColumnByIdInAllSections(t);e.id,u&&JSON.stringify(u),null==m||m.periodStartDate,null==m||m.periodEndDate;const f=(null==u?void 0:u.startDate)||(null==m?void 0:m.periodStartDate)||c.periodStartDate||this.periodStartDate,b=(null==u?void 0:u.endDate)||(null==m?void 0:m.periodEndDate)||c.periodEndDate||this.periodEndDate,g=(null==u?void 0:u.instantDate)||c.periodInstantDate||b||f,v={conceptId:e.originalConceptId||e.id,columnId:t,value:i,period:{type:e.periodType||"duration",...p?{date:g}:{startDate:f,endDate:b}}};h&&(v.unit=h,e.id);const y=null==(s=e.type)?void 0:s.toLowerCase().includes("monetary"),x=(null==(l=this._decimalsData[e.id])?void 0:l[t])||("INF"!==this.decimals?this.decimals:void 0);if(y&&x){const e=parseFloat(x);v.decimals=isNaN(e)?x:String(-Math.abs(e))}(null==(d=null==m?void 0:m.dimensionData)?void 0:d.memberLabel)&&(v.dimension=m.dimensionData.memberLabel),JSON.stringify(v,null,2),o.push(v)}_findColumnByIdInAllSections(e){for(const t of this._allSections)if(t.columns){const i=t.columns.find(t=>t.id===e);if(i)return i}}_removeDuplicateSubmissions(e){const t=new Map;return e.forEach(e=>{const i="instant"===e.period.type?e.period.date:`${e.period.startDate}_${e.period.endDate}`,o=`${e.conceptId}_${e.value}_${e.dimension||"no-dimension"}_${i}`;t.has(o)||t.set(o,e)}),Array.from(t.values())}_findColumnById(e){if(this._currentSchema)for(const t of this._currentSchema.sections)if(t.columns){const i=t.columns.find(t=>t.id===e);if(i)return i}}_findColumnByIdInSection(e,t){if(null==t?void 0:t.columns)return t.columns.find(t=>t.id===e)}_getTypedMemberNameForAxis(e,t){var i,o,r,n;if(!(null==(o=null==(i=this.xbrlInput)?void 0:i.hypercubes)?void 0:o[0]))return null;const a=null==t?void 0:t.id;if(!a)return null;const s=null==(r=this.xbrlInput.hypercubes[0].roles)?void 0:r.find(e=>e.roleId===a);if(!(null==s?void 0:s.items))return null;for(const l of s.items)if(l.dimensions){const t=l.dimensions.find(t=>t.id===e);if(null==(n=null==t?void 0:t.typedMember)?void 0:n.id)return t.typedMember.id}return null}_doesConceptApplyToTypedDimension(e,t,i){var o,r,n;if(!(null==(r=null==(o=this.xbrlInput)?void 0:o.hypercubes)?void 0:r[0]))return!1;const a=null==t?void 0:t.id;if(!a)return!1;const s=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===a);if(!(null==(n=null==s?void 0:s.items)?void 0:n.length))return!1;for(const l of s.items){const t=e.originalConceptId||e.id;if(l.conceptIds&&l.conceptIds.includes(t)){const e=l.dimensions.some(e=>e.typedMember);return e}}return e.originalConceptId||e.id,!1}_getApplicableTypedDimensions(e,t){var i,o,r;if(!(null==(o=null==(i=this.xbrlInput)?void 0:i.hypercubes)?void 0:o[0])||!(null==t?void 0:t.id))return[];const n=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===t.id);if(!(null==(r=null==n?void 0:n.items)?void 0:r.length))return[];const a=e.originalConceptId||e.id;for(const s of n.items)if(s.conceptIds&&s.conceptIds.includes(a)){const e=s.dimensions.filter(e=>e.typedMember).map(e=>e.id);return e}return[]}_processConceptsForSubmission(e,t,i){const o="Toelichting op de geconsolideerde jaarrekening - Financiële vaste activa: Deelnemingen: Volledig geconsolideerd: Specificatie",r=(null==i?void 0:i.title)||"Unknown";e.forEach(e=>{if(r===o&&(e.originalConceptId||e.id,e.fields&&(e.fields.length,e.fields.forEach((t,i)=>{var o;t.columnId,null==(o=this._formData[e.id])||o[t.columnId]}))),e.fields&&e.fields.length>1&&e.fields.forEach((e,t)=>{}),e.fields&&e.fields.length>0){e.fields.forEach(o=>{var r,n,a,s,l,d,c,p;const u=this._formData[e.id];let h=null==u?void 0:u[o.columnId];const m=o.conceptId||e.id.split("__").slice(0,-1).join("__")||e.id;if((null==h||""===h)&&this._isRoundingLevelConcept(m)&&!this._hasValidGlobalDecimals()){const t=this._findFactValueForField(e,o,i);null!=t&&""!==t&&(h=t)}if((null==h||""===h)&&this._effectiveMasterData){const e=null==(r=this._effectiveMasterData)?void 0:r[m];null!=e&&""!==e&&(h=e,o.columnId,JSON.stringify(h))}if(null!=h&&""!==h){const r=this._findColumnByIdInSection(o.columnId,i),u=null==(n=this._periodData[e.id])?void 0:n[o.columnId],m={conceptId:e.id,draftInstanceId:e.id,columnId:o.columnId,value:h,period:{type:e.periodType||"duration"}};if("instant"===e.periodType){const t=this._resolveSubmissionInstantDate(e,o,u,r);m.period.date=t}else{const e=(null==u?void 0:u.startDate)||(null==r?void 0:r.periodStartDate)||o.periodStartDate||this.periodStartDate,t=(null==u?void 0:u.endDate)||(null==r?void 0:r.periodEndDate)||o.periodEndDate||this.periodEndDate;m.period.startDate=e,m.period.endDate=t}e.id,o.columnId,u&&JSON.stringify(u),null==r||r.periodStartDate,null==r||r.periodEndDate,"instant"===m.period.type?m.period.date:(m.period.startDate,m.period.endDate);const f=null==(a=this._unitData[e.id])?void 0:a[o.columnId];f?(m.unit=f,e.id,o.columnId):(e.id,o.columnId,JSON.stringify(this._unitData,null,2));const b=null==(s=e.type)?void 0:s.toLowerCase().includes("monetary"),g=(null==(l=this._decimalsData[e.id])?void 0:l[o.columnId])||("INF"!==this.decimals?this.decimals:void 0);if(b&&g){const e=parseFloat(g);m.decimals=isNaN(e)?g:String(-Math.abs(e))}"dimension"===(null==r?void 0:r.type)&&(null==(d=r.dimensionData)?void 0:d.dimensionIdKey)?(m.dimension=r.dimensionData.dimensionIdKey,o.columnId,r.dimensionData.dimensionIdKey):(o.columnId,null==r||r.type,null==r||r.dimensionData);const v=i?this._scopedColumnKey(i.id,o.columnId):o.columnId,y=this._typedMemberData[v],x=this._typedMemberData[o.columnId];if(y||x){const t=this._getApplicableTypedDimensions(e,i);if(e.id,t.length>0){const e={};t.forEach(t=>{const o=(null==y?void 0:y[t])??(null==x?void 0:x[t]);if(o){const r=this._getTypedMemberNameForAxis(t,i);e[t]={value:o,memberName:r||"Unknown"}}}),Object.keys(e).length>0&&(m.typedMembers=e)}else e.id}else o.columnId,Object.keys(this._typedMemberData),r&&(r.id,r.type,null==(c=r.dimensionData)||c.hasTypedMembers,r.dimensionData);if(!m.typedMembers&&(null==(p=o.crossRoleTypedMembers)?void 0:p.length)){const t=`${e.id}__${o.columnId}`,i=this._typedMemberData[t];if(i){const t={};o.crossRoleTypedMembers.forEach(e=>{const o=i[e.axisId];null!=o&&""!==o&&(t[e.axisId]={value:o,memberName:e.typedMemberId})}),Object.keys(t).length>0&&(m.typedMembers=t,e.id,o.columnId)}}t.push(m)}});const o=this._repeatCounts[e.id]||0;if(o>0&&e.fields.some(e=>{var t;return null==(t=e.crossRoleTypedMembers)?void 0:t.length}))for(let r=1;r<=o;r++){const o=`${e.id}__repeat_${r}`;e.fields.forEach(r=>{var n,a,s,l,d;const c=null==(n=this._formData[o])?void 0:n[r.columnId];if(null==c||""===c)return;const p=this._findColumnByIdInSection(r.columnId,i),u=null==(a=this._periodData[o])?void 0:a[r.columnId],h={conceptId:e.id,draftInstanceId:o,columnId:r.columnId,value:c,period:{type:e.periodType||"duration"}};"instant"===e.periodType?h.period.date=this._resolveSubmissionInstantDate(e,r,u,p):(h.period.startDate=(null==u?void 0:u.startDate)||(null==p?void 0:p.periodStartDate)||r.periodStartDate||this.periodStartDate,h.period.endDate=(null==u?void 0:u.endDate)||(null==p?void 0:p.periodEndDate)||r.periodEndDate||this.periodEndDate);const m=null==(s=this._unitData[o])?void 0:s[r.columnId];if(m&&(h.unit=m),"dimension"===(null==p?void 0:p.type)&&(null==(l=p.dimensionData)?void 0:l.dimensionIdKey)&&(h.dimension=p.dimensionData.dimensionIdKey),null==(d=r.crossRoleTypedMembers)?void 0:d.length){const e=`${o}__${r.columnId}`,t=this._typedMemberData[e];if(t){const e={};r.crossRoleTypedMembers.forEach(i=>{const o=t[i.axisId];null!=o&&""!==o&&(e[i.axisId]={value:o,memberName:i.typedMemberId})}),Object.keys(e).length>0&&(h.typedMembers=e)}}t.push(h)})}}e.children&&this._processConceptsForSubmission(e.children,t,i)})}_handleReset(){this._formData={...this.initialData},this._touched.clear(),this._dirty=!1,this.hasUnsavedChanges=!1,this._submitted=!1,this._preservedFormData={},this._preservedTypedMemberData={},this._validateForm(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("form-reset",{detail:{},bubbles:!0}))}_getFormState(){return{data:this._formData,errors:this._errors,touched:this._touched,dirty:this._dirty,valid:this._valid,submitted:this._submitted}}_analyzeAllVisibleRoles(){if(this._currentSchema&&this._currentSchema.sections&&0!==this._currentSchema.sections.length){this._currentSchema.sections.length;for(const e of this._currentSchema.sections)this._analyzeAndLogRole(e.id)}}_handleRoleContextMenu(e,t,i){e.preventDefault(),e.stopPropagation(),this._contextMenuX=e.clientX,this._contextMenuY=e.clientY,this._contextMenuRoleId=t,this._showRoleContextMenu=!0,this.requestUpdate()}_closeRoleContextMenu(){this._showRoleContextMenu=!1,this._contextMenuRoleId=null,this.requestUpdate()}_handleRemoveRole(){if(!this._contextMenuRoleId)return void this._closeRoleContextMenu();const e=this._allSections.find(e=>e.id===this._contextMenuRoleId),t=(null==e?void 0:e.title)||"Unknown";if(this._contextMenuRoleId,Array.isArray(this._selectedRoleIds)&&(this._selectedRoleIds.length>0&&"object"==typeof this._selectedRoleIds[0]?this._selectedRoleIds=this._selectedRoleIds.filter(e=>e.roleId!==this._contextMenuRoleId):this._selectedRoleIds=this._selectedRoleIds.filter(e=>e!==this._contextMenuRoleId)),this._selectedRoleIds.length,this._activeSidePanelRoleId===this._contextMenuRoleId){const e=this._getRoleIdsArray();this._activeSidePanelRoleId=e.length>0?e[0]:null,this._activeSidePanelRoleId}this._applyRoleFilter(),this.dispatchEvent(new CustomEvent("role-removed",{detail:{roleId:this._contextMenuRoleId,roleTitle:t,remainingRolesCount:this._selectedRoleIds.length},bubbles:!0,composed:!0})),this._closeRoleContextMenu()}_handleRoleCompletedChange(e,t){t?this._roleCompletedStates.set(e,!0):this._roleCompletedStates.delete(e),this._roleCompletedStates=new Map(this._roleCompletedStates),this._handleSaveDraft("auto")}_handleSidePanelRoleClick(e){this._activeSidePanelRoleId&&this._activeSidePanelRoleId!==e&&this._analyzeAndLogRole(this._activeSidePanelRoleId),this._activeSidePanelRoleId=e}_analyzeAndLogRole(e){const t=this._allSections.find(t=>t.id===e);if(!t)return void console.warn(`⚠️ Section not found for roleId: ${e}`);t.title,this.masterData&&Object.keys(this.masterData);const i=[];this._collectAllFields(t.concepts||[],new Set((t.columns||[]).map(e=>e.id)),t.columns||[],i);const o=this._roleHasErrors(e),r=i.filter(e=>e.isEmpty).length,n=i.filter(e=>!e.isEmpty).length;let a;i.length,a=o?"INVALID":0===n?"UNTOUCHED":r>0?"INCOMPLETE":"COMPLETE","INVALID"===a||("UNTOUCHED"===a?(this._roleBorderStatuses.set(e,"untouched"),this._roleBorderStatuses=new Map(this._roleBorderStatuses)):"INCOMPLETE"===a?(this._roleBorderStatuses.set(e,"incomplete"),this._roleBorderStatuses=new Map(this._roleBorderStatuses)):(this._roleBorderStatuses.set(e,"complete"),this._roleBorderStatuses=new Map(this._roleBorderStatuses)))}_collectAllFields(e,t,i,o){var r,n,a;for(const s of e)if(s.abstract)s.children&&s.children.length>0&&this._collectAllFields(s.children,t,i,o);else{if(s.fields&&s.fields.length>0){const e=s.fields.filter(e=>t.has(e.columnId));for(const t of e){const e=s.id,l=t.conceptId;let d=null==(r=this._formData[e])?void 0:r[t.columnId];void 0===d&&e!==l&&(d=null==(n=this._formData[l])?void 0:n[t.columnId]);const c=null==(a=this._effectiveMasterData)?void 0:a[l];(null==d||"string"==typeof d&&""===d.trim())&&void 0!==c&&(d=c,t.columnId,JSON.stringify(d));let p=null==d||"string"==typeof d&&""===d.trim();if(p&&s.facts&&s.facts.length>0){const e=i.find(e=>e.id===t.columnId),o={conceptId:l,columnId:t.columnId,periodStartDate:t.periodStartDate||(null==e?void 0:e.periodStartDate),periodEndDate:t.periodEndDate||(null==e?void 0:e.periodEndDate),periodInstantDate:t.periodInstantDate||("instant"===t.periodType?t.periodEndDate||t.periodStartDate:void 0),periodType:t.periodType,dimensionData:null==e?void 0:e.dimensionData},r=De.findMatchingFact(s.facts,o);r&&null!==r.value&&void 0!==r.value&&""!==r.value&&(d=r.value,p=!1)}o.push({conceptId:l,columnId:t.columnId,value:d,isEmpty:p})}}s.children&&s.children.length>0&&this._collectAllFields(s.children,t,i,o)}}_handleSidePanelSearchInput(e){const t=e.target;this._sidePanelSearchQuery=t.value}_clearSidePanelSearch(){var e;this._sidePanelSearchQuery="";const t=null==(e=this.shadowRoot)?void 0:e.querySelector(".side-panel-search-input");t&&(t.value="",t.focus()),this.updateComplete.then(()=>this._scrollActiveRoleIntoView())}_toggleSidePanelCollapse(){this._sidePanelCollapsed=!this._sidePanelCollapsed}_isSectionBlank(e){const t=e.columns||this._columns,i=e=>{var o;for(const r of e){if(!r.abstract)for(const e of t){const t=null==(o=this._formData[r.id])?void 0:o[e.id];if(null!=t&&""!==t)return!0}if(r.children&&r.children.length>0&&i(r.children))return!0}return!1};return!i(e.concepts)}_getConceptSearchMatchIds(e){var t,i,o;const r=new Set;if(!e.trim()||!(null==(i=null==(t=this.xbrlInput)?void 0:t.presentation)?void 0:i.length))return r;const n=e.toLowerCase().trim(),a=e=>{var t;for(const i of e)r.add(i.id),(null==(t=i.children)?void 0:t.length)&&a(i.children)},s=e=>{var t,i,o,l;for(const d of e){let e=(null==(t=d.conceptName)?void 0:t.toLowerCase().includes(n))||(null==(i=d.id)?void 0:i.toLowerCase().includes(n));!e&&Array.isArray(d.labels)&&(e=d.labels.some(e=>{var t;return null==(t=e.label)?void 0:t.toLowerCase().includes(n)})),e?(r.add(d.id),(null==(o=d.children)?void 0:o.length)&&a(d.children)):(null==(l=d.children)?void 0:l.length)&&s(d.children)}};for(const l of this.xbrlInput.presentation)for(const e of l.roles||[])s((null==(o=e.presentationLinkbase)?void 0:o.concepts)||[]);return r}_isSectionConceptSearchMatch(e,t){if(0===t.size)return!1;const i=e=>{var o;for(const r of e){if(t.has(r.originalConceptId))return!0;if((null==(o=r.children)?void 0:o.length)&&i(r.children))return!0}return!1};return i(e.concepts)}_filterSidePanelSections(e){if(!this._sidePanelSearchQuery.trim())return e;const t=this._sidePanelSearchQuery.toLowerCase().trim();return e.filter(e=>{var i,o,r;const n=e.title.toLowerCase().includes(t),a=e.id.toLowerCase().includes(t),s=(null==(i=e.description)?void 0:i.toLowerCase().includes(t))||!1,l=(null==(r=null==(o=e.metadata)?void 0:o.roleURI)?void 0:r.toLowerCase().includes(t))||!1;return n||a||s||l})}_renderAdminModeContent(t){var i,o;if(!t)return e.html`
|
|
3901
|
+
`}_handleClearAdvancedFilters(){const e=this._lastFocusedFieldIdentity;this._showFactsOnly=!1,this._conceptSearchText="",this.updateComplete.then(async()=>{var t;const i=Array.from((null==(t=this.shadowRoot)?void 0:t.querySelectorAll("jupiter-form-section"))??[]);await Promise.all(i.map(e=>e.updateComplete));const o=i.flatMap(e=>{var t;return Array.from((null==(t=e.shadowRoot)?void 0:t.querySelectorAll("jupiter-concept-tree"))??[])});await Promise.all(o.map(e=>e.updateComplete)),this._scrollActiveRoleIntoView(),e&&this._restoreFieldFocus(e)})}_effectiveNumberLocale(){return this.numberLocale||("nl"===this.language?"nl-NL":"en-US")}_amountScaleFactor(){if("INF"===this.decimals||void 0===this.decimals||null===this.decimals)return null;const e=parseFloat(this.decimals);return isNaN(e)||e<=0?null:Math.pow(10,e)}_amountScaleCaption(){const e=this._amountScaleFactor();if(null===e)return E.t("section.amountScaleBase");const t=new Intl.NumberFormat(this._effectiveNumberLocale()).format(e);return E.t("section.amountScaleFactor",{factor:t})}_sectionHasMonetaryConcepts(e){return e.some(e=>{var t;return(null==(t=e.type)?void 0:t.toLowerCase().includes("monetary"))||e.children&&this._sectionHasMonetaryConcepts(e.children)})}_scrollActiveRoleIntoView(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector(".side-panel-roles-list .side-panel-role-item.active");null==t||t.scrollIntoView({block:"center"})}_restoreFieldFocus(e){var t,i,o,r;const n=(null==(t=this.shadowRoot)?void 0:t.querySelectorAll("jupiter-form-section"))??[];for(const a of Array.from(n)){const t=(null==(i=a.shadowRoot)?void 0:i.querySelectorAll("jupiter-concept-tree"))??[];for(const i of Array.from(t)){const t=(null==(o=i.shadowRoot)?void 0:o.querySelectorAll("jupiter-form-field"))??[];for(const i of Array.from(t))if(i.conceptId===e.conceptId&&i.columnId===e.columnId){const e=null==(r=i.shadowRoot)?void 0:r.querySelector('input:not([type="hidden"]), select, textarea');return void(null==e||e.focus({preventScroll:!0}))}}}}_handleFilterRolesClick(){this._showFilterDialog=!0}_handleAdvancedFilterApply(e){this._showFactsOnly=e.detail.showFactsOnly,this._conceptSearchText=e.detail.conceptSearchText??"",this._showFilterDialog=!1}_handleFilterDialogCancel(){this._showFilterDialog=!1;this._getRoleIdsArray().length;this._allSections.length}_handleFormulaValidationDialogCancel(){this._showFormulaValidationDialog=!1}_handleFormulaConceptClick(e){this._showFormulaValidationDialog=!1,this.scrollToConcept(e.detail.conceptQName,void 0,void 0,e.detail.columnId,e.detail.conceptId)}_handleRoleFilterApply(e){const{selectedRoleIds:t,periodPreferences:i}=e.detail;this._applyRoleSelection(t,i,"filterDialog")}_applyRoleSelection(e,t,i){var o,r;this._selectedRoleIds,this._selectedRoleIds=e,this._periodPreferences=t,this._selectedRoleIds,this._periodPreferences;const n=this._generateSubmissionData(),a=this._draftStorageService.createMetadataSnapshot(this.periodStartDate,this.periodEndDate,this.language,this._selectedRoleIds,this._allSections,this._typedMemberData,this._periodPreferences,this._periodData,this._unitData,this.reportingLanguage,this._repeatCounts,this._decimalsData,void 0,this._getHiddenColumnsForMetadata(),this._totalManuallyEditedData);this._draftStorageService.saveDraft(n,a),this.dynaformsFacts=n,this.dynaformsMetadata=a,this._skipPeriodPreferencesRestore=!0,this._skipDraftLoading=!0,this._initializeForm(),this._skipDraftLoading=!1,this._skipPeriodPreferencesRestore=!1,null==(o=this._currentSchema)||o.sections.length,null==(r=this._currentSchema)||r.sections.map(e=>e.id);const s=this._loadDraftIfExists().then(()=>{this._seedAutoSaveBaseline()}).catch(e=>{console.error("❌ Error restoring form data after reinitialization:",e)});this._showFilterDialog=!1;const l=Array.isArray(this._selectedRoleIds)&&this._selectedRoleIds.length>0?(this._selectedRoleIds[0],this._selectedRoleIds.length):0;return this._allSections.length,this._selectedRoleIds,this.dispatchEvent(new CustomEvent("roles-filter-changed",{detail:{selectedRoleIds:e,totalRoles:this._allSections.length,visibleRoles:l,periodPreferences:t,source:i},bubbles:!0})),s}_confirmRevealHiddenRole(e){var t;return null==(t=this._revealRolePrompt)||t.resolve(!1),new Promise(t=>{this._revealRolePrompt={section:e,resolve:t}})}_settleRevealRolePrompt(e){const t=this._revealRolePrompt;this._revealRolePrompt=null,null==t||t.resolve(e)}_revealRole(e){var t;const i=this._selectedRoleIds;let o;if(i.length>0&&"object"==typeof i[0]){const r=i,n=Math.max(-1,...r.map(e=>e.order))+1;o=[...r,{roleId:e.id,roleURI:(null==(t=e.metadata)?void 0:t.roleURI)||"",order:n}]}else o=[...i,e.id];return this._applyRoleSelection(o,this._periodPreferences,"scrollToConcept")}_haveDimensionSelectionsChanged(e){var t;const i=new Set([...Object.keys(this._periodPreferences||{}),...Object.keys(e||{})]);for(const o of i){const i=null==(t=this._periodPreferences)?void 0:t[o],r=null==e?void 0:e[o],n=(null==i?void 0:i.dimensionSelections)||[],a=(null==r?void 0:r.dimensionSelections)||[];if(JSON.stringify(n.sort((e,t)=>e.dimensionId.localeCompare(t.dimensionId)))!==JSON.stringify(a.sort((e,t)=>e.dimensionId.localeCompare(t.dimensionId))))return!0}return!1}_validateForm(){var e;const t=[],i=this._currentSchema;if(i){for(const o of i.sections)for(const i of o.concepts)for(const o of i.fields){const r=null==(e=this._formData[i.id])?void 0:e[o.columnId],n=$.validateField(o.id,i.id,o.columnId,r,o.type,o.validation||[]);t.push(...n)}t.push(...Array.from(this._calculationWarnings.values())),this._errors=t,this._valid=0===t.filter(e=>"error"===e.severity).length}}_handleCalculationMismatchChanged(e){const{key:t,mismatch:i}=e.detail,o=new Map(this._calculationWarnings);i?o.set(t,{fieldId:`${i.totalConceptId}__${i.columnId}`,conceptId:i.totalConceptId,columnId:i.columnId,message:i.message,severity:"warning",rule:{type:"custom",message:i.message,severity:"warning"},details:i}):o.delete(t),this._calculationWarnings=o,this._validateForm()}_writeFormDataValue(e,t,i){const o={...this._formData};o[e]||(o[e]={});const r=o[e][t];return o[e]={...o[e],[t]:i},this._formData=o,r}_handleFieldChange(e){const{fieldId:t,conceptId:i,columnId:o,value:r}=e.detail,n=this._writeFormDataValue(i,o,r);this._formData[i],this._touched.add(`${i}-${o}`),this._dirty=!0,this.hasUnsavedChanges=!0,this._validateForm(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("field-change",{detail:{fieldId:t,conceptId:i,columnId:o,value:r,oldValue:n},bubbles:!0}))}_handlePeriodChange(e){e.detail;const{conceptId:t,columnId:i,periodType:o,periodStartDate:r,periodEndDate:n,periodInstantDate:a,unit:s}=e.detail,l={...this._periodData};l[t]||(l[t]={}),l[t]={...l[t],[i]:{startDate:r,endDate:n,instantDate:a}},this._periodData=l,this._periodData[t][i],JSON.stringify(this._periodData,null,2),s&&this._storeUnit(t,i,s),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate()}_handleUnitChange(e){e.detail;const{conceptId:t,columnId:i,unit:o}=e.detail;this._storeUnit(t,i,o),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate()}_storeUnit(e,t,i){JSON.stringify(this._unitData,null,2);const o={...this._unitData};o[e]||(o[e]={}),o[e]={...o[e],[t]:i},this._unitData=o,this._unitData[e][t],JSON.stringify(this._unitData,null,2)}_handleDecimalsChange(e){const{conceptId:t,columnId:i,decimals:o}=e.detail;t&&i&&(this._storeDecimals(t,i,o),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate())}_computeEffectiveMasterData(){const e="rj-i_DocumentIntendedRoundingLevel";if("INF"!==this.decimals){const t=parseFloat(this.decimals);if(!isNaN(t))return void(this._effectiveMasterData={...this.masterData||{},[e]:String(-t)})}this._effectiveMasterData=this.masterData?{...this.masterData}:void 0}_initializeGlobalDecimalsFromRoundingData(){if(this._hasValidGlobalDecimals())return;const e=this._findRoundingLevelFactValue(this._allSections)??this._findRoundingLevelValueInFormData(this._formData);if(null==e||""===e)return;const t=parseFloat(String(e));isNaN(t)||(this.decimals=String(Math.abs(t)))}_findRoundingLevelValueInFormData(e){if(e)for(const t of Object.keys(e)){if(!this._isRoundingLevelConcept(t))continue;const i=e[t]||{};for(const e of Object.keys(i)){const t=i[e];if(null!=t&&""!==t)return t}}}_findRoundingLevelFactValue(e){for(const t of e){const e=this._findRoundingLevelFactValueInConcepts(t.concepts||[]);if(null!=e&&""!==e)return e}}_findRoundingLevelFactValueInConcepts(e){for(const t of e){const e=t.originalConceptId||t.id;if(this._isRoundingLevelConcept(e)){const e=t.facts||[];for(const t of e)if(void 0!==(null==t?void 0:t.value)&&null!==(null==t?void 0:t.value)&&""!==(null==t?void 0:t.value))return t.value}if(t.children&&t.children.length>0){const e=this._findRoundingLevelFactValueInConcepts(t.children);if(null!=e&&""!==e)return e}}}_hasValidGlobalDecimals(){if(void 0===this.decimals||null===this.decimals)return!1;if("INF"===this.decimals)return!1;const e=parseFloat(this.decimals);return!isNaN(e)}_isRoundingLevelConcept(e){return!!e&&("rj-i_DocumentIntendedRoundingLevel"===e||e.includes("DocumentIntendedRoundingLevel"))}_findFactValueForField(e,t,i){var o,r;if(!e.facts||0===e.facts.length)return;const n=this._findColumnByIdInSection(t.columnId,i),a=null==(o=this._periodData[e.id])?void 0:o[t.columnId],s=(null==a?void 0:a.startDate)||(null==n?void 0:n.periodStartDate)||t.periodStartDate||this.periodStartDate,l=(null==a?void 0:a.endDate)||(null==n?void 0:n.periodEndDate)||t.periodEndDate||this.periodEndDate,d=(null==a?void 0:a.instantDate)||t.periodInstantDate||l||s,c=null==(r=this._unitData[e.id])?void 0:r[t.columnId],p={conceptId:e.originalConceptId||t.conceptId||e.id,columnId:t.columnId,periodStartDate:s,periodEndDate:l,periodInstantDate:d,periodType:t.periodType,unit:c,dimensionData:null==n?void 0:n.dimensionData},u=De.findMatchingFact(e.facts,p);return null==u?void 0:u.value}_storeDecimals(e,t,i){const o={...this._decimalsData};o[e]||(o[e]={}),o[e]={...o[e],[t]:i??""},this._decimalsData=o}_generateUniqueConceptKey(e,t){return`${e}::${t}`}_extractOriginalConceptId(e){const t=e.split("::");return t.length>1?t[1]:e}_handleAddConceptRepeat(e){const{conceptId:t}=e.detail;this._repeatCounts={...this._repeatCounts,[t]:(this._repeatCounts[t]||0)+1},this._dirty=!0,this.hasUnsavedChanges=!0}_handleRemoveConceptRepeat(e){const{conceptId:t}=e.detail,i=t.match(/^(.+)__repeat_(\d+)$/),o=i?i[1]:t,r=i?parseInt(i[2]):this._repeatCounts[t]||0,n=this._repeatCounts[o]||0;if(n<=0||r<1||r>n)return;const a={...this._formData},s={...this._typedMemberData},l={...this._unitData},d={...this._periodData};for(let u=r;u<n;u++){const e=`${o}__repeat_${u+1}`,t=`${o}__repeat_${u}`;void 0!==a[e]?a[t]=a[e]:delete a[t];const i=`${t}__`,r=`${e}__`,n=Object.keys(s).filter(e=>e.startsWith(r));Object.keys(s).filter(e=>e.startsWith(i)).forEach(e=>delete s[e]),n.forEach(e=>{s[`${t}__${e.slice(r.length)}`]=s[e]}),n.forEach(e=>delete s[e]),void 0!==l[e]?l[t]=l[e]:delete l[t],void 0!==d[e]?d[t]=d[e]:delete d[t]}const c=`${o}__repeat_${n}`;delete a[c],delete l[c],delete d[c];const p=`${c}__`;Object.keys(s).filter(e=>e.startsWith(p)).forEach(e=>delete s[e]),this._formData=a,this._typedMemberData=s,this._unitData=l,this._periodData=d,this._repeatCounts={...this._repeatCounts,[o]:n-1},this._dirty=!0,this.hasUnsavedChanges=!0}_scopedColumnKey(e,t){return`${e}__${t}`}_handleTypedMemberChange(e){const{columnId:t,axisId:i,value:o,conceptId:r,sectionId:n}=e.detail,a=r?`${r}__${t}`:n?this._scopedColumnKey(n,t):t,s={...this._typedMemberData};s[a]||(s[a]={}),s[a]={...s[a],[i]:o},this._typedMemberData=s,this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("typed-member-change",{detail:{columnId:t,axisId:i,value:o},bubbles:!0}))}_handleFieldBlur(e){var t;e.detail;const{fieldId:i,conceptId:o,columnId:r,xbrlValidationErrors:n}=e.detail;let a="";const s=e.composedPath();s.length;for(const l of s){const e=l;if("JUPITER-FORM-SECTION"===e.tagName){a=e.getAttribute("section-id")||"";break}}if(n&&n.length,n&&n.length>0){const e=(null==(t=this._formData[o])?void 0:t[r])||"",s=this._xbrlFormErrors.findIndex(e=>e.fieldId===i&&e.sectionId===a),l={sectionId:a,fieldId:i,conceptId:o,columnId:r,value:e,errors:n};this._xbrlFormErrors=s>=0?[...this._xbrlFormErrors.slice(0,s),l,...this._xbrlFormErrors.slice(s+1)]:[...this._xbrlFormErrors,l]}else{this._xbrlFormErrors.length;this._xbrlFormErrors=this._xbrlFormErrors.filter(e=>!(e.fieldId===i&&e.sectionId===a)),this._xbrlFormErrors.length}this._xbrlFormErrors.length,this._xbrlFormErrors}_getSectionTitle(e){this._allSections.map(e=>({id:e.id,title:e.title}));const t=this._allSections.find(t=>t.id===e),i=(null==t?void 0:t.title)||e||"(Unknown Section)";return i}_roleHasErrors(e){return this._xbrlFormErrors.some(t=>t.sectionId===e)}async _handleErrorFieldClick(e,t,i){this._showErrorPopup=!1,this.requestUpdate(),await this._focusFormField(e,t,i)}async _handleTypedDimensionFactClick(e,t,i){this._showTypedDimensionWarning=!1,this.requestUpdate(),await this._focusFormField(e,t,i)}async _focusFormField(e,t,i){var o,r,n,a,s,l,d;if(await this.updateComplete,!(null==(o=this._currentSchema)?void 0:o.sections.some(e=>e.id===i))){const e=this._allSections.find(e=>e.id===i);if(!e||!(await this._confirmRevealHiddenRole(e)))return;await this._revealRole(e)}(null==(r=this._hiddenColumnIds.get(i))?void 0:r.has(t))&&(this._showColumn(i,t),await this.updateComplete),"sidePanel"===this.display&&this._activeSidePanelRoleId!==i&&(this._activeSidePanelRoleId,this._activeSidePanelRoleId=i,this.requestUpdate(),await this.updateComplete,this._scrollActiveRoleIntoView(),await new Promise(e=>setTimeout(e,500)));const c=null==(n=this.shadowRoot)?void 0:n.querySelectorAll("jupiter-form-section");let p=null;if(null==c||c.forEach(e=>{var t;(null==(t=e.section)?void 0:t.id)===i&&(p=e)}),!p)return void console.warn(`⚠️ Section not found: ${i}`);if(await p.updateComplete,await(null==(a=p.revealConcept)?void 0:a.call(p,e))&&await Promise.all(Array.from((null==(s=p.shadowRoot)?void 0:s.querySelectorAll("jupiter-concept-tree"))??[]).map(e=>e.updateComplete)),await new Promise(e=>setTimeout(e,100)),p.shadowRoot,p.shadowRoot){null==(l=p.shadowRoot.innerHTML)||l.length;const e=p.shadowRoot.querySelectorAll("*");e.length;Array.from(e).filter(e=>{const t=e;return!(!t.tagName||!t.tagName.includes("-"))}).map(e=>e.tagName).join(", ")}const u=`${e}_${t}_field`,h=null==(d=p.shadowRoot)?void 0:d.querySelectorAll("jupiter-concept-tree");let m=null;if(null==h||h.length,h&&h.forEach((i,o)=>{var r;if(m)return;const n=null==(r=i.shadowRoot)?void 0:r.querySelectorAll("jupiter-form-field");null==n||n.length,null==n||n.forEach((i,o)=>{var r;if(!m&&(i.conceptId,i.columnId,i.conceptId===e&&i.columnId===t)){const e=null==(r=i.shadowRoot)?void 0:r.querySelector("input, textarea");e&&(m=e)}})}),!m)return void console.warn(`⚠️ Input field not found for: ${u}`);const f=m;p.scrollIntoView({behavior:"smooth",block:"start"}),await new Promise(e=>setTimeout(e,300)),f.focus(),"INPUT"!==f.tagName&&"TEXTAREA"!==f.tagName||f.select(),f.style.boxShadow="0 0 0 3px rgba(220, 38, 38, 0.5)",setTimeout(()=>{f.style.boxShadow=""},2e3)}_handleSectionExpand(e){this.dispatchEvent(new CustomEvent("section-expand",{detail:e.detail,bubbles:!0}))}_handleConceptExpand(e){this.dispatchEvent(new CustomEvent("concept-expand",{detail:e.detail,bubbles:!0}))}_handleColumnRemove(e){const{columnId:t,sectionId:i}=e.detail;if(this._currentSchema&&i){const e=this._currentSchema.sections.find(e=>e.id===i);e&&e.columns&&(e.columns=e.columns.filter(e=>e.id!==t))}else this._columns=this._columns.filter(e=>e.id!==t),this._currentSchema&&this._currentSchema.sections.forEach(e=>{e.columns&&(e.columns=e.columns.filter(e=>e.id!==t))});this._removeColumnData(t,i),this._dirty=!0,this.hasUnsavedChanges=!0,this._validateForm(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-remove",{detail:{columnId:t,sectionId:i},bubbles:!0}))}_handleColumnHide(e){const{columnId:t,sectionId:i}=e.detail;i&&t&&(this._hiddenColumnIds.has(i)||this._hiddenColumnIds.set(i,new Set),this._hiddenColumnIds.get(i).add(t),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-hide",{detail:{columnId:t,sectionId:i},bubbles:!0})))}_handleColumnShow(e){const{columnId:t,sectionId:i}=e.detail;i&&t&&this._showColumn(i,t)}_showColumn(e,t){var i;null==(i=this._hiddenColumnIds.get(e))||i.delete(t),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-show",{detail:{columnId:t,sectionId:e},bubbles:!0}))}_getColumnsWithHiddenFlags(e){const t=e.columns||this._columns,i=this._hiddenColumnIds.get(e.id);return i&&0!==i.size?t.map(e=>i.has(e.id)?{...e,hidden:!0}:e):t}_getHiddenColumnsForMetadata(){if(0===this._hiddenColumnIds.size)return;const e={};return this._hiddenColumnIds.forEach((t,i)=>{t.size>0&&(e[i]=Array.from(t))}),Object.keys(e).length>0?e:void 0}_handleColumnAddRequest(e){const{sectionId:t,columnRequest:i,insertAfterColumnId:o}=e.detail;this._addColumnFromRequest(i,t,o)}_getAvailableDimensionsForSection(e){var t,i,o;if(!(null==(i=null==(t=this.xbrlInput)?void 0:t.hypercubes)?void 0:i[0]))return[];const r=this.xbrlInput.hypercubes[0].roles.find(t=>t.roleId===e);if(!(null==(o=null==r?void 0:r.items)?void 0:o.length))return[];const n=[],a=this.language||"en",s=(e,t)=>{var i;return(null==(i=(null==e?void 0:e.find(e=>e.lang===a&&"http://www.xbrl.org/2003/role/label"===e.role))||(null==e?void 0:e.find(e=>"en"===e.lang&&"http://www.xbrl.org/2003/role/label"===e.role))||(null==e?void 0:e.find(e=>"http://www.xbrl.org/2003/role/label"===e.role)))?void 0:i.label)||t};return r.items.forEach(e=>{e.dimensions&&e.dimensions.length>0&&e.dimensions.forEach(e=>{if(!n.find(t=>t.id===e.id)){const t=s(e.labels,e.conceptName),i={id:e.id,conceptName:e.conceptName,axisLabel:t};e.members&&e.members.length>0&&(i.members=e.members.map(e=>({id:e.id,label:s(e.labels,e.conceptName||e.id)}))),e.typedMember&&(i.typedMember={id:e.typedMember.id,dataType:e.typedMember.type||"string",validation:e.typedMember.validation}),n.push(i)}})}),n}_formatPeriodDisplay(e,t){if(!e||!t)return`${e||""} / ${t||""}`;const i=e.substring(0,4);return i===t.substring(0,4)?i:`${e} / ${t}`}_resolveSubmissionInstantDate(e,t,i,o){const r=this._getEffectivePeriodRole(e);if(null==r?void 0:r.includes("periodStartLabel")){const e=(null==i?void 0:i.startDate)||(null==o?void 0:o.periodStartDate)||t.periodStartDate||this.periodStartDate,n=(null==i?void 0:i.endDate)||(null==o?void 0:o.periodEndDate)||t.periodEndDate||this.periodEndDate;return this._resolveInstantDate(r,void 0,e,n)}return(null==i?void 0:i.instantDate)||(null==i?void 0:i.endDate)||t.periodInstantDate||(null==o?void 0:o.periodEndDate)||t.periodEndDate||t.periodStartDate||this.periodStartDate}_getEffectivePeriodRole(e){return e.effectivePeriodRole??e.preferredLabel}_resolveInstantDate(e,t,i,o){if(null==e?void 0:e.includes("periodStartLabel")){const e=i||"2025-01-01";try{const t=new Date(e);return t.setDate(t.getDate()-1),t.toISOString().split("T")[0]}catch{return e}}return t||o||i||"2025-01-01"}_correctLegacyPeriodStartInstantDates(){this._allSections.forEach(e=>{this._correctPeriodStartInstantDatesInConcepts(e.concepts,e)})}_correctPeriodStartInstantDatesInConcepts(e,t){e.forEach(e=>{var i,o;(null==(i=this._getEffectivePeriodRole(e))?void 0:i.includes("periodStartLabel"))&&"instant"===e.periodType&&(null==(o=e.fields)?void 0:o.length)&&e.fields.forEach(i=>{this._correctFieldPeriodStartInstantDate(e,i,e.id,t);const o=this._repeatCounts[e.id]||0;for(let r=1;r<=o;r++)this._correctFieldPeriodStartInstantDate(e,i,`${e.id}__repeat_${r}`,t)}),e.children&&this._correctPeriodStartInstantDatesInConcepts(e.children,t)})}_correctFieldPeriodStartInstantDate(e,t,i,o){var r;const n=this._findColumnByIdInSection(t.columnId,o),a=null==(r=this._periodData[i])?void 0:r[t.columnId],s=(null==a?void 0:a.startDate)||(null==n?void 0:n.periodStartDate)||t.periodStartDate||this.periodStartDate,l=(null==a?void 0:a.endDate)||(null==n?void 0:n.periodEndDate)||t.periodEndDate||this.periodEndDate,d=this._resolveInstantDate(this._getEffectivePeriodRole(e),void 0,s,l);a&&a.instantDate!==d&&(t.columnId,a.instantDate,a.instantDate=d),t.periodInstantDate!==d&&(e.id,t.columnId,t.periodInstantDate,t.periodInstantDate=d)}_addColumnFromRequest(e,t,i){var o,r,n,a,s;const l=`col-${Date.now()}`;let d="",c="";"instant"===e.periodType?(d=e.instantDate||"",c=""):"duration"!==e.periodType&&"mixed"!==e.periodType||(d=this._formatPeriodDisplay(e.startDate,e.endDate),c="");let p={dimensionId:"period",memberValue:"instant"===e.periodType?`instant-${e.instantDate}`:`duration-${e.startDate}-${e.endDate}`,memberLabel:d};if(e.selectedDimensions&&e.selectedDimensions.length>0){const t=[],i=[];for(const o of e.selectedDimensions)o.isTyped?(t.push(o.axisLabel),i.push(`${o.axisId}|${o.typedValue||""}`)):o.memberId&&o.memberLabel&&(t.push(o.memberLabel),i.push(`${o.axisId}|${o.memberId}`));t.length>0&&(d=t.join(" | "),c="instant"===e.periodType?e.instantDate||"":this._formatPeriodDisplay(e.startDate,e.endDate),p={dimensionId:l,memberValue:t.join(" | "),memberLabel:t.join(" | "),memberKey:t.join(" | "),dimensionIdKey:i.join("::"),selectedDimensions:e.selectedDimensions},p.memberKey)}else if(null==(r=null==(o=this.xbrlInput)?void 0:o.hypercubes)?void 0:r[0]){const i=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===t);if(1===(null==(n=null==i?void 0:i.items)?void 0:n.length)){const t=i.items[0];if(1===t.dimensions.length){const i=t.dimensions[0];if(i.members&&i.members.length>0){const t=(null==(a=i.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:a.label)||i.conceptName,o=i.members[0],r=(null==(s=o.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:s.label)||o.conceptName;d=r,c="instant"===e.periodType?e.instantDate||"":this._formatPeriodDisplay(e.startDate,e.endDate),p={dimensionId:l,axisId:i.id,memberId:o.id,memberValue:r,memberLabel:r,axis:t,axisLabel:t,memberKey:`${t} | ${r}`,dimensionIdKey:`${i.id} | ${o.id}`},p.memberKey}}}}const u={id:l,title:d,description:c,type:(p.memberKey,"dimension"),order:this._columns.length,removable:!0,dimensionData:p,periodStartDate:"instant"===e.periodType?e.instantDate:e.startDate,periodEndDate:"instant"===e.periodType?e.instantDate:e.endDate};if(e.selectedDimensions&&e.selectedDimensions.length>0){const t={};let i=!1;for(const o of e.selectedDimensions)o.isTyped&&(t[o.axisId]=o.typedValue||"",i=!0);i&&(this._typedMemberData[l]=t,u.dimensionData&&(u.dimensionData.hasTypedMembers=!0,u.dimensionData.typedMembers=e.selectedDimensions.filter(e=>e.isTyped).map(e=>({axisId:e.axisId,axisLabel:e.axisLabel,typedMemberId:e.axisId,memberLabel:e.axisLabel,type:e.dataType,validation:e.validation}))))}if(this._currentSchema){const e=this._currentSchema.sections.find(e=>e.id===t);if(e)if(e.columns||(e.columns=[...this._columns]),i){const t=e.columns.findIndex(e=>e.id===i);e.columns=-1!==t?[...e.columns.slice(0,t+1),u,...e.columns.slice(t+1)]:[...e.columns,u]}else e.columns=[...e.columns,u]}this._replicateFieldsForNewColumn(l,e,t),this._dirty=!0,this.hasUnsavedChanges=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-add",{detail:{column:u},bubbles:!0}))}_removeColumnData(e,t){if(this._currentSchema)if(t){const i=this._currentSchema.sections.find(e=>e.id===t);i&&this._removeColumnDataFromConcepts(i.concepts,e)}else for(const i in this._formData)void 0!==this._formData[i][e]&&delete this._formData[i][e]}_removeColumnDataFromConcepts(e,t){e.forEach(e=>{this._formData[e.id]&&void 0!==this._formData[e.id][t]&&delete this._formData[e.id][t],e.fields&&(e.fields=e.fields.filter(e=>e.columnId!==t)),e.children&&this._removeColumnDataFromConcepts(e.children,t)})}_shouldCreateFieldForConcept(e,t){if(e.abstract)return!1;if(!(t.selectedDimensions&&t.selectedDimensions.length>0)&&e.periodType){if("instant"===t.periodType&&"instant"!==e.periodType)return!1;if("duration"===t.periodType&&"duration"!==e.periodType)return!1}return!0}_replicateFieldsForNewColumn(e,t,i){if(!this._currentSchema)return;const o=new k,r=this._currentSchema.sections.find(e=>e.id===i);r&&this._replicateFieldsForSection(r.concepts,e,t,o)}_replicateFieldsForSection(e,t,i,o){e.forEach(e=>{var r;if(this._shouldCreateFieldForConcept(e,i)){const o=null==(r=e.fields)?void 0:r[0];let n;const a="instant"===i.periodType?i.instantDate:i.startDate,s="instant"===i.periodType?i.instantDate:i.endDate,l=this._resolveInstantDate(this._getEffectivePeriodRole(e),i.instantDate,a,s);n=o?{id:`${e.id}_${t}`,conceptId:e.id,columnId:t,type:o.type,label:o.label,placeholder:o.placeholder,required:o.required,disabled:o.disabled,validation:o.validation,defaultValue:o.defaultValue,periodType:e.periodType,conceptType:e.type,periodStartDate:a,periodEndDate:s,periodInstantDate:"instant"===e.periodType?l:void 0}:{id:`${e.id}_${t}`,conceptId:e.id,columnId:t,type:"text",label:e.label||e.name,placeholder:`Enter ${e.name}`,required:!1,disabled:!1,validation:[],defaultValue:"",periodType:e.periodType,conceptType:e.type,periodStartDate:a,periodEndDate:s,periodInstantDate:"instant"===e.periodType?l:void 0},e.fields||(e.fields=[]),e.fields.push(n)}e.children&&this._replicateFieldsForSection(e.children,t,i,o)})}_addColumn(){const e={id:`dim-${Date.now()}`,title:`Dimension ${this._columns.length}`,description:"Additional dimension column",type:"dimension",order:this._columns.length,removable:!0,dimensionData:{dimensionId:"custom",memberValue:"default",memberLabel:"Default Member"}};this._columns=[...this._columns,e],this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-add",{detail:{column:e},bubbles:!0}))}_findMissingTypedDimensionFacts(){var e;const t=[];if(!this._currentSchema)return t;for(const i of this._currentSchema.sections)for(const o of i.columns||[]){const r=null==(e=o.dimensionData)?void 0:e.typedMembers;if(!r||0===r.length)continue;const n=this._typedMemberData[this._scopedColumnKey(i.id,o.id)],a=this._typedMemberData[o.id];r.some(e=>{const t=(null==n?void 0:n[e.axisId])??(null==a?void 0:a[e.axisId]);return!(null==t?void 0:t.trim())})&&this._collectEnteredFactsForColumn(i.concepts,o,i,t)}return t}_collectEnteredFactsForColumn(e,t,i,o){var r,n;for(const a of e){const e=null==(r=this._formData[a.id])?void 0:r[t.id];null!=e&&""!==String(e).trim()&&o.push({conceptId:a.id,conceptLabel:a.label,columnId:t.id,columnTitle:t.title,sectionId:i.id,sectionTitle:i.title,value:e}),(null==(n=a.children)?void 0:n.length)&&this._collectEnteredFactsForColumn(a.children,t,i,o)}}_groupTypedDimensionWarningFactsByRole(){const e=[],t=new Map;for(const i of this._typedDimensionWarningFacts){let o=t.get(i.sectionId);o||(o={sectionId:i.sectionId,sectionTitle:i.sectionTitle,facts:[]},t.set(i.sectionId,o),e.push(o)),o.facts.push(i)}return e}_handleSubmit(){if(this._submitted=!0,this._submitDisabled=!0,"admin"===this.mode)return this._handleSaveDraft(),this._handleAdminModeSubmit(),void(this._submitDisabled=!1);const e=this._findMissingTypedDimensionFacts();if(e.length>0)return this._typedDimensionWarningFacts=e,this._showTypedDimensionWarning=!0,this._submitDisabled=!1,void this.requestUpdate();this._continueSubmit()}_continueSubmit(){if(this._submitted=!0,this._submitDisabled=!0,this._xbrlFormErrors.length,this._xbrlFormErrors,this._xbrlFormErrors.length>0)return this._xbrlFormErrors,this._showErrorPopup=!0,this._submitDisabled=!1,void this.requestUpdate();if(this._validateForm(),!this._valid)return this._errors,this._showErrorPopup=!0,this._submitDisabled=!1,void this.requestUpdate();this._correctLegacyPeriodStartInstantDates();const e=this._generateSubmissionData();JSON.stringify(e,null,2),e.forEach((e,t)=>{e.conceptId,e.columnId,e.value,e.unit}),this.dispatchEvent(new CustomEvent("form-submit",{detail:{data:this._formData,submissionData:e,valid:this._valid,errors:this._errors,reportingLanguage:this.reportingLanguage},bubbles:!0})),setTimeout(()=>{this._submitDisabled=!1},1e3)}_handleQuickValidate(){"admin"!==this.mode&&this._runFormulaValidationPreflight()}_runFormulaValidationPreflight(){var e,t,i,o,r,n,a,s;if(!this.formulaEnabled)return;const l=null==(i=null==(t=null==(e=this.xbrlInput)?void 0:e.formula)?void 0:t[0])?void 0:i.roles;if(!l||0===l.length)return;const d=(null==(r=null==(o=this._currentSchema)?void 0:o.sections)?void 0:r.length)?this._currentSchema.sections:this._allSections;if(!d||0===d.length)return;const c=new Set(d.map(e=>{var t;return(null==(t=e.metadata)?void 0:t.roleURI)||e.id})),p=l.filter(e=>c.has(e.roleURI));if(0===p.length)return;const u=d.map(e=>{var t;return{roleURI:(null==(t=e.metadata)?void 0:t.roleURI)||e.id,concepts:e.concepts,columns:e.columns}}),h=X(this._formData,this._mergeAllSectionColumns(),u,null==(s=null==(a=null==(n=this.xbrlInput)?void 0:n.hypercubes)?void 0:a[0])?void 0:s.roles,this.periodStartDate,this.periodEndDate,this._typedMemberData),m={...this.xbrlInput,formula:[{...this.xbrlInput.formula[0],roles:p}]},f=this._formulaValidationService.evaluate(m,h,this.language),b=this._formulaValidationService.summarize(f);this._formulaValidationResults=f,this._formulaValidationSummary=b;f.some(e=>!e.skipped&&!e.satisfied)&&(this._showFormulaValidationDialog=!0),this.dispatchEvent(new CustomEvent("formula-validation-complete",{detail:{results:f,summary:b},bubbles:!0,composed:!0}))}_mergeAllSectionColumns(){const e=new Map;return this._columns.forEach(t=>e.set(t.id,t)),this._allSections.forEach(t=>{(t.columns||[]).forEach(t=>e.set(t.id,t))}),Array.from(e.values())}_handleSaveDraft(e="manual"){if(this._xbrlFormErrors.length,this._xbrlFormErrors,this._xbrlFormErrors.length>0)return this._xbrlFormErrors,this._showErrorPopup=!0,void this.requestUpdate();this._formData,this._unitData,this._selectedRoleIds,this._correctLegacyPeriodStartInstantDates();const t=this._generateSubmissionData();t.forEach((e,t)=>{e.conceptId,e.columnId,e.value,e.unit});const i=this._roleCompletedStates.size>0?Object.fromEntries(this._roleCompletedStates):void 0,o=this._draftStorageService.createMetadataSnapshot(this.periodStartDate,this.periodEndDate,this.language,this._selectedRoleIds,this._allSections,this._typedMemberData,this._periodPreferences,this._periodData,this._unitData,this.reportingLanguage,this._repeatCounts,this._decimalsData,i,this._getHiddenColumnsForMetadata(),this._totalManuallyEditedData),r=JSON.stringify({draftData:t,metadata:o});if(r===this._lastSavedDraftSnapshot)return void(this.hasUnsavedChanges=!1);this._lastSavedDraftSnapshot=r,this.hasUnsavedChanges=!1;const n=this._draftStorageService.saveDraft(t,o);o.selectedRoleIds,this.dynaformsFacts=t,this.dynaformsMetadata=o,this.dispatchEvent(new CustomEvent("form-save-draft",{detail:{data:this._formData,draftData:t,metadata:o,saved:n,valid:this._valid,errors:this._errors,dynaformsFacts:t,dynaformsMetadata:o,reportingLanguage:this.reportingLanguage,source:"auto"==e?"auto":"manual"},bubbles:!0,composed:!0}));this._getRoleIdsArray().length;t.length,o.customColumns.length,Array.isArray(this._selectedRoleIds)&&this._selectedRoleIds.length>0&&this._selectedRoleIds[0]}async _loadDraftIfExists(){if(this.dynaformsFacts&&this.dynaformsMetadata){const e={formData:this.dynaformsFacts,metadata:this.dynaformsMetadata};return await this._restoreFromDraft(e),this._draftLoaded=!0,this._draftLoadedAt=this.dynaformsMetadata.savedAt||(new Date).toISOString(),void this.dispatchEvent(new CustomEvent("form-draft-loaded",{detail:{draft:e,source:"external",compatible:!0,warnings:[]},bubbles:!0,composed:!0}))}if(!this._draftStorageService.hasDraft())return;const e=this._draftStorageService.loadDraft();if(!e)return void console.warn("⚠️ Failed to load draft");const{compatible:t,warnings:i}=this._draftStorageService.validateDraftCompatibility(e,this.periodStartDate,this.periodEndDate);i.length>0&&console.warn("⚠️ Draft compatibility warnings:",i),await this._restoreFromDraft(e),this.dispatchEvent(new CustomEvent("form-draft-loaded",{detail:{draft:e,compatible:t,warnings:i},bubbles:!0,composed:!0})),e.formData.length,e.metadata.savedAt,this._draftStorageService.getDraftAge()}async _restoreFromDraft(e){var t;const{formData:i,metadata:o}=e;o.selectedRoleIds&&o.selectedRoleIds.length>0&&(this._selectedRoleIds=o.selectedRoleIds,this._selectedRoleIds.length),o.typedMemberData&&(this._typedMemberData=o.typedMemberData,this._preservedTypedMemberData={}),o.repeatCounts&&(this._repeatCounts=o.repeatCounts,this._repeatCounts),o.periodData&&(this._periodData=o.periodData,Object.keys(this._periodData).length),o.unitData&&(this._unitData=o.unitData,Object.keys(this._unitData).length),o.decimalsData&&(this._decimalsData=o.decimalsData,Object.keys(this._decimalsData).length),o.roleCompletedStates&&(this._roleCompletedStates=new Map(Object.entries(o.roleCompletedStates)),Object.keys(o.roleCompletedStates).length),o.hiddenColumns&&(this._hiddenColumnIds=new Map(Object.entries(o.hiddenColumns).map(([e,t])=>[e,new Set(t)])),this._hiddenColumnIds.size),o.totalManuallyEditedData&&(this._totalManuallyEditedData=o.totalManuallyEditedData,Object.keys(this._totalManuallyEditedData).length),o.periodPreferences?this._skipPeriodPreferencesRestore||(this._periodPreferences=o.periodPreferences,this._periodPreferences,this.xbrlInput&&(this._currentSchema=k.buildFormSchema(this.xbrlInput,this.periodStartDate,this.periodEndDate,this.language,this._periodPreferences),this._allSections=[...this._currentSchema.sections],this._applyCustomPeriodDataToFields(),o.customColumns&&o.customColumns.length>0&&(this._mergeAdditionalCustomColumns(o.customColumns),o.customColumns.length))):o.customColumns&&o.customColumns.length>0&&(this._restoreCustomColumns(o.customColumns),o.customColumns.length);const r={},n={},a={};i.forEach(e=>{let{conceptId:t,draftInstanceId:i,value:o,columnId:s,period:l,unit:d}=e;if(!s&&l&&(s=this._inferColumnIdFromPeriod(l,t),!s))return void console.warn(`⚠️ Could not infer columnId for concept ${t}, skipping...`);const c=i||t,p=c.includes("__repeat_")?c.split("__repeat_")[0]:c,u=this._findActualConceptId(p),h=c.includes("__repeat_")?`${u||p}__repeat_${c.split("__repeat_")[1]}`:u||c;r[h]||(r[h]={}),r[h][s]=o,l&&(n[h]||(n[h]={}),"instant"===l.type?(n[h][s]={instantDate:l.date},l.date):"duration"===l.type&&(n[h][s]={startDate:l.startDate,endDate:l.endDate},l.startDate,l.endDate)),d&&(a[h]||(a[h]={}),a[h][s]=d)}),this._formData={...this._formData,...r},Object.keys(r).length,this._seedLegacyManuallyEditedTotals(r),this._initializeGlobalDecimalsFromRoundingData(),this._periodData={...this._periodData,...o.periodData||{},...n},Object.keys(this._periodData).length,JSON.stringify(this._periodData,null,2),this._unitData={...this._unitData,...o.unitData||{},...a},Object.keys(this._unitData).length,JSON.stringify(this._unitData,null,2),this._correctLegacyPeriodStartInstantDates(),this._selectedRoleIds.length>0&&this._applyRoleFilter(),this._dirty=!0,this._touched.clear(),this._validateForm(),this._allSections=[...this._allSections],this.requestUpdate(),await this.updateComplete,await new Promise(e=>setTimeout(e,100));const s=(null==(t=this.shadowRoot)?void 0:t.querySelectorAll("input, textarea, select").length)||0;s>0?this._populateFieldValues(r):console.error("❌ No fields found in DOM even after updateComplete")}_findActualConceptId(e){for(const t of this._allSections){const i=this._findActualConceptIdInTree(t.concepts,e);if(i)return i}return null}_findActualConceptIdInTree(e,t){for(const i of e){if(i.originalConceptId===t||i.id===t)return i.id;if(i.children){const e=this._findActualConceptIdInTree(i.children,t);if(e)return e}}return null}_inferColumnIdFromPeriod(e,t){for(const i of this._allSections){if(this._findConceptInSection(i.concepts,t)&&i.columns){for(const t of i.columns){const i="instant"===e.type,o="duration"===e.type;if(i&&e.date){if(t.periodStartDate===e.date||t.periodStartDate===t.periodEndDate&&t.periodStartDate===e.date)return t.id,t.id}else if(o&&e.startDate&&e.endDate&&t.periodStartDate===e.startDate&&t.periodEndDate===e.endDate)return t.id,t.id}if("instant"===e.type){const e=i.columns.find(e=>"instant"===e.id);if(e)return e.id}else{const e=i.columns.find(e=>"duration"===e.id);if(e)return e.id}}}return null}_findConceptInSection(e,t){for(const i of e){if(i.id===t||i.originalConceptId===t)return i;if(i.children){const e=this._findConceptInSection(i.children,t);if(e)return e}}return null}_populateFieldValues(e){Object.keys(e).forEach(t=>{const i=e[t];Object.keys(i).forEach(e=>{var o,r;const n=i[e],a=`${t}__${e}`,s=null==(o=this.shadowRoot)?void 0:o.querySelector(`#${CSS.escape(a)}`);s?(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement)&&("checkbox"===s.type?s.checked=Boolean(n):s.value=null!=n?String(n):""):(console.warn(` ❌ Field element NOT FOUND: ${a}`),console.warn(" Available fields in DOM:",Array.from((null==(r=this.shadowRoot)?void 0:r.querySelectorAll("input, textarea, select"))||[]).map(e=>e.id).filter(e=>e.includes(t.split("__")[0]))))})})}_seedLegacyManuallyEditedTotals(e){const t={...this._totalManuallyEditedData};let i=!1;const o=r=>{var n;for(const a of r){if(F(a.preferredLabel)){const o=e[a.id];if(o)for(const e of Object.keys(o)){const r=o[e];null==r||""===r||void 0!==(null==(n=t[a.id])?void 0:n[e])||(t[a.id]={...t[a.id]||{},[e]:!0},i=!0)}}a.children&&a.children.length>0&&o(a.children)}};for(const r of this._allSections)o(r.concepts||[]);i&&(this._totalManuallyEditedData=t)}_restoreCustomColumns(e){const t=new Map;e.forEach(e=>{t.has(e.sectionId)||t.set(e.sectionId,[]),t.get(e.sectionId).push(e)}),this._allSections.forEach(e=>{var i;const o=t.get(e.id);if(o){if(e.columns=o.map(e=>{const t={id:e.columnId,title:e.label,description:e.description,type:e.dimensionData?"dimension":"base",periodStartDate:e.startDate||e.date,periodEndDate:e.endDate||e.date,dimensionData:e.dimensionData,order:0,removable:"duration"!==e.columnId&&"instant"!==e.columnId,periodType:e.periodType};return e.columnId,t}),(null==(i=this.xbrlInput)?void 0:i.datatypes)&&!e.datatypes){const t=Array.isArray(this.xbrlInput.datatypes)?this.xbrlInput.datatypes:this.xbrlInput.datatypes.concepts||[];e.datatypes=t,t.length,e.id}else e.datatypes?(e.id,e.datatypes.length):console.warn(`⚠️ [Draft Restore] No datatypes available for section ${e.id}`);this._regenerateFieldsForSection(e),o.length,e.id}}),this._currentSchema&&(this._currentSchema={...this._currentSchema,sections:this._allSections})}_mergeAdditionalCustomColumns(e){const t=new Map;e.forEach(e=>{e.columnId.startsWith("col-")&&(t.has(e.sectionId)||t.set(e.sectionId,[]),t.get(e.sectionId).push(e))}),this._allSections.forEach(e=>{var i;const o=t.get(e.id);if(o&&o.length>0){if(e.columns||(e.columns=[]),(null==(i=this.xbrlInput)?void 0:i.datatypes)&&!e.datatypes){const t=Array.isArray(this.xbrlInput.datatypes)?this.xbrlInput.datatypes:this.xbrlInput.datatypes.concepts||[];e.datatypes=t,t.length,e.id}else e.datatypes?(e.id,e.datatypes.length):console.warn(`⚠️ [Merge Custom] No datatypes available for section ${e.id}`);o.forEach(t=>{t.columnId,t.startDate,t.endDate,t.date,t.periodType;if(!e.columns.find(e=>e.id===t.columnId)){const i={id:t.columnId,title:t.label,description:t.description,type:t.dimensionData?"dimension":"base",periodStartDate:t.startDate||t.date,periodEndDate:t.endDate||t.date,dimensionData:t.dimensionData,order:e.columns.length,removable:!0,periodType:t.periodType};i.id,i.title,i.description,i.periodStartDate,i.periodEndDate,i.periodType,e.columns.push(i),t.columnId,e.id}}),this._regenerateFieldsForSection(e)}}),this._currentSchema&&(this._currentSchema={...this._currentSchema,sections:this._allSections})}_applyCustomPeriodDataToFields(){if(!this._periodData||0===Object.keys(this._periodData).length)return;const e=t=>{t.forEach(t=>{if(this._periodData[t.id]){const e=this._periodData[t.id];t.fields&&t.fields.forEach(i=>{const o=e[i.columnId];o&&(o.startDate&&(i.periodStartDate=o.startDate),o.endDate&&(i.periodEndDate=o.endDate),o.instantDate&&(i.periodInstantDate=o.instantDate),t.id,i.columnId,i.periodStartDate,i.periodEndDate,i.periodInstantDate)})}t.children&&t.children.length>0&&e(t.children)})};this._allSections.forEach(t=>{t.concepts&&t.concepts.length>0&&e(t.concepts)})}_regenerateFieldsForSection(e){if(!e.columns)return;const t=this._periodPreferences[e.id]||{showDuration:!0,showInstant:!0,showPreviousYear:!1},i=o=>{o.forEach(o=>{o.fields=[];this._shouldShowConceptBasedOnPeriodPreferences(o,t)&&e.columns.forEach(t=>{var i;const r=o.periodType,n=this._inferColumnPeriodType(t);if(o.abstract)return;const a=t.id.startsWith("col-"),s=t.id.startsWith("duration_")||t.id.startsWith("instant_")||t.id.startsWith("typed-"),l=!0===e.showPeriodControl;if(!(!n||"duration"===t.id||"default"===t.id||a&&l||s)&&r&&n&&r!==n)return o.id,void t.id;const d={id:`${o.id}_${t.id}`,conceptId:o.id,columnId:t.id,type:this._mapConceptTypeToFieldType(o.type),label:o.label,periodType:r,conceptType:o.type,periodStartDate:t.periodStartDate,periodEndDate:t.periodEndDate,periodInstantDate:"instant"===r?this._resolveInstantDate(this._getEffectivePeriodRole(o),void 0,t.periodStartDate,t.periodEndDate):void 0};if(null==(i=this._periodData[o.id])?void 0:i[t.id]){const e=this._periodData[o.id][t.id];e.startDate&&(d.periodStartDate=e.startDate),e.endDate&&(d.periodEndDate=e.endDate),e.instantDate&&(d.periodInstantDate=e.instantDate),o.id,t.id,d.periodStartDate,d.periodEndDate,d.periodInstantDate}else o.id,t.id,this._periodData[o.id];(o.id.includes("DescriptionLocationNL")||t.id.startsWith("col-"))&&(o.id,t.id,d.periodStartDate,d.periodEndDate,t.periodStartDate),o.fields.push(d)}),o.children&&i(o.children)})};i(e.concepts)}_shouldShowConceptBasedOnPeriodPreferences(e,t){return!!e.abstract||(!e.periodType||!("duration"===e.periodType&&!t.showDuration)&&!("instant"===e.periodType&&!t.showInstant))}_inferColumnPeriodType(e){return e.periodType?e.periodType:e.periodStartDate&&e.periodEndDate?e.periodStartDate===e.periodEndDate?"instant":"duration":e.periodStartDate&&!e.periodEndDate?"instant":void 0}_mapConceptTypeToFieldType(e){return e?e.includes("monetary")||e.includes("Monetary")?"number":e.includes("date")||e.includes("Date")?"date":e.includes("boolean")||e.includes("Boolean")?"boolean":e.includes("integer")||e.includes("Integer")||e.includes("decimal")||e.includes("Decimal")?"number":"text":"text"}_generateSubmissionData(){const e=[];if(!this._currentSchema)return e;this._currentSchema.sections.forEach(t=>{this._processConceptsForSubmission(t.concepts,e,t)}),this._includePreservedDataInSubmission(e);return this._removeDuplicateSubmissions(e)}_includePreservedDataInSubmission(e){Object.keys(this._preservedFormData).forEach(t=>{const i=this._preservedFormData[t];i&&Object.keys(i).forEach(o=>{const r=i[o];if(null!=r&&""!==r){const i=this._findConceptInAllSections(t);if(i){const n=this._findSectionForConcept(t);this._addConceptDataToSubmission(i,o,r,e,n||void 0)}}})}),e.length}_findConceptInAllSections(e){for(const t of this._allSections){const i=this._findConceptInSection(t.concepts,e);if(i)return i}return null}_findSectionForConcept(e){for(const t of this._allSections){if(this._findConceptInSection(t.concepts,e))return t}return null}_addConceptDataToSubmission(e,t,i,o,r){var n,a,s,l,d;const c=e.fields.find(e=>e.columnId===t);if(!c)return;const p="instant"===e.periodType,u=null==(n=this._periodData[e.id])?void 0:n[t],h=null==(a=this._unitData[e.id])?void 0:a[t],m=this._findColumnByIdInAllSections(t);e.id,u&&JSON.stringify(u),null==m||m.periodStartDate,null==m||m.periodEndDate;const f=(null==u?void 0:u.startDate)||(null==m?void 0:m.periodStartDate)||c.periodStartDate||this.periodStartDate,b=(null==u?void 0:u.endDate)||(null==m?void 0:m.periodEndDate)||c.periodEndDate||this.periodEndDate,g=(null==u?void 0:u.instantDate)||c.periodInstantDate||b||f,v={conceptId:e.originalConceptId||e.id,columnId:t,value:i,period:{type:e.periodType||"duration",...p?{date:g}:{startDate:f,endDate:b}}};h&&(v.unit=h,e.id);const y=null==(s=e.type)?void 0:s.toLowerCase().includes("monetary"),x=(null==(l=this._decimalsData[e.id])?void 0:l[t])||("INF"!==this.decimals?this.decimals:void 0);if(y&&x){const e=parseFloat(x);v.decimals=isNaN(e)?x:String(-Math.abs(e))}(null==(d=null==m?void 0:m.dimensionData)?void 0:d.memberLabel)&&(v.dimension=m.dimensionData.memberLabel),JSON.stringify(v,null,2),o.push(v)}_findColumnByIdInAllSections(e){for(const t of this._allSections)if(t.columns){const i=t.columns.find(t=>t.id===e);if(i)return i}}_removeDuplicateSubmissions(e){const t=new Map;return e.forEach(e=>{const i="instant"===e.period.type?e.period.date:`${e.period.startDate}_${e.period.endDate}`,o=`${e.conceptId}_${e.value}_${e.dimension||"no-dimension"}_${i}`;t.has(o)||t.set(o,e)}),Array.from(t.values())}_findColumnById(e){if(this._currentSchema)for(const t of this._currentSchema.sections)if(t.columns){const i=t.columns.find(t=>t.id===e);if(i)return i}}_findColumnByIdInSection(e,t){if(null==t?void 0:t.columns)return t.columns.find(t=>t.id===e)}_getTypedMemberNameForAxis(e,t){var i,o,r,n;if(!(null==(o=null==(i=this.xbrlInput)?void 0:i.hypercubes)?void 0:o[0]))return null;const a=null==t?void 0:t.id;if(!a)return null;const s=null==(r=this.xbrlInput.hypercubes[0].roles)?void 0:r.find(e=>e.roleId===a);if(!(null==s?void 0:s.items))return null;for(const l of s.items)if(l.dimensions){const t=l.dimensions.find(t=>t.id===e);if(null==(n=null==t?void 0:t.typedMember)?void 0:n.id)return t.typedMember.id}return null}_doesConceptApplyToTypedDimension(e,t,i){var o,r,n;if(!(null==(r=null==(o=this.xbrlInput)?void 0:o.hypercubes)?void 0:r[0]))return!1;const a=null==t?void 0:t.id;if(!a)return!1;const s=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===a);if(!(null==(n=null==s?void 0:s.items)?void 0:n.length))return!1;for(const l of s.items){const t=e.originalConceptId||e.id;if(l.conceptIds&&l.conceptIds.includes(t)){const e=l.dimensions.some(e=>e.typedMember);return e}}return e.originalConceptId||e.id,!1}_getApplicableTypedDimensions(e,t){var i,o,r;if(!(null==(o=null==(i=this.xbrlInput)?void 0:i.hypercubes)?void 0:o[0])||!(null==t?void 0:t.id))return[];const n=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===t.id);if(!(null==(r=null==n?void 0:n.items)?void 0:r.length))return[];const a=e.originalConceptId||e.id;for(const s of n.items)if(s.conceptIds&&s.conceptIds.includes(a)){const e=s.dimensions.filter(e=>e.typedMember).map(e=>e.id);return e}return[]}_processConceptsForSubmission(e,t,i){const o="Toelichting op de geconsolideerde jaarrekening - Financiële vaste activa: Deelnemingen: Volledig geconsolideerd: Specificatie",r=(null==i?void 0:i.title)||"Unknown";e.forEach(e=>{if(r===o&&(e.originalConceptId||e.id,e.fields&&(e.fields.length,e.fields.forEach((t,i)=>{var o;t.columnId,null==(o=this._formData[e.id])||o[t.columnId]}))),e.fields&&e.fields.length>1&&e.fields.forEach((e,t)=>{}),e.fields&&e.fields.length>0){e.fields.forEach(o=>{var r,n,a,s,l,d,c,p;const u=this._formData[e.id];let h=null==u?void 0:u[o.columnId];const m=o.conceptId||e.id.split("__").slice(0,-1).join("__")||e.id;if((null==h||""===h)&&this._isRoundingLevelConcept(m)&&!this._hasValidGlobalDecimals()){const t=this._findFactValueForField(e,o,i);null!=t&&""!==t&&(h=t)}if((null==h||""===h)&&this._effectiveMasterData){const e=null==(r=this._effectiveMasterData)?void 0:r[m];null!=e&&""!==e&&(h=e,o.columnId,JSON.stringify(h))}if(null!=h&&""!==h){const r=this._findColumnByIdInSection(o.columnId,i),u=null==(n=this._periodData[e.id])?void 0:n[o.columnId],m={conceptId:e.id,draftInstanceId:e.id,columnId:o.columnId,value:h,period:{type:e.periodType||"duration"}};if("instant"===e.periodType){const t=this._resolveSubmissionInstantDate(e,o,u,r);m.period.date=t}else{const e=(null==u?void 0:u.startDate)||(null==r?void 0:r.periodStartDate)||o.periodStartDate||this.periodStartDate,t=(null==u?void 0:u.endDate)||(null==r?void 0:r.periodEndDate)||o.periodEndDate||this.periodEndDate;m.period.startDate=e,m.period.endDate=t}e.id,o.columnId,u&&JSON.stringify(u),null==r||r.periodStartDate,null==r||r.periodEndDate,"instant"===m.period.type?m.period.date:(m.period.startDate,m.period.endDate);const f=null==(a=this._unitData[e.id])?void 0:a[o.columnId];f?(m.unit=f,e.id,o.columnId):(e.id,o.columnId,JSON.stringify(this._unitData,null,2));const b=null==(s=e.type)?void 0:s.toLowerCase().includes("monetary"),g=(null==(l=this._decimalsData[e.id])?void 0:l[o.columnId])||("INF"!==this.decimals?this.decimals:void 0);if(b&&g){const e=parseFloat(g);m.decimals=isNaN(e)?g:String(-Math.abs(e))}"dimension"===(null==r?void 0:r.type)&&(null==(d=r.dimensionData)?void 0:d.dimensionIdKey)?(m.dimension=r.dimensionData.dimensionIdKey,o.columnId,r.dimensionData.dimensionIdKey):(o.columnId,null==r||r.type,null==r||r.dimensionData);const v=i?this._scopedColumnKey(i.id,o.columnId):o.columnId,y=this._typedMemberData[v],x=this._typedMemberData[o.columnId];if(y||x){const t=this._getApplicableTypedDimensions(e,i);if(e.id,t.length>0){const e={};t.forEach(t=>{const o=(null==y?void 0:y[t])??(null==x?void 0:x[t]);if(o){const r=this._getTypedMemberNameForAxis(t,i);e[t]={value:o,memberName:r||"Unknown"}}}),Object.keys(e).length>0&&(m.typedMembers=e)}else e.id}else o.columnId,Object.keys(this._typedMemberData),r&&(r.id,r.type,null==(c=r.dimensionData)||c.hasTypedMembers,r.dimensionData);if(!m.typedMembers&&(null==(p=o.crossRoleTypedMembers)?void 0:p.length)){const t=`${e.id}__${o.columnId}`,i=this._typedMemberData[t];if(i){const t={};o.crossRoleTypedMembers.forEach(e=>{const o=i[e.axisId];null!=o&&""!==o&&(t[e.axisId]={value:o,memberName:e.typedMemberId})}),Object.keys(t).length>0&&(m.typedMembers=t,e.id,o.columnId)}}t.push(m)}});const o=this._repeatCounts[e.id]||0;if(o>0&&e.fields.some(e=>{var t;return null==(t=e.crossRoleTypedMembers)?void 0:t.length}))for(let r=1;r<=o;r++){const o=`${e.id}__repeat_${r}`;e.fields.forEach(r=>{var n,a,s,l,d;const c=null==(n=this._formData[o])?void 0:n[r.columnId];if(null==c||""===c)return;const p=this._findColumnByIdInSection(r.columnId,i),u=null==(a=this._periodData[o])?void 0:a[r.columnId],h={conceptId:e.id,draftInstanceId:o,columnId:r.columnId,value:c,period:{type:e.periodType||"duration"}};"instant"===e.periodType?h.period.date=this._resolveSubmissionInstantDate(e,r,u,p):(h.period.startDate=(null==u?void 0:u.startDate)||(null==p?void 0:p.periodStartDate)||r.periodStartDate||this.periodStartDate,h.period.endDate=(null==u?void 0:u.endDate)||(null==p?void 0:p.periodEndDate)||r.periodEndDate||this.periodEndDate);const m=null==(s=this._unitData[o])?void 0:s[r.columnId];if(m&&(h.unit=m),"dimension"===(null==p?void 0:p.type)&&(null==(l=p.dimensionData)?void 0:l.dimensionIdKey)&&(h.dimension=p.dimensionData.dimensionIdKey),null==(d=r.crossRoleTypedMembers)?void 0:d.length){const e=`${o}__${r.columnId}`,t=this._typedMemberData[e];if(t){const e={};r.crossRoleTypedMembers.forEach(i=>{const o=t[i.axisId];null!=o&&""!==o&&(e[i.axisId]={value:o,memberName:i.typedMemberId})}),Object.keys(e).length>0&&(h.typedMembers=e)}}t.push(h)})}}e.children&&this._processConceptsForSubmission(e.children,t,i)})}_handleReset(){this._formData={...this.initialData},this._touched.clear(),this._dirty=!1,this.hasUnsavedChanges=!1,this._submitted=!1,this._preservedFormData={},this._preservedTypedMemberData={},this._validateForm(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("form-reset",{detail:{},bubbles:!0}))}_getFormState(){return{data:this._formData,errors:this._errors,touched:this._touched,dirty:this._dirty,valid:this._valid,submitted:this._submitted}}_analyzeAllVisibleRoles(){if(this._currentSchema&&this._currentSchema.sections&&0!==this._currentSchema.sections.length){this._currentSchema.sections.length;for(const e of this._currentSchema.sections)this._analyzeAndLogRole(e.id)}}_handleRoleContextMenu(e,t,i){e.preventDefault(),e.stopPropagation(),this._contextMenuX=e.clientX,this._contextMenuY=e.clientY,this._contextMenuRoleId=t,this._showRoleContextMenu=!0,this.requestUpdate()}_closeRoleContextMenu(){this._showRoleContextMenu=!1,this._contextMenuRoleId=null,this.requestUpdate()}_handleRemoveRole(){if(!this._contextMenuRoleId)return void this._closeRoleContextMenu();const e=this._allSections.find(e=>e.id===this._contextMenuRoleId),t=(null==e?void 0:e.title)||"Unknown";if(this._contextMenuRoleId,Array.isArray(this._selectedRoleIds)&&(this._selectedRoleIds.length>0&&"object"==typeof this._selectedRoleIds[0]?this._selectedRoleIds=this._selectedRoleIds.filter(e=>e.roleId!==this._contextMenuRoleId):this._selectedRoleIds=this._selectedRoleIds.filter(e=>e!==this._contextMenuRoleId)),this._selectedRoleIds.length,this._activeSidePanelRoleId===this._contextMenuRoleId){const e=this._getRoleIdsArray();this._activeSidePanelRoleId=e.length>0?e[0]:null,this._activeSidePanelRoleId}this._applyRoleFilter(),this.dispatchEvent(new CustomEvent("role-removed",{detail:{roleId:this._contextMenuRoleId,roleTitle:t,remainingRolesCount:this._selectedRoleIds.length},bubbles:!0,composed:!0})),this._closeRoleContextMenu()}_handleRoleCompletedChange(e,t){t?this._roleCompletedStates.set(e,!0):this._roleCompletedStates.delete(e),this._roleCompletedStates=new Map(this._roleCompletedStates),this._handleSaveDraft("auto")}_handleSidePanelRoleClick(e){this._activeSidePanelRoleId&&this._activeSidePanelRoleId!==e&&this._analyzeAndLogRole(this._activeSidePanelRoleId),this._activeSidePanelRoleId=e}_analyzeAndLogRole(e){const t=this._allSections.find(t=>t.id===e);if(!t)return void console.warn(`⚠️ Section not found for roleId: ${e}`);t.title,this.masterData&&Object.keys(this.masterData);const i=[];this._collectAllFields(t.concepts||[],new Set((t.columns||[]).map(e=>e.id)),t.columns||[],i);const o=this._roleHasErrors(e),r=i.filter(e=>e.isEmpty).length,n=i.filter(e=>!e.isEmpty).length;let a;i.length,a=o?"INVALID":0===n?"UNTOUCHED":r>0?"INCOMPLETE":"COMPLETE","INVALID"===a||("UNTOUCHED"===a?(this._roleBorderStatuses.set(e,"untouched"),this._roleBorderStatuses=new Map(this._roleBorderStatuses)):"INCOMPLETE"===a?(this._roleBorderStatuses.set(e,"incomplete"),this._roleBorderStatuses=new Map(this._roleBorderStatuses)):(this._roleBorderStatuses.set(e,"complete"),this._roleBorderStatuses=new Map(this._roleBorderStatuses)))}_collectAllFields(e,t,i,o){var r,n,a;for(const s of e)if(s.abstract)s.children&&s.children.length>0&&this._collectAllFields(s.children,t,i,o);else{if(s.fields&&s.fields.length>0){const e=s.fields.filter(e=>t.has(e.columnId));for(const t of e){const e=s.id,l=t.conceptId;let d=null==(r=this._formData[e])?void 0:r[t.columnId];void 0===d&&e!==l&&(d=null==(n=this._formData[l])?void 0:n[t.columnId]);const c=null==(a=this._effectiveMasterData)?void 0:a[l];(null==d||"string"==typeof d&&""===d.trim())&&void 0!==c&&(d=c,t.columnId,JSON.stringify(d));let p=null==d||"string"==typeof d&&""===d.trim();if(p&&s.facts&&s.facts.length>0){const e=i.find(e=>e.id===t.columnId),o={conceptId:l,columnId:t.columnId,periodStartDate:t.periodStartDate||(null==e?void 0:e.periodStartDate),periodEndDate:t.periodEndDate||(null==e?void 0:e.periodEndDate),periodInstantDate:t.periodInstantDate||("instant"===t.periodType?t.periodEndDate||t.periodStartDate:void 0),periodType:t.periodType,dimensionData:null==e?void 0:e.dimensionData},r=De.findMatchingFact(s.facts,o);r&&null!==r.value&&void 0!==r.value&&""!==r.value&&(d=r.value,p=!1)}o.push({conceptId:l,columnId:t.columnId,value:d,isEmpty:p})}}s.children&&s.children.length>0&&this._collectAllFields(s.children,t,i,o)}}_handleSidePanelSearchInput(e){const t=e.target;this._sidePanelSearchQuery=t.value}_clearSidePanelSearch(){var e;this._sidePanelSearchQuery="";const t=null==(e=this.shadowRoot)?void 0:e.querySelector(".side-panel-search-input");t&&(t.value="",t.focus()),this.updateComplete.then(()=>this._scrollActiveRoleIntoView())}_toggleSidePanelCollapse(){this._sidePanelCollapsed=!this._sidePanelCollapsed}_isSectionBlank(e){const t=e.columns||this._columns,i=e=>{var o;for(const r of e){if(!r.abstract)for(const e of t){const t=null==(o=this._formData[r.id])?void 0:o[e.id];if(null!=t&&""!==t)return!0}if(r.children&&r.children.length>0&&i(r.children))return!0}return!1};return!i(e.concepts)}_getConceptSearchMatchIds(e){var t,i,o;const r=new Set;if(!e.trim()||!(null==(i=null==(t=this.xbrlInput)?void 0:t.presentation)?void 0:i.length))return r;const n=e.toLowerCase().trim(),a=e=>{var t;for(const i of e)r.add(i.id),(null==(t=i.children)?void 0:t.length)&&a(i.children)},s=e=>{var t,i,o,l;for(const d of e){let e=(null==(t=d.conceptName)?void 0:t.toLowerCase().includes(n))||(null==(i=d.id)?void 0:i.toLowerCase().includes(n));!e&&Array.isArray(d.labels)&&(e=d.labels.some(e=>{var t;return null==(t=e.label)?void 0:t.toLowerCase().includes(n)})),e?(r.add(d.id),(null==(o=d.children)?void 0:o.length)&&a(d.children)):(null==(l=d.children)?void 0:l.length)&&s(d.children)}};for(const l of this.xbrlInput.presentation)for(const e of l.roles||[])s((null==(o=e.presentationLinkbase)?void 0:o.concepts)||[]);return r}_isSectionConceptSearchMatch(e,t){if(0===t.size)return!1;const i=e=>{var o;for(const r of e){if(t.has(r.originalConceptId))return!0;if((null==(o=r.children)?void 0:o.length)&&i(r.children))return!0}return!1};return i(e.concepts)}_filterSidePanelSections(e){if(!this._sidePanelSearchQuery.trim())return e;const t=this._sidePanelSearchQuery.toLowerCase().trim();return e.filter(e=>{var i,o,r;const n=e.title.toLowerCase().includes(t),a=e.id.toLowerCase().includes(t),s=(null==(i=e.description)?void 0:i.toLowerCase().includes(t))||!1,l=(null==(r=null==(o=e.metadata)?void 0:o.roleURI)?void 0:r.toLowerCase().includes(t))||!1;return n||a||s||l})}_renderAdminModeContent(t){var i,o;if(!t)return e.html`
|
|
3902
3902
|
<div class="admin-mode-container">
|
|
3903
3903
|
<p>No role selected</p>
|
|
3904
3904
|
</div>
|
|
@@ -4294,7 +4294,11 @@ const I={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:x},w=(e=I,t,
|
|
|
4294
4294
|
@click="${"inProgress"===this._validationStatus?()=>this.dispatchEvent(new CustomEvent("resume-validation-progress",{bubbles:!0,composed:!0})):this._handleSubmit}"
|
|
4295
4295
|
?disabled="${this.disabled||this.readonly||this._submitDisabled}"
|
|
4296
4296
|
>
|
|
4297
|
-
${"inProgress"===this._validationStatus
|
|
4297
|
+
${"inProgress"===this._validationStatus?e.html`${E.t("form.validationInProgress")}<span class="validation-dots"
|
|
4298
|
+
><span style="visibility:${this._validationDotCount>=1?"visible":"hidden"}">.</span
|
|
4299
|
+
><span style="visibility:${this._validationDotCount>=2?"visible":"hidden"}">.</span
|
|
4300
|
+
><span style="visibility:${this._validationDotCount>=3?"visible":"hidden"}">.</span
|
|
4301
|
+
></span>`:this.submitButtonLabel||("admin"===this.mode?E.t("form.save"):E.t("form.submit"))}
|
|
4298
4302
|
</button>
|
|
4299
4303
|
|
|
4300
4304
|
</div>
|