jupiter-dynamic-forms 1.9.9 β 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/add-column-dialog.d.ts.map +1 -1
- package/dist/core/dynamic-form.d.ts.map +1 -1
- package/dist/core/filter-roles-dialog.d.ts.map +1 -1
- package/dist/core/form-section.d.ts.map +1 -1
- package/dist/index.js +69 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +434 -200
- package/dist/index.mjs.map +1 -1
- package/dist/utils/i18n.d.ts +38 -0
- package/dist/utils/i18n.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/let s=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(r&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=n.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&n.set(t,e))}return e}toString(){return this.cssText}};const a=r?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,o))(t)})(e):e,{is:l,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:p,getOwnPropertySymbols:
|
|
6
|
+
*/let s=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(r&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=n.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&n.set(t,e))}return e}toString(){return this.cssText}};const a=r?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,o))(t)})(e):e,{is:l,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:p,getOwnPropertySymbols:m,getPrototypeOf:h}=Object,u=globalThis,b=u.trustedTypes,f=b?b.emptyScript:"",y=u.reactiveElementPolyfillSupport,g=(e,t)=>e,v={toAttribute(e,t){switch(t){case Boolean:e=e?f:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(r){i=null}}return i}},x=(e,t)=>!l(e,t),_={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:x};
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/Symbol.metadata??(Symbol.metadata=Symbol("metadata")),u.litPropertyMetadata??(u.litPropertyMetadata=new WeakMap);class $ extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,t);void 0!==r&&d(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){const{get:r,set:o}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const n=null==r?void 0:r.call(this);null==o||o.call(this,t),this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const e=
|
|
11
|
+
*/Symbol.metadata??(Symbol.metadata=Symbol("metadata")),u.litPropertyMetadata??(u.litPropertyMetadata=new WeakMap);class $ extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,t);void 0!==r&&d(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){const{get:r,set:o}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const n=null==r?void 0:r.call(this);null==o||o.call(this,t),this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const e=h(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const e=this.properties,t=[...p(e),...m(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const e=this._$Eu(t,i);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(e=this.constructor.l)||e.forEach(e=>e(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),void 0!==this.renderRoot&&this.isConnected&&(null==(t=e.hostConnected)||t.call(e))}removeController(e){var t;null==(t=this._$EO)||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(r)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const r of t){const t=document.createElement("style"),o=i.litNonce;void 0!==o&&t.setAttribute("nonce",o),t.textContent=r.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(e=this._$EO)||e.forEach(e=>{var t;return null==(t=e.hostConnected)?void 0:t.call(e)})}enableUpdating(e){}disconnectedCallback(){var e;null==(e=this._$EO)||e.forEach(e=>{var t;return null==(t=e.hostDisconnected)?void 0:t.call(e)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){var i;const r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(void 0!==o&&!0===r.reflect){const n=(void 0!==(null==(i=r.converter)?void 0:i.toAttribute)?r.converter:v).toAttribute(t,r.type);this._$Em=e,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(e,t){var i,r;const o=this.constructor,n=o._$Eh.get(e);if(void 0!==n&&this._$Em!==n){const e=o.getPropertyOptions(n),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null==(i=e.converter)?void 0:i.fromAttribute)?e.converter:v;this._$Em=n;const a=s.fromAttribute(t,e.type);this[n]=a??(null==(r=this._$Ej)?void 0:r.get(n))??a,this._$Em=null}}requestUpdate(e,t,i){var r;if(void 0!==e){const o=this.constructor,n=this[e];if(i??(i=o.getPropertyOptions(e)),!((i.hasChanged??x)(n,t)||i.useDefault&&i.reflect&&n===(null==(r=this._$Ej)?void 0:r.get(e))&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:r,wrapped:o},n){i&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,n??t??this[e]),!0!==o||void 0!==n)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,i,r)}}let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null==(e=this._$EO)||e.forEach(e=>{var t;return null==(t=e.hostUpdate)?void 0:t.call(e)}),this.update(i)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null==(t=this._$EO)||t.forEach(e=>{var t;return null==(t=e.hostUpdated)?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}}$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[g("elementProperties")]=new Map,$[g("finalized")]=new Map,null==y||y({ReactiveElement:$}),(u.reactiveElementVersions??(u.reactiveElementVersions=[])).push("2.1.1");
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
@@ -19,7 +19,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/function S(e){return w({...e,state:!0,attribute:!1})}class C{static validateField(e,t,i,r,o,n=[]){const s=[];for(const a of n){const n=this.validateRule(e,t,i,r,o,a);n&&s.push(n)}return s}static validateRule(e,t,i,r,o,n){const s=null==r||""===r;switch(n.type){case"required":if(s)return this.createError(e,t,i,n);break;case"min":if(!s&&"number"==typeof r&&r<n.value)return this.createError(e,t,i,n);break;case"max":if(!s&&"number"==typeof r&&r>n.value)return this.createError(e,t,i,n);break;case"minLength":if(!s&&"string"==typeof r&&r.length<n.value)return this.createError(e,t,i,n);break;case"maxLength":if(!s&&"string"==typeof r&&r.length>n.value)return this.createError(e,t,i,n);break;case"pattern":if(!s&&"string"==typeof r){if(!new RegExp(n.value).test(r))return this.createError(e,t,i,n)}break;case"email":if(!s&&"string"==typeof r){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))return this.createError(e,t,i,n)}break;case"url":if(!s&&"string"==typeof r)try{new URL(r)}catch{return this.createError(e,t,i,n)}break;case"custom":break;default:console.warn(`Unknown validation rule type: ${n.type}`)}return null}static createError(e,t,i,r){return{fieldId:e,conceptId:t,columnId:i,message:r.message,severity:r.severity||"error",rule:r}}static validateDataType(e,t){if(null==e||""===e)return{valid:!0,convertedValue:e};switch(t){case"number":case"decimal":case"currency":case"percentage":{const t=Number(e);return isNaN(t)?{valid:!1,error:"Invalid number format"}:{valid:!0,convertedValue:t}}case"date":{const t=new Date(e);return isNaN(t.getTime())?{valid:!1,error:"Invalid date format"}:{valid:!0,convertedValue:t.toISOString().split("T")[0]}}case"datetime":{const t=new Date(e);return isNaN(t.getTime())?{valid:!1,error:"Invalid datetime format"}:{valid:!0,convertedValue:t.toISOString()}}case"boolean":if("boolean"==typeof e)return{valid:!0,convertedValue:e};if("string"==typeof e){const t=e.toLowerCase();if("true"===t||"1"===t)return{valid:!0,convertedValue:!0};if("false"===t||"0"===t)return{valid:!0,convertedValue:!1}}return{valid:!1,error:"Invalid boolean format"};case"text":case"textarea":case"email":case"url":case"tel":return{valid:!0,convertedValue:String(e)};default:return{valid:!0,convertedValue:e}}}static formatValue(e,t,i="en-US"){if(null==e)return"";switch(t){case"number":return new Intl.NumberFormat(i).format(Number(e));case"decimal":return new Intl.NumberFormat(i,{minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(e));case"currency":return new Intl.NumberFormat(i,{style:"currency",currency:"USD"}).format(Number(e));case"percentage":return new Intl.NumberFormat(i,{style:"percent",minimumFractionDigits:2}).format(Number(e)/100);case"date":return new Date(e).toLocaleDateString(i);case"datetime":return new Date(e).toLocaleString(i);default:return String(e)}}}class T{static createUniqueConceptId(e,t){let i=e.id;if(e.preferredLabel&&""!==e.preferredLabel.trim()){const t=e.preferredLabel.match(/\/([^\/]+)$/),r=t?t[1]:e.preferredLabel.replace(/[^a-zA-Z0-9]/g,"_");i=`${e.id}_${r}`}if(t){return`${i}__${this.createSectionHash(t)}`}return i}static createSectionHash(e){let t=0;for(let i=0;i<e.length;i++){t=(t<<5)-t+e.charCodeAt(i),t&=t}return Math.abs(t).toString(36).substr(0,6)}static buildFormSchema(e,t,i,r="en",o){var n;if(!e.presentation||0===e.presentation.length)throw new Error("XBRL presentation data is required");const s=e.presentation[0],a=null==(n=e.hypercubes)?void 0:n[0],l=[];return[...s.roles].sort((e,t)=>e.role.localeCompare(t.role)).forEach(e=>{const n=this.buildSectionFromRole(e,t,i,a,r,o);this.assignFieldColumnIds(n),l.push(n)}),{formId:`xbrl-form-${Date.now()}`,title:`XBRL Form - ${this.extractEntityName(s.entrypoint)}`,description:"Dynamic form generated from XBRL taxonomy data",version:"1.0.0",sections:l}}static buildSectionFromRole(e,t,i,r,o="en",n){var s;const a=this.extractRoleTitle(e.role),l=this.getAllNonAbstractConcepts(e),d=new Set(l.filter(e=>e.periodType).map(e=>e.periodType)),c=null==r?void 0:r.roles.find(t=>t.roleId===e.id),p=null==n?void 0:n[e.id],h=this.generateDefaultColumnsForRole(e,t||"2025-01-01",i||"2025-12-31",c,l,d,p),m={periodTypes:d,availableColumnIds:h.map(e=>e.id)},u=[];return(null==(s=e.presentationLinkbase)?void 0:s.concepts)&&e.presentationLinkbase.concepts.forEach(r=>{const n=this.buildConceptTree(r,0,t,i,m,e.id,o);n&&u.push(n)}),{id:e.id,title:a,description:e.description||`Section for ${a}`,concepts:u,columns:h,expanded:!1,metadata:{roleURI:e.roleURI,originalRole:e.role},showPeriodControl:d.size>1,showPreviousYear:!0===e.showPreviousYear,instant:!0===e.instant,duration:!0===e.duration}}static buildConceptTree(e,t,i,r,o,n,s="en"){const a=this.getPreferredLabel(e.labels,s),l=[];if(!e.elementAbstract){let t=[];if((null==o?void 0:o.availableColumnIds)&&o.availableColumnIds.length>0){if(t=o.availableColumnIds.filter(t=>{const i=t.includes("instant")||"instant"===t,r=t.includes("duration")||"duration"===t;return"instant"===e.periodType?i:"duration"===e.periodType?r:!i&&!r}),0===t.length&&o.availableColumnIds.length>0){o.availableColumnIds.some(e=>e.includes("instant")||e.includes("duration"))||(t=o.availableColumnIds)}}else t=(null==o?void 0:o.periodTypes)&&0!==o.periodTypes.size?1===o.periodTypes.size&&o.periodTypes.has("instant")?["instant"]:1===o.periodTypes.size&&o.periodTypes.has("duration")?["duration"]:"instant"===e.periodType?["instant"]:"duration"===e.periodType?["duration"]:["duration","instant"]:["default"];t.forEach(t=>{const o=this.createFieldFromConcept(e,i,r,t);o&&l.push(o)})}const d=[];e.children&&e.children.length>0&&e.children.forEach(e=>{const a=this.buildConceptTree(e,t+1,i,r,o,n,s);a&&d.push(a)});return l.length>0||d.length>0?{id:this.createUniqueConceptId(e,n),originalConceptId:e.id,name:e.conceptName,label:a,description:`${e.conceptName} (${e.type})`,type:e.type,level:t,children:d,fields:l,collapsed:t>0,abstract:e.elementAbstract,periodType:e.periodType}:null}static createFieldFromConcept(e,t,i,r){const o=this.mapXBRLTypeToFieldType(e.type),n=this.getPreferredLabel(e.labels);let s;s=r||("instant"===e.periodType?"instant":"duration"===e.periodType?"duration":"default");const a={id:`${e.id}_${s}_field`,conceptId:e.id,columnId:s,type:o,label:n,placeholder:`Enter ${n.toLowerCase()}`,required:!1,disabled:e.elementAbstract,defaultValue:null};return"duration"!==e.periodType&&"instant"!==e.periodType||(a.periodStartDate=t||"2025-01-01",a.periodEndDate=i||"2025-12-31"),a}static mapXBRLTypeToFieldType(e){return{"xbrli:stringItemType":"text","xbrli:monetaryItemType":"currency","xbrli:integerItemType":"number","xbrli:decimalItemType":"decimal","xbrli:percentItemType":"percentage","xbrli:dateItemType":"date","xbrli:booleanItemType":"boolean","dtr-types:domainItemType":"select","bw2-titel9:chamberOfCommerceRegistrationNumberItemType":"text"}[e]||"text"}static getPreferredLabel(e,t="en"){if(!e||0===e.length)return"Unnamed Concept";const i=e.filter(e=>e.lang===t),r=i.length>0?i:e,o=r.find(e=>e.preferredLabel);if(o)return o.label;const n=r.find(e=>"http://www.xbrl.org/2003/role/label"===e.role);if(n)return n.label;const s=r.find(e=>"http://www.xbrl.org/2003/role/terseLabel"===e.role);return s?s.label:r.length>0?r[0].label:e[0].label}static assignFieldColumnIds(e){if(!e.columns||0===e.columns.length)return;const t=e.columns.map(e=>e.id);e.concepts.forEach(e=>{this.assignColumnIdsToConceptFields(e,t)})}static assignColumnIdsToConceptFields(e,t){e.fields=e.fields.filter(e=>t.includes(e.columnId)),e.children&&e.children.forEach(e=>{this.assignColumnIdsToConceptFields(e,t)})}static countFieldsInTree(e){let t=e.fields.length;return e.children&&e.children.forEach(e=>{t+=this.countFieldsInTree(e)}),t}static getAllNonAbstractConcepts(e){var t;const i=[];return(null==(t=e.presentationLinkbase)?void 0:t.concepts)&&e.presentationLinkbase.concepts.forEach(e=>{this.collectNonAbstractConcepts(e,i)}),i}static collectNonAbstractConcepts(e,t){e.elementAbstract||t.push(e),e.children&&e.children.length>0&&e.children.forEach(e=>{this.collectNonAbstractConcepts(e,t)})}static generateDefaultColumnsForRole(e,t,i,r,o,n,s){var a,l;const d=o||this.getAllNonAbstractConcepts(e),c=n||new Set(d.filter(e=>e.periodType).map(e=>e.periodType));if(0===d.length)return[{id:"default",title:"Value",description:"Default value column",type:"base",order:0,removable:!1}];let p=[];if(1===(null==(a=null==r?void 0:r.items)?void 0:a.length)){const e=r.items[0];1===e.dimensions.length?p=this.generateSingleDimensionColumns(e.dimensions[0],t,i,c):e.dimensions.length>1&&(p=this.generateMultiDimensionColumns(e.dimensions,t,i,c)),s&&(p=this.filterColumnsByPeriodPreferences(p,s))}else(null==(l=null==r?void 0:r.items)?void 0:l.length)&&r.items.length;const h=[];p.length>0?h.push(...p):0===c.size?h.push({id:"default",title:"Value",description:"Default value column",type:"base",order:0,removable:!1}):1===c.size&&c.has("instant")?h.push({id:"instant",title:i,description:"",type:"base",order:0,removable:!1}):1===c.size&&c.has("duration")?h.push({id:"duration",title:`${t} / ${i}`,description:"",type:"base",order:0,removable:!1}):(h.push({id:"duration",title:`${t} / ${i}`,description:"",type:"base",order:0,removable:!1}),h.push({id:"instant",title:i,description:"",type:"base",order:1,removable:!1}));let m=h;if(s&&(m=this.filterColumnsByPeriodPreferences(h,s)),null==s?void 0:s.showPreviousYear){const e=this.generatePreviousYearColumns(m,t,i);m=[...m,...e]}return m}static getPreviousYearDate(e){try{const t=new Date(e);return t.setFullYear(t.getFullYear()-1),t.toISOString().split("T")[0]}catch(t){return console.error(`Error calculating previous year for date ${e}:`,t),e}}static generatePreviousYearColumns(e,t,i){const r=[],o=this.getPreviousYearDate(t),n=this.getPreviousYearDate(i);return e.forEach((e,t)=>{let i=e.title,s="",a="";e.dimensionData?(i=e.title,s=e.description&&e.description.includes("/")?`${o} / ${n}`:n,a=`${e.id}_prev`):"instant"===e.id||e.id.includes("instant")?(i=n,s="",a=`instant_prev_${t}`):"duration"===e.id||e.id.includes("duration")?(i=`${o} / ${n}`,s="",a=`duration_prev_${t}`):e.title.includes("/")?(i=`${o} / ${n}`,s="",a=`${e.id}_prev`):(i=n,s="",a=`${e.id}_prev`),r.push({...e,id:a,title:i,description:s,order:e.order+100,removable:!0,periodStartDate:o,periodEndDate:n,dimensionData:e.dimensionData?{...e.dimensionData,dimensionId:`${e.dimensionData.dimensionId}_prev`}:void 0})}),r}static filterColumnsByPeriodPreferences(e,t){return e.filter(e=>{var i,r,o,n;const s=e.id.includes("duration")||(null==(r=null==(i=e.dimensionData)?void 0:i.dimensionId)?void 0:r.includes("duration")),a=e.id.includes("instant")||(null==(n=null==(o=e.dimensionData)?void 0:o.dimensionId)?void 0:n.includes("instant"));return!s&&!a||!(s&&!t.showDuration)&&!(a&&!t.showInstant)})}static generateSingleDimensionColumns(e,t,i,r){var o,n,s;if(e.typedMember&&(!e.members||0===e.members.length)){const n=(null==(o=e.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:o.label)||e.conceptName,s={axisId:e.id,axisLabel:n,typedMemberId:e.typedMember.id,dimensionKey:`${n} | [Typed Input]`,dimensionIdKey:`${e.id}|[typed]`},a=[];return 0===r.size?a.push({id:"typed-default",title:n,description:"Typed dimension input column",type:"dimension",dimensionData:{dimensionId:"typed-default",axisId:s.axisId,memberId:"[typed]",memberValue:"Typed Input",memberLabel:"Typed Input",axis:s.axisLabel,axisLabel:s.axisLabel,memberKey:s.dimensionKey,dimensionIdKey:s.dimensionIdKey,hasTypedMembers:!0,typedMemberId:s.typedMemberId,typedMembers:[{axisId:s.axisId,axisLabel:s.axisLabel,typedMemberId:s.typedMemberId,memberLabel:s.axisLabel}]},order:0,removable:!1}):1===r.size&&r.has("instant")?a.push({id:"typed-instant",title:`${n} [Typed Input Available]`,description:i,type:"dimension",dimensionData:{dimensionId:"typed-instant",axisId:s.axisId,memberId:"[typed]",memberValue:"Typed Input",memberLabel:"Typed Input",axis:s.axisLabel,axisLabel:s.axisLabel,memberKey:s.dimensionKey,dimensionIdKey:s.dimensionIdKey,hasTypedMembers:!0,typedMemberId:s.typedMemberId,typedMembers:[{axisId:s.axisId,axisLabel:s.axisLabel,typedMemberId:s.typedMemberId,memberLabel:s.axisLabel}]},order:0,removable:!1}):1===r.size&&r.has("duration")?a.push({id:"typed-duration",title:`${n} [Typed Input Available]`,description:`${t} / ${i}`,type:"dimension",dimensionData:{dimensionId:"typed-duration",axisId:s.axisId,memberId:"[typed]",memberValue:"Typed Input",memberLabel:"Typed Input",axis:s.axisLabel,axisLabel:s.axisLabel,memberKey:s.dimensionKey,dimensionIdKey:s.dimensionIdKey,hasTypedMembers:!0,typedMemberId:s.typedMemberId,typedMembers:[{axisId:s.axisId,axisLabel:s.axisLabel,typedMemberId:s.typedMemberId,memberLabel:s.axisLabel}]},order:0,removable:!1}):(a.push({id:"typed-duration",title:`${n} [Typed Input Available]`,description:`${t} / ${i}`,type:"dimension",dimensionData:{dimensionId:"typed-duration",axisId:s.axisId,memberId:"[typed]",memberValue:"Typed Input",memberLabel:"Typed Input",axis:s.axisLabel,axisLabel:s.axisLabel,memberKey:s.dimensionKey,dimensionIdKey:s.dimensionIdKey,hasTypedMembers:!0,typedMemberId:s.typedMemberId,typedMembers:[{axisId:s.axisId,axisLabel:s.axisLabel,typedMemberId:s.typedMemberId,memberLabel:s.axisLabel}]},order:0,removable:!1}),a.push({id:"typed-instant",title:`${n} [Typed Input Available]`,description:i,type:"dimension",dimensionData:{dimensionId:"typed-instant",axisId:s.axisId,memberId:"[typed]",memberValue:"Typed Input",memberLabel:"Typed Input",axis:s.axisLabel,axisLabel:s.axisLabel,memberKey:s.dimensionKey,dimensionIdKey:s.dimensionIdKey,hasTypedMembers:!0,typedMemberId:s.typedMemberId,typedMembers:[{axisId:s.axisId,axisLabel:s.axisLabel,typedMemberId:s.typedMemberId,memberLabel:s.axisLabel}]},order:1,removable:!1})),a}if(!e.members||!Array.isArray(e.members))return[];if(0===e.members.length)return[];const a=(null==(n=e.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:n.label)||e.conceptName,l=e.members[0],d=(null==(s=l.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:s.label)||l.conceptName,c={axisId:e.id,axisLabel:a,memberId:l.id,memberLabel:d,dimensionKey:`${a} | ${d}`,dimensionIdKey:`${e.id} | ${l.id}`},p=[];return 0===r.size?p.push({id:"default",title:c.memberLabel,description:"Default value column",type:"dimension",dimensionData:{dimensionId:"default",axisId:c.axisId,memberId:c.memberId,memberValue:c.memberLabel,memberLabel:c.memberLabel,axis:c.axisLabel,axisLabel:c.axisLabel,memberKey:c.dimensionKey,dimensionIdKey:c.dimensionIdKey},order:0,removable:!1}):1===r.size&&r.has("instant")?p.push({id:"instant",title:`${c.memberLabel}`,description:i,type:"dimension",dimensionData:{dimensionId:"instant",axisId:c.axisId,memberId:c.memberId,memberValue:c.memberLabel,memberLabel:c.memberLabel,axis:c.axisLabel,axisLabel:c.axisLabel,memberKey:c.dimensionKey,dimensionIdKey:c.dimensionIdKey},order:0,removable:!1}):1===r.size&&r.has("duration")?p.push({id:"duration",title:`${c.memberLabel}`,description:`${t} / ${i}`,type:"dimension",dimensionData:{dimensionId:"duration",axisId:c.axisId,memberId:c.memberId,memberValue:c.memberLabel,memberLabel:c.memberLabel,axis:c.axisLabel,axisLabel:c.axisLabel,memberKey:c.dimensionKey,dimensionIdKey:c.dimensionIdKey},order:0,removable:!1}):(p.push({id:"duration",title:`${c.memberLabel}`,description:`${t} / ${i}`,type:"dimension",dimensionData:{dimensionId:"duration",axisId:c.axisId,memberId:c.memberId,memberValue:c.memberLabel,memberLabel:c.memberLabel,axis:c.axisLabel,axisLabel:c.axisLabel,memberKey:c.dimensionKey,dimensionIdKey:c.dimensionIdKey},order:0,removable:!1}),p.push({id:"instant",title:`${c.memberLabel}`,description:i,type:"dimension",dimensionData:{dimensionId:"instant",axisId:c.axisId,memberId:c.memberId,memberValue:c.memberLabel,memberLabel:c.memberLabel,axis:c.axisLabel,axisLabel:c.axisLabel,memberKey:c.dimensionKey,dimensionIdKey:c.dimensionIdKey},order:1,removable:!1})),p}static generateMultiDimensionColumns(e,t,i,r){e.some(e=>e.typedMember);const o=e.filter(e=>!!e.typedMember||!!(e.members&&Array.isArray(e.members)&&e.members.length>0));if(0===o.length)return[];const n=o.map(e=>{var t;const i=(null==(t=e.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:t.label)||e.conceptName;if(e.typedMember)return{id:e.id,axisLabel:i,isTyped:!0,typedMemberId:e.typedMember.id,members:[{id:"[typed]",label:`${i} [Typed Input Available]`}]};const r=this.getAllDimensionMembers(e.members);return{id:e.id,axisLabel:i,isTyped:!1,members:r.map(e=>{var t;return{id:e.id,label:(null==(t=e.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:t.label)||e.conceptName}})}}),s=this.generateDimensionCombinations(n),a=[];return s.forEach((e,o)=>{const n=e.map(e=>e.memberLabel).join(" | "),s=e.filter(e=>e.isTyped),l=e.filter(e=>!e.isTyped),d={dimensionId:`multi_${o}`,memberValue:n,memberLabel:n,combinations:l.map(e=>({axisId:e.axisId,axisLabel:e.axisLabel,memberId:e.memberId,memberLabel:e.memberLabel})),typedMembers:s.map(e=>({axisId:e.axisId,axisLabel:e.axisLabel,typedMemberId:e.typedMemberId,memberLabel:e.memberLabel})),hasTypedMembers:s.length>0,memberKey:n,dimensionIdKey:[...l.map(e=>`${e.axisId}|${e.memberId}`),...s.map(e=>`${e.axisId}|[typed]`)].join("::")};0===r.size||1===r.size&&r.has("duration")?a.push({id:`duration_${o}`,title:`${n}`,description:`${t} / ${i}`,type:"dimension",dimensionData:{...d,dimensionId:`duration_${o}`},order:2*o,removable:!1}):1===r.size&&r.has("instant")?a.push({id:`instant_${o}`,title:`${n}`,description:i,type:"dimension",dimensionData:{...d,dimensionId:`instant_${o}`},order:2*o,removable:!1}):(a.push({id:`duration_${o}`,title:`${n}`,description:`${t} / ${i}`,type:"dimension",dimensionData:{...d,dimensionId:`duration_${o}`},order:2*o,removable:!1}),a.push({id:`instant_${o}`,title:`${n}`,description:i,type:"dimension",dimensionData:{...d,dimensionId:`instant_${o}`},order:2*o+1,removable:!1}))}),a}static getAllDimensionMembers(e){if(!e||!Array.isArray(e))return[];const t=[];return e.forEach(e=>{t.push(e),e.children&&e.children.length>0&&t.push(...this.getAllDimensionMembers(e.children))}),t}static generateDimensionCombinations(e){if(0===e.length)return[];if(1===e.length)return e[0].members.map(t=>[{axisId:e[0].id,axisLabel:e[0].axisLabel,memberId:t.id,memberLabel:t.label,isTyped:e[0].isTyped||!1,typedMemberId:e[0].typedMemberId}]);const[t,...i]=e,r=this.generateDimensionCombinations(i),o=[];return t.members.forEach(e=>{0===r.length?o.push([{axisId:t.id,axisLabel:t.axisLabel,memberId:e.id,memberLabel:e.label,isTyped:t.isTyped||!1,typedMemberId:t.typedMemberId}]):r.forEach(i=>{o.push([{axisId:t.id,axisLabel:t.axisLabel,memberId:e.id,memberLabel:e.label,isTyped:t.isTyped||!1,typedMemberId:t.typedMemberId},...i])})}),o}static formatDateForDisplay(e){try{return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return e}}static extractEntityName(e){try{const t=new URL(e).pathname.split("/");return t[t.length-1].replace(".xsd","").replace(/[^a-zA-Z0-9]/g," ").trim()||"Entity"}catch{return"Entity"}}static extractRoleTitle(e){const t=e.match(/^\[[\d]+\]\s*(.+)$/);return t?t[1].trim():e}static extractRoleOrder(e){const t=e.match(/^\[([\d]+)\]/);return t?parseInt(t[1],10):0}static buildColumnsFromHypercubes(){return[{id:"default",label:"Values",type:"data"}]}}const k={"nl-types:formattedExplanationItemType":{fieldType:"textarea",placeholder:"Enter detailed explanation..."},"nl-types:monetaryNoDecimals20ItemType":{fieldType:"number",htmlInputType:"number",allowDecimals:!1,step:1,placeholder:"Enter amount (no decimals)"},"xbrli:monetaryItemType":{fieldType:"currency",htmlInputType:"number",allowDecimals:!0,step:.01,placeholder:"0.00"},"xbrli:stringItemType":{fieldType:"text",htmlInputType:"text",placeholder:"Enter text"},"xbrli:dateItemType":{fieldType:"date",htmlInputType:"date"},"xbrli:dateTimeItemType":{fieldType:"datetime",htmlInputType:"datetime-local"},"xbrli:integerItemType":{fieldType:"integer",htmlInputType:"number",allowDecimals:!1,step:1,placeholder:"Enter whole number"},"xbrli:nonNegativeIntegerItemType":{fieldType:"integer",htmlInputType:"number",allowDecimals:!1,min:0,step:1,placeholder:"Enter positive number"},"xbrli:positiveIntegerItemType":{fieldType:"integer",htmlInputType:"number",allowDecimals:!1,min:1,step:1,placeholder:"Enter positive number"},"xbrli:decimalItemType":{fieldType:"decimal",htmlInputType:"number",allowDecimals:!0,step:"any",placeholder:"Enter decimal value"},"xbrli:sharesItemType":{fieldType:"number",htmlInputType:"number",allowDecimals:!0,min:0,step:.01,placeholder:"Enter number of shares"},"xbrli:shares":{fieldType:"number",htmlInputType:"number",allowDecimals:!0,min:0,step:.01,placeholder:"Enter number of shares"},"xbrli:gYearItemType":{fieldType:"number",htmlInputType:"number",allowDecimals:!1,min:1900,max:2100,step:1,placeholder:"YYYY"},"xbrli:booleanItemType":{fieldType:"boolean"},"xbrli:pureItemType":{fieldType:"percentage",htmlInputType:"number",allowDecimals:!0,step:.01,placeholder:"Enter percentage"},"xbrli:percentItemType":{fieldType:"percentage",htmlInputType:"number",allowDecimals:!0,step:.01,placeholder:"Enter percentage"},"xbrli:emailItemType":{fieldType:"email",htmlInputType:"email",placeholder:"email@example.com"},"xbrli:urlItemType":{fieldType:"url",htmlInputType:"url",placeholder:"https://example.com"},"xbrli:telephoneItemType":{fieldType:"tel",htmlInputType:"tel",placeholder:"+1 (555) 000-0000"}};function F(e){if(!e)return{fieldType:"text",htmlInputType:"text",placeholder:"Enter value"};if(k[e])return k[e];const t=e.toLowerCase();if(t.includes("monetary"))return t.includes("nodecimals")||t.includes("no-decimals")?{fieldType:"number",htmlInputType:"number",allowDecimals:!1,step:1,placeholder:"Enter amount (no decimals)"}:{fieldType:"currency",htmlInputType:"number",allowDecimals:!0,step:.01,placeholder:"0.00"};if(t.includes("explanation")||t.includes("description")||t.includes("notes")||t.includes("formatted"))return{fieldType:"textarea",placeholder:"Enter detailed information..."};if(t.includes("date"))return t.includes("time")?{fieldType:"datetime",htmlInputType:"datetime-local"}:{fieldType:"date",htmlInputType:"date"};if(t.includes("boolean")||t.includes("bool"))return{fieldType:"boolean"};if(t.includes("integer")||t.includes("int")){const e=t.includes("nonnegative")||t.includes("non-negative");return{fieldType:"integer",htmlInputType:"number",allowDecimals:!1,min:t.includes("positive")?1:e?0:void 0,step:1,placeholder:"Enter whole number"}}return t.includes("decimal")||t.includes("numeric")||t.includes("number")?{fieldType:"decimal",htmlInputType:"number",allowDecimals:!0,step:"any",placeholder:"Enter decimal value"}:t.includes("percent")||t.includes("pure")?{fieldType:"percentage",htmlInputType:"number",allowDecimals:!0,step:.01,placeholder:"Enter percentage"}:{fieldType:"text",htmlInputType:"text",placeholder:"Enter value"}}function E(e){return"textarea"===e}function j(e){return"boolean"===e}function P(e){return["number","decimal","integer","currency","percentage"].includes(e)}var A=Object.defineProperty,L=Object.getOwnPropertyDescriptor,R=(e,t,i,r)=>{for(var o,n=r>1?void 0:r?L(t,i):t,s=e.length-1;s>=0;s--)(o=e[s])&&(n=(r?o(t,i,n):o(n))||n);return r&&n&&A(t,i,n),n};exports.JupiterFormField=class extends e.LitElement{constructor(){super(...arguments),this.value=null,this.disabled=!1,this.locale="en-US",this.hideLabel=!1,this._errors=[],this._touched=!1}willUpdate(e){(e.has("value")||e.has("field"))&&this._validateField()}_validateField(){var e;(null==(e=this.field)?void 0:e.validation)&&(this._errors=C.validateField(this.field.id,this.conceptId,this.columnId,this.value,this.field.type,this.field.validation))}_handleInput(e){const t=e.target;let i=t.value;"number"===this.field.type||"decimal"===this.field.type?i=""===i?null:Number(i):"boolean"===this.field.type&&(i=t.checked),this.value=i,this._touched=!0,this.dispatchEvent(new CustomEvent("field-change",{detail:{fieldId:this.field.id,conceptId:this.conceptId,columnId:this.columnId,value:i,oldValue:this.value},bubbles:!0}))}_handleFocus(){this.dispatchEvent(new CustomEvent("field-focus",{detail:{fieldId:this.field.id,conceptId:this.conceptId,columnId:this.columnId},bubbles:!0}))}_handleBlur(){this._touched=!0,this.dispatchEvent(new CustomEvent("field-blur",{detail:{fieldId:this.field.id,conceptId:this.conceptId,columnId:this.columnId},bubbles:!0}))}_renderInput(){var t;const i=this._errors.some(e=>"error"===e.severity),r=this._errors.some(e=>"warning"===e.severity),o="field-input "+(i?"error":r?"warning":""),n=`${this.conceptId}__${this.columnId}`,s=`data[${this.conceptId}][${this.columnId}]`,a=F(this.conceptType);this.conceptType;const l=a.fieldType||this.field.type||"text";if("textarea"===l||E(l))return e.html`
|
|
22
|
+
*/function S(e){return w({...e,state:!0,attribute:!1})}class C{static validateField(e,t,i,r,o,n=[]){const s=[];for(const a of n){const n=this.validateRule(e,t,i,r,o,a);n&&s.push(n)}return s}static validateRule(e,t,i,r,o,n){const s=null==r||""===r;switch(n.type){case"required":if(s)return this.createError(e,t,i,n);break;case"min":if(!s&&"number"==typeof r&&r<n.value)return this.createError(e,t,i,n);break;case"max":if(!s&&"number"==typeof r&&r>n.value)return this.createError(e,t,i,n);break;case"minLength":if(!s&&"string"==typeof r&&r.length<n.value)return this.createError(e,t,i,n);break;case"maxLength":if(!s&&"string"==typeof r&&r.length>n.value)return this.createError(e,t,i,n);break;case"pattern":if(!s&&"string"==typeof r){if(!new RegExp(n.value).test(r))return this.createError(e,t,i,n)}break;case"email":if(!s&&"string"==typeof r){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))return this.createError(e,t,i,n)}break;case"url":if(!s&&"string"==typeof r)try{new URL(r)}catch{return this.createError(e,t,i,n)}break;case"custom":break;default:console.warn(`Unknown validation rule type: ${n.type}`)}return null}static createError(e,t,i,r){return{fieldId:e,conceptId:t,columnId:i,message:r.message,severity:r.severity||"error",rule:r}}static validateDataType(e,t){if(null==e||""===e)return{valid:!0,convertedValue:e};switch(t){case"number":case"decimal":case"currency":case"percentage":{const t=Number(e);return isNaN(t)?{valid:!1,error:"Invalid number format"}:{valid:!0,convertedValue:t}}case"date":{const t=new Date(e);return isNaN(t.getTime())?{valid:!1,error:"Invalid date format"}:{valid:!0,convertedValue:t.toISOString().split("T")[0]}}case"datetime":{const t=new Date(e);return isNaN(t.getTime())?{valid:!1,error:"Invalid datetime format"}:{valid:!0,convertedValue:t.toISOString()}}case"boolean":if("boolean"==typeof e)return{valid:!0,convertedValue:e};if("string"==typeof e){const t=e.toLowerCase();if("true"===t||"1"===t)return{valid:!0,convertedValue:!0};if("false"===t||"0"===t)return{valid:!0,convertedValue:!1}}return{valid:!1,error:"Invalid boolean format"};case"text":case"textarea":case"email":case"url":case"tel":return{valid:!0,convertedValue:String(e)};default:return{valid:!0,convertedValue:e}}}static formatValue(e,t,i="en-US"){if(null==e)return"";switch(t){case"number":return new Intl.NumberFormat(i).format(Number(e));case"decimal":return new Intl.NumberFormat(i,{minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(e));case"currency":return new Intl.NumberFormat(i,{style:"currency",currency:"USD"}).format(Number(e));case"percentage":return new Intl.NumberFormat(i,{style:"percent",minimumFractionDigits:2}).format(Number(e)/100);case"date":return new Date(e).toLocaleDateString(i);case"datetime":return new Date(e).toLocaleString(i);default:return String(e)}}}class T{static createUniqueConceptId(e,t){let i=e.id;if(e.preferredLabel&&""!==e.preferredLabel.trim()){const t=e.preferredLabel.match(/\/([^\/]+)$/),r=t?t[1]:e.preferredLabel.replace(/[^a-zA-Z0-9]/g,"_");i=`${e.id}_${r}`}if(t){return`${i}__${this.createSectionHash(t)}`}return i}static createSectionHash(e){let t=0;for(let i=0;i<e.length;i++){t=(t<<5)-t+e.charCodeAt(i),t&=t}return Math.abs(t).toString(36).substr(0,6)}static buildFormSchema(e,t,i,r="en",o){var n;if(!e.presentation||0===e.presentation.length)throw new Error("XBRL presentation data is required");const s=e.presentation[0],a=null==(n=e.hypercubes)?void 0:n[0],l=[];return[...s.roles].sort((e,t)=>e.role.localeCompare(t.role)).forEach(e=>{const n=this.buildSectionFromRole(e,t,i,a,r,o);this.assignFieldColumnIds(n),l.push(n)}),{formId:`xbrl-form-${Date.now()}`,title:`XBRL Form - ${this.extractEntityName(s.entrypoint)}`,description:"Dynamic form generated from XBRL taxonomy data",version:"1.0.0",sections:l}}static buildSectionFromRole(e,t,i,r,o="en",n){var s;const a=this.extractRoleTitle(e.role),l=this.getAllNonAbstractConcepts(e),d=new Set(l.filter(e=>e.periodType).map(e=>e.periodType)),c=null==r?void 0:r.roles.find(t=>t.roleId===e.id),p=null==n?void 0:n[e.id],m=this.generateDefaultColumnsForRole(e,t||"2025-01-01",i||"2025-12-31",c,l,d,p),h={periodTypes:d,availableColumnIds:m.map(e=>e.id)},u=[];return(null==(s=e.presentationLinkbase)?void 0:s.concepts)&&e.presentationLinkbase.concepts.forEach(r=>{const n=this.buildConceptTree(r,0,t,i,h,e.id,o);n&&u.push(n)}),{id:e.id,title:a,description:e.description||`Section for ${a}`,concepts:u,columns:m,expanded:!1,metadata:{roleURI:e.roleURI,originalRole:e.role},showPeriodControl:d.size>1,showPreviousYear:!0===e.showPreviousYear,instant:!0===e.instant,duration:!0===e.duration}}static buildConceptTree(e,t,i,r,o,n,s="en"){const a=this.getPreferredLabel(e.labels,s),l=[];if(!e.elementAbstract){let t=[];if((null==o?void 0:o.availableColumnIds)&&o.availableColumnIds.length>0){if(t=o.availableColumnIds.filter(t=>{const i=t.includes("instant")||"instant"===t,r=t.includes("duration")||"duration"===t;return"instant"===e.periodType?i:"duration"===e.periodType?r:!i&&!r}),0===t.length&&o.availableColumnIds.length>0){o.availableColumnIds.some(e=>e.includes("instant")||e.includes("duration"))||(t=o.availableColumnIds)}}else t=(null==o?void 0:o.periodTypes)&&0!==o.periodTypes.size?1===o.periodTypes.size&&o.periodTypes.has("instant")?["instant"]:1===o.periodTypes.size&&o.periodTypes.has("duration")?["duration"]:"instant"===e.periodType?["instant"]:"duration"===e.periodType?["duration"]:["duration","instant"]:["default"];t.forEach(t=>{const o=this.createFieldFromConcept(e,i,r,t);o&&l.push(o)})}const d=[];e.children&&e.children.length>0&&e.children.forEach(e=>{const a=this.buildConceptTree(e,t+1,i,r,o,n,s);a&&d.push(a)});return l.length>0||d.length>0?{id:this.createUniqueConceptId(e,n),originalConceptId:e.id,name:e.conceptName,label:a,description:`${e.conceptName} (${e.type})`,type:e.type,level:t,children:d,fields:l,collapsed:t>0,abstract:e.elementAbstract,periodType:e.periodType}:null}static createFieldFromConcept(e,t,i,r){const o=this.mapXBRLTypeToFieldType(e.type),n=this.getPreferredLabel(e.labels);let s;s=r||("instant"===e.periodType?"instant":"duration"===e.periodType?"duration":"default");const a={id:`${e.id}_${s}_field`,conceptId:e.id,columnId:s,type:o,label:n,placeholder:`Enter ${n.toLowerCase()}`,required:!1,disabled:e.elementAbstract,defaultValue:null};return"duration"!==e.periodType&&"instant"!==e.periodType||(a.periodStartDate=t||"2025-01-01",a.periodEndDate=i||"2025-12-31"),a}static mapXBRLTypeToFieldType(e){return{"xbrli:stringItemType":"text","xbrli:monetaryItemType":"currency","xbrli:integerItemType":"number","xbrli:decimalItemType":"decimal","xbrli:percentItemType":"percentage","xbrli:dateItemType":"date","xbrli:booleanItemType":"boolean","dtr-types:domainItemType":"select","bw2-titel9:chamberOfCommerceRegistrationNumberItemType":"text"}[e]||"text"}static getPreferredLabel(e,t="en"){if(!e||0===e.length)return"Unnamed Concept";const i=e.filter(e=>e.lang===t),r=i.length>0?i:e,o=r.find(e=>e.preferredLabel);if(o)return o.label;const n=r.find(e=>"http://www.xbrl.org/2003/role/label"===e.role);if(n)return n.label;const s=r.find(e=>"http://www.xbrl.org/2003/role/terseLabel"===e.role);return s?s.label:r.length>0?r[0].label:e[0].label}static assignFieldColumnIds(e){if(!e.columns||0===e.columns.length)return;const t=e.columns.map(e=>e.id);e.concepts.forEach(e=>{this.assignColumnIdsToConceptFields(e,t)})}static assignColumnIdsToConceptFields(e,t){e.fields=e.fields.filter(e=>t.includes(e.columnId)),e.children&&e.children.forEach(e=>{this.assignColumnIdsToConceptFields(e,t)})}static countFieldsInTree(e){let t=e.fields.length;return e.children&&e.children.forEach(e=>{t+=this.countFieldsInTree(e)}),t}static getAllNonAbstractConcepts(e){var t;const i=[];return(null==(t=e.presentationLinkbase)?void 0:t.concepts)&&e.presentationLinkbase.concepts.forEach(e=>{this.collectNonAbstractConcepts(e,i)}),i}static collectNonAbstractConcepts(e,t){e.elementAbstract||t.push(e),e.children&&e.children.length>0&&e.children.forEach(e=>{this.collectNonAbstractConcepts(e,t)})}static generateDefaultColumnsForRole(e,t,i,r,o,n,s){var a,l;const d=o||this.getAllNonAbstractConcepts(e),c=n||new Set(d.filter(e=>e.periodType).map(e=>e.periodType));if(0===d.length)return[{id:"default",title:"Value",description:"Default value column",type:"base",order:0,removable:!1}];let p=[];if(1===(null==(a=null==r?void 0:r.items)?void 0:a.length)){const e=r.items[0];1===e.dimensions.length?p=this.generateSingleDimensionColumns(e.dimensions[0],t,i,c):e.dimensions.length>1&&(p=this.generateMultiDimensionColumns(e.dimensions,t,i,c)),s&&(p=this.filterColumnsByPeriodPreferences(p,s))}else(null==(l=null==r?void 0:r.items)?void 0:l.length)&&r.items.length;const m=[];p.length>0?m.push(...p):0===c.size?m.push({id:"default",title:"Value",description:"Default value column",type:"base",order:0,removable:!1}):1===c.size&&c.has("instant")?m.push({id:"instant",title:i,description:"",type:"base",order:0,removable:!1}):1===c.size&&c.has("duration")?m.push({id:"duration",title:`${t} / ${i}`,description:"",type:"base",order:0,removable:!1}):(m.push({id:"duration",title:`${t} / ${i}`,description:"",type:"base",order:0,removable:!1}),m.push({id:"instant",title:i,description:"",type:"base",order:1,removable:!1}));let h=m;if(s&&(h=this.filterColumnsByPeriodPreferences(m,s)),null==s?void 0:s.showPreviousYear){const e=this.generatePreviousYearColumns(h,t,i);h=[...h,...e]}return h}static getPreviousYearDate(e){try{const t=new Date(e);return t.setFullYear(t.getFullYear()-1),t.toISOString().split("T")[0]}catch(t){return console.error(`Error calculating previous year for date ${e}:`,t),e}}static generatePreviousYearColumns(e,t,i){const r=[],o=this.getPreviousYearDate(t),n=this.getPreviousYearDate(i);return e.forEach((e,t)=>{let i=e.title,s="",a="";e.dimensionData?(i=e.title,s=e.description&&e.description.includes("/")?`${o} / ${n}`:n,a=`${e.id}_prev`):"instant"===e.id||e.id.includes("instant")?(i=n,s="",a=`instant_prev_${t}`):"duration"===e.id||e.id.includes("duration")?(i=`${o} / ${n}`,s="",a=`duration_prev_${t}`):e.title.includes("/")?(i=`${o} / ${n}`,s="",a=`${e.id}_prev`):(i=n,s="",a=`${e.id}_prev`),r.push({...e,id:a,title:i,description:s,order:e.order+100,removable:!0,periodStartDate:o,periodEndDate:n,dimensionData:e.dimensionData?{...e.dimensionData,dimensionId:`${e.dimensionData.dimensionId}_prev`}:void 0})}),r}static filterColumnsByPeriodPreferences(e,t){return e.filter(e=>{var i,r,o,n;const s=e.id.includes("duration")||(null==(r=null==(i=e.dimensionData)?void 0:i.dimensionId)?void 0:r.includes("duration")),a=e.id.includes("instant")||(null==(n=null==(o=e.dimensionData)?void 0:o.dimensionId)?void 0:n.includes("instant"));return!s&&!a||!(s&&!t.showDuration)&&!(a&&!t.showInstant)})}static generateSingleDimensionColumns(e,t,i,r){var o,n,s;if(e.typedMember&&(!e.members||0===e.members.length)){const n=(null==(o=e.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:o.label)||e.conceptName,s={axisId:e.id,axisLabel:n,typedMemberId:e.typedMember.id,dimensionKey:`${n} | [Typed Input]`,dimensionIdKey:`${e.id}|[typed]`},a=[];return 0===r.size?a.push({id:"typed-default",title:n,description:"Typed dimension input column",type:"dimension",dimensionData:{dimensionId:"typed-default",axisId:s.axisId,memberId:"[typed]",memberValue:"Typed Input",memberLabel:"Typed Input",axis:s.axisLabel,axisLabel:s.axisLabel,memberKey:s.dimensionKey,dimensionIdKey:s.dimensionIdKey,hasTypedMembers:!0,typedMemberId:s.typedMemberId,typedMembers:[{axisId:s.axisId,axisLabel:s.axisLabel,typedMemberId:s.typedMemberId,memberLabel:s.axisLabel}]},order:0,removable:!1}):1===r.size&&r.has("instant")?a.push({id:"typed-instant",title:`${n} [Typed Input Available]`,description:i,type:"dimension",dimensionData:{dimensionId:"typed-instant",axisId:s.axisId,memberId:"[typed]",memberValue:"Typed Input",memberLabel:"Typed Input",axis:s.axisLabel,axisLabel:s.axisLabel,memberKey:s.dimensionKey,dimensionIdKey:s.dimensionIdKey,hasTypedMembers:!0,typedMemberId:s.typedMemberId,typedMembers:[{axisId:s.axisId,axisLabel:s.axisLabel,typedMemberId:s.typedMemberId,memberLabel:s.axisLabel}]},order:0,removable:!1}):1===r.size&&r.has("duration")?a.push({id:"typed-duration",title:`${n} [Typed Input Available]`,description:`${t} / ${i}`,type:"dimension",dimensionData:{dimensionId:"typed-duration",axisId:s.axisId,memberId:"[typed]",memberValue:"Typed Input",memberLabel:"Typed Input",axis:s.axisLabel,axisLabel:s.axisLabel,memberKey:s.dimensionKey,dimensionIdKey:s.dimensionIdKey,hasTypedMembers:!0,typedMemberId:s.typedMemberId,typedMembers:[{axisId:s.axisId,axisLabel:s.axisLabel,typedMemberId:s.typedMemberId,memberLabel:s.axisLabel}]},order:0,removable:!1}):(a.push({id:"typed-duration",title:`${n} [Typed Input Available]`,description:`${t} / ${i}`,type:"dimension",dimensionData:{dimensionId:"typed-duration",axisId:s.axisId,memberId:"[typed]",memberValue:"Typed Input",memberLabel:"Typed Input",axis:s.axisLabel,axisLabel:s.axisLabel,memberKey:s.dimensionKey,dimensionIdKey:s.dimensionIdKey,hasTypedMembers:!0,typedMemberId:s.typedMemberId,typedMembers:[{axisId:s.axisId,axisLabel:s.axisLabel,typedMemberId:s.typedMemberId,memberLabel:s.axisLabel}]},order:0,removable:!1}),a.push({id:"typed-instant",title:`${n} [Typed Input Available]`,description:i,type:"dimension",dimensionData:{dimensionId:"typed-instant",axisId:s.axisId,memberId:"[typed]",memberValue:"Typed Input",memberLabel:"Typed Input",axis:s.axisLabel,axisLabel:s.axisLabel,memberKey:s.dimensionKey,dimensionIdKey:s.dimensionIdKey,hasTypedMembers:!0,typedMemberId:s.typedMemberId,typedMembers:[{axisId:s.axisId,axisLabel:s.axisLabel,typedMemberId:s.typedMemberId,memberLabel:s.axisLabel}]},order:1,removable:!1})),a}if(!e.members||!Array.isArray(e.members))return[];if(0===e.members.length)return[];const a=(null==(n=e.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:n.label)||e.conceptName,l=e.members[0],d=(null==(s=l.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:s.label)||l.conceptName,c={axisId:e.id,axisLabel:a,memberId:l.id,memberLabel:d,dimensionKey:`${a} | ${d}`,dimensionIdKey:`${e.id} | ${l.id}`},p=[];return 0===r.size?p.push({id:"default",title:c.memberLabel,description:"Default value column",type:"dimension",dimensionData:{dimensionId:"default",axisId:c.axisId,memberId:c.memberId,memberValue:c.memberLabel,memberLabel:c.memberLabel,axis:c.axisLabel,axisLabel:c.axisLabel,memberKey:c.dimensionKey,dimensionIdKey:c.dimensionIdKey},order:0,removable:!1}):1===r.size&&r.has("instant")?p.push({id:"instant",title:`${c.memberLabel}`,description:i,type:"dimension",dimensionData:{dimensionId:"instant",axisId:c.axisId,memberId:c.memberId,memberValue:c.memberLabel,memberLabel:c.memberLabel,axis:c.axisLabel,axisLabel:c.axisLabel,memberKey:c.dimensionKey,dimensionIdKey:c.dimensionIdKey},order:0,removable:!1}):1===r.size&&r.has("duration")?p.push({id:"duration",title:`${c.memberLabel}`,description:`${t} / ${i}`,type:"dimension",dimensionData:{dimensionId:"duration",axisId:c.axisId,memberId:c.memberId,memberValue:c.memberLabel,memberLabel:c.memberLabel,axis:c.axisLabel,axisLabel:c.axisLabel,memberKey:c.dimensionKey,dimensionIdKey:c.dimensionIdKey},order:0,removable:!1}):(p.push({id:"duration",title:`${c.memberLabel}`,description:`${t} / ${i}`,type:"dimension",dimensionData:{dimensionId:"duration",axisId:c.axisId,memberId:c.memberId,memberValue:c.memberLabel,memberLabel:c.memberLabel,axis:c.axisLabel,axisLabel:c.axisLabel,memberKey:c.dimensionKey,dimensionIdKey:c.dimensionIdKey},order:0,removable:!1}),p.push({id:"instant",title:`${c.memberLabel}`,description:i,type:"dimension",dimensionData:{dimensionId:"instant",axisId:c.axisId,memberId:c.memberId,memberValue:c.memberLabel,memberLabel:c.memberLabel,axis:c.axisLabel,axisLabel:c.axisLabel,memberKey:c.dimensionKey,dimensionIdKey:c.dimensionIdKey},order:1,removable:!1})),p}static generateMultiDimensionColumns(e,t,i,r){e.some(e=>e.typedMember);const o=e.filter(e=>!!e.typedMember||!!(e.members&&Array.isArray(e.members)&&e.members.length>0));if(0===o.length)return[];const n=o.map(e=>{var t;const i=(null==(t=e.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:t.label)||e.conceptName;if(e.typedMember)return{id:e.id,axisLabel:i,isTyped:!0,typedMemberId:e.typedMember.id,members:[{id:"[typed]",label:`${i} [Typed Input Available]`}]};const r=this.getAllDimensionMembers(e.members);return{id:e.id,axisLabel:i,isTyped:!1,members:r.map(e=>{var t;return{id:e.id,label:(null==(t=e.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:t.label)||e.conceptName}})}}),s=this.generateDimensionCombinations(n),a=[];return s.forEach((e,o)=>{const n=e.map(e=>e.memberLabel).join(" | "),s=e.filter(e=>e.isTyped),l=e.filter(e=>!e.isTyped),d={dimensionId:`multi_${o}`,memberValue:n,memberLabel:n,combinations:l.map(e=>({axisId:e.axisId,axisLabel:e.axisLabel,memberId:e.memberId,memberLabel:e.memberLabel})),typedMembers:s.map(e=>({axisId:e.axisId,axisLabel:e.axisLabel,typedMemberId:e.typedMemberId,memberLabel:e.memberLabel})),hasTypedMembers:s.length>0,memberKey:n,dimensionIdKey:[...l.map(e=>`${e.axisId}|${e.memberId}`),...s.map(e=>`${e.axisId}|[typed]`)].join("::")};0===r.size||1===r.size&&r.has("duration")?a.push({id:`duration_${o}`,title:`${n}`,description:`${t} / ${i}`,type:"dimension",dimensionData:{...d,dimensionId:`duration_${o}`},order:2*o,removable:!1}):1===r.size&&r.has("instant")?a.push({id:`instant_${o}`,title:`${n}`,description:i,type:"dimension",dimensionData:{...d,dimensionId:`instant_${o}`},order:2*o,removable:!1}):(a.push({id:`duration_${o}`,title:`${n}`,description:`${t} / ${i}`,type:"dimension",dimensionData:{...d,dimensionId:`duration_${o}`},order:2*o,removable:!1}),a.push({id:`instant_${o}`,title:`${n}`,description:i,type:"dimension",dimensionData:{...d,dimensionId:`instant_${o}`},order:2*o+1,removable:!1}))}),a}static getAllDimensionMembers(e){if(!e||!Array.isArray(e))return[];const t=[];return e.forEach(e=>{t.push(e),e.children&&e.children.length>0&&t.push(...this.getAllDimensionMembers(e.children))}),t}static generateDimensionCombinations(e){if(0===e.length)return[];if(1===e.length)return e[0].members.map(t=>[{axisId:e[0].id,axisLabel:e[0].axisLabel,memberId:t.id,memberLabel:t.label,isTyped:e[0].isTyped||!1,typedMemberId:e[0].typedMemberId}]);const[t,...i]=e,r=this.generateDimensionCombinations(i),o=[];return t.members.forEach(e=>{0===r.length?o.push([{axisId:t.id,axisLabel:t.axisLabel,memberId:e.id,memberLabel:e.label,isTyped:t.isTyped||!1,typedMemberId:t.typedMemberId}]):r.forEach(i=>{o.push([{axisId:t.id,axisLabel:t.axisLabel,memberId:e.id,memberLabel:e.label,isTyped:t.isTyped||!1,typedMemberId:t.typedMemberId},...i])})}),o}static formatDateForDisplay(e){try{return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return e}}static extractEntityName(e){try{const t=new URL(e).pathname.split("/");return t[t.length-1].replace(".xsd","").replace(/[^a-zA-Z0-9]/g," ").trim()||"Entity"}catch{return"Entity"}}static extractRoleTitle(e){const t=e.match(/^\[[\d]+\]\s*(.+)$/);return t?t[1].trim():e}static extractRoleOrder(e){const t=e.match(/^\[([\d]+)\]/);return t?parseInt(t[1],10):0}static buildColumnsFromHypercubes(){return[{id:"default",label:"Values",type:"data"}]}}const k={en:{form:{loading:"Loading form...",submit:"Submit",saveDraft:"Save Draft",errors:"Errors",modified:"Modified",valid:"Valid",yes:"Yes",no:"No",noRoleSelected:"No Role Selected",pleaseSelectRole:"Please select a role from the list on the left."},filter:{selectRoles:"Select Roles",filterRoles:"Filter Roles",title:"Filter Roles",searchPlaceholder:"Search roles by name, ID, or URI...",clearSearch:"Clear search",showingResults:"Showing",of:"of",roles:"roles",matching:"matching",selectAll:"Select All",selectNone:"Select None",selectFiltered:"Select Filtered",deselectFiltered:"Deselect Filtered",deselectAll:"Deselect All",reset:"Reset",noRolesFound:"No roles found matching",tryDifferentSearch:"Try a different search term or clear the search.",noRolesAvailable:"No roles available.",cancel:"Cancel",applyFilter:"Apply Filter",showPeriodColumn:"Show Period Column:",additionalOptions:"Additional Options:",showPreviousYear:"Show previous year",duration:"Duration",instant:"Instant",uri:"URI"},column:{addColumn:"Add Column",columnType:"Column Type",instantSingleDate:"Instant (single date)",durationDates:"Duration (start and end dates)",instantDate:"Instant Date",startPeriodDate:"Start Period Date",endPeriodDate:"End Period Date",availableDimensions:"Available Dimensions",dimensionsDescription:"Select dimensions to include in the column. Domain members can be selected here, while typed dimension values will be entered directly in the column header.",enterValue:"Enter value for",enterValuePlaceholder:"Enter value...",selectMember:"Select member:",noMembersAvailable:"No members available for this dimension",cancel:"Cancel",removeColumn:"Remove column",required:"required"},section:{enterPlaceholder:"Enter"},admin:{title:"Configure Roles",description:"Select which roles should display the 'Show Previous Year' checkbox and configure period type columns."},validation:{summary:"Please fix the following errors before submitting:",errorsFound:"errors found"}},nl:{form:{loading:"Formulier laden...",submit:"Indienen",saveDraft:"Concept opslaan",errors:"Fouten",modified:"Gewijzigd",valid:"Geldig",yes:"Ja",no:"Nee",noRoleSelected:"Geen rol geselecteerd",pleaseSelectRole:"Selecteer een rol uit de lijst aan de linkerkant."},filter:{selectRoles:"Rollen selecteren",filterRoles:"Rollen filteren",title:"Rollen filteren",searchPlaceholder:"Zoek rollen op naam, ID of URI...",clearSearch:"Zoekopdracht wissen",showingResults:"Weergeven",of:"van",roles:"rollen",matching:"overeenkomend met",selectAll:"Alles selecteren",selectNone:"Niets selecteren",selectFiltered:"Gefilterd selecteren",deselectFiltered:"Gefilterd deselecteren",deselectAll:"Alles deselecteren",reset:"Resetten",noRolesFound:"Geen rollen gevonden die overeenkomen met",tryDifferentSearch:"Probeer een andere zoekterm of wis de zoekopdracht.",noRolesAvailable:"Geen rollen beschikbaar.",cancel:"Annuleren",applyFilter:"Filter toepassen",showPeriodColumn:"Periodekolom weergeven:",additionalOptions:"Aanvullende opties:",showPreviousYear:"Vorig jaar weergeven",duration:"Duur",instant:"Moment",uri:"URI"},column:{addColumn:"Kolom toevoegen",columnType:"Kolomtype",instantSingleDate:"Moment (enkele datum)",durationDates:"Duur (begin- en einddatum)",instantDate:"Momentdatum",startPeriodDate:"Startdatum periode",endPeriodDate:"Einddatum periode",availableDimensions:"Beschikbare dimensies",dimensionsDescription:"Selecteer dimensies om in de kolom op te nemen. Domeinleden kunnen hier worden geselecteerd, terwijl getypte dimensiewaarden direct in de kolomkop worden ingevoerd.",enterValue:"Voer waarde in voor",enterValuePlaceholder:"Voer waarde in...",selectMember:"Selecteer lid:",noMembersAvailable:"Geen leden beschikbaar voor deze dimensie",cancel:"Annuleren",removeColumn:"Kolom verwijderen",required:"verplicht"},section:{enterPlaceholder:"Invoeren"},admin:{title:"Rollen configureren",description:"Selecteer welke rollen het selectievakje 'Vorig jaar weergeven' moeten weergeven en configureer periodetype kolommen."},validation:{summary:"Corrigeer de volgende fouten voordat u indient:",errorsFound:"fouten gevonden"}}};class F{static setLanguage(e){k[e]?this.currentLanguage=e:(console.warn(`Language '${e}' not supported, falling back to 'en'`),this.currentLanguage="en")}static getLanguage(){return this.currentLanguage}static t(e,t){const i=e.split(".");let r=k[this.currentLanguage];for(const o of i){if(!r||"object"!=typeof r||!(o in r))return console.warn(`Translation key '${e}' not found for language '${this.currentLanguage}'`),e;r=r[o]}return t&&"string"==typeof r?this.interpolate(r,t):r}static interpolate(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,i)=>i in t?String(t[i]):e)}static has(e){const t=e.split(".");let i=k[this.currentLanguage];for(const r of t){if(!i||"object"!=typeof i||!(r in i))return!1;i=i[r]}return void 0!==i}static getAvailableLanguages(){return Object.keys(k)}}F.currentLanguage="en";const E={"nl-types:formattedExplanationItemType":{fieldType:"textarea",placeholder:"Enter detailed explanation..."},"nl-types:monetaryNoDecimals20ItemType":{fieldType:"number",htmlInputType:"number",allowDecimals:!1,step:1,placeholder:"Enter amount (no decimals)"},"xbrli:monetaryItemType":{fieldType:"currency",htmlInputType:"number",allowDecimals:!0,step:.01,placeholder:"0.00"},"xbrli:stringItemType":{fieldType:"text",htmlInputType:"text",placeholder:"Enter text"},"xbrli:dateItemType":{fieldType:"date",htmlInputType:"date"},"xbrli:dateTimeItemType":{fieldType:"datetime",htmlInputType:"datetime-local"},"xbrli:integerItemType":{fieldType:"integer",htmlInputType:"number",allowDecimals:!1,step:1,placeholder:"Enter whole number"},"xbrli:nonNegativeIntegerItemType":{fieldType:"integer",htmlInputType:"number",allowDecimals:!1,min:0,step:1,placeholder:"Enter positive number"},"xbrli:positiveIntegerItemType":{fieldType:"integer",htmlInputType:"number",allowDecimals:!1,min:1,step:1,placeholder:"Enter positive number"},"xbrli:decimalItemType":{fieldType:"decimal",htmlInputType:"number",allowDecimals:!0,step:"any",placeholder:"Enter decimal value"},"xbrli:sharesItemType":{fieldType:"number",htmlInputType:"number",allowDecimals:!0,min:0,step:.01,placeholder:"Enter number of shares"},"xbrli:shares":{fieldType:"number",htmlInputType:"number",allowDecimals:!0,min:0,step:.01,placeholder:"Enter number of shares"},"xbrli:gYearItemType":{fieldType:"number",htmlInputType:"number",allowDecimals:!1,min:1900,max:2100,step:1,placeholder:"YYYY"},"xbrli:booleanItemType":{fieldType:"boolean"},"xbrli:pureItemType":{fieldType:"percentage",htmlInputType:"number",allowDecimals:!0,step:.01,placeholder:"Enter percentage"},"xbrli:percentItemType":{fieldType:"percentage",htmlInputType:"number",allowDecimals:!0,step:.01,placeholder:"Enter percentage"},"xbrli:emailItemType":{fieldType:"email",htmlInputType:"email",placeholder:"email@example.com"},"xbrli:urlItemType":{fieldType:"url",htmlInputType:"url",placeholder:"https://example.com"},"xbrli:telephoneItemType":{fieldType:"tel",htmlInputType:"tel",placeholder:"+1 (555) 000-0000"}};function j(e){if(!e)return{fieldType:"text",htmlInputType:"text",placeholder:"Enter value"};if(E[e])return E[e];const t=e.toLowerCase();if(t.includes("monetary"))return t.includes("nodecimals")||t.includes("no-decimals")?{fieldType:"number",htmlInputType:"number",allowDecimals:!1,step:1,placeholder:"Enter amount (no decimals)"}:{fieldType:"currency",htmlInputType:"number",allowDecimals:!0,step:.01,placeholder:"0.00"};if(t.includes("explanation")||t.includes("description")||t.includes("notes")||t.includes("formatted"))return{fieldType:"textarea",placeholder:"Enter detailed information..."};if(t.includes("date"))return t.includes("time")?{fieldType:"datetime",htmlInputType:"datetime-local"}:{fieldType:"date",htmlInputType:"date"};if(t.includes("boolean")||t.includes("bool"))return{fieldType:"boolean"};if(t.includes("integer")||t.includes("int")){const e=t.includes("nonnegative")||t.includes("non-negative");return{fieldType:"integer",htmlInputType:"number",allowDecimals:!1,min:t.includes("positive")?1:e?0:void 0,step:1,placeholder:"Enter whole number"}}return t.includes("decimal")||t.includes("numeric")||t.includes("number")?{fieldType:"decimal",htmlInputType:"number",allowDecimals:!0,step:"any",placeholder:"Enter decimal value"}:t.includes("percent")||t.includes("pure")?{fieldType:"percentage",htmlInputType:"number",allowDecimals:!0,step:.01,placeholder:"Enter percentage"}:{fieldType:"text",htmlInputType:"text",placeholder:"Enter value"}}function P(e){return"textarea"===e}function R(e){return"boolean"===e}function A(e){return["number","decimal","integer","currency","percentage"].includes(e)}var L=Object.defineProperty,M=Object.getOwnPropertyDescriptor,z=(e,t,i,r)=>{for(var o,n=r>1?void 0:r?M(t,i):t,s=e.length-1;s>=0;s--)(o=e[s])&&(n=(r?o(t,i,n):o(n))||n);return r&&n&&L(t,i,n),n};exports.JupiterFormField=class extends e.LitElement{constructor(){super(...arguments),this.value=null,this.disabled=!1,this.locale="en-US",this.hideLabel=!1,this._errors=[],this._touched=!1}willUpdate(e){(e.has("value")||e.has("field"))&&this._validateField()}_validateField(){var e;(null==(e=this.field)?void 0:e.validation)&&(this._errors=C.validateField(this.field.id,this.conceptId,this.columnId,this.value,this.field.type,this.field.validation))}_handleInput(e){const t=e.target;let i=t.value;"number"===this.field.type||"decimal"===this.field.type?i=""===i?null:Number(i):"boolean"===this.field.type&&(i=t.checked),this.value=i,this._touched=!0,this.dispatchEvent(new CustomEvent("field-change",{detail:{fieldId:this.field.id,conceptId:this.conceptId,columnId:this.columnId,value:i,oldValue:this.value},bubbles:!0}))}_handleFocus(){this.dispatchEvent(new CustomEvent("field-focus",{detail:{fieldId:this.field.id,conceptId:this.conceptId,columnId:this.columnId},bubbles:!0}))}_handleBlur(){this._touched=!0,this.dispatchEvent(new CustomEvent("field-blur",{detail:{fieldId:this.field.id,conceptId:this.conceptId,columnId:this.columnId},bubbles:!0}))}_renderInput(){var t;const i=this._errors.some(e=>"error"===e.severity),r=this._errors.some(e=>"warning"===e.severity),o="field-input "+(i?"error":r?"warning":""),n=`${this.conceptId}__${this.columnId}`,s=`data[${this.conceptId}][${this.columnId}]`,a=j(this.conceptType);this.conceptType;const l=a.fieldType||this.field.type||"text";if("textarea"===l||P(l))return e.html`
|
|
23
23
|
<textarea
|
|
24
24
|
id="${n}"
|
|
25
25
|
name="${s}"
|
|
@@ -53,7 +53,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
53
53
|
</option>
|
|
54
54
|
`)}
|
|
55
55
|
</select>
|
|
56
|
-
`;if("boolean"===l||
|
|
56
|
+
`;if("boolean"===l||R(l))return e.html`
|
|
57
57
|
<div class="checkbox-container">
|
|
58
58
|
<input
|
|
59
59
|
id="${n}"
|
|
@@ -68,7 +68,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
68
68
|
/>
|
|
69
69
|
<span>${this.field.label}</span>
|
|
70
70
|
</div>
|
|
71
|
-
`;const d=a.htmlInputType||this._getInputType(),c=void 0!==a.step?a.step:
|
|
71
|
+
`;const d=a.htmlInputType||this._getInputType(),c=void 0!==a.step?a.step:A(l)?"any":void 0,p=a.min,m=a.max;return e.html`
|
|
72
72
|
<input
|
|
73
73
|
id="${n}"
|
|
74
74
|
name="${s}"
|
|
@@ -79,7 +79,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
79
79
|
placeholder="${a.placeholder||this.field.placeholder||""}"
|
|
80
80
|
step="${void 0!==c?c:""}"
|
|
81
81
|
min="${void 0!==p?p:""}"
|
|
82
|
-
max="${void 0!==
|
|
82
|
+
max="${void 0!==m?m:""}"
|
|
83
83
|
@input="${this._handleInput}"
|
|
84
84
|
@focus="${this._handleFocus}"
|
|
85
85
|
@blur="${this._handleBlur}"
|
|
@@ -209,7 +209,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
209
209
|
margin: 0;
|
|
210
210
|
width: auto;
|
|
211
211
|
}
|
|
212
|
-
`,
|
|
212
|
+
`,z([w({type:Object})],exports.JupiterFormField.prototype,"field",2),z([w({type:String})],exports.JupiterFormField.prototype,"conceptId",2),z([w({type:String})],exports.JupiterFormField.prototype,"conceptType",2),z([w({type:String})],exports.JupiterFormField.prototype,"columnId",2),z([w()],exports.JupiterFormField.prototype,"value",2),z([w({type:Boolean})],exports.JupiterFormField.prototype,"disabled",2),z([w({type:String})],exports.JupiterFormField.prototype,"locale",2),z([w({type:Boolean})],exports.JupiterFormField.prototype,"hideLabel",2),z([S()],exports.JupiterFormField.prototype,"_errors",2),z([S()],exports.JupiterFormField.prototype,"_touched",2),exports.JupiterFormField=z([t("jupiter-form-field")],exports.JupiterFormField);var J=Object.defineProperty,U=Object.getOwnPropertyDescriptor,N=(e,t,i,r)=>{for(var o,n=r>1?void 0:r?U(t,i):t,s=e.length-1;s>=0;s--)(o=e[s])&&(n=(r?o(t,i,n):o(n))||n);return r&&n&&J(t,i,n),n};exports.JupiterConceptTree=class extends e.LitElement{constructor(){super(...arguments),this.columns=[],this.formData={},this.disabled=!1,this.locale="en-US",this.expandedConcepts=new Set,this._expanded=!0}connectedCallback(){super.connectedCallback(),this._expanded=this.expandedConcepts.has(this.concept.id)}willUpdate(e){super.willUpdate(e),e.has("expandedConcepts")&&(this._expanded=this.expandedConcepts.has(this.concept.id))}_toggleExpanded(){this._expanded=!this._expanded,this.dispatchEvent(new CustomEvent("concept-expand",{detail:{conceptId:this.concept.id,expanded:this._expanded},bubbles:!0}))}_getFieldForColumn(e){var t;return null==(t=this.concept.fields)?void 0:t.find(t=>t.columnId===e)}_getFieldValue(e){var t;return null==(t=this.formData[this.concept.id])?void 0:t[e.columnId]}_handleFieldChange(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("field-change",{detail:e.detail,bubbles:!0}))}render(){const t=this.concept.children&&this.concept.children.length>0,i=this.concept.level||0,r=this.concept.abstract||!1;return e.html`
|
|
213
213
|
<!-- Concept Name Cell (Left Column) -->
|
|
214
214
|
<td class="concept-name-cell ${r?"abstract":t?"":"leaf"}">
|
|
215
215
|
<div class="concept-content" style="--level: ${i}">
|
|
@@ -346,32 +346,32 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
|
|
349
|
-
`,
|
|
349
|
+
`,N([w({type:Object})],exports.JupiterConceptTree.prototype,"concept",2),N([w({type:Array})],exports.JupiterConceptTree.prototype,"columns",2),N([w({type:Object})],exports.JupiterConceptTree.prototype,"formData",2),N([w({type:Boolean})],exports.JupiterConceptTree.prototype,"disabled",2),N([w({type:String})],exports.JupiterConceptTree.prototype,"locale",2),N([w({type:Set})],exports.JupiterConceptTree.prototype,"expandedConcepts",2),N([S()],exports.JupiterConceptTree.prototype,"_expanded",2),exports.JupiterConceptTree=N([t("jupiter-concept-tree")],exports.JupiterConceptTree);var O=Object.defineProperty,V=Object.getOwnPropertyDescriptor,q=(e,t,i,r)=>{for(var o,n=r>1?void 0:r?V(t,i):t,s=e.length-1;s>=0;s--)(o=e[s])&&(n=(r?o(t,i,n):o(n))||n);return r&&n&&O(t,i,n),n};exports.JupiterAddColumnDialog=class extends e.LitElement{constructor(){super(...arguments),this.periodType="duration",this.open=!1,this.availableDimensions=[],this._startDate="",this._endDate="",this._instantDate="",this._selectedType="duration",this._selectedDimensions=new Map}updated(e){e.has("open")&&this.open&&this._resetForm(),e.has("availableDimensions")}connectedCallback(){super.connectedCallback(),this._resetForm()}willUpdate(e){super.willUpdate(e),e.has("open")&&this.open&&this._resetForm()}_handleCancel(){this.open=!1,this.dispatchEvent(new CustomEvent("dialog-cancel",{bubbles:!0}))}_handleConfirm(){if(!this._isFormValid())return;const e={periodType:"mixed"===this.periodType?this._selectedType:this.periodType};"instant"===this.periodType||"mixed"===this.periodType&&"instant"===this._selectedType?e.instantDate=this._instantDate:(e.startDate=this._startDate,e.endDate=this._endDate),this._selectedDimensions.size>0&&(e.selectedDimensions=Array.from(this._selectedDimensions.values())),this.dispatchEvent(new CustomEvent("column-add",{detail:e,bubbles:!0}))}_isFormValid(){return"mixed"===this.periodType?"instant"===this._selectedType?!!this._instantDate:!!this._startDate&&!!this._endDate&&this._startDate<=this._endDate:"duration"===this.periodType?!!this._startDate&&!!this._endDate&&this._startDate<=this._endDate:"instant"===this.periodType&&!!this._instantDate}_handleStartDateChange(e){this._startDate=e.target.value}_handleEndDateChange(e){this._endDate=e.target.value}_handleSelectedTypeChange(e){this._selectedType=e.target.value}_handleInstantDateChange(e){this._instantDate=e.target.value}_handleDimensionToggle(e,t){if(t.target.checked){const t=this.availableDimensions.find(t=>t.id===e);if(t){const i={axisId:t.id,axisLabel:t.axisLabel,isTyped:!(!t.typedMember||t.members&&0!==t.members.length)};this._selectedDimensions.set(e,i)}}else this._selectedDimensions.delete(e);this.requestUpdate()}_handleMemberSelection(e,t,i){const r=this._selectedDimensions.get(e);r&&(r.memberId=t,r.memberLabel=i,this._selectedDimensions.set(e,r),this.requestUpdate())}_handleTypedValueChange(e,t){const i=t.target,r=this._selectedDimensions.get(e);r&&(r.typedValue=i.value,this._selectedDimensions.set(e,r))}_resetForm(){const e=(new Date).toISOString().split("T")[0];this._startDate=e,this._endDate=e,this._instantDate=e,this._selectedType="instant"===this.periodType?"instant":"duration",this._selectedDimensions.clear(),this._autoSelectSingleMemberDimensions(),this.requestUpdate()}_autoSelectSingleMemberDimensions(){this.availableDimensions.forEach(e=>{if(e.members&&1===e.members.length){const t=e.members[0],i={axisId:e.id,axisLabel:e.axisLabel,memberId:t.id,memberLabel:t.label,isTyped:!1};this._selectedDimensions.set(e.id,i)}else if(e.typedMember&&(!e.members||0===e.members.length)){const t={axisId:e.id,axisLabel:e.axisLabel,isTyped:!0};this._selectedDimensions.set(e.id,t)}})}render(){if(!this.open)return e.html``;const t=this._isFormValid();return e.html`
|
|
350
350
|
<div class="dialog" @click="${e=>e.stopPropagation()}">
|
|
351
351
|
<div class="dialog-header">
|
|
352
|
-
<h2 class="dialog-title"
|
|
352
|
+
<h2 class="dialog-title">${F.t("column.addColumn")}</h2>
|
|
353
353
|
|
|
354
354
|
</div>
|
|
355
355
|
|
|
356
356
|
<div class="dialog-content">
|
|
357
357
|
${"mixed"===this.periodType?e.html`
|
|
358
358
|
<div class="form-group">
|
|
359
|
-
<label class="form-label required"
|
|
359
|
+
<label class="form-label required">${F.t("column.columnType")}</label>
|
|
360
360
|
<select
|
|
361
361
|
class="form-input"
|
|
362
362
|
.value="${this._selectedType}"
|
|
363
363
|
@change="${this._handleSelectedTypeChange}"
|
|
364
364
|
required
|
|
365
365
|
>
|
|
366
|
-
<option value="instant"
|
|
367
|
-
<option value="duration"
|
|
366
|
+
<option value="instant">${F.t("column.instantSingleDate")}</option>
|
|
367
|
+
<option value="duration">${F.t("column.durationDates")}</option>
|
|
368
368
|
</select>
|
|
369
369
|
</div>
|
|
370
370
|
`:""}
|
|
371
371
|
|
|
372
372
|
${"instant"===this.periodType||"mixed"===this.periodType&&"instant"===this._selectedType?e.html`
|
|
373
373
|
<div class="form-group">
|
|
374
|
-
<label class="form-label required"
|
|
374
|
+
<label class="form-label required">${F.t("column.instantDate")}</label>
|
|
375
375
|
<input
|
|
376
376
|
type="date"
|
|
377
377
|
class="form-input"
|
|
@@ -383,7 +383,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
383
383
|
`:e.html`
|
|
384
384
|
<div class="form-group date-row">
|
|
385
385
|
<div class="date-field">
|
|
386
|
-
<label class="form-label required"
|
|
386
|
+
<label class="form-label required">${F.t("column.startPeriodDate")}</label>
|
|
387
387
|
<input
|
|
388
388
|
type="date"
|
|
389
389
|
class="form-input"
|
|
@@ -393,7 +393,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
393
393
|
/>
|
|
394
394
|
</div>
|
|
395
395
|
<div class="date-field">
|
|
396
|
-
<label class="form-label required"
|
|
396
|
+
<label class="form-label required">${F.t("column.endPeriodDate")}</label>
|
|
397
397
|
<input
|
|
398
398
|
type="date"
|
|
399
399
|
class="form-input"
|
|
@@ -408,8 +408,8 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
408
408
|
<!-- Dimensions Section -->
|
|
409
409
|
${this.availableDimensions.length>0?e.html`
|
|
410
410
|
<div class="dimensions-section">
|
|
411
|
-
<h3
|
|
412
|
-
<p class="form-description"
|
|
411
|
+
<h3>${F.t("column.availableDimensions")}</h3>
|
|
412
|
+
<p class="form-description">${F.t("column.dimensionsDescription")}</p>
|
|
413
413
|
|
|
414
414
|
${this.availableDimensions.map(t=>{const i=this._selectedDimensions.has(t.id),r=this._selectedDimensions.get(t.id),o=!(!t.typedMember||t.members&&0!==t.members.length);return e.html`
|
|
415
415
|
<div class="dimension-item">
|
|
@@ -431,20 +431,20 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
431
431
|
${o?e.html`
|
|
432
432
|
<!-- Typed Dimension Input -->
|
|
433
433
|
<div class="member-selection">
|
|
434
|
-
<label
|
|
434
|
+
<label>${F.t("column.enterValue")} ${t.conceptName}:</label>
|
|
435
435
|
<input
|
|
436
436
|
type="text"
|
|
437
437
|
class="typed-input"
|
|
438
438
|
.value="${(null==r?void 0:r.typedValue)||""}"
|
|
439
439
|
@input="${e=>this._handleTypedValueChange(t.id,e)}"
|
|
440
|
-
placeholder="
|
|
440
|
+
placeholder="${F.t("column.enterValuePlaceholder")}"
|
|
441
441
|
/>
|
|
442
442
|
</div>
|
|
443
443
|
`:e.html`
|
|
444
444
|
<!-- Domain Members Selection -->
|
|
445
445
|
${t.members&&t.members.length>0?e.html`
|
|
446
446
|
<div class="member-selection">
|
|
447
|
-
<label
|
|
447
|
+
<label>${F.t("column.selectMember")}</label>
|
|
448
448
|
<div class="member-list">
|
|
449
449
|
${t.members.map(i=>e.html`
|
|
450
450
|
<div class="member-option">
|
|
@@ -463,7 +463,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
463
463
|
</div>
|
|
464
464
|
</div>
|
|
465
465
|
`:e.html`
|
|
466
|
-
<p class="form-description"
|
|
466
|
+
<p class="form-description">${F.t("column.noMembersAvailable")}</p>
|
|
467
467
|
`}
|
|
468
468
|
`}
|
|
469
469
|
</div>
|
|
@@ -476,14 +476,14 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
476
476
|
|
|
477
477
|
<div class="dialog-actions">
|
|
478
478
|
<button class="btn btn-cancel" @click="${this._handleCancel}">
|
|
479
|
-
|
|
479
|
+
${F.t("column.cancel")}
|
|
480
480
|
</button>
|
|
481
481
|
<button
|
|
482
482
|
class="btn btn-primary"
|
|
483
483
|
?disabled="${!t}"
|
|
484
484
|
@click="${this._handleConfirm}"
|
|
485
485
|
>
|
|
486
|
-
|
|
486
|
+
${F.t("column.addColumn")}
|
|
487
487
|
</button>
|
|
488
488
|
</div>
|
|
489
489
|
</div>
|
|
@@ -744,7 +744,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
744
744
|
margin: 0 0 12px 0;
|
|
745
745
|
line-height: 1.4;
|
|
746
746
|
}
|
|
747
|
-
`,
|
|
747
|
+
`,q([w({type:String})],exports.JupiterAddColumnDialog.prototype,"periodType",2),q([w({type:Boolean})],exports.JupiterAddColumnDialog.prototype,"open",2),q([w({type:Array})],exports.JupiterAddColumnDialog.prototype,"availableDimensions",2),q([S()],exports.JupiterAddColumnDialog.prototype,"_startDate",2),q([S()],exports.JupiterAddColumnDialog.prototype,"_endDate",2),q([S()],exports.JupiterAddColumnDialog.prototype,"_instantDate",2),q([S()],exports.JupiterAddColumnDialog.prototype,"_selectedType",2),q([S()],exports.JupiterAddColumnDialog.prototype,"_selectedDimensions",2),exports.JupiterAddColumnDialog=q([t("jupiter-add-column-dialog")],exports.JupiterAddColumnDialog);var K=Object.defineProperty,B=Object.getOwnPropertyDescriptor,Y=(e,t,i,r)=>{for(var o,n=r>1?void 0:r?B(t,i):t,s=e.length-1;s>=0;s--)(o=e[s])&&(n=(r?o(t,i,n):o(n))||n);return r&&n&&K(t,i,n),n};exports.JupiterFormSection=class extends e.LitElement{constructor(){super(...arguments),this.columns=[],this.formData={},this.typedMemberData={},this.disabled=!1,this.collapsible=!0,this.locale="en-US",this.isFirstSection=!1,this.availableDimensions=[],this.hideHeader=!1,this._expanded=!0,this._showAddColumnDialog=!1,this._sectionPeriodType="duration",this._expandedConcepts=new Set,this._allTreeExpanded=!1}connectedCallback(){super.connectedCallback(),this._expanded=!1!==this.section.expanded,this._determinePeriodType(),this._checkAndExpandFirstSection()}updated(e){super.updated(e),(e.has("isFirstSection")||e.has("section"))&&this._checkAndExpandFirstSection()}_checkAndExpandFirstSection(){this.isFirstSection&&this.section&&this.section.concepts&&(this._expanded=!0,setTimeout(()=>{this._expandAllTrees(),console.log("π― First section detected - expanded section and tree by default")},0))}_determinePeriodType(){const e=this._getAllNonAbstractConcepts(this.section.concepts);if(0===e.length)return this._sectionPeriodType="duration",void console.log(`π Section ${this.section.id}: No concepts, defaulting to duration`);const t=new Set(e.map(e=>e.periodType).filter(Boolean));if(0===t.size)this._sectionPeriodType="duration";else if(1===t.size){const e=Array.from(t)[0];this._sectionPeriodType="instant"===e?"instant":"duration"}else this._sectionPeriodType="mixed"}_getAllNonAbstractConcepts(e){const t=[];for(const i of e)i.abstract||t.push(i),i.children&&t.push(...this._getAllNonAbstractConcepts(i.children));return t}_toggleExpanded(){this.collapsible&&(this._expanded=!this._expanded,this._expanded&&this._expandAllTrees(),this.dispatchEvent(new CustomEvent("section-expand",{detail:{sectionId:this.section.id,expanded:this._expanded},bubbles:!0})))}_handleRemoveColumn(e){this.dispatchEvent(new CustomEvent("column-remove",{detail:{columnId:e,sectionId:this.section.id},bubbles:!0}))}_handleAddColumn(){const e=this._determineButtonPeriodType();this._sectionPeriodType=e,this._showAddColumnDialog=!0}_determineButtonPeriodType(){const e=this._getAllNonAbstractConcepts(this.section.concepts);if(0===e.length)return"duration";const t=new Set(e.map(e=>e.periodType).filter(e=>null!=e));if(0===t.size)return"duration";if(1===t.size){return"instant"===Array.from(t)[0]?"instant":"duration"}return"mixed"}_getConceptsWithFields(e){const t=[];for(const i of e)!i.abstract&&i.fields&&i.fields.length>0&&t.push(i),i.children&&t.push(...this._getConceptsWithFields(i.children));return t}_handleDialogCancel(){this._showAddColumnDialog=!1}_handleColumnAdd(e){e.stopPropagation(),this._showAddColumnDialog=!1,this.dispatchEvent(new CustomEvent("column-add-request",{detail:{sectionId:this.section.id,columnRequest:e.detail},bubbles:!0}))}_handleFieldChange(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("field-change",{detail:e.detail,bubbles:!0}))}_flattenConcepts(e,t=new Set){const i=[];for(const r of e)if(i.push(r),r.children&&r.children.length>0&&t.has(r.id)){const e=this._flattenConcepts(r.children,t);i.push(...e)}return i}_getAllConceptIds(e){const t=[];for(const i of e)i.children&&i.children.length>0&&(t.push(i.id),t.push(...this._getAllConceptIds(i.children)));return t}_expandAllTrees(){this._getAllConceptIds(this.section.concepts||[]).forEach(e=>this._expandedConcepts.add(e)),this._allTreeExpanded=!0,this.requestUpdate()}_collapseAllTrees(){this._expandedConcepts.clear(),this._allTreeExpanded=!1,this.requestUpdate()}_handleConceptExpand(e){e.stopPropagation();const{conceptId:t,expanded:i}=e.detail;i?this._expandedConcepts.add(t):this._expandedConcepts.delete(t);const r=this._getAllConceptIds(this.section.concepts||[]);this._allTreeExpanded=r.length>0&&r.every(e=>this._expandedConcepts.has(e)),this.requestUpdate(),this.dispatchEvent(new CustomEvent("concept-expand",{detail:e.detail,bubbles:!0}))}_getTypedMemberHeaderValue(e,t){var i;return(null==(i=this.typedMemberData[e])?void 0:i[t])||""}_handleTypedMemberHeaderChange(e,t,i){const r=e.target.value;console.log(`π [FormSection] Typed member header change: columnId=${t}, axisId=${i}, value=${r}`),this.dispatchEvent(new CustomEvent("typed-member-change",{detail:{columnId:t,axisId:i,value:r},bubbles:!0}))}render(){return this.section.concepts&&0!==this.section.concepts.length?e.html`
|
|
748
748
|
${this.hideHeader?"":e.html`
|
|
749
749
|
<div class="section-header ${this.collapsible?"":"not-collapsible"}"
|
|
750
750
|
@click="${this._toggleExpanded}">
|
|
@@ -784,7 +784,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
784
784
|
<input
|
|
785
785
|
type="text"
|
|
786
786
|
class="typed-member-header-field"
|
|
787
|
-
placeholder="
|
|
787
|
+
placeholder="${F.t("section.enterPlaceholder")} ${i.axisLabel}"
|
|
788
788
|
.value="${this._getTypedMemberHeaderValue(t.id,i.axisId)}"
|
|
789
789
|
@input="${e=>this._handleTypedMemberHeaderChange(e,t.id,i.axisId)}"
|
|
790
790
|
/>
|
|
@@ -797,15 +797,15 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
797
797
|
<button
|
|
798
798
|
class="remove-column-btn"
|
|
799
799
|
@click="${e=>{e.stopPropagation(),this._handleRemoveColumn(t.id)}}"
|
|
800
|
-
title="
|
|
800
|
+
title="${F.t("column.removeColumn")}"
|
|
801
801
|
>Γ</button>
|
|
802
802
|
`:""}
|
|
803
803
|
</div>
|
|
804
804
|
</th>
|
|
805
805
|
`})}
|
|
806
806
|
<th class="header-cell add-column-only">
|
|
807
|
-
<button class="add-column-btn" @click="${e=>{e.stopPropagation(),this._handleAddColumn()}}" title="
|
|
808
|
-
+
|
|
807
|
+
<button class="add-column-btn" @click="${e=>{e.stopPropagation(),this._handleAddColumn()}}" title="${F.t("column.addColumn")}">
|
|
808
|
+
+ ${F.t("column.addColumn")}
|
|
809
809
|
</button>
|
|
810
810
|
</th>
|
|
811
811
|
</tr>
|
|
@@ -1093,14 +1093,14 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1093
1093
|
color: var(--jupiter-text-secondary, #666);
|
|
1094
1094
|
font-style: italic;
|
|
1095
1095
|
}
|
|
1096
|
-
`,
|
|
1096
|
+
`,Y([w({type:Object})],exports.JupiterFormSection.prototype,"section",2),Y([w({type:Array})],exports.JupiterFormSection.prototype,"columns",2),Y([w({type:Object})],exports.JupiterFormSection.prototype,"formData",2),Y([w({type:Object})],exports.JupiterFormSection.prototype,"typedMemberData",2),Y([w({type:Boolean})],exports.JupiterFormSection.prototype,"disabled",2),Y([w({type:Boolean})],exports.JupiterFormSection.prototype,"collapsible",2),Y([w({type:String})],exports.JupiterFormSection.prototype,"locale",2),Y([w({type:Boolean})],exports.JupiterFormSection.prototype,"isFirstSection",2),Y([w({type:Array})],exports.JupiterFormSection.prototype,"availableDimensions",2),Y([w({type:Boolean})],exports.JupiterFormSection.prototype,"hideHeader",2),Y([S()],exports.JupiterFormSection.prototype,"_expanded",2),Y([S()],exports.JupiterFormSection.prototype,"_showAddColumnDialog",2),Y([S()],exports.JupiterFormSection.prototype,"_sectionPeriodType",2),Y([S()],exports.JupiterFormSection.prototype,"_expandedConcepts",2),Y([S()],exports.JupiterFormSection.prototype,"_allTreeExpanded",2),exports.JupiterFormSection=Y([t("jupiter-form-section")],exports.JupiterFormSection);var H=Object.defineProperty,G=Object.getOwnPropertyDescriptor,Q=(e,t,i,r)=>{for(var o,n=r>1?void 0:r?G(t,i):t,s=e.length-1;s>=0;s--)(o=e[s])&&(n=(r?o(t,i,n):o(n))||n);return r&&n&&H(t,i,n),n};exports.JupiterFilterRolesDialog=class extends e.LitElement{constructor(){super(...arguments),this.open=!1,this.availableRoles=[],this.selectedRoleIds=[],this.periodPreferences={},this._tempSelectedRoles=new Set,this._searchQuery="",this._filteredRoles=[],this._tempPeriodPreferences={}}connectedCallback(){super.connectedCallback(),this._initializeTempSelection(),this._initializePeriodPreferences()}updated(e){(e.has("selectedRoleIds")||e.has("open"))&&this._initializeTempSelection(),(e.has("availableRoles")||e.has("_searchQuery"))&&this._updateFilteredRoles(),(e.has("availableRoles")||e.has("periodPreferences")||e.has("open"))&&this._initializePeriodPreferences()}_updateFilteredRoles(){if(!this._searchQuery.trim())return void(this._filteredRoles=[...this.availableRoles].sort((e,t)=>e.title.localeCompare(t.title)));const e=this._searchQuery.toLowerCase().trim(),t=this.availableRoles.filter(t=>{var i;const r=t.title.toLowerCase().includes(e),o=t.id.toLowerCase().includes(e),n=(null==(i=t.description)?void 0:i.toLowerCase().includes(e))||!1,s=this._searchInRoleURI(t,e);return r||o||n||s});this._filteredRoles=t.sort((e,t)=>e.title.localeCompare(t.title))}_searchInRoleURI(e,t){var i;if(null==(i=e.metadata)?void 0:i.roleURI)return e.metadata.roleURI.toLowerCase().includes(t);const r=/https?:\/\/[^\s]+/i,o=r.test(e.title),n=r.test(e.id);return o||n?e.title.toLowerCase().includes(t)||e.id.toLowerCase().includes(t):!!(e.id.includes(".")||e.id.includes("/")||e.id.includes(":"))&&e.id.toLowerCase().includes(t)}_handleSearchInput(e){const t=e.target;this._searchQuery=t.value}_clearSearch(){var e;this._searchQuery="";const t=null==(e=this.shadowRoot)?void 0:e.querySelector(".search-input");t&&(t.value="",t.focus())}_highlightSearchTerm(e){if(!this._searchQuery.trim())return e;const t=this._searchQuery.trim(),i=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return e.replace(i,"<mark>$1</mark>")}_renderHighlightedText(e){return e}_getSelectedFilteredCount(){return this._filteredRoles.filter(e=>this._tempSelectedRoles.has(e.id)).length}_initializeTempSelection(){this._tempSelectedRoles=new Set(this.selectedRoleIds)}_initializePeriodPreferences(){const e={};this.availableRoles.forEach(t=>{const i=this.periodPreferences[t.id];if(i)e[t.id]={...i};else{const i=!0===t.showPeriodControl;let r,o;void 0!==t.duration||void 0!==t.instant?(r=!0===t.duration,o=!0===t.instant):(r=i||this._hasConceptsWithPeriodType(t,"duration"),o=i||this._hasConceptsWithPeriodType(t,"instant")),e[t.id]={showDuration:r,showInstant:o,showPreviousYear:!0===t.showPreviousYear}}}),this._tempPeriodPreferences=e}_hasConceptsWithPeriodType(e,t){const i=e=>e.some(e=>!e.abstract&&e.periodType===t||!!e.children&&i(e.children));return i(e.concepts)}_handlePeriodCheckboxChange(e,t,i){e.stopPropagation();const r=e.target,o={...this._tempPeriodPreferences};o[t]||(o[t]={showDuration:!0,showInstant:!0,showPreviousYear:!1}),"duration"===i?o[t].showDuration=r.checked:"instant"===i?o[t].showInstant=r.checked:"previousYear"===i&&(o[t].showPreviousYear=r.checked),this._tempPeriodPreferences=o,this.requestUpdate()}_handleCheckboxChange(e,t){const i=e.target,r=new Set(this._tempSelectedRoles);i.checked?r.add(t):r.delete(t),this._tempSelectedRoles=r,this.requestUpdate()}_selectAll(){const e=new Set(this._tempSelectedRoles);this._filteredRoles.forEach(t=>e.add(t.id)),this._tempSelectedRoles=e,this.requestUpdate()}_selectNone(){const e=new Set(this._tempSelectedRoles);this._filteredRoles.forEach(t=>e.delete(t.id)),this._tempSelectedRoles=e,this.requestUpdate()}_selectAllGlobal(){this._tempSelectedRoles=new Set(this.availableRoles.map(e=>e.id)),this.requestUpdate()}_selectNoneGlobal(){this._tempSelectedRoles=new Set,this.requestUpdate()}_resetToOriginal(){this._tempSelectedRoles=new Set(this.selectedRoleIds),this.requestUpdate()}_handleCancel(){this._initializeTempSelection(),this.dispatchEvent(new CustomEvent("dialog-cancel",{bubbles:!0}))}_handleApply(){const e=Array.from(this._tempSelectedRoles);this.dispatchEvent(new CustomEvent("roles-filter-apply",{detail:{selectedRoleIds:e,periodPreferences:this._tempPeriodPreferences},bubbles:!0}))}_handleBackdropClick(e){e.target===this&&this._handleCancel()}render(){const t=this._tempSelectedRoles.size,i=this.availableRoles.length,r=this._filteredRoles.length,o=this._searchQuery.trim().length>0;return e.html`
|
|
1097
1097
|
<div class="dialog" @click="${e=>e.stopPropagation()}">
|
|
1098
1098
|
<!-- Dialog Header -->
|
|
1099
1099
|
<div class="dialog-header">
|
|
1100
1100
|
<svg class="filter-icon" viewBox="0 0 24 24">
|
|
1101
1101
|
<path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/>
|
|
1102
1102
|
</svg>
|
|
1103
|
-
<h2 class="dialog-title"
|
|
1103
|
+
<h2 class="dialog-title">${F.t("filter.title")}</h2>
|
|
1104
1104
|
<button class="close-button" @click="${this._handleCancel}">Γ</button>
|
|
1105
1105
|
</div>
|
|
1106
1106
|
|
|
@@ -1116,12 +1116,12 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1116
1116
|
<input
|
|
1117
1117
|
type="text"
|
|
1118
1118
|
class="search-input"
|
|
1119
|
-
placeholder="
|
|
1119
|
+
placeholder="${F.t("filter.searchPlaceholder")}"
|
|
1120
1120
|
.value="${this._searchQuery}"
|
|
1121
1121
|
@input="${this._handleSearchInput}"
|
|
1122
1122
|
/>
|
|
1123
1123
|
${this._searchQuery?e.html`
|
|
1124
|
-
<button class="clear-search" @click="${this._clearSearch}" title="
|
|
1124
|
+
<button class="clear-search" @click="${this._clearSearch}" title="${F.t("filter.clearSearch")}">
|
|
1125
1125
|
Γ
|
|
1126
1126
|
</button>
|
|
1127
1127
|
`:e.html`
|
|
@@ -1134,8 +1134,8 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1134
1134
|
<!-- Search Results Info -->
|
|
1135
1135
|
${o?e.html`
|
|
1136
1136
|
<div class="search-results-info">
|
|
1137
|
-
|
|
1138
|
-
${r!==i?e.html
|
|
1137
|
+
${F.t("filter.showingResults")} ${r} ${F.t("filter.of")} ${i} ${F.t("filter.roles")}
|
|
1138
|
+
${r!==i?e.html`${F.t("filter.matching")} "${this._searchQuery}"`:""}
|
|
1139
1139
|
</div>
|
|
1140
1140
|
`:""}
|
|
1141
1141
|
|
|
@@ -1143,27 +1143,27 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1143
1143
|
<div class="selection-controls">
|
|
1144
1144
|
${o?e.html`
|
|
1145
1145
|
<button class="selection-control" @click="${this._selectAll}">
|
|
1146
|
-
|
|
1146
|
+
${F.t("filter.selectFiltered")} (${r})
|
|
1147
1147
|
</button>
|
|
1148
1148
|
<button class="selection-control" @click="${this._selectNone}">
|
|
1149
|
-
|
|
1149
|
+
${F.t("filter.deselectFiltered")}
|
|
1150
1150
|
</button>
|
|
1151
1151
|
<button class="selection-control" @click="${this._selectAllGlobal}">
|
|
1152
|
-
|
|
1152
|
+
${F.t("filter.selectAll")} (${i})
|
|
1153
1153
|
</button>
|
|
1154
1154
|
<button class="selection-control" @click="${this._selectNoneGlobal}">
|
|
1155
|
-
|
|
1155
|
+
${F.t("filter.deselectAll")}
|
|
1156
1156
|
</button>
|
|
1157
1157
|
`:e.html`
|
|
1158
1158
|
<button class="selection-control" @click="${this._selectAll}">
|
|
1159
|
-
|
|
1159
|
+
${F.t("filter.selectAll")}
|
|
1160
1160
|
</button>
|
|
1161
1161
|
<button class="selection-control" @click="${this._selectNone}">
|
|
1162
|
-
|
|
1162
|
+
${F.t("filter.selectNone")}
|
|
1163
1163
|
</button>
|
|
1164
1164
|
`}
|
|
1165
1165
|
<button class="selection-control" @click="${this._resetToOriginal}">
|
|
1166
|
-
|
|
1166
|
+
${F.t("filter.reset")}
|
|
1167
1167
|
</button>
|
|
1168
1168
|
</div>
|
|
1169
1169
|
|
|
@@ -1172,10 +1172,10 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1172
1172
|
${0===this._filteredRoles.length?e.html`
|
|
1173
1173
|
<div class="no-results">
|
|
1174
1174
|
${o?e.html`
|
|
1175
|
-
|
|
1176
|
-
|
|
1175
|
+
${F.t("filter.noRolesFound")} "${this._searchQuery}".<br>
|
|
1176
|
+
${F.t("filter.tryDifferentSearch")}
|
|
1177
1177
|
`:e.html`
|
|
1178
|
-
|
|
1178
|
+
${F.t("filter.noRolesAvailable")}
|
|
1179
1179
|
`}
|
|
1180
1180
|
</div>
|
|
1181
1181
|
`:e.html`
|
|
@@ -1190,12 +1190,12 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1190
1190
|
<div class="role-info">
|
|
1191
1191
|
<h4 class="role-title">${t.title}</h4>
|
|
1192
1192
|
${(null==(i=t.metadata)?void 0:i.roleURI)?e.html`
|
|
1193
|
-
<p class="role-description"
|
|
1193
|
+
<p class="role-description">${F.t("filter.uri")}: ${t.metadata.roleURI}</p>
|
|
1194
1194
|
`:""}
|
|
1195
1195
|
|
|
1196
1196
|
${o?e.html`
|
|
1197
1197
|
<div class="period-controls">
|
|
1198
|
-
<p class="period-controls-label"
|
|
1198
|
+
<p class="period-controls-label">${F.t("filter.showPeriodColumn")}</p>
|
|
1199
1199
|
<div class="period-checkboxes">
|
|
1200
1200
|
<label class="period-checkbox-item">
|
|
1201
1201
|
<input
|
|
@@ -1204,7 +1204,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1204
1204
|
.checked="${n.showDuration}"
|
|
1205
1205
|
@change="${e=>this._handlePeriodCheckboxChange(e,t.id,"duration")}"
|
|
1206
1206
|
/>
|
|
1207
|
-
<span class="period-checkbox-label"
|
|
1207
|
+
<span class="period-checkbox-label">${F.t("filter.duration")}</span>
|
|
1208
1208
|
</label>
|
|
1209
1209
|
<label class="period-checkbox-item">
|
|
1210
1210
|
<input
|
|
@@ -1213,14 +1213,14 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1213
1213
|
.checked="${n.showInstant}"
|
|
1214
1214
|
@change="${e=>this._handlePeriodCheckboxChange(e,t.id,"instant")}"
|
|
1215
1215
|
/>
|
|
1216
|
-
<span class="period-checkbox-label"
|
|
1216
|
+
<span class="period-checkbox-label">${F.t("filter.instant")}</span>
|
|
1217
1217
|
</label>
|
|
1218
1218
|
</div>
|
|
1219
1219
|
</div>
|
|
1220
1220
|
`:""}
|
|
1221
1221
|
|
|
1222
1222
|
<div class="period-controls">
|
|
1223
|
-
<p class="period-controls-label"
|
|
1223
|
+
<p class="period-controls-label">${F.t("filter.additionalOptions")}</p>
|
|
1224
1224
|
<div class="period-checkboxes">
|
|
1225
1225
|
<label class="period-checkbox-item">
|
|
1226
1226
|
<input
|
|
@@ -1229,7 +1229,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1229
1229
|
.checked="${n.showPreviousYear}"
|
|
1230
1230
|
@change="${e=>this._handlePeriodCheckboxChange(e,t.id,"previousYear")}"
|
|
1231
1231
|
/>
|
|
1232
|
-
<span class="period-checkbox-label"
|
|
1232
|
+
<span class="period-checkbox-label">${F.t("filter.showPreviousYear")}</span>
|
|
1233
1233
|
</label>
|
|
1234
1234
|
</div>
|
|
1235
1235
|
</div>
|
|
@@ -1245,14 +1245,14 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1245
1245
|
<!-- Dialog Actions -->
|
|
1246
1246
|
<div class="dialog-actions">
|
|
1247
1247
|
<button class="btn-secondary" @click="${this._handleCancel}">
|
|
1248
|
-
|
|
1248
|
+
${F.t("filter.cancel")}
|
|
1249
1249
|
</button>
|
|
1250
1250
|
<button
|
|
1251
1251
|
class="btn-primary"
|
|
1252
1252
|
@click="${this._handleApply}"
|
|
1253
1253
|
?disabled="${0===t}"
|
|
1254
1254
|
>
|
|
1255
|
-
|
|
1255
|
+
${F.t("filter.applyFilter")} (${t})
|
|
1256
1256
|
</button>
|
|
1257
1257
|
</div>
|
|
1258
1258
|
</div>
|
|
@@ -1581,7 +1581,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1581
1581
|
opacity: 0.6;
|
|
1582
1582
|
cursor: not-allowed;
|
|
1583
1583
|
}
|
|
1584
|
-
`,H([w({type:Boolean,reflect:!0})],exports.JupiterFilterRolesDialog.prototype,"open",2),H([w({type:Array})],exports.JupiterFilterRolesDialog.prototype,"availableRoles",2),H([w({type:Array})],exports.JupiterFilterRolesDialog.prototype,"selectedRoleIds",2),H([w({type:Object})],exports.JupiterFilterRolesDialog.prototype,"periodPreferences",2),H([S()],exports.JupiterFilterRolesDialog.prototype,"_tempSelectedRoles",2),H([S()],exports.JupiterFilterRolesDialog.prototype,"_searchQuery",2),H([S()],exports.JupiterFilterRolesDialog.prototype,"_filteredRoles",2),H([S()],exports.JupiterFilterRolesDialog.prototype,"_tempPeriodPreferences",2),exports.JupiterFilterRolesDialog=H([t("jupiter-filter-roles-dialog")],exports.JupiterFilterRolesDialog);var Q=Object.defineProperty,G=Object.getOwnPropertyDescriptor,X=(e,t,i,r)=>{for(var o,n=r>1?void 0:r?G(t,i):t,s=e.length-1;s>=0;s--)(o=e[s])&&(n=(r?o(t,i,n):o(n))||n);return r&&n&&Q(t,i,n),n};exports.JupiterDynamicForm=class extends e.LitElement{constructor(){super(...arguments),this.config={},this.initialData={},this.disabled=!1,this.readonly=!1,this.periodStartDate="2025-01-01",this.periodEndDate="2025-12-31",this.language="en",this.display="accordion",this.mode="inputForm",this.financialStatementsTypeAxis=[],this._formData={},this._preservedFormData={},this._typedMemberData={},this._preservedTypedMemberData={},this._columns=[],this._errors=[],this._touched=new Set,this._dirty=!1,this._valid=!0,this._submitted=!1,this._allSections=[],this._selectedRoleIds=[],this._showFilterDialog=!1,this._periodPreferences={},this._activeSidePanelRoleId=null,this._adminRoleConfigs={}}connectedCallback(){super.connectedCallback(),this._initializeForm()}updated(e){e.has("financialStatementsTypeAxis")&&console.log("π financialStatementsTypeAxis changed:",this.financialStatementsTypeAxis),(e.has("xbrlInput")||e.has("schema")||e.has("language")||e.has("periodStartDate")||e.has("periodEndDate")||e.has("financialStatementsTypeAxis"))&&this._initializeForm()}_initializeForm(){var e;if(this.xbrlInput)try{console.log("π Initializing form from XBRL input:",this.xbrlInput),console.log("π
Using period dates:",this.periodStartDate,"to",this.periodEndDate),console.log("π Using language:",this.language),this._initializePeriodPreferencesFromData(),console.log("βοΈ Using period preferences:",this._periodPreferences),this._currentSchema=T.buildFormSchema(this.xbrlInput,this.periodStartDate,this.periodEndDate,this.language,this._periodPreferences),console.log("β
Generated schema with sections:",this._currentSchema.sections.length),this._allSections=[...this._currentSchema.sections],this.financialStatementsTypeAxis&&this.financialStatementsTypeAxis.length>0&&(console.log("π Applying financialStatementsTypeAxis filter:",this.financialStatementsTypeAxis),console.log("π Sections before filter:",this._allSections.length),this._allSections=this._filterRolesByFinancialStatementsType(this._allSections),console.log("π Sections after filter:",this._allSections.length)),0===this._selectedRoleIds.length&&(this._selectedRoleIds=this._allSections.map(e=>e.id),console.log("β
Auto-selected all roles:",this._selectedRoleIds.length)),this._applyRoleFilter(),this._columns=[{id:"base",title:"Value",description:"Base values for concepts",type:"base",order:0,removable:!1}]}catch(t){console.error("β Error building form from XBRL input:",t),this._currentSchema=this._getDefaultSchema(),this._allSections=[],this._selectedRoleIds=[],this._columns=this._getDefaultColumns()}else this.schema?(this._currentSchema=this.schema,this._allSections=[...this.schema.sections],this._selectedRoleIds=this._allSections.map(e=>e.id),this._columns=this._getDefaultColumns()):(this._currentSchema=this._getDefaultSchema(),this._allSections=[],this._selectedRoleIds=[],this._columns=this._getDefaultColumns());this._formData={...this.initialData},(null==(e=this.xbrlInput)?void 0:e.initialData)&&(this._formData={...this._formData,...this.xbrlInput.initialData}),this._validateForm()}_getDefaultSchema(){return{version:"1.0",formId:"default-form",title:"Dynamic Form",description:"Please provide form schema or XBRL input data",sections:[]}}_getDefaultColumns(){return[{id:"base",title:"Value",description:"Base values for concepts",type:"base",order:0,removable:!1}]}_initializePeriodPreferencesFromData(){var e,t,i;if(!(null==(i=null==(t=null==(e=this.xbrlInput)?void 0:e.presentation)?void 0:t[0])?void 0:i.roles))return;const r={...this._periodPreferences};this.xbrlInput.presentation[0].roles.forEach(e=>{if(!r[e.id]){const t=!0===e.showPreviousYear,i=void 0===e.instant||!0===e.instant,o=void 0===e.duration||!0===e.duration;r[e.id]={showDuration:o,showInstant:i,showPreviousYear:t}}}),this._periodPreferences=r}_applyRoleFilter(){if(!this._currentSchema||!this._allSections.length)return;if(console.log(`π Applying role filter: ${this._selectedRoleIds.length} selected out of ${this._allSections.length} total`),0===this._selectedRoleIds.length)return console.log("π No roles selected - showing empty form"),this._currentSchema={...this._currentSchema,sections:[]},void this.requestUpdate();this._preserveDataForHiddenSections();const e=this._allSections.filter(e=>this._selectedRoleIds.includes(e.id));console.log(`π Filtered sections: ${e.length} (IDs: ${e.map(e=>e.id).join(", ")})`),this._restoreDataForVisibleSections(e),this._currentSchema={...this._currentSchema,sections:e},console.log(`β
Schema updated. Current sections count: ${this._currentSchema.sections.length}`),this.requestUpdate()}_filterRolesByFinancialStatementsType(e){var t;if(!this.financialStatementsTypeAxis||0===this.financialStatementsTypeAxis.length)return e;if(!(null==(t=this.xbrlInput)?void 0:t.hypercubes)||0===this.xbrlInput.hypercubes.length)return e;const i=this.xbrlInput.hypercubes[0];return console.log("π Filter values:",this.financialStatementsTypeAxis),e.filter(e=>{var t;const r=null==(t=i.roles)?void 0:t.find(t=>t.roleId===e.id);if(!r||!r.items||0===r.items.length)return console.log(`β
${e.title}: No hypercube entry - INCLUDED`),!0;let o=!1,n=!1;for(const i of r.items){if(!i.dimensions||0===i.dimensions.length)continue;const e=i.dimensions.find(e=>{var t;return"bw2-titel9_FinancialStatementsTypeAxis"===e.id||(null==(t=e.conceptName)?void 0:t.includes("FinancialStatementsTypeAxis"))});if(e&&(o=!0,e.members&&e.members.length>0)){if(e.members.some(e=>{if(e.conceptName){const t=e.conceptName.split(":"),i=t.length>1?t[1]:e.conceptName;return this.financialStatementsTypeAxis.some(e=>{const t=e.split(":"),r=t.length>1?t[1]:e;return i===r})}return this.financialStatementsTypeAxis.includes(e.id)})){n=!0;break}}}return!o||n})}_preserveDataForHiddenSections(){var e;((null==(e=this._currentSchema)?void 0:e.sections.map(e=>e.id))||[]).filter(e=>!this._selectedRoleIds.includes(e)).forEach(e=>{const t=this._allSections.find(t=>t.id===e);t&&this._preserveSectionData(t)})}_restoreDataForVisibleSections(e){e.forEach(e=>{this._restoreSectionData(e)}),console.log(`π Restored data for ${e.length} visible sections`)}_preserveSectionData(e){e.concepts.forEach(e=>{this._preserveConceptData(e)})}_preserveConceptData(e){this._formData[e.id]&&(this._preservedFormData[e.id]={...this._formData[e.id]}),e.fields.forEach(e=>{this._typedMemberData[e.columnId]&&(this._preservedTypedMemberData[e.columnId]={...this._typedMemberData[e.columnId]})}),e.children&&e.children.forEach(e=>{this._preserveConceptData(e)})}_restoreSectionData(e){e.concepts.forEach(e=>{this._restoreConceptData(e)})}_restoreConceptData(e){this._preservedFormData[e.id]&&(this._formData[e.id]={...this._preservedFormData[e.id]}),e.fields.forEach(e=>{this._preservedTypedMemberData[e.columnId]&&(this._typedMemberData[e.columnId]={...this._preservedTypedMemberData[e.columnId]})}),e.children&&e.children.forEach(e=>{this._restoreConceptData(e)})}_shouldShowFilterButton(){return!0}_handleFilterRolesClick(){this._showFilterDialog=!0}_handleFilterDialogCancel(){this._showFilterDialog=!1,console.log(`π« Filter dialog cancelled. Current selection: ${this._selectedRoleIds.length}/${this._allSections.length}`)}_handleRoleFilterApply(e){const{selectedRoleIds:t,periodPreferences:i}=e.detail;this._selectedRoleIds=t;JSON.stringify(this._periodPreferences)!==JSON.stringify(i)?(this._periodPreferences=i,console.log("π Period preferences updated:",this._periodPreferences),this._initializeForm()):this._applyRoleFilter(),this._showFilterDialog=!1,console.log(`π― Applied role filter: ${t.length}/${this._allSections.length} roles selected`),this.dispatchEvent(new CustomEvent("roles-filter-changed",{detail:{selectedRoleIds:t,totalRoles:this._allSections.length,visibleRoles:t.length,periodPreferences:i},bubbles:!0}))}_validateForm(){var e;const t=[],i=this._currentSchema;if(i){for(const r of i.sections)for(const i of r.concepts)for(const r of i.fields){const o=null==(e=this._formData[i.id])?void 0:e[r.columnId],n=C.validateField(r.id,i.id,r.columnId,o,r.type,r.validation||[]);t.push(...n)}this._errors=t,this._valid=0===t.filter(e=>"error"===e.severity).length}}_handleFieldChange(e){const{fieldId:t,conceptId:i,columnId:r,value:o}=e.detail,n={...this._formData};n[i]||(n[i]={});const s=n[i][r];n[i]={...n[i],[r]:o},this._formData=n,this._touched.add(`${i}-${r}`),this._dirty=!0,this._validateForm(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("field-change",{detail:{fieldId:t,conceptId:i,columnId:r,value:o,oldValue:s},bubbles:!0}))}_generateUniqueConceptKey(e,t){return`${e}::${t}`}_extractOriginalConceptId(e){const t=e.split("::");return t.length>1?t[1]:e}_handleTypedMemberChange(e){const{columnId:t,axisId:i,value:r}=e.detail;console.log(`π [DynamicForm] Typed member change: columnId=${t}, axisId=${i}, value=${r}`);const o={...this._typedMemberData};o[t]||(o[t]={}),o[t]={...o[t],[i]:r},this._typedMemberData=o,this._dirty=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("typed-member-change",{detail:{columnId:t,axisId:i,value:r},bubbles:!0}))}_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._validateForm(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-remove",{detail:{columnId:t,sectionId:i},bubbles:!0}))}_handleColumnAddRequest(e){const{sectionId:t,columnRequest:i}=e.detail;this._addColumnFromRequest(i,t)}_getAvailableDimensionsForSection(e){var t,i,r;if(!(null==(i=null==(t=this.xbrlInput)?void 0:t.hypercubes)?void 0:i[0]))return[];const o=this.xbrlInput.hypercubes[0].roles.find(t=>t.roleId===e);if(!(null==(r=null==o?void 0:o.items)?void 0:r.length))return console.log(`β No hypercube items found for role: ${e}`),[];const n=[];return o.items.forEach(e=>{e.dimensions&&e.dimensions.length>0&&e.dimensions.forEach(e=>{var t;if(!n.find(t=>t.id===e.id)){const i=(null==(t=e.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:t.label)||e.conceptName,r={id:e.id,conceptName:e.conceptName,axisLabel:i};e.members&&e.members.length>0&&(r.members=e.members.map(e=>{var t,i;return{id:e.id,label:(null==(i=null==(t=e.labels)?void 0:t.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:i.label)||e.conceptName||e.id}})),e.typedMember&&(r.typedMember={id:e.typedMember.id,dataType:"string"}),n.push(r)}})}),n}_addColumnFromRequest(e,t){var i,r,o,n,s;const a=`col-${Date.now()}`;let l="",d="";"instant"===e.periodType?(l=e.instantDate||"",d=""):"duration"!==e.periodType&&"mixed"!==e.periodType||(l=`${e.startDate} / ${e.endDate}`,d="");let c={dimensionId:"period",memberValue:"instant"===e.periodType?`instant-${e.instantDate}`:`duration-${e.startDate}-${e.endDate}`,memberLabel:l};if(e.selectedDimensions&&e.selectedDimensions.length>0){const t=[],i=[];for(const o of e.selectedDimensions)o.isTyped&&o.typedValue?(t.push(`${o.axisLabel}: ${o.typedValue}`),i.push(`${o.axisId}|${o.typedValue}`)):o.memberId&&o.memberLabel&&(t.push(o.memberLabel),i.push(`${o.axisId}|${o.memberId}`));const r="instant"===e.periodType?`(${e.instantDate})`:`(${e.startDate} / ${e.endDate})`;t.length>0&&(l=`${t.join(" | ")} ${r}`,c={dimensionId:a,memberValue:t.join(" | "),memberLabel:t.join(" | "),memberKey:t.join(" | "),dimensionIdKey:i.join("::"),selectedDimensions:e.selectedDimensions},console.log(`π Applied selected dimensions to new column: ${c.memberKey}`))}else if(null==(r=null==(i=this.xbrlInput)?void 0:i.hypercubes)?void 0:r[0]){const i=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===t);if(1===(null==(o=null==i?void 0:i.items)?void 0:o.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==(n=i.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:n.label)||i.conceptName,r=i.members[0],o=(null==(s=r.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:s.label)||r.conceptName;l=`${o} ${"instant"===e.periodType?`(${e.instantDate})`:`(${e.startDate} / ${e.endDate})`}`,c={dimensionId:a,axisId:i.id,memberId:r.id,memberValue:o,memberLabel:o,axis:t,axisLabel:t,memberKey:`${t} | ${o}`,dimensionIdKey:`${i.id} | ${r.id}`},console.log(`π Applied hypercube dimension to new column: ${c.memberKey}`)}}}}const p={id:a,title:l,description:d,type:(c.memberKey,"dimension"),order:this._columns.length,removable:!0,dimensionData:c};if(e.selectedDimensions&&e.selectedDimensions.length>0){const t={};let i=!1;for(const r of e.selectedDimensions)r.isTyped&&(t[r.axisId]=r.typedValue||"",i=!0);i&&(this._typedMemberData[a]=t,p.dimensionData&&(p.dimensionData.hasTypedMembers=!0,p.dimensionData.typedMembers=e.selectedDimensions.filter(e=>e.isTyped).map(e=>({axisId:e.axisId,axisLabel:e.axisLabel,typedMemberId:e.axisId,memberLabel:e.axisLabel}))))}if(this._currentSchema){const e=this._currentSchema.sections.find(e=>e.id===t);e&&(e.columns||(e.columns=[...this._columns]),e.columns=[...e.columns,p])}this._replicateFieldsForNewColumn(a,e,t),this._dirty=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-add",{detail:{column:p},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(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 r=new T,o=this._currentSchema.sections.find(e=>e.id===i);o&&this._replicateFieldsForSection(o.concepts,e,t,r)}_replicateFieldsForSection(e,t,i,r){e.forEach(e=>{var o;if(this._shouldCreateFieldForConcept(e,i)){const r=null==(o=e.fields)?void 0:o[0];let n;n=r?{id:`${e.id}_${t}`,conceptId:e.id,columnId:t,type:r.type,label:r.label,placeholder:r.placeholder,required:r.required,disabled:r.disabled,validation:r.validation,defaultValue:r.defaultValue,periodStartDate:"instant"===i.periodType?i.instantDate:i.startDate,periodEndDate:"instant"===i.periodType?i.instantDate:i.endDate}:{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:"",periodStartDate:"instant"===i.periodType?i.instantDate:i.startDate,periodEndDate:"instant"===i.periodType?i.instantDate:i.endDate},e.fields||(e.fields=[]),e.fields.push(n)}e.children&&this._replicateFieldsForSection(e.children,t,i,r)})}_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}))}_handleSubmit(){if(console.log("π Form submission started..."),this._submitted=!0,"admin"===this.mode)return void this._handleAdminModeSubmit();this._validateForm();const e=this._generateSubmissionData();console.log("π Form Submission Data:",JSON.stringify(e,null,2)),this.dispatchEvent(new CustomEvent("form-submit",{detail:{data:this._formData,submissionData:e,valid:this._valid,errors:this._errors},bubbles:!0})),console.log("β
Form submit event dispatched")}_handleSaveDraft(){const e=this._generateSubmissionData();this.dispatchEvent(new CustomEvent("form-save-draft",{detail:{data:this._formData,draftData:e,valid:this._valid,errors:this._errors},bubbles:!0}))}_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(r=>{const o=i[r];if(null!=o&&""!==o){const i=this._findConceptInAllSections(t);if(i){const n=this._findSectionForConcept(t);this._addConceptDataToSubmission(i,r,o,e,n||void 0)}}})}),console.log(`π€ Included preserved data in submission. Total entries: ${e.length}`)}_findConceptInAllSections(e){for(const t of this._allSections){const i=this._findConceptInSection(t.concepts,e);if(i)return i}return null}_findConceptInSection(e,t){for(const i of e){if(i.id===t)return i;if(i.children){const e=this._findConceptInSection(i.children,t);if(e)return e}}return null}_findSectionForConcept(e){for(const t of this._allSections){if(this._findConceptInSection(t.concepts,e))return t}return null}_addConceptDataToSubmission(e,t,i,r,o){var n;const s=e.fields.find(e=>e.columnId===t);if(!s)return;const a="instant"===e.periodType,l=this._findColumnByIdInAllSections(t);alert("hi"),console.log(`π [Submission] Concept: ${e.id}, Column: ${t}, Column Period: ${(null==l?void 0:l.periodStartDate)||"none"} - ${(null==l?void 0:l.periodEndDate)||"none"}`);const d={conceptId:e.originalConceptId||e.id,value:i,period:{type:e.periodType||"duration",...a?{date:(null==l?void 0:l.periodEndDate)||s.periodStartDate||this.periodStartDate}:{startDate:(null==l?void 0:l.periodStartDate)||s.periodStartDate||this.periodStartDate,endDate:(null==l?void 0:l.periodEndDate)||s.periodEndDate||this.periodEndDate}}};(null==(n=null==l?void 0:l.dimensionData)?void 0:n.memberLabel)&&(d.dimension=l.dimensionData.memberLabel),r.push(d)}_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}`,r=`${e.conceptId}_${e.value}_${e.dimension||"no-dimension"}_${i}`;t.has(r)||t.set(r,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,r,o,n;if(!(null==(r=null==(i=this.xbrlInput)?void 0:i.hypercubes)?void 0:r[0]))return null;const s=null==t?void 0:t.id;if(!s)return null;const a=null==(o=this.xbrlInput.hypercubes[0].roles)?void 0:o.find(e=>e.roleId===s);if(!(null==a?void 0:a.items))return null;for(const l of a.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 r,o,n;if(!(null==(o=null==(r=this.xbrlInput)?void 0:r.hypercubes)?void 0:o[0]))return!1;const s=null==t?void 0:t.id;if(!s)return!1;const a=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===s);if(!(null==(n=null==a?void 0:a.items)?void 0:n.length))return!1;for(const l of a.items){const t=e.originalConceptId||e.id;if(l.conceptIds&&l.conceptIds.includes(t)){const e=l.dimensions.some(e=>e.typedMember);return console.log(`π [DynamicForm] Concept ${t} found in hypercube item. Has typed dimensions:`,e),e}}return console.log(`π [DynamicForm] Concept ${e.originalConceptId||e.id} not found in any hypercube items for role ${s}`),!1}_getApplicableTypedDimensions(e,t){var i,r,o;if(!(null==(r=null==(i=this.xbrlInput)?void 0:i.hypercubes)?void 0:r[0])||!(null==t?void 0:t.id))return[];const n=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===t.id);if(!(null==(o=null==n?void 0:n.items)?void 0:o.length))return[];const s=e.originalConceptId||e.id;for(const a of n.items)if(a.conceptIds&&a.conceptIds.includes(s)){const e=a.dimensions.filter(e=>e.typedMember).map(e=>e.id);return console.log(`π [DynamicForm] Found applicable typed dimensions for concept ${s}:`,e),e}return[]}_processConceptsForSubmission(e,t,i){const r="Toelichting op de geconsolideerde jaarrekening - FinanciΓ«le vaste activa: Deelnemingen: Volledig geconsolideerd: Specificatie",o=(null==i?void 0:i.title)||"Unknown";e.forEach(e=>{o===r&&(console.warn(`[DUPLICATE DEBUG] Processing concept ${e.originalConceptId||e.id} in target role`),e.fields&&(console.warn(`[DUPLICATE DEBUG] Concept has ${e.fields.length} fields`),e.fields.forEach((t,i)=>{var r;console.warn(`[DUPLICATE DEBUG] Field ${i}: columnId=${t.columnId}, current value=${null==(r=this._formData[e.id])?void 0:r[t.columnId]}`)}))),e.fields&&e.fields.length>1&&e.fields.forEach((e,t)=>{}),e.fields&&e.fields.length>0&&e.fields.forEach(n=>{var s,a;const l=this._formData[e.id],d=null==l?void 0:l[n.columnId];if(null!=d&&""!==d){const l=this._findColumnByIdInSection(n.columnId,i),c={conceptId:e.id,value:d,period:{type:e.periodType||"duration"}};if("instant"===e.periodType?c.period.date=(null==l?void 0:l.periodEndDate)||n.periodStartDate||this.periodStartDate:(c.period.startDate=(null==l?void 0:l.periodStartDate)||n.periodStartDate||this.periodStartDate,c.period.endDate=(null==l?void 0:l.periodEndDate)||n.periodEndDate||this.periodEndDate),console.log(`π [Submission] Concept: ${e.id}, Column: ${n.columnId}, Column Period: ${(null==l?void 0:l.periodStartDate)||"none"} - ${(null==l?void 0:l.periodEndDate)||"none"}, Used Period: ${"instant"===c.period.type?c.period.date:`${c.period.startDate} - ${c.period.endDate}`}`),"dimension"===(null==l?void 0:l.type)&&(null==(s=l.dimensionData)?void 0:s.dimensionIdKey)?(c.dimension=l.dimensionData.dimensionIdKey,console.log(`π [DynamicForm] Using dimension key from field's column (${n.columnId}):`,l.dimensionData.dimensionIdKey)):console.log(`π [DynamicForm] No dimension data found for field column ${n.columnId}. Column type: ${null==l?void 0:l.type}, has dimensionData: ${!!(null==l?void 0:l.dimensionData)}`),this._typedMemberData[n.columnId]){const t=this._getApplicableTypedDimensions(e,i);if(console.log(`π [DynamicForm] Concept ${e.id} applicable typed dimensions:`,t),t.length>0){const e={},r=this._typedMemberData[n.columnId];t.forEach(t=>{if(r[t]){const o=this._getTypedMemberNameForAxis(t,i);e[t]={value:r[t],memberName:o||"Unknown"}}}),Object.keys(e).length>0?(c.typedMembers=e,console.log("π [DynamicForm] Adding filtered typed members to submission:",e)):console.log("π [DynamicForm] No typed member values found for applicable dimensions:",t)}else console.log(`π [DynamicForm] Skipping typed members for concept ${e.id} - not applicable to this hypercube`)}else console.log(`π [DynamicForm] No typed member data found for column ${n.columnId}. Available columns:`,Object.keys(this._typedMemberData)),l&&console.log("π [DynamicForm] Column details:",{id:l.id,type:l.type,hasTypedMembers:null==(a=l.dimensionData)?void 0:a.hasTypedMembers,dimensionData:l.dimensionData});o===r&&console.warn("[DUPLICATE DEBUG] Final submission entry:",c),t.push(c)}}),e.children&&this._processConceptsForSubmission(e.children,t,i)})}_handleReset(){this._formData={...this.initialData},this._touched.clear(),this._dirty=!1,this._submitted=!1,this._preservedFormData={},this._preservedTypedMemberData={},console.log("π Form reset - all data and preserved data cleared"),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}}_handleSidePanelRoleClick(e){this._activeSidePanelRoleId=e}_renderAdminModeContent(t){var i,r,o;if(!t)return e.html`
|
|
1584
|
+
`,Q([w({type:Boolean,reflect:!0})],exports.JupiterFilterRolesDialog.prototype,"open",2),Q([w({type:Array})],exports.JupiterFilterRolesDialog.prototype,"availableRoles",2),Q([w({type:Array})],exports.JupiterFilterRolesDialog.prototype,"selectedRoleIds",2),Q([w({type:Object})],exports.JupiterFilterRolesDialog.prototype,"periodPreferences",2),Q([S()],exports.JupiterFilterRolesDialog.prototype,"_tempSelectedRoles",2),Q([S()],exports.JupiterFilterRolesDialog.prototype,"_searchQuery",2),Q([S()],exports.JupiterFilterRolesDialog.prototype,"_filteredRoles",2),Q([S()],exports.JupiterFilterRolesDialog.prototype,"_tempPeriodPreferences",2),exports.JupiterFilterRolesDialog=Q([t("jupiter-filter-roles-dialog")],exports.JupiterFilterRolesDialog);var W=Object.defineProperty,X=Object.getOwnPropertyDescriptor,Z=(e,t,i,r)=>{for(var o,n=r>1?void 0:r?X(t,i):t,s=e.length-1;s>=0;s--)(o=e[s])&&(n=(r?o(t,i,n):o(n))||n);return r&&n&&W(t,i,n),n};exports.JupiterDynamicForm=class extends e.LitElement{constructor(){super(...arguments),this.config={},this.initialData={},this.disabled=!1,this.readonly=!1,this.periodStartDate="2025-01-01",this.periodEndDate="2025-12-31",this.language="en",this.display="accordion",this.mode="inputForm",this.financialStatementsTypeAxis=[],this._formData={},this._preservedFormData={},this._typedMemberData={},this._preservedTypedMemberData={},this._columns=[],this._errors=[],this._touched=new Set,this._dirty=!1,this._valid=!0,this._submitted=!1,this._allSections=[],this._selectedRoleIds=[],this._showFilterDialog=!1,this._periodPreferences={},this._activeSidePanelRoleId=null,this._adminRoleConfigs={}}connectedCallback(){super.connectedCallback(),this._initializeForm()}updated(e){e.has("language")&&F.setLanguage(this.language),e.has("financialStatementsTypeAxis")&&console.log("π financialStatementsTypeAxis changed:",this.financialStatementsTypeAxis),(e.has("xbrlInput")||e.has("schema")||e.has("language")||e.has("periodStartDate")||e.has("periodEndDate")||e.has("financialStatementsTypeAxis"))&&this._initializeForm()}_initializeForm(){var e;if(this.xbrlInput)try{console.log("π Initializing form from XBRL input:",this.xbrlInput),console.log("π
Using period dates:",this.periodStartDate,"to",this.periodEndDate),console.log("π Using language:",this.language),this._initializePeriodPreferencesFromData(),console.log("βοΈ Using period preferences:",this._periodPreferences),this._currentSchema=T.buildFormSchema(this.xbrlInput,this.periodStartDate,this.periodEndDate,this.language,this._periodPreferences),console.log("β
Generated schema with sections:",this._currentSchema.sections.length),this._allSections=[...this._currentSchema.sections],this.financialStatementsTypeAxis&&this.financialStatementsTypeAxis.length>0&&(console.log("π Applying financialStatementsTypeAxis filter:",this.financialStatementsTypeAxis),console.log("π Sections before filter:",this._allSections.length),this._allSections=this._filterRolesByFinancialStatementsType(this._allSections),console.log("π Sections after filter:",this._allSections.length)),0===this._selectedRoleIds.length&&(this._selectedRoleIds=this._allSections.map(e=>e.id),console.log("β
Auto-selected all roles:",this._selectedRoleIds.length)),this._applyRoleFilter(),this._columns=[{id:"base",title:"Value",description:"Base values for concepts",type:"base",order:0,removable:!1}]}catch(t){console.error("β Error building form from XBRL input:",t),this._currentSchema=this._getDefaultSchema(),this._allSections=[],this._selectedRoleIds=[],this._columns=this._getDefaultColumns()}else this.schema?(this._currentSchema=this.schema,this._allSections=[...this.schema.sections],this._selectedRoleIds=this._allSections.map(e=>e.id),this._columns=this._getDefaultColumns()):(this._currentSchema=this._getDefaultSchema(),this._allSections=[],this._selectedRoleIds=[],this._columns=this._getDefaultColumns());this._formData={...this.initialData},(null==(e=this.xbrlInput)?void 0:e.initialData)&&(this._formData={...this._formData,...this.xbrlInput.initialData}),this._validateForm()}_getDefaultSchema(){return{version:"1.0",formId:"default-form",title:"Dynamic Form",description:"Please provide form schema or XBRL input data",sections:[]}}_getDefaultColumns(){return[{id:"base",title:"Value",description:"Base values for concepts",type:"base",order:0,removable:!1}]}_initializePeriodPreferencesFromData(){var e,t,i;if(!(null==(i=null==(t=null==(e=this.xbrlInput)?void 0:e.presentation)?void 0:t[0])?void 0:i.roles))return;const r={...this._periodPreferences};this.xbrlInput.presentation[0].roles.forEach(e=>{if(!r[e.id]){const t=!0===e.showPreviousYear,i=void 0===e.instant||!0===e.instant,o=void 0===e.duration||!0===e.duration;r[e.id]={showDuration:o,showInstant:i,showPreviousYear:t}}}),this._periodPreferences=r}_applyRoleFilter(){if(!this._currentSchema||!this._allSections.length)return;if(console.log(`π Applying role filter: ${this._selectedRoleIds.length} selected out of ${this._allSections.length} total`),0===this._selectedRoleIds.length)return console.log("π No roles selected - showing empty form"),this._currentSchema={...this._currentSchema,sections:[]},void this.requestUpdate();this._preserveDataForHiddenSections();const e=this._allSections.filter(e=>this._selectedRoleIds.includes(e.id));console.log(`π Filtered sections: ${e.length} (IDs: ${e.map(e=>e.id).join(", ")})`),this._restoreDataForVisibleSections(e),this._currentSchema={...this._currentSchema,sections:e},console.log(`β
Schema updated. Current sections count: ${this._currentSchema.sections.length}`),this.requestUpdate()}_filterRolesByFinancialStatementsType(e){var t;if(!this.financialStatementsTypeAxis||0===this.financialStatementsTypeAxis.length)return e;if(!(null==(t=this.xbrlInput)?void 0:t.hypercubes)||0===this.xbrlInput.hypercubes.length)return e;const i=this.xbrlInput.hypercubes[0];return console.log("π Filter values:",this.financialStatementsTypeAxis),e.filter(e=>{var t;const r=null==(t=i.roles)?void 0:t.find(t=>t.roleId===e.id);if(!r||!r.items||0===r.items.length)return console.log(`β
${e.title}: No hypercube entry - INCLUDED`),!0;let o=!1,n=!1;for(const i of r.items){if(!i.dimensions||0===i.dimensions.length)continue;const e=i.dimensions.find(e=>{var t;return"bw2-titel9_FinancialStatementsTypeAxis"===e.id||(null==(t=e.conceptName)?void 0:t.includes("FinancialStatementsTypeAxis"))});if(e&&(o=!0,e.members&&e.members.length>0)){if(e.members.some(e=>{if(e.conceptName){const t=e.conceptName.split(":"),i=t.length>1?t[1]:e.conceptName;return this.financialStatementsTypeAxis.some(e=>{const t=e.split(":"),r=t.length>1?t[1]:e;return i===r})}return this.financialStatementsTypeAxis.includes(e.id)})){n=!0;break}}}return!o||n})}_preserveDataForHiddenSections(){var e;((null==(e=this._currentSchema)?void 0:e.sections.map(e=>e.id))||[]).filter(e=>!this._selectedRoleIds.includes(e)).forEach(e=>{const t=this._allSections.find(t=>t.id===e);t&&this._preserveSectionData(t)})}_restoreDataForVisibleSections(e){e.forEach(e=>{this._restoreSectionData(e)}),console.log(`π Restored data for ${e.length} visible sections`)}_preserveSectionData(e){e.concepts.forEach(e=>{this._preserveConceptData(e)})}_preserveConceptData(e){this._formData[e.id]&&(this._preservedFormData[e.id]={...this._formData[e.id]}),e.fields.forEach(e=>{this._typedMemberData[e.columnId]&&(this._preservedTypedMemberData[e.columnId]={...this._typedMemberData[e.columnId]})}),e.children&&e.children.forEach(e=>{this._preserveConceptData(e)})}_restoreSectionData(e){e.concepts.forEach(e=>{this._restoreConceptData(e)})}_restoreConceptData(e){this._preservedFormData[e.id]&&(this._formData[e.id]={...this._preservedFormData[e.id]}),e.fields.forEach(e=>{this._preservedTypedMemberData[e.columnId]&&(this._typedMemberData[e.columnId]={...this._preservedTypedMemberData[e.columnId]})}),e.children&&e.children.forEach(e=>{this._restoreConceptData(e)})}_shouldShowFilterButton(){return!0}_handleFilterRolesClick(){this._showFilterDialog=!0}_handleFilterDialogCancel(){this._showFilterDialog=!1,console.log(`π« Filter dialog cancelled. Current selection: ${this._selectedRoleIds.length}/${this._allSections.length}`)}_handleRoleFilterApply(e){const{selectedRoleIds:t,periodPreferences:i}=e.detail;this._selectedRoleIds=t;JSON.stringify(this._periodPreferences)!==JSON.stringify(i)?(this._periodPreferences=i,console.log("π Period preferences updated:",this._periodPreferences),this._initializeForm()):this._applyRoleFilter(),this._showFilterDialog=!1,console.log(`π― Applied role filter: ${t.length}/${this._allSections.length} roles selected`),this.dispatchEvent(new CustomEvent("roles-filter-changed",{detail:{selectedRoleIds:t,totalRoles:this._allSections.length,visibleRoles:t.length,periodPreferences:i},bubbles:!0}))}_validateForm(){var e;const t=[],i=this._currentSchema;if(i){for(const r of i.sections)for(const i of r.concepts)for(const r of i.fields){const o=null==(e=this._formData[i.id])?void 0:e[r.columnId],n=C.validateField(r.id,i.id,r.columnId,o,r.type,r.validation||[]);t.push(...n)}this._errors=t,this._valid=0===t.filter(e=>"error"===e.severity).length}}_handleFieldChange(e){const{fieldId:t,conceptId:i,columnId:r,value:o}=e.detail,n={...this._formData};n[i]||(n[i]={});const s=n[i][r];n[i]={...n[i],[r]:o},this._formData=n,this._touched.add(`${i}-${r}`),this._dirty=!0,this._validateForm(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("field-change",{detail:{fieldId:t,conceptId:i,columnId:r,value:o,oldValue:s},bubbles:!0}))}_generateUniqueConceptKey(e,t){return`${e}::${t}`}_extractOriginalConceptId(e){const t=e.split("::");return t.length>1?t[1]:e}_handleTypedMemberChange(e){const{columnId:t,axisId:i,value:r}=e.detail;console.log(`π [DynamicForm] Typed member change: columnId=${t}, axisId=${i}, value=${r}`);const o={...this._typedMemberData};o[t]||(o[t]={}),o[t]={...o[t],[i]:r},this._typedMemberData=o,this._dirty=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("typed-member-change",{detail:{columnId:t,axisId:i,value:r},bubbles:!0}))}_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._validateForm(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-remove",{detail:{columnId:t,sectionId:i},bubbles:!0}))}_handleColumnAddRequest(e){const{sectionId:t,columnRequest:i}=e.detail;this._addColumnFromRequest(i,t)}_getAvailableDimensionsForSection(e){var t,i,r;if(!(null==(i=null==(t=this.xbrlInput)?void 0:t.hypercubes)?void 0:i[0]))return[];const o=this.xbrlInput.hypercubes[0].roles.find(t=>t.roleId===e);if(!(null==(r=null==o?void 0:o.items)?void 0:r.length))return console.log(`β No hypercube items found for role: ${e}`),[];const n=[];return o.items.forEach(e=>{e.dimensions&&e.dimensions.length>0&&e.dimensions.forEach(e=>{var t;if(!n.find(t=>t.id===e.id)){const i=(null==(t=e.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:t.label)||e.conceptName,r={id:e.id,conceptName:e.conceptName,axisLabel:i};e.members&&e.members.length>0&&(r.members=e.members.map(e=>{var t,i;return{id:e.id,label:(null==(i=null==(t=e.labels)?void 0:t.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:i.label)||e.conceptName||e.id}})),e.typedMember&&(r.typedMember={id:e.typedMember.id,dataType:"string"}),n.push(r)}})}),n}_addColumnFromRequest(e,t){var i,r,o,n,s;const a=`col-${Date.now()}`;let l="",d="";"instant"===e.periodType?(l=e.instantDate||"",d=""):"duration"!==e.periodType&&"mixed"!==e.periodType||(l=`${e.startDate} / ${e.endDate}`,d="");let c={dimensionId:"period",memberValue:"instant"===e.periodType?`instant-${e.instantDate}`:`duration-${e.startDate}-${e.endDate}`,memberLabel:l};if(e.selectedDimensions&&e.selectedDimensions.length>0){const t=[],i=[];for(const o of e.selectedDimensions)o.isTyped&&o.typedValue?(t.push(`${o.axisLabel}: ${o.typedValue}`),i.push(`${o.axisId}|${o.typedValue}`)):o.memberId&&o.memberLabel&&(t.push(o.memberLabel),i.push(`${o.axisId}|${o.memberId}`));const r="instant"===e.periodType?`(${e.instantDate})`:`(${e.startDate} / ${e.endDate})`;t.length>0&&(l=`${t.join(" | ")} ${r}`,c={dimensionId:a,memberValue:t.join(" | "),memberLabel:t.join(" | "),memberKey:t.join(" | "),dimensionIdKey:i.join("::"),selectedDimensions:e.selectedDimensions},console.log(`π Applied selected dimensions to new column: ${c.memberKey}`))}else if(null==(r=null==(i=this.xbrlInput)?void 0:i.hypercubes)?void 0:r[0]){const i=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===t);if(1===(null==(o=null==i?void 0:i.items)?void 0:o.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==(n=i.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:n.label)||i.conceptName,r=i.members[0],o=(null==(s=r.labels.find(e=>"http://www.xbrl.org/2003/role/label"===e.role))?void 0:s.label)||r.conceptName;l=`${o} ${"instant"===e.periodType?`(${e.instantDate})`:`(${e.startDate} / ${e.endDate})`}`,c={dimensionId:a,axisId:i.id,memberId:r.id,memberValue:o,memberLabel:o,axis:t,axisLabel:t,memberKey:`${t} | ${o}`,dimensionIdKey:`${i.id} | ${r.id}`},console.log(`π Applied hypercube dimension to new column: ${c.memberKey}`)}}}}const p={id:a,title:l,description:d,type:(c.memberKey,"dimension"),order:this._columns.length,removable:!0,dimensionData:c};if(e.selectedDimensions&&e.selectedDimensions.length>0){const t={};let i=!1;for(const r of e.selectedDimensions)r.isTyped&&(t[r.axisId]=r.typedValue||"",i=!0);i&&(this._typedMemberData[a]=t,p.dimensionData&&(p.dimensionData.hasTypedMembers=!0,p.dimensionData.typedMembers=e.selectedDimensions.filter(e=>e.isTyped).map(e=>({axisId:e.axisId,axisLabel:e.axisLabel,typedMemberId:e.axisId,memberLabel:e.axisLabel}))))}if(this._currentSchema){const e=this._currentSchema.sections.find(e=>e.id===t);e&&(e.columns||(e.columns=[...this._columns]),e.columns=[...e.columns,p])}this._replicateFieldsForNewColumn(a,e,t),this._dirty=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("column-add",{detail:{column:p},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(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 r=new T,o=this._currentSchema.sections.find(e=>e.id===i);o&&this._replicateFieldsForSection(o.concepts,e,t,r)}_replicateFieldsForSection(e,t,i,r){e.forEach(e=>{var o;if(this._shouldCreateFieldForConcept(e,i)){const r=null==(o=e.fields)?void 0:o[0];let n;n=r?{id:`${e.id}_${t}`,conceptId:e.id,columnId:t,type:r.type,label:r.label,placeholder:r.placeholder,required:r.required,disabled:r.disabled,validation:r.validation,defaultValue:r.defaultValue,periodStartDate:"instant"===i.periodType?i.instantDate:i.startDate,periodEndDate:"instant"===i.periodType?i.instantDate:i.endDate}:{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:"",periodStartDate:"instant"===i.periodType?i.instantDate:i.startDate,periodEndDate:"instant"===i.periodType?i.instantDate:i.endDate},e.fields||(e.fields=[]),e.fields.push(n)}e.children&&this._replicateFieldsForSection(e.children,t,i,r)})}_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}))}_handleSubmit(){if(console.log("π Form submission started..."),this._submitted=!0,"admin"===this.mode)return void this._handleAdminModeSubmit();this._validateForm();const e=this._generateSubmissionData();console.log("π Form Submission Data:",JSON.stringify(e,null,2)),this.dispatchEvent(new CustomEvent("form-submit",{detail:{data:this._formData,submissionData:e,valid:this._valid,errors:this._errors},bubbles:!0})),console.log("β
Form submit event dispatched")}_handleSaveDraft(){const e=this._generateSubmissionData();this.dispatchEvent(new CustomEvent("form-save-draft",{detail:{data:this._formData,draftData:e,valid:this._valid,errors:this._errors},bubbles:!0}))}_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(r=>{const o=i[r];if(null!=o&&""!==o){const i=this._findConceptInAllSections(t);if(i){const n=this._findSectionForConcept(t);this._addConceptDataToSubmission(i,r,o,e,n||void 0)}}})}),console.log(`π€ Included preserved data in submission. Total entries: ${e.length}`)}_findConceptInAllSections(e){for(const t of this._allSections){const i=this._findConceptInSection(t.concepts,e);if(i)return i}return null}_findConceptInSection(e,t){for(const i of e){if(i.id===t)return i;if(i.children){const e=this._findConceptInSection(i.children,t);if(e)return e}}return null}_findSectionForConcept(e){for(const t of this._allSections){if(this._findConceptInSection(t.concepts,e))return t}return null}_addConceptDataToSubmission(e,t,i,r,o){var n;const s=e.fields.find(e=>e.columnId===t);if(!s)return;const a="instant"===e.periodType,l=this._findColumnByIdInAllSections(t);alert("hi"),console.log(`π [Submission] Concept: ${e.id}, Column: ${t}, Column Period: ${(null==l?void 0:l.periodStartDate)||"none"} - ${(null==l?void 0:l.periodEndDate)||"none"}`);const d={conceptId:e.originalConceptId||e.id,value:i,period:{type:e.periodType||"duration",...a?{date:(null==l?void 0:l.periodEndDate)||s.periodStartDate||this.periodStartDate}:{startDate:(null==l?void 0:l.periodStartDate)||s.periodStartDate||this.periodStartDate,endDate:(null==l?void 0:l.periodEndDate)||s.periodEndDate||this.periodEndDate}}};(null==(n=null==l?void 0:l.dimensionData)?void 0:n.memberLabel)&&(d.dimension=l.dimensionData.memberLabel),r.push(d)}_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}`,r=`${e.conceptId}_${e.value}_${e.dimension||"no-dimension"}_${i}`;t.has(r)||t.set(r,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,r,o,n;if(!(null==(r=null==(i=this.xbrlInput)?void 0:i.hypercubes)?void 0:r[0]))return null;const s=null==t?void 0:t.id;if(!s)return null;const a=null==(o=this.xbrlInput.hypercubes[0].roles)?void 0:o.find(e=>e.roleId===s);if(!(null==a?void 0:a.items))return null;for(const l of a.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 r,o,n;if(!(null==(o=null==(r=this.xbrlInput)?void 0:r.hypercubes)?void 0:o[0]))return!1;const s=null==t?void 0:t.id;if(!s)return!1;const a=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===s);if(!(null==(n=null==a?void 0:a.items)?void 0:n.length))return!1;for(const l of a.items){const t=e.originalConceptId||e.id;if(l.conceptIds&&l.conceptIds.includes(t)){const e=l.dimensions.some(e=>e.typedMember);return console.log(`π [DynamicForm] Concept ${t} found in hypercube item. Has typed dimensions:`,e),e}}return console.log(`π [DynamicForm] Concept ${e.originalConceptId||e.id} not found in any hypercube items for role ${s}`),!1}_getApplicableTypedDimensions(e,t){var i,r,o;if(!(null==(r=null==(i=this.xbrlInput)?void 0:i.hypercubes)?void 0:r[0])||!(null==t?void 0:t.id))return[];const n=this.xbrlInput.hypercubes[0].roles.find(e=>e.roleId===t.id);if(!(null==(o=null==n?void 0:n.items)?void 0:o.length))return[];const s=e.originalConceptId||e.id;for(const a of n.items)if(a.conceptIds&&a.conceptIds.includes(s)){const e=a.dimensions.filter(e=>e.typedMember).map(e=>e.id);return console.log(`π [DynamicForm] Found applicable typed dimensions for concept ${s}:`,e),e}return[]}_processConceptsForSubmission(e,t,i){const r="Toelichting op de geconsolideerde jaarrekening - FinanciΓ«le vaste activa: Deelnemingen: Volledig geconsolideerd: Specificatie",o=(null==i?void 0:i.title)||"Unknown";e.forEach(e=>{o===r&&(console.warn(`[DUPLICATE DEBUG] Processing concept ${e.originalConceptId||e.id} in target role`),e.fields&&(console.warn(`[DUPLICATE DEBUG] Concept has ${e.fields.length} fields`),e.fields.forEach((t,i)=>{var r;console.warn(`[DUPLICATE DEBUG] Field ${i}: columnId=${t.columnId}, current value=${null==(r=this._formData[e.id])?void 0:r[t.columnId]}`)}))),e.fields&&e.fields.length>1&&e.fields.forEach((e,t)=>{}),e.fields&&e.fields.length>0&&e.fields.forEach(n=>{var s,a;const l=this._formData[e.id],d=null==l?void 0:l[n.columnId];if(null!=d&&""!==d){const l=this._findColumnByIdInSection(n.columnId,i),c={conceptId:e.id,value:d,period:{type:e.periodType||"duration"}};if("instant"===e.periodType?c.period.date=(null==l?void 0:l.periodEndDate)||n.periodStartDate||this.periodStartDate:(c.period.startDate=(null==l?void 0:l.periodStartDate)||n.periodStartDate||this.periodStartDate,c.period.endDate=(null==l?void 0:l.periodEndDate)||n.periodEndDate||this.periodEndDate),console.log(`π [Submission] Concept: ${e.id}, Column: ${n.columnId}, Column Period: ${(null==l?void 0:l.periodStartDate)||"none"} - ${(null==l?void 0:l.periodEndDate)||"none"}, Used Period: ${"instant"===c.period.type?c.period.date:`${c.period.startDate} - ${c.period.endDate}`}`),"dimension"===(null==l?void 0:l.type)&&(null==(s=l.dimensionData)?void 0:s.dimensionIdKey)?(c.dimension=l.dimensionData.dimensionIdKey,console.log(`π [DynamicForm] Using dimension key from field's column (${n.columnId}):`,l.dimensionData.dimensionIdKey)):console.log(`π [DynamicForm] No dimension data found for field column ${n.columnId}. Column type: ${null==l?void 0:l.type}, has dimensionData: ${!!(null==l?void 0:l.dimensionData)}`),this._typedMemberData[n.columnId]){const t=this._getApplicableTypedDimensions(e,i);if(console.log(`π [DynamicForm] Concept ${e.id} applicable typed dimensions:`,t),t.length>0){const e={},r=this._typedMemberData[n.columnId];t.forEach(t=>{if(r[t]){const o=this._getTypedMemberNameForAxis(t,i);e[t]={value:r[t],memberName:o||"Unknown"}}}),Object.keys(e).length>0?(c.typedMembers=e,console.log("π [DynamicForm] Adding filtered typed members to submission:",e)):console.log("π [DynamicForm] No typed member values found for applicable dimensions:",t)}else console.log(`π [DynamicForm] Skipping typed members for concept ${e.id} - not applicable to this hypercube`)}else console.log(`π [DynamicForm] No typed member data found for column ${n.columnId}. Available columns:`,Object.keys(this._typedMemberData)),l&&console.log("π [DynamicForm] Column details:",{id:l.id,type:l.type,hasTypedMembers:null==(a=l.dimensionData)?void 0:a.hasTypedMembers,dimensionData:l.dimensionData});o===r&&console.warn("[DUPLICATE DEBUG] Final submission entry:",c),t.push(c)}}),e.children&&this._processConceptsForSubmission(e.children,t,i)})}_handleReset(){this._formData={...this.initialData},this._touched.clear(),this._dirty=!1,this._submitted=!1,this._preservedFormData={},this._preservedTypedMemberData={},console.log("π Form reset - all data and preserved data cleared"),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}}_handleSidePanelRoleClick(e){this._activeSidePanelRoleId=e}_renderAdminModeContent(t){var i,r,o;if(!t)return e.html`
|
|
1585
1585
|
<div class="admin-mode-container">
|
|
1586
1586
|
<p>No role selected</p>
|
|
1587
1587
|
</div>
|
|
@@ -1633,7 +1633,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1633
1633
|
<!-- Validation Summary -->
|
|
1634
1634
|
${r?e.html`
|
|
1635
1635
|
<div class="validation-summary">
|
|
1636
|
-
<h4 class="validation-summary-title"
|
|
1636
|
+
<h4 class="validation-summary-title">${F.t("validation.summary")}</h4>
|
|
1637
1637
|
<ul class="validation-summary-list">
|
|
1638
1638
|
${this._errors.filter(e=>"error"===e.severity).map(t=>e.html`
|
|
1639
1639
|
<li class="validation-summary-item">${t.message}</li>
|
|
@@ -1649,9 +1649,9 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1649
1649
|
</div>
|
|
1650
1650
|
`):0===t.sections.length?e.html`
|
|
1651
1651
|
<div class="no-roles-message">
|
|
1652
|
-
<h3
|
|
1653
|
-
<p
|
|
1654
|
-
<p
|
|
1652
|
+
<h3>${F.t("form.noRoleSelected")}</h3>
|
|
1653
|
+
<p>${F.t("filter.selectRoles")}</p>
|
|
1654
|
+
<p>${F.t("filter.roles")}: ${this._allSections.length}</p>
|
|
1655
1655
|
</div>
|
|
1656
1656
|
`:t.sections.map((t,r)=>e.html`
|
|
1657
1657
|
<jupiter-form-section
|
|
@@ -1728,8 +1728,8 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1728
1728
|
></jupiter-form-section>
|
|
1729
1729
|
`:e.html`
|
|
1730
1730
|
<div class="no-roles-message">
|
|
1731
|
-
<h3
|
|
1732
|
-
<p
|
|
1731
|
+
<h3>${F.t("form.noRoleSelected")}</h3>
|
|
1732
|
+
<p>${F.t("form.pleaseSelectRole")}</p>
|
|
1733
1733
|
</div>
|
|
1734
1734
|
`}
|
|
1735
1735
|
</div>
|
|
@@ -1762,7 +1762,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1762
1762
|
<svg class="filter-icon" viewBox="0 0 24 24">
|
|
1763
1763
|
<path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/>
|
|
1764
1764
|
</svg>
|
|
1765
|
-
${0===this._selectedRoleIds.length?"
|
|
1765
|
+
${0===this._selectedRoleIds.length?F.t("filter.selectRoles"):F.t("filter.filterRoles")}
|
|
1766
1766
|
<span class="roles-count">${this._selectedRoleIds.length}/${this._allSections.length}</span>
|
|
1767
1767
|
</button>
|
|
1768
1768
|
`:""}
|
|
@@ -1772,7 +1772,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1772
1772
|
@click="${this._handleSaveDraft}"
|
|
1773
1773
|
?disabled="${this.disabled||this.readonly}"
|
|
1774
1774
|
>
|
|
1775
|
-
|
|
1775
|
+
${F.t("form.saveDraft")}
|
|
1776
1776
|
</button>
|
|
1777
1777
|
|
|
1778
1778
|
<button
|
|
@@ -1780,13 +1780,13 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1780
1780
|
@click="${this._handleSubmit}"
|
|
1781
1781
|
?disabled="${this.disabled||this.readonly}"
|
|
1782
1782
|
>
|
|
1783
|
-
|
|
1783
|
+
${F.t("form.submit")}
|
|
1784
1784
|
</button>
|
|
1785
1785
|
|
|
1786
1786
|
<div class="form-meta">
|
|
1787
|
-
<span
|
|
1788
|
-
<span
|
|
1789
|
-
<span
|
|
1787
|
+
<span>${F.t("form.errors")}: ${t}</span>
|
|
1788
|
+
<span>${F.t("form.modified")}: ${this._dirty?F.t("form.yes"):F.t("form.no")}</span>
|
|
1789
|
+
<span>${F.t("form.valid")}: ${this._valid?F.t("form.yes"):F.t("form.no")}</span>
|
|
1790
1790
|
</div>
|
|
1791
1791
|
</div>
|
|
1792
1792
|
|
|
@@ -1803,7 +1803,7 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
1803
1803
|
></jupiter-filter-roles-dialog>
|
|
1804
1804
|
`:""}
|
|
1805
1805
|
</div>
|
|
1806
|
-
`:e.html`<div
|
|
1806
|
+
`:e.html`<div>${F.t("form.loading")}</div>`}},exports.JupiterDynamicForm.styles=e.css`
|
|
1807
1807
|
:host {
|
|
1808
1808
|
display: block;
|
|
1809
1809
|
font-family: var(--jupiter-font-family, system-ui, -apple-system, sans-serif);
|
|
@@ -2036,8 +2036,8 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
2036
2036
|
}
|
|
2037
2037
|
|
|
2038
2038
|
.side-panel-content .form-sections {
|
|
2039
|
-
padding: 24px;
|
|
2040
|
-
padding-
|
|
2039
|
+
padding: 0 24px 24px 24px;
|
|
2040
|
+
padding-top: 0;
|
|
2041
2041
|
}
|
|
2042
2042
|
|
|
2043
2043
|
/* Admin Mode Styles */
|
|
@@ -2106,5 +2106,5 @@ const D={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},I=(e=D,t,
|
|
|
2106
2106
|
cursor: pointer;
|
|
2107
2107
|
user-select: none;
|
|
2108
2108
|
}
|
|
2109
|
-
`,
|
|
2109
|
+
`,Z([w({type:Object})],exports.JupiterDynamicForm.prototype,"schema",2),Z([w({type:Object})],exports.JupiterDynamicForm.prototype,"xbrlInput",2),Z([w({type:Object})],exports.JupiterDynamicForm.prototype,"config",2),Z([w({type:Object})],exports.JupiterDynamicForm.prototype,"initialData",2),Z([w({type:Boolean})],exports.JupiterDynamicForm.prototype,"disabled",2),Z([w({type:Boolean})],exports.JupiterDynamicForm.prototype,"readonly",2),Z([w({type:String})],exports.JupiterDynamicForm.prototype,"periodStartDate",2),Z([w({type:String})],exports.JupiterDynamicForm.prototype,"periodEndDate",2),Z([w({type:String})],exports.JupiterDynamicForm.prototype,"language",2),Z([w({type:String})],exports.JupiterDynamicForm.prototype,"display",2),Z([w({type:String})],exports.JupiterDynamicForm.prototype,"mode",2),Z([w({type:Array})],exports.JupiterDynamicForm.prototype,"financialStatementsTypeAxis",2),Z([S()],exports.JupiterDynamicForm.prototype,"_formData",2),Z([S()],exports.JupiterDynamicForm.prototype,"_preservedFormData",2),Z([S()],exports.JupiterDynamicForm.prototype,"_typedMemberData",2),Z([S()],exports.JupiterDynamicForm.prototype,"_preservedTypedMemberData",2),Z([S()],exports.JupiterDynamicForm.prototype,"_columns",2),Z([S()],exports.JupiterDynamicForm.prototype,"_errors",2),Z([S()],exports.JupiterDynamicForm.prototype,"_touched",2),Z([S()],exports.JupiterDynamicForm.prototype,"_dirty",2),Z([S()],exports.JupiterDynamicForm.prototype,"_valid",2),Z([S()],exports.JupiterDynamicForm.prototype,"_submitted",2),Z([S()],exports.JupiterDynamicForm.prototype,"_currentSchema",2),Z([S()],exports.JupiterDynamicForm.prototype,"_allSections",2),Z([S()],exports.JupiterDynamicForm.prototype,"_selectedRoleIds",2),Z([S()],exports.JupiterDynamicForm.prototype,"_showFilterDialog",2),Z([S()],exports.JupiterDynamicForm.prototype,"_periodPreferences",2),Z([S()],exports.JupiterDynamicForm.prototype,"_activeSidePanelRoleId",2),Z([S()],exports.JupiterDynamicForm.prototype,"_adminRoleConfigs",2),exports.JupiterDynamicForm=Z([t("jupiter-dynamic-form")],exports.JupiterDynamicForm);exports.FormValidator=C,exports.TYPE_INPUT_MAP=E,exports.getInputTypeForConceptType=j,exports.isCheckboxType=R,exports.isNumericType=A,exports.isSelectType=function(e){return"select"===e},exports.isTextareaType=P,exports.version="1.5.0";
|
|
2110
2110
|
//# sourceMappingURL=index.js.map
|