1import{n as e,t}from"./numbers-CEPOpf9-.js";import{q as n}from"./utils-CIrmDxyu.js";import"./parcelle-CWQA0mxM.js";import{f as r}from"./lots-ClfLLMfy.js";import"./d3-B5i2VnzJ.js";import{n as i}from"./enumsUnites-BAbhFITr.js";import{r as a}from"./positionsReglementaires-BCj0HlFd.js";import{t as o}from"./i18n-C6BK9ULc.js";import{n as s,r as c}from"./xlsx-CwJXNsWo.js";var l={},u={},d=34,f=10,p=13;function m(e){return Function(`d`,`return {`+e.map(function(e,t){return JSON.stringify(e)+`: d[`+t+`] || ""`}).join(`,`)+`}`)}function h(e,t){var n=m(e);return function(r,i){return t(n(r),i,e)}}function g(e){var t=Object.create(null),n=[];return e.forEach(function(e){for(var r in e)r in t||n.push(t[r]=r)}),n}function _(e,t){var n=e+``,r=n.length;return r<t?Array(t-r+1).join(0)+n:n}function v(e){return e<0?`-`+_(-e,6):e>9999?`+`+_(e,6):_(e,4)}function y(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?`Invalid Date`:v(e.getUTCFullYear(),4)+`-`+_(e.getUTCMonth()+1,2)+`-`+_(e.getUTCDate(),2)+(i?`T`+_(t,2)+`:`+_(n,2)+`:`+_(r,2)+`.`+_(i,3)+`Z`:r?`T`+_(t,2)+`:`+_(n,2)+`:`+_(r,2)+`Z`:n||t?`T`+_(t,2)+`:`+_(n,2)+`Z`:``)}function b(e){var t=RegExp(`["`+e+` 2\r]`),n=e.charCodeAt(0);function r(e,t){var n,r,a=i(e,function(e,i){if(n)return n(e,i-1);r=e,n=t?h(e,t):m(e)});return a.columns=r||[],a}function i(e,t){var r=[],i=e.length,a=0,o=0,s,c=i<=0,m=!1;e.charCodeAt(i-1)===f&&--i,e.charCodeAt(i-1)===p&&--i;function h(){if(c)return u;if(m)return m=!1,l;var t,r=a,o;if(e.charCodeAt(r)===d){for(;a++<i&&e.charCodeAt(a)!==d||e.charCodeAt(++a)===d;);return(t=a)>=i?c=!0:(o=e.charCodeAt(a++))===f?m=!0:o===p&&(m=!0,e.charCodeAt(a)===f&&++a),e.slice(r+1,t-1).replace(/""/g,`"`)}for(;a<i;){if((o=e.charCodeAt(t=a++))===f)m=!0;else if(o===p)m=!0,e.charCodeAt(a)===f&&++a;else if(o!==n)continue;return e.slice(r,t)}return c=!0,e.slice(r,i)}for(;(s=h())!==u;){for(var g=[];s!==l&&s!==u;)g.push(s),s=h();t&&(g=t(g,o++))==null||r.push(g)}return r}function a(t,n){return t.map(function(t){return n.map(function(e){return v(t[e])}).join(e)})}function o(t,n){return n??=g(t),[n.map(v).join(e)].concat(a(t,n)).join(` 3`)}function s(e,t){return t??=g(e),a(e,t).join(` 4`)}function c(e){return e.map(_).join(` 5`)}function _(t){return t.map(v).join(e)}function v(e){return e==null?``:e instanceof Date?y(e):t.test(e+=``)?`"`+e.replace(/"/g,`""`)+`"`:e}return{parse:r,parseRows:i,format:o,formatBody:s,formatRows:c,formatRow:_,formatValue:v}}var x=[`Bâtiment/Parcelle`,`Zone`,`Dossier`,`Composant`,`Lot`,`Sous-lot`,`Donnée environnementale (DE)`,`ID-DE`,`Quantité`,`Unité (de la DE)`,`DVE`,`Type de DE`,`Commentaires`],S=[`Bâtiment/Parcelle`,`Zone`,`Dossier`,`Composant`,`Lot`,`Sous-lot`,`Donnée environnementale (DE)`,`ID-DE`,`Quantité`,`Unité (de la DE)`,`DVE`,`Type de DE`,`Commentaires`,`Lot personnalisé`],C=[`nomBatiment`,`nomZone`,`dossier`,`descriptionComposant`,`nomLot`,`nomSousLot`,`nomDonneeEnv`,`idDonneeEnv`,`quantite`,`unite`,`dve`,`labelTypeDonneeEnv`,`commentaires`,`nomLotConstructif`],w={nomBatiment:`Bâtiment/Parcelle`,nomZone:`Zone`,dossier:`Dossier`,descriptionComposant:`Composant`,nomLot:`Lot`,nomSousLot:`Sous-lot`,nomDonneeEnv:`Donnée environnementale (DE)`,idDonneeEnv:`ID-DE`,quantite:`Quantité`,unite:`Unité (de la DE)`,dve:`DVE`,labelTypeDonneeEnv:`Type de DE`,commentaires:`Commentaires`,nomLotConstructif:`Lot personnalisé`,externalReferenceID:`Reference externe`,macroComponentID:`Reference macrocomposant`},T={"Lot personalisé":`Lot personnalisé`},E=[`descriptionComposant`],D=`IMPORT_COMPOSANTS`,O=`IMPORT_RSEE`,k={contexteDemandeAjout:null,nomBatiment:null,nomZone:null,dossier:null,descriptionComposant:null,nomLot:null,nomSousLot:null,nomDonneeEnv:null,idDonneeEnv:null,quantite:null,unite:null,dve:null,labelTypeDonneeEnv:null,commentaires:null,nomLotConstructif:null,constructionPrice:null,positionComposant:null,typologieComposant:null,indexComposant:null,ratiosDisponibles:[],indexBat:null,indexZone:null,indexContrib:null,indexLot:null,indexSousLot:null,matchedDonneeEnv:{},modificationsPendantImport:{},import:{criticite:null,typeInsertion:null,codeErreur:[]}};function A(n,i){let s=[];n.children.map(e=>{e.children.map(t=>{t.children[0].children.map(n=>{if(n.data){let i={nomBatiment:e.name,nomZone:t.name,nomLot:o.t(r(n.id)[0].replace(`Lot `,``)),nomSousLot:``};n.data.fiches_fdes.map(e=>{let t=j(i,e);s.push(t)})}n.children&&n.children.map(i=>{let a={nomBatiment:e.name,nomZone:t.name,nomLot:o.t(r(n.id)[0].replace(`Lot `,``)),nomSousLot:o.t(r(i.id)[1])};i.data.fiches_fdes.map(e=>{let t=j(a,e);s.push(t)})})})})}),n.parcelle.children[0].data.fiches_fdes.map(e=>{let t=``,n=``;e.destination&&e.destination!==`parcelle`&&e.destination!==`contributeur5`&&a.includes(e.destination)&&([t,n]=r(e.destination,!0),t=o.t(t),n=n?o.t(n):``);let i=j({nomBatiment:`Parcelle`,nomZone:``,nomLot:t,nomSousLot:n},e);s.push(i)});let c=[];if(i){let n={};return c=s.reduce((r,i)=>{let a=`${i.descriptionComposant}-${i.nomDonneeEnv}-${i.idDonneeEnv}-${i.unite}-${i.dve}-${i.nomLot}-${i.nomSousLot}`;return n[a]?(n[a].quantite=t(n[a].quantite,i.quantite),n[a].nomBatiment!==i.nomBatiment&&(n[a].nomBatiment=``),n[a].nomZone=``):(n[a]={...i},n[a].quantite=e(n[a].quantite),r.push(n[a])),r},[]),c}return s}function j(t,r){let a=r.typologieComposant==`composantINIESFluideFrigorigene`?r.charge_initiale:r.quantity,o={nomBatiment:t.nomBatiment,nomZone:t.nomZone,nomLot:t.nomLot,nomSousLot:t.nomSousLot,descriptionComposant:r.label,commentaires:r.commentaire,nomDonneeEnv:r.name?r.name:``,idDonneeEnv:r.id_INIES||r.id_fiche_configurateur,quantite:e(a),unite:r.unit!==null&&r.unit!==void 0?i.find(e=>e.value==r.unit).label:``,dve:r.dvt,labelTypeDonneeEnv:n(r),nomLotConstructif:r.nomLotConstructif?r.nomLotConstructif:``,constructionPrice:r.constructionPrice?r.constructionPrice:``,macrocomponent:r.macrocomponent?r.macrocomponent:``,externalReferenceID:r.externalReferenceID?r.externalReferenceID:``,constructionUnitaryPrice:r.constructionUnitaryPrice?r.constructionUnitaryPrice:``};return(o.nomLot?.includes(`10`)&&o.nomSousLot===``||o.nomLot?.includes(`11`)&&o.nomSousLot===``||o.nomLot?.includes(`12`)&&o.nomSousLot===``||o.nomLot?.includes(`13`)&&o.nomSousLot===``)&&(o.nomSousLot=t.nomLot),o}function M(e){let t=C,n=S,r=e.map(e=>t.map(t=>e[t])),i=t.map(e=>e===`nomSousLot`?`Obligatoire (sauf pour Parcelle)`:e===`descriptionComposant`?`Obligatoire`:`Optionnel`);return r.unshift(i),r.unshift(n),b(`;`).formatRows(r)}function N(e){let t=C,n=S,r=e.map(e=>t.map(t=>e[t])),i=t.map(e=>e===`nomSousLot`?`Obligatoire (sauf pour Parcelle)`:e===`descriptionComposant`?`Obligatoire`:`Optionnel`);r.unshift(i),r.unshift(n);let a=s.book_new(),o=s.aoa_to_sheet(r);s.book_append_sheet(a,o),c(a,`exportComposantsVizcab.xlsx`)}export{D as a,x as c,k as d,b as f,C as i,E as l,N as n,O as o,A as r,T as s,M as t,w as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.