From 9202c3e93044ae250e5ad1240be72e6491b45dc5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 13:20:44 +0000 Subject: [PATCH] Deploy to GitHub pages --- .nojekyll | 0 assets/RulesSearch-AGDNDU76-B0fJI113.js | 39 + assets/index-BEqDY2_e.css | 1 + assets/index-F_Regecv.js | 1029 +++++++++++++++++++++++ index.html | 49 ++ 5 files changed, 1118 insertions(+) create mode 100644 .nojekyll create mode 100644 assets/RulesSearch-AGDNDU76-B0fJI113.js create mode 100644 assets/index-BEqDY2_e.css create mode 100644 assets/index-F_Regecv.js create mode 100644 index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/assets/RulesSearch-AGDNDU76-B0fJI113.js b/assets/RulesSearch-AGDNDU76-B0fJI113.js new file mode 100644 index 0000000..2e7e252 --- /dev/null +++ b/assets/RulesSearch-AGDNDU76-B0fJI113.js @@ -0,0 +1,39 @@ +import{u as de,r as O,D as fe,j as w,R as ge,a as N}from"./index-F_Regecv.js";function _(t){return Array.isArray?Array.isArray(t):ne(t)==="[object Array]"}const pe=1/0;function me(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-pe?"-0":e}function xe(t){return t==null?"":me(t)}function y(t){return typeof t=="string"}function se(t){return typeof t=="number"}function Me(t){return t===!0||t===!1||Ee(t)&&ne(t)=="[object Boolean]"}function re(t){return typeof t=="object"}function Ee(t){return re(t)&&t!==null}function m(t){return t!=null}function W(t){return!t.trim().length}function ne(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const ye="Incorrect 'index' type",Ie=t=>`Invalid value for key ${t}`,_e=t=>`Pattern length exceeds max of ${t}.`,Se=t=>`Missing ${t} property in key`,Ae=t=>`Property 'weight' in key '${t}' must be a positive integer`,J=Object.prototype.hasOwnProperty;class we{constructor(e){this._keys=[],this._keyMap={};let s=0;e.forEach(r=>{let n=ie(r);this._keys.push(n),this._keyMap[n.id]=n,s+=n.weight}),this._keys.forEach(r=>{r.weight/=s})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ie(t){let e=null,s=null,r=null,n=1,i=null;if(y(t)||_(t))r=t,e=Z(t),s=B(t);else{if(!J.call(t,"name"))throw new Error(Se("name"));const c=t.name;if(r=c,J.call(t,"weight")&&(n=t.weight,n<=0))throw new Error(Ae(c));e=Z(c),s=B(c),i=t.getFn}return{path:e,id:s,weight:n,src:r,getFn:i}}function Z(t){return _(t)?t:t.split(".")}function B(t){return _(t)?t.join("."):t}function be(t,e){let s=[],r=!1;const n=(i,c,o)=>{if(m(i))if(!c[o])s.push(i);else{let h=c[o];const a=i[h];if(!m(a))return;if(o===c.length-1&&(y(a)||se(a)||Me(a)))s.push(xe(a));else if(_(a)){r=!0;for(let l=0,d=a.length;lt.score===e.score?t.idx{this._keysMap[s.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,y(this.docs[0])?this.docs.forEach((e,s)=>{this._addString(e,s)}):this.docs.forEach((e,s)=>{this._addObject(e,s)}),this.norm.clear())}add(e){const s=this.size();y(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let s=e,r=this.size();s{let c=n.getFn?n.getFn(e):this.getFn(e,n.path);if(m(c)){if(_(c)){let o=[];const h=[{nestedArrIndex:-1,value:c}];for(;h.length;){const{nestedArrIndex:a,value:l}=h.pop();if(m(l))if(y(l)&&!W(l)){let d={v:l,i:a,n:this.norm.get(l)};o.push(d)}else _(l)&&l.forEach((d,f)=>{h.push({nestedArrIndex:f,value:d})})}r.$[i]=o}else if(y(c)&&!W(c)){let o={v:c,n:this.norm.get(c)};r.$[i]=o}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function ce(t,e,{getFn:s=u.getFn,fieldNormWeight:r=u.fieldNormWeight}={}){const n=new Q({getFn:s,fieldNormWeight:r});return n.setKeys(t.map(ie)),n.setSources(e),n.create(),n}function $e(t,{getFn:e=u.getFn,fieldNormWeight:s=u.fieldNormWeight}={}){const{keys:r,records:n}=t,i=new Q({getFn:e,fieldNormWeight:s});return i.setKeys(r),i.setIndexRecords(n),i}function F(t,{errors:e=0,currentLocation:s=0,expectedLocation:r=0,distance:n=u.distance,ignoreLocation:i=u.ignoreLocation}={}){const c=e/t.length;if(i)return c;const o=Math.abs(r-s);return n?c+o/n:o?1:c}function Oe(t=[],e=u.minMatchCharLength){let s=[],r=-1,n=-1,i=0;for(let c=t.length;i=e&&s.push([r,n]),r=-1)}return t[i-1]&&i-r>=e&&s.push([r,i-1]),s}const v=32;function je(t,e,s,{location:r=u.location,distance:n=u.distance,threshold:i=u.threshold,findAllMatches:c=u.findAllMatches,minMatchCharLength:o=u.minMatchCharLength,includeMatches:h=u.includeMatches,ignoreLocation:a=u.ignoreLocation}={}){if(e.length>v)throw new Error(_e(v));const l=e.length,d=t.length,f=Math.max(0,Math.min(r,d));let g=i,p=f;const x=o>1||h,R=x?Array(d):[];let I;for(;(I=t.indexOf(e,p))>-1;){let M=F(e,{currentLocation:I,expectedLocation:f,distance:n,ignoreLocation:a});if(g=Math.min(M,g),p=I+l,x){let S=0;for(;S=U;E-=1){let T=E-1,X=s[t.charAt(T)];if(x&&(R[T]=+!!X),C[E]=(C[E+1]<<1|1)&X,M&&(C[E]|=(k[E+1]|k[E])<<1|1|k[E+1]),C[E]&ue&&(L=F(e,{errors:M,currentLocation:T,expectedLocation:f,distance:n,ignoreLocation:a}),L<=g)){if(g=L,p=T,p<=f)break;U=Math.max(1,2*f-p)}}if(F(e,{errors:M+1,currentLocation:f,expectedLocation:f,distance:n,ignoreLocation:a})>g)break;k=C}const D={isMatch:p>=0,score:Math.max(.001,L)};if(x){const M=Oe(R,o);M.length?h&&(D.indices=M):D.isMatch=!1}return D}function Te(t){let e={};for(let s=0,r=t.length;s{this.chunks.push({pattern:f,alphabet:Te(f),startIndex:g})},d=this.pattern.length;if(d>v){let f=0;const g=d%v,p=d-g;for(;f{const{isMatch:I,score:k,indices:L}=je(e,p,x,{location:n+R,distance:i,threshold:c,findAllMatches:o,minMatchCharLength:h,includeMatches:r,ignoreLocation:a});I&&(f=!0),d+=k,I&&L&&(l=[...l,...L])});let g={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(g.indices=l),g}}class b{constructor(e){this.pattern=e}static isMultiMatch(e){return q(e,this.multiRegex)}static isSingleMatch(e){return q(e,this.singleRegex)}search(){}}function q(t,e){const s=t.match(e);return s?s[1]:null}class Fe extends b{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const s=e===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class Pe extends b{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class De extends b{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const s=e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class Ke extends b{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const s=!e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class We extends b{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const s=e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class Be extends b{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const s=!e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class ae extends b{constructor(e,{location:s=u.location,threshold:r=u.threshold,distance:n=u.distance,includeMatches:i=u.includeMatches,findAllMatches:c=u.findAllMatches,minMatchCharLength:o=u.minMatchCharLength,isCaseSensitive:h=u.isCaseSensitive,ignoreLocation:a=u.ignoreLocation}={}){super(e),this._bitapSearch=new oe(e,{location:s,threshold:r,distance:n,includeMatches:i,findAllMatches:c,minMatchCharLength:o,isCaseSensitive:h,ignoreLocation:a})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class he extends b{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let s=0,r;const n=[],i=this.pattern.length;for(;(r=e.indexOf(this.pattern,s))>-1;)s=r+i,n.push([r,s-1]);const c=!!n.length;return{isMatch:c,score:c?0:1,indices:n}}}const z=[Fe,he,De,Ke,Be,We,Pe,ae],ee=z.length,ze=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,He="|";function Ve(t,e={}){return t.split(He).map(s=>{let r=s.trim().split(ze).filter(i=>i&&!!i.trim()),n=[];for(let i=0,c=r.length;i!!(t[P.AND]||t[P.OR]),Ue=t=>!!t[Y.PATH],Xe=t=>!_(t)&&re(t)&&!G(t),te=t=>({[P.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function le(t,e,{auto:s=!0}={}){const r=n=>{let i=Object.keys(n);const c=Ue(n);if(!c&&i.length>1&&!G(n))return r(te(n));if(Xe(n)){const h=c?n[Y.PATH]:i[0],a=c?n[Y.PATTERN]:n[h];if(!y(a))throw new Error(Ie(h));const l={keyId:B(h),pattern:a};return s&&(l.searcher=V(a,e)),l}let o={children:[],operator:i[0]};return i.forEach(h=>{const a=n[h];_(a)&&a.forEach(l=>{o.children.push(r(l))})}),o};return G(t)||(t=te(t)),r(t)}function Je(t,{ignoreFieldNorm:e=u.ignoreFieldNorm}){t.forEach(s=>{let r=1;s.matches.forEach(({key:n,norm:i,score:c})=>{const o=n?n.weight:null;r*=Math.pow(c===0&&o?Number.EPSILON:c,(o||1)*(e?1:i))}),s.score=r})}function Ze(t,e){const s=t.matches;e.matches=[],m(s)&&s.forEach(r=>{if(!m(r.indices)||!r.indices.length)return;const{indices:n,value:i}=r;let c={indices:n,value:i};r.key&&(c.key=r.key.src),r.idx>-1&&(c.refIndex=r.idx),e.matches.push(c)})}function qe(t,e){e.score=t.score}function et(t,e,{includeMatches:s=u.includeMatches,includeScore:r=u.includeScore}={}){const n=[];return s&&n.push(Ze),r&&n.push(qe),t.map(i=>{const{idx:c}=i,o={item:e[c],refIndex:c};return n.length&&n.forEach(h=>{h(i,o)}),o})}class ${constructor(e,s={},r){this.options={...u,...s},this.options.useExtendedSearch,this._keyStore=new we(this.options.keys),this.setCollection(e,r)}setCollection(e,s){if(this._docs=e,s&&!(s instanceof Q))throw new Error(ye);this._myIndex=s||ce(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){m(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const s=[];for(let r=0,n=this._docs.length;r-1&&(h=h.slice(0,s)),et(h,this._docs,{includeMatches:r,includeScore:n})}_searchStringList(e){const s=V(e,this.options),{records:r}=this._myIndex,n=[];return r.forEach(({v:i,i:c,n:o})=>{if(!m(i))return;const{isMatch:h,score:a,indices:l}=s.searchIn(i);h&&n.push({item:i,idx:c,matches:[{score:a,value:i,norm:o,indices:l}]})}),n}_searchLogical(e){const s=le(e,this.options),r=(o,h,a)=>{if(!o.children){const{keyId:d,searcher:f}=o,g=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(h,d),searcher:f});return g&&g.length?[{idx:a,item:h,matches:g}]:[]}const l=[];for(let d=0,f=o.children.length;d{if(m(o)){let a=r(s,o,h);a.length&&(i[h]||(i[h]={idx:h,item:o,matches:[]},c.push(i[h])),a.forEach(({matches:l})=>{i[h].matches.push(...l)}))}}),c}_searchObjectList(e){const s=V(e,this.options),{keys:r,records:n}=this._myIndex,i=[];return n.forEach(({$:c,i:o})=>{if(!m(c))return;let h=[];r.forEach((a,l)=>{h.push(...this._findMatches({key:a,value:c[l],searcher:s}))}),h.length&&i.push({idx:o,item:c,matches:h})}),i}_findMatches({key:e,value:s,searcher:r}){if(!m(s))return[];let n=[];if(_(s))s.forEach(({v:i,i:c,n:o})=>{if(!m(i))return;const{isMatch:h,score:a,indices:l}=r.searchIn(i);h&&n.push({score:a,key:e,value:i,idx:c,norm:o,indices:l})});else{const{v:i,n:c}=s,{isMatch:o,score:h,indices:a}=r.searchIn(i);o&&n.push({score:h,key:e,value:i,norm:c,indices:a})}return n}}$.version="7.0.0";$.createIndex=ce;$.parseIndex=$e;$.config=u;$.parseQuery=le;Qe(Ge);function lt(){const t=de(),e=O.useContext(fe),s=Object.entries(t.getParsedRules()).map(([a,l])=>{var d;return{name:a,title:(d=l==null?void 0:l.rawNode)==null?void 0:d.titre}}),[r,n]=O.useState([]),[i,c]=O.useState(""),o=new $(s,{keys:["title","name"]});O.useEffect(()=>{c("")},[e]),O.useEffect(()=>{const a=o.search(i,{limit:10});n(a.map(l=>l.item))},[i]);const h=r.length===0;return w.jsxs(tt,{id:"documentation-search",children:[w.jsx(st,{id:"documentation-search-input",type:"text",placeholder:"Chercher une règle",value:i,onChange:a=>c(a.target.value),onFocus:a=>c(a.target.value),empty:h}),h?null:w.jsx(rt,{id:"documentation-search-results",children:r.map(({name:a,title:l},d)=>w.jsx(nt,{id:"documentation-search-item",isLast:d===r.length-1,onClick:()=>c(""),children:w.jsx(ge,{dottedName:a,children:w.jsxs(it,{onClick:()=>c(""),children:[w.jsx(ct,{id:"documentation-search-item-name",children:a}),w.jsx(ot,{id:"documentation-search-item-title",children:l})]})})},a))})]})}var tt=N.div` + margin-bottom: 1rem; + margin-right: 1rem; + max-width: 350px; +`,st=N.input` + width: 100%; + padding: 0.5rem; + border: 1px solid #ccc; + border-radius: ${({empty:t})=>t?"5px":"5px 5px 0 0"}; + + &:focus { + outline: none; + border: 1px solid #666; + } +`,rt=N.div` + background-color: white; + border: 1px solid #ccc; + border-top: none; + border-radius: 0 0 0.25rem 0.25rem; + position: relative; +`,nt=N.div` + padding: 0.5rem; + border-bottom: ${({isLast:t})=>t?"none":"1px solid #e6e6e6"}; + border-left: 2px solid transparent; + border-radius: ${({isLast:t})=>t?"0 0 0.25rem 0.25rem":"0"}; + + &:hover { + background-color: #f6f6f6; + } +`,it=N.span` + display: flex; + flex-wrap: wrap; + flex-gap: 0.5rem; + align-items: center; +`,ct=N.span` + width: 100%; +`,ot=N.span` + color: #666; +`;export{lt as default}; diff --git a/assets/index-BEqDY2_e.css b/assets/index-BEqDY2_e.css new file mode 100644 index 0000000..dbc2a00 --- /dev/null +++ b/assets/index-BEqDY2_e.css @@ -0,0 +1 @@ +body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}*{--textColor: #2975d1;--darkerColor: #333350}.App{padding:1rem;margin-bottom:1rem}#documentation-rule-root>p:first-of-type{display:inline-block;background:var(--lighterColor);padding:.4rem .6rem .2rem}header{color:var(--textColor);background:linear-gradient(60deg,var(--darkColor) 0%,var(--color) 100%);padding:.6rem 1rem;box-shadow:0 1px 3px rgba(var(--rgbColor),.12),0 1px 2px rgba(var(--rgbColor),.24);border-radius:.4rem}small{color:inherit}a{color:var(--textColor)}a:hover{color:var(--darkerColor)}h1{color:inherit;margin-top:.6rem;margin-bottom:.6rem}a{text-decoration:none}button{color:inherit}span{background:inherit}small{background:none}li :scope.active .content{background-color:transparent}#documentation-rule-root>article{max-width:800px} diff --git a/assets/index-F_Regecv.js b/assets/index-F_Regecv.js new file mode 100644 index 0000000..683bc61 --- /dev/null +++ b/assets/index-F_Regecv.js @@ -0,0 +1,1029 @@ +var N0=Object.defineProperty;var P0=(e,t,n)=>t in e?N0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ce=(e,t,n)=>P0(e,typeof t!="symbol"?t+"":t,n);function j0(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function hr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qm={exports:{}},is={},Mm={exports:{}},re={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var vo=Symbol.for("react.element"),O0=Symbol.for("react.portal"),A0=Symbol.for("react.fragment"),R0=Symbol.for("react.strict_mode"),_0=Symbol.for("react.profiler"),L0=Symbol.for("react.provider"),I0=Symbol.for("react.context"),T0=Symbol.for("react.forward_ref"),$0=Symbol.for("react.suspense"),z0=Symbol.for("react.memo"),F0=Symbol.for("react.lazy"),Up=Symbol.iterator;function V0(e){return e===null||typeof e!="object"?null:(e=Up&&e[Up]||e["@@iterator"],typeof e=="function"?e:null)}var Um={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Bm=Object.assign,Wm={};function li(e,t,n){this.props=e,this.context=t,this.refs=Wm,this.updater=n||Um}li.prototype.isReactComponent={};li.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};li.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Hm(){}Hm.prototype=li.prototype;function dc(e,t,n){this.props=e,this.context=t,this.refs=Wm,this.updater=n||Um}var fc=dc.prototype=new Hm;fc.constructor=dc;Bm(fc,li.prototype);fc.isPureReactComponent=!0;var Bp=Array.isArray,Km=Object.prototype.hasOwnProperty,mc={current:null},Gm={key:!0,ref:!0,__self:!0,__source:!0};function Qm(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)Km.call(t,r)&&!Gm.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,H=O[F];if(0>>1;Fi(we,x))tei(pe,we)?(O[F]=pe,O[te]=x,F=te):(O[F]=we,O[ae]=x,F=ae);else if(tei(pe,x))O[F]=pe,O[te]=x,F=te;else break e}}return z}function i(O,z){var x=O.sortIndex-z.sortIndex;return x!==0?x:O.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,p=null,f=3,d=!1,b=!1,y=!1,k=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(O){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=O)r(u),z.sortIndex=z.expirationTime,t(l,z);else break;z=n(u)}}function C(O){if(y=!1,v(O),!b)if(n(l)!==null)b=!0,U(P);else{var z=n(u);z!==null&&q(C,z.startTime-O)}}function P(O,z){b=!1,y&&(y=!1,h(A),A=-1),d=!0;var x=f;try{for(v(z),p=n(l);p!==null&&(!(p.expirationTime>z)||O&&!D());){var F=p.callback;if(typeof F=="function"){p.callback=null,f=p.priorityLevel;var H=F(p.expirationTime<=z);z=e.unstable_now(),typeof H=="function"?p.callback=H:p===n(l)&&r(l),v(z)}else r(l);p=n(l)}if(p!==null)var E=!0;else{var ae=n(u);ae!==null&&q(C,ae.startTime-z),E=!1}return E}finally{p=null,f=x,d=!1}}var w=!1,N=null,A=-1,B=5,W=-1;function D(){return!(e.unstable_now()-WO||125F?(O.sortIndex=x,t(u,O),n(l)===null&&O===n(u)&&(y?(h(A),A=-1):y=!0,q(C,x-F))):(O.sortIndex=H,t(l,O),b||d||(b=!0,U(P))),O},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(O){var z=f;return function(){var x=f;f=z;try{return O.apply(this,arguments)}finally{f=x}}}})(eh);Zm.exports=eh;var X0=Zm.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var th=_,yt=X0;function L(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ml=Object.prototype.hasOwnProperty,J0=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Hp={},Kp={};function Z0(e){return Ml.call(Kp,e)?!0:Ml.call(Hp,e)?!1:J0.test(e)?Kp[e]=!0:(Hp[e]=!0,!1)}function ex(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tx(e,t,n,r){if(t===null||typeof t>"u"||ex(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ze(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Be[e]=new Ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Be[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Be[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Be[e]=new Ze(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Be[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Be[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Be[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Be[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Be[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var gc=/[\-:]([a-z])/g;function vc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(gc,vc);Be[t]=new Ze(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(gc,vc);Be[t]=new Ze(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(gc,vc);Be[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Be[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});Be.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Be[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function yc(e,t,n,r){var i=Be.hasOwnProperty(t)?Be[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` +`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Ys=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ji(e):""}function nx(e){switch(e.tag){case 5:return ji(e.type);case 16:return ji("Lazy");case 13:return ji("Suspense");case 19:return ji("SuspenseList");case 0:case 2:case 15:return e=Xs(e.type,!1),e;case 11:return e=Xs(e.type.render,!1),e;case 1:return e=Xs(e.type,!0),e;default:return""}}function Hl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Pr:return"Fragment";case Nr:return"Portal";case Ul:return"Profiler";case xc:return"StrictMode";case Bl:return"Suspense";case Wl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ih:return(e.displayName||"Context")+".Consumer";case rh:return(e._context.displayName||"Context")+".Provider";case bc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case wc:return t=e.displayName||null,t!==null?t:Hl(e.type)||"Memo";case Sn:t=e._payload,e=e._init;try{return Hl(e(t))}catch{}}return null}function rx(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Hl(t);case 8:return t===xc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Mn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ah(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ix(e){var t=ah(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _o(e){e._valueTracker||(e._valueTracker=ix(e))}function sh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ah(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Sa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Kl(e,t){var n=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Qp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Mn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function lh(e,t){t=t.checked,t!=null&&yc(e,"checked",t,!1)}function Gl(e,t){lh(e,t);var n=Mn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ql(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ql(e,t.type,Mn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Yp(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ql(e,t,n){(t!=="number"||Sa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Oi=Array.isArray;function Dr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Lo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Qi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ii={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ox=["Webkit","ms","Moz","O"];Object.keys(Ii).forEach(function(e){ox.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ii[t]=Ii[e]})});function dh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ii.hasOwnProperty(e)&&Ii[e]?(""+t).trim():t+"px"}function fh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=dh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var ax=Se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Jl(e,t){if(t){if(ax[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function Zl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var eu=null;function Ec(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tu=null,qr=null,Mr=null;function Zp(e){if(e=bo(e)){if(typeof tu!="function")throw Error(L(280));var t=e.stateNode;t&&(t=us(t),tu(e.stateNode,e.type,t))}}function mh(e){qr?Mr?Mr.push(e):Mr=[e]:qr=e}function hh(){if(qr){var e=qr,t=Mr;if(Mr=qr=null,Zp(e),t)for(e=0;e>>=0,e===0?32:31-(vx(e)/yx|0)|0}var Io=64,To=4194304;function Ai(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ja(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Ai(s):(o&=a,o!==0&&(r=Ai(o)))}else a=n&~i,a!==0?r=Ai(a):o!==0&&(r=Ai(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function yo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ft(t),e[t]=n}function Ex(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=$i),ld=" ",ud=!1;function Th(e,t){switch(e){case"keyup":return Yx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $h(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jr=!1;function Jx(e,t){switch(e){case"compositionend":return $h(t);case"keypress":return t.which!==32?null:(ud=!0,ld);case"textInput":return e=t.data,e===ld&&ud?null:e;default:return null}}function Zx(e,t){if(jr)return e==="compositionend"||!Ac&&Th(e,t)?(e=Lh(),aa=Pc=On=null,jr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fd(n)}}function Dh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qh(){for(var e=window,t=Sa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Sa(e.document)}return t}function Rc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function l1(e){var t=qh(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Dh(n.ownerDocument.documentElement,n)){if(r!==null&&Rc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=md(n,o);var a=md(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Or=null,su=null,Fi=null,lu=!1;function hd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;lu||Or==null||Or!==Sa(r)||(r=Or,"selectionStart"in r&&Rc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fi&&to(Fi,r)||(Fi=r,r=Ra(su,"onSelect"),0_r||(e.current=mu[_r],mu[_r]=null,_r--)}function he(e,t){_r++,mu[_r]=e.current,e.current=t}var Un={},Qe=Hn(Un),ot=Hn(!1),lr=Un;function Qr(e,t){var n=e.type.contextTypes;if(!n)return Un;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function at(e){return e=e.childContextTypes,e!=null}function La(){xe(ot),xe(Qe)}function Ed(e,t,n){if(Qe.current!==Un)throw Error(L(168));he(Qe,t),he(ot,n)}function Yh(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(L(108,rx(e)||"Unknown",i));return Se({},n,r)}function Ia(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Un,lr=Qe.current,he(Qe,e),he(ot,ot.current),!0}function kd(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=Yh(e,t,lr),r.__reactInternalMemoizedMergedChildContext=e,xe(ot),xe(Qe),he(Qe,e)):xe(ot),he(ot,n)}var on=null,cs=!1,pl=!1;function Xh(e){on===null?on=[e]:on.push(e)}function b1(e){cs=!0,Xh(e)}function Kn(){if(!pl&&on!==null){pl=!0;var e=0,t=ue;try{var n=on;for(ue=1;e>=a,i-=a,an=1<<32-Ft(t)+i|n<A?(B=N,N=null):B=N.sibling;var W=f(h,N,v[A],C);if(W===null){N===null&&(N=B);break}e&&N&&W.alternate===null&&t(h,N),g=o(W,g,A),w===null?P=W:w.sibling=W,w=W,N=B}if(A===v.length)return n(h,N),be&&Yn(h,A),P;if(N===null){for(;AA?(B=N,N=null):B=N.sibling;var D=f(h,N,W.value,C);if(D===null){N===null&&(N=B);break}e&&N&&D.alternate===null&&t(h,N),g=o(D,g,A),w===null?P=D:w.sibling=D,w=D,N=B}if(W.done)return n(h,N),be&&Yn(h,A),P;if(N===null){for(;!W.done;A++,W=v.next())W=p(h,W.value,C),W!==null&&(g=o(W,g,A),w===null?P=W:w.sibling=W,w=W);return be&&Yn(h,A),P}for(N=r(h,N);!W.done;A++,W=v.next())W=d(N,h,A,W.value,C),W!==null&&(e&&W.alternate!==null&&N.delete(W.key===null?A:W.key),g=o(W,g,A),w===null?P=W:w.sibling=W,w=W);return e&&N.forEach(function(S){return t(h,S)}),be&&Yn(h,A),P}function k(h,g,v,C){if(typeof v=="object"&&v!==null&&v.type===Pr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Ro:e:{for(var P=v.key,w=g;w!==null;){if(w.key===P){if(P=v.type,P===Pr){if(w.tag===7){n(h,w.sibling),g=i(w,v.props.children),g.return=h,h=g;break e}}else if(w.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Sn&&Ad(P)===w.type){n(h,w.sibling),g=i(w,v.props),g.ref=Ei(h,w,v),g.return=h,h=g;break e}n(h,w);break}else t(h,w);w=w.sibling}v.type===Pr?(g=ir(v.props.children,h.mode,C,v.key),g.return=h,h=g):(C=ma(v.type,v.key,v.props,null,h.mode,C),C.ref=Ei(h,g,v),C.return=h,h=C)}return a(h);case Nr:e:{for(w=v.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(h,g.sibling),g=i(g,v.children||[]),g.return=h,h=g;break e}else{n(h,g);break}else t(h,g);g=g.sibling}g=xl(v,h.mode,C),g.return=h,h=g}return a(h);case Sn:return w=v._init,k(h,g,w(v._payload),C)}if(Oi(v))return b(h,g,v,C);if(vi(v))return y(h,g,v,C);Mo(h,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,g!==null&&g.tag===6?(n(h,g.sibling),g=i(g,v),g.return=h,h=g):(n(h,g),g=yl(v,h.mode,C),g.return=h,h=g),a(h)):n(h,g)}return k}var Xr=og(!0),ag=og(!1),wo={},Qt=Hn(wo),oo=Hn(wo),ao=Hn(wo);function tr(e){if(e===wo)throw Error(L(174));return e}function Dc(e,t){switch(he(ao,t),he(oo,e),he(Qt,wo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Xl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Xl(t,e)}xe(Qt),he(Qt,t)}function Jr(){xe(Qt),xe(oo),xe(ao)}function sg(e){tr(ao.current);var t=tr(Qt.current),n=Xl(t,e.type);t!==n&&(he(oo,e),he(Qt,n))}function qc(e){oo.current===e&&(xe(Qt),xe(oo))}var Ee=Hn(0);function Da(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var dl=[];function Mc(){for(var e=0;en?n:4,e(!0);var r=fl.transition;fl.transition={};try{e(!1),t()}finally{ue=n,fl.transition=r}}function kg(){return Pt().memoizedState}function S1(e,t,n){var r=Fn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Sg(e))Cg(t,n);else if(n=tg(e,t,n,r),n!==null){var i=Xe();Vt(n,e,r,i),Ng(n,t,r)}}function C1(e,t,n){var r=Fn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Sg(e))Cg(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,qt(s,a)){var l=t.interleaved;l===null?(i.next=i,Fc(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=tg(e,t,i,r),n!==null&&(i=Xe(),Vt(n,e,r,i),Ng(n,t,r))}}function Sg(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function Cg(e,t){Vi=qa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ng(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Sc(e,n)}}var Ma={readContext:Nt,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},N1={readContext:Nt,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:Nt,useEffect:_d,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ca(4194308,4,yg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ca(4194308,4,e,t)},useInsertionEffect:function(e,t){return ca(4,2,e,t)},useMemo:function(e,t){var n=Ut();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ut();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=S1.bind(null,ke,e),[r.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:Rd,useDebugValue:Kc,useDeferredValue:function(e){return Ut().memoizedState=e},useTransition:function(){var e=Rd(!1),t=e[0];return e=k1.bind(null,e[1]),Ut().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ke,i=Ut();if(be){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),qe===null)throw Error(L(349));cr&30||cg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,_d(dg.bind(null,r,o,e),[e]),r.flags|=2048,uo(9,pg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ut(),t=qe.identifierPrefix;if(be){var n=sn,r=an;n=(r&~(1<<32-Ft(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=so++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Ht]=t,e[io]=r,Tg(e,t,!1,!1),t.stateNode=e;e:{switch(a=Zl(n,r),n){case"dialog":ve("cancel",e),ve("close",e),i=r;break;case"iframe":case"object":case"embed":ve("load",e),i=r;break;case"video":case"audio":for(i=0;iei&&(t.flags|=128,r=!0,ki(o,!1),t.lanes=4194304)}else{if(!r)if(e=Da(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ki(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!be)return Ke(t),null}else 2*Ae()-o.renderingStartTime>ei&&n!==1073741824&&(t.flags|=128,r=!0,ki(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ae(),t.sibling=null,n=Ee.current,he(Ee,r?n&1|2:n&1),t):(Ke(t),null);case 22:case 23:return Zc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ft&1073741824&&(Ke(t),t.subtreeFlags&6&&(t.flags|=8192)):Ke(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function I1(e,t){switch(Lc(t),t.tag){case 1:return at(t.type)&&La(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jr(),xe(ot),xe(Qe),Mc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qc(t),null;case 13:if(xe(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));Yr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(Ee),null;case 4:return Jr(),null;case 10:return zc(t.type._context),null;case 22:case 23:return Zc(),null;case 24:return null;default:return null}}var Bo=!1,Ge=!1,T1=typeof WeakSet=="function"?WeakSet:Set,M=null;function $r(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Pe(e,t,r)}else n.current=null}function Nu(e,t,n){try{n()}catch(r){Pe(e,t,r)}}var qd=!1;function $1(e,t){if(uu=Oa,e=qh(),Rc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,p=e,f=null;t:for(;;){for(var d;p!==n||i!==0&&p.nodeType!==3||(s=a+i),p!==o||r!==0&&p.nodeType!==3||(l=a+r),p.nodeType===3&&(a+=p.nodeValue.length),(d=p.firstChild)!==null;)f=p,p=d;for(;;){if(p===e)break t;if(f===n&&++u===i&&(s=a),f===o&&++c===r&&(l=a),(d=p.nextSibling)!==null)break;p=f,f=p.parentNode}p=d}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(cu={focusedElem:e,selectionRange:n},Oa=!1,M=t;M!==null;)if(t=M,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,M=e;else for(;M!==null;){t=M;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var y=b.memoizedProps,k=b.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?y:Tt(t.type,y),k);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(C){Pe(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,M=e;break}M=t.return}return b=qd,qd=!1,b}function Di(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Nu(t,n,o)}i=i.next}while(i!==r)}}function fs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Pu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Fg(e){var t=e.alternate;t!==null&&(e.alternate=null,Fg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ht],delete t[io],delete t[fu],delete t[y1],delete t[x1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Vg(e){return e.tag===5||e.tag===3||e.tag===4}function Md(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ju(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=_a));else if(r!==4&&(e=e.child,e!==null))for(ju(e,t,n),e=e.sibling;e!==null;)ju(e,t,n),e=e.sibling}function Ou(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ou(e,t,n),e=e.sibling;e!==null;)Ou(e,t,n),e=e.sibling}var Me=null,$t=!1;function wn(e,t,n){for(n=n.child;n!==null;)Dg(e,t,n),n=n.sibling}function Dg(e,t,n){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(os,n)}catch{}switch(n.tag){case 5:Ge||$r(n,t);case 6:var r=Me,i=$t;Me=null,wn(e,t,n),Me=r,$t=i,Me!==null&&($t?(e=Me,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Me.removeChild(n.stateNode));break;case 18:Me!==null&&($t?(e=Me,n=n.stateNode,e.nodeType===8?cl(e.parentNode,n):e.nodeType===1&&cl(e,n),Zi(e)):cl(Me,n.stateNode));break;case 4:r=Me,i=$t,Me=n.stateNode.containerInfo,$t=!0,wn(e,t,n),Me=r,$t=i;break;case 0:case 11:case 14:case 15:if(!Ge&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&Nu(n,t,a),i=i.next}while(i!==r)}wn(e,t,n);break;case 1:if(!Ge&&($r(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Pe(n,t,s)}wn(e,t,n);break;case 21:wn(e,t,n);break;case 22:n.mode&1?(Ge=(r=Ge)||n.memoizedState!==null,wn(e,t,n),Ge=r):wn(e,t,n);break;default:wn(e,t,n)}}function Ud(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new T1),t.forEach(function(r){var i=W1.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Ae()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*F1(r/1960))-r,10e?16:e,An===null)var r=!1;else{if(e=An,An=null,Wa=0,oe&6)throw Error(L(331));var i=oe;for(oe|=4,M=e.current;M!==null;){var o=M,a=o.child;if(M.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lAe()-Xc?rr(e,0):Yc|=n),st(e,t)}function Gg(e,t){t===0&&(e.mode&1?(t=To,To<<=1,!(To&130023424)&&(To=4194304)):t=1);var n=Xe();e=dn(e,t),e!==null&&(yo(e,t,n),st(e,n))}function B1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gg(e,n)}function W1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(L(314))}r!==null&&r.delete(t),Gg(e,n)}var Qg;Qg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)nt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nt=!1,_1(e,t,n);nt=!!(e.flags&131072)}else nt=!1,be&&t.flags&1048576&&Jh(t,$a,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;pa(e,t),e=t.pendingProps;var i=Qr(t,Qe.current);Br(t,n),i=Bc(null,t,r,e,i,n);var o=Wc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,at(r)?(o=!0,Ia(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Vc(t),i.updater=ps,t.stateNode=i,i._reactInternals=t,xu(t,r,e,n),t=Eu(null,t,r,!0,o,n)):(t.tag=0,be&&o&&_c(t),Ye(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(pa(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=K1(r),e=Tt(r,e),i){case 0:t=wu(null,t,r,e,n);break e;case 1:t=Fd(null,t,r,e,n);break e;case 11:t=$d(null,t,r,e,n);break e;case 14:t=zd(null,t,r,Tt(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Tt(r,i),wu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Tt(r,i),Fd(e,t,r,i,n);case 3:e:{if(_g(t),e===null)throw Error(L(387));r=t.pendingProps,o=t.memoizedState,i=o.element,ng(e,t),Va(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Zr(Error(L(423)),t),t=Vd(e,t,r,n,i);break e}else if(r!==i){i=Zr(Error(L(424)),t),t=Vd(e,t,r,n,i);break e}else for(mt=Tn(t.stateNode.containerInfo.firstChild),vt=t,be=!0,zt=null,n=ag(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Yr(),r===i){t=fn(e,t,n);break e}Ye(e,t,r,n)}t=t.child}return t;case 5:return sg(t),e===null&&gu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,pu(r,i)?a=null:o!==null&&pu(r,o)&&(t.flags|=32),Rg(e,t),Ye(e,t,a,n),t.child;case 6:return e===null&&gu(t),null;case 13:return Lg(e,t,n);case 4:return Dc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Xr(t,null,r,n):Ye(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Tt(r,i),$d(e,t,r,i,n);case 7:return Ye(e,t,t.pendingProps,n),t.child;case 8:return Ye(e,t,t.pendingProps.children,n),t.child;case 12:return Ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,he(za,r._currentValue),r._currentValue=a,o!==null)if(qt(o.value,a)){if(o.children===i.children&&!ot.current){t=fn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=un(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),vu(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(L(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),vu(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Ye(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Br(t,n),i=Nt(i),r=r(i),t.flags|=1,Ye(e,t,r,n),t.child;case 14:return r=t.type,i=Tt(r,t.pendingProps),i=Tt(r.type,i),zd(e,t,r,i,n);case 15:return Og(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Tt(r,i),pa(e,t),t.tag=1,at(r)?(e=!0,Ia(t)):e=!1,Br(t,n),ig(t,r,i),xu(t,r,i,n),Eu(null,t,r,!0,e,n);case 19:return Ig(e,t,n);case 22:return Ag(e,t,n)}throw Error(L(156,t.tag))};function Yg(e,t){return Eh(e,t)}function H1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function St(e,t,n,r){return new H1(e,t,n,r)}function tp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function K1(e){if(typeof e=="function")return tp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bc)return 11;if(e===wc)return 14}return 2}function Vn(e,t){var n=e.alternate;return n===null?(n=St(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ma(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")tp(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Pr:return ir(n.children,i,o,t);case xc:a=8,i|=8;break;case Ul:return e=St(12,n,t,i|2),e.elementType=Ul,e.lanes=o,e;case Bl:return e=St(13,n,t,i),e.elementType=Bl,e.lanes=o,e;case Wl:return e=St(19,n,t,i),e.elementType=Wl,e.lanes=o,e;case oh:return hs(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rh:a=10;break e;case ih:a=9;break e;case bc:a=11;break e;case wc:a=14;break e;case Sn:a=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=St(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ir(e,t,n,r){return e=St(7,e,r,t),e.lanes=n,e}function hs(e,t,n,r){return e=St(22,e,r,t),e.elementType=oh,e.lanes=n,e.stateNode={isHidden:!1},e}function yl(e,t,n){return e=St(6,e,null,t),e.lanes=n,e}function xl(e,t,n){return t=St(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function G1(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Zs(0),this.expirationTimes=Zs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zs(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function np(e,t,n,r,i,o,a,s,l){return e=new G1(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=St(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vc(o),e}function Q1(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ev)}catch(e){console.error(e)}}ev(),Jm.exports=xt;var tv=Jm.exports;const Xd=hr(tv);var Jd=tv;ql.createRoot=Jd.createRoot,ql.hydrateRoot=Jd.hydrateRoot;var eb=Object.create,ap=Object.defineProperty,tb=Object.getOwnPropertyDescriptor,nv=Object.getOwnPropertyNames,nb=Object.getPrototypeOf,rb=Object.prototype.hasOwnProperty,rv=(e,t)=>function(){return t||(0,e[nv(e)[0]])((t={exports:{}}).exports,t),t.exports},ib=(e,t)=>{for(var n in t)ap(e,n,{get:t[n],enumerable:!0})},ob=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of nv(t))!rb.call(e,i)&&i!==n&&ap(e,i,{get:()=>t[i],enumerable:!(r=tb(t,i))||r.enumerable});return e},iv=(e,t,n)=>(n=e!=null?eb(nb(e)):{},ob(ap(n,"default",{value:e,enumerable:!0}),e)),ab=rv({"../../node_modules/nearley/lib/nearley.js"(e,t){(function(n,r){typeof t=="object"&&t.exports?t.exports=r():n.nearley=r()})(e,function(){function n(c,p,f){return this.id=++n.highestId,this.name=c,this.symbols=p,this.postprocess=f,this}n.highestId=0,n.prototype.toString=function(c){var p=typeof c>"u"?this.symbols.map(u).join(" "):this.symbols.slice(0,c).map(u).join(" ")+" ● "+this.symbols.slice(c).map(u).join(" ");return this.name+" → "+p};function r(c,p,f,d){this.rule=c,this.dot=p,this.reference=f,this.data=[],this.wantedBy=d,this.isComplete=this.dot===c.symbols.length}r.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},r.prototype.nextState=function(c){var p=new r(this.rule,this.dot+1,this.reference,this.wantedBy);return p.left=this,p.right=c,p.isComplete&&(p.data=p.build(),p.right=void 0),p},r.prototype.build=function(){var c=[],p=this;do c.push(p.right.data),p=p.left;while(p.left);return c.reverse(),c},r.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,s.fail))};function i(c,p){this.grammar=c,this.index=p,this.states=[],this.wants={},this.scannable=[],this.completed={}}i.prototype.process=function(c){for(var p=this.states,f=this.wants,d=this.completed,b=0;b0&&p.push(" ^ "+d+" more lines identical to this"),d=0,p.push(" "+k)),f=k}},s.prototype.getSymbolDisplay=function(c){return l(c)},s.prototype.buildFirstStateStack=function(c,p){if(p.indexOf(c)!==-1)return null;if(c.wantedBy.length===0)return[c];var f=c.wantedBy[0],d=[c].concat(p),b=this.buildFirstStateStack(f,d);return b===null?null:[c].concat(b)},s.prototype.save=function(){var c=this.table[this.current];return c.lexerState=this.lexerState,c},s.prototype.restore=function(c){var p=c.index;this.current=p,this.table[p]=c,this.table.splice(p+1),this.lexerState=c.lexerState,this.results=this.finish()},s.prototype.rewind=function(c){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[c])},s.prototype.finish=function(){var c=[],p=this.grammar.start,f=this.table[this.table.length-1];return f.states.forEach(function(d){d.rule.name===p&&d.dot===d.rule.symbols.length&&d.reference===0&&d.data!==s.fail&&c.push(d)}),c.map(function(d){return d.data})};function l(c){var p=typeof c;if(p==="string")return c;if(p==="object"){if(c.literal)return JSON.stringify(c.literal);if(c instanceof RegExp)return"character matching "+c;if(c.type)return c.type+" token";if(c.test)return"token matching "+String(c.test);throw new Error("Unknown symbol type: "+c)}}function u(c){var p=typeof c;if(p==="string")return c;if(p==="object"){if(c.literal)return JSON.stringify(c.literal);if(c instanceof RegExp)return c.toString();if(c.type)return"%"+c.type;if(c.test)return"<"+String(c.test)+">";throw new Error("Unknown symbol type: "+c)}}return{Parser:s,Grammar:o,Rule:n}})}}),sb=rv({"../../node_modules/moo/moo.js"(e,t){(function(n,r){typeof define=="function"&&define.amd?define([],r):typeof t=="object"&&t.exports?t.exports=r():n.moo=r()})(e,function(){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=typeof new RegExp().sticky=="boolean";function o(S){return S&&r.call(S)==="[object RegExp]"}function a(S){return S&&typeof S=="object"&&!o(S)&&!Array.isArray(S)}function s(S){return S.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function l(S){var R=new RegExp("|"+S);return R.exec("").length-1}function u(S){return"("+S+")"}function c(S){if(!S.length)return"(?!)";var R=S.map(function(T){return"(?:"+T+")"}).join("|");return"(?:"+R+")"}function p(S){if(typeof S=="string")return"(?:"+s(S)+")";if(o(S)){if(S.ignoreCase)throw new Error("RegExp /i flag not allowed");if(S.global)throw new Error("RegExp /g flag is implied");if(S.sticky)throw new Error("RegExp /y flag is implied");if(S.multiline)throw new Error("RegExp /m flag is implied");return S.source}else throw new Error("Not a pattern: "+S)}function f(S,R){return S.length>R?S:Array(R-S.length+1).join(" ")+S}function d(S,R){for(var T=S.length,$=0;;){var U=S.lastIndexOf(` +`,T-1);if(U===-1||($++,T=U,$===R)||T===0)break}var q=$0)throw new Error("RegExp has capture groups: "+pe+` +Use (?: … ) instead`);if(!F.lineBreaks&&pe.test(` +`))throw new Error("Rule should declare lineBreaks: "+pe);z.push(u(te))}}var je=T&&T.fallback,We=i&&!je?"ym":"gm",ut=i||je?"":"|";q===!0&&(We+="u");var ct=new RegExp(c(z)+ut,We);return{regexp:ct,groups:O,fast:$,error:T||g}}function C(S){var R=v(h(S));return new A({start:R},"start")}function P(S,R,T){var $=S&&(S.push||S.next);if($&&!T[$])throw new Error("Missing state '"+$+"' (in token '"+S.defaultType+"' of state '"+R+"')");if(S&&S.pop&&+S.pop!=1)throw new Error("pop must be 1 (in token '"+S.defaultType+"' of state '"+R+"')")}function w(S,R){var T=S.$all?h(S.$all):[];delete S.$all;var $=Object.getOwnPropertyNames(S);R||(R=$[0]);for(var U=Object.create(null),q=0;q<$.length;q++){var O=$[q];U[O]=h(S[O]).concat(T)}for(var q=0;q<$.length;q++)for(var O=$[q],z=U[O],x=Object.create(null),F=0;F{var a;const i={SyntaxError:"Erreur syntaxique",EvaluationError:"Erreur d'évaluation",SituationError:"Erreur lors de la mise à jour de la situation",UnknownRule:"Règle inconnue",PrivateRule:"Règle privée"},o=/error/i.test(e);return` +[ ${i[e]??e} ]`+(n&&"dottedName"in n&&((a=n.dottedName)!=null&&a.length)?` +➡️ Dans la règle "${n.dottedName}"`:"")+` +${o?"✖️":"⚠️"} ${t}`+(r?` +`+(o?" ":"ℹ️ ")+r.message:"")},bs=class extends K{constructor(e){super("InternalError",` +Erreur interne du moteur. + +Cette erreur est le signe d'un bug dans publicodes. Pour nous aider à le résoudre, vous pouvez copier ce texte dans un nouveau ticket : https://github.com/betagouv/mon-entreprise/issues/new. + +payload: +${JSON.stringify(e,null,2)} +`,e)}},lb=class extends bs{constructor(e){super(e)}};function ws(e,t,n,r){e.warn(sp("Avertissement",t,n,r))}function Zd(e,t){e.warn(sp("Avertissement",`Cette règle est tagguée comme experimentale. + +Cela veut dire qu'elle peut être modifiée, renommée, ou supprimée sans qu'il n'y ait de changement de version majeure dans l'API. +`,{dottedName:t}))}function ef(e,t,n){if(e.has(t)){e.get(t).add(n);return}e.set(t,new Set([n]))}function ub(e,t){return Object.entries(t).reduce((n,[r,i])=>({...n,[r]:[...n[r]??[],...i]}),e)}var Yt=e=>{const t={};for(const n in e)t[n]=e[n];return t};function po(e,t=!0){function n(r){const i=e(r,n);return i===!1?r:i===void 0?Iu(n,r):t?i:Iu(n,i)}return n}function ov(e){function t(r){switch(e(r,t)){case"continue":Iu(n,r);return;case"stop":return}}const n=r=>(t(r),r);return t}function cb(e,t){const n={};for(const r in t)n[r]=e(t[r]);return n}var Iu=(e,t)=>{switch(t=pb(e,t),t.nodeKind){case"rule":return db(e,t);case"reference":case"constant":return t;case"arrondi":return wb(e,t);case"simplifier unité":case"variable manquante":case"est non applicable":case"est non défini":return mb(e,t);case"barème":case"taux progressif":case"grille":return gb(e,t);case"une possibilité":return vb(e,t);case"durée":return xb(e,t);case"résoudre référence circulaire":return Eb(e,t);case"inversion":return bb(e,t);case"operation":return yb(e,t);case"contexte":return Sb(e,t);case"unité":return Cb(e,t);case"variations":return Nb(e,t);case"replacementRule":return fb(e,t);case"texte":return kb(e,t);case"condition":return Pb(e,t);default:throw new lb(t)}},pb=(e,t)=>{if(!("sourceMap"in t)||!t.sourceMap||!t.sourceMap.args)return t;const n=t.sourceMap,r={};for(const i in n.args){const o=n.args[i];r[i]=Array.isArray(o)?o.map(a=>e(a)):e(o)}return{...t,sourceMap:{...n,args:r}}},db=(e,t)=>{const n=Yt(t);n.suggestions={};for(const r in t.suggestions)n.suggestions[r]=e(t.suggestions[r]);return n.replacements=t.replacements.map(e),n.explanation={ruleDisabledByItsParent:t.explanation.ruleDisabledByItsParent,nullableParent:t.explanation.nullableParent?e(t.explanation.nullableParent):void 0,parents:t.explanation.parents.map(e),valeur:e(t.explanation.valeur)},n},fb=(e,t)=>({...t,definitionRule:e(t.definitionRule),replacedReference:e(t.replacedReference),whiteListedNames:t.whiteListedNames.map(e),blackListedNames:t.blackListedNames.map(e)}),mb=(e,t)=>({...t,explanation:e(t.explanation)});function hb(e,t){return t.map(n=>({...n,...n.plafond&&{plafond:e(n.plafond)},..."montant"in n&&{montant:e(n.montant)},..."taux"in n&&{taux:e(n.taux)}}))}var gb=(e,t)=>({...t,explanation:{assiette:e(t.explanation.assiette),multiplicateur:e(t.explanation.multiplicateur),tranches:hb(e,t.explanation.tranches)}}),vb=(e,t)=>({...t,explanation:t.explanation.map(e)}),yb=(e,t)=>{const n=Yt(t);return n.explanation=[e(t.explanation[0]),e(t.explanation[1])],n},xb=(e,t)=>({...t,explanation:{depuis:e(t.explanation.depuis),"jusqu'à":e(t.explanation["jusqu'à"])}}),bb=(e,t)=>({...t,explanation:{...t.explanation,inversionCandidates:t.explanation.inversionCandidates.map(e)}}),wb=(e,t)=>({...t,explanation:{valeur:e(t.explanation.valeur),arrondi:e(t.explanation.arrondi)}}),Eb=(e,t)=>({...t,explanation:{...t.explanation,valeur:e(t.explanation.valeur)}}),kb=(e,t)=>({...t,explanation:t.explanation.map(n=>typeof n=="string"?n:e(n))}),Sb=(e,t)=>({...t,explanation:{...t.explanation,contexte:t.explanation.contexte.map(([n,r])=>[e(n),e(r)]),valeur:e(t.explanation.valeur)}}),Cb=(e,t)=>{const n=Yt(t);return n.explanation=e(t.explanation),n},Nb=(e,t)=>({...t,explanation:t.explanation.map(({condition:n,consequence:r})=>({condition:e(n),consequence:r&&e(r)}))}),Pb=(e,t)=>{const n=Yt(t);return n.explanation={si:e(t.explanation.si),alors:e(t.explanation.alors),sinon:e(t.explanation.sinon)},n},Ui={constant:e=>e};function $e(e,t){if(Ui??(Ui={}),Ui[e])throw new K("EvaluationError",`Multiple evaluation functions registered for the nodeKind \x1B[4m${e}`,{dottedName:""});Ui[e]=t}var tf={isNullable:void 0,type:void 0};function jb(e,t,n){function r(o){if(!o||typeof o!="object")return tf;if(n.has(o))return n.get(o);n.set(o,tf);const a=i(o);return n.set(o,a),a}function i(o){switch(o.nodeKind){case"barème":case"durée":case"grille":case"taux progressif":return{isNullable:!1,type:"number"};case"est non défini":case"est non applicable":return{isNullable:!1,type:"boolean"};case"constant":return{isNullable:o.isNullable??o.nodeValue===null,type:o.type};case"operation":return{isNullable:["<","<=",">",">=","/","*"].includes(o.operationKind)?r(o.explanation[0]).isNullable||r(o.explanation[1]).isNullable:o.operationKind==="-"?r(o.explanation[0]).isNullable:!1,type:["<","<=",">",">=","=","!=","et","ou"].includes(o.operationKind)?"boolean":"number"};case"inversion":case"replacementRule":case"résoudre référence circulaire":return{isNullable:!1,type:"number"};case"texte":case"une possibilité":return{isNullable:!1,type:"string"};case"contexte":case"rule":case"arrondi":return r(o.explanation.valeur);case"unité":case"simplifier unité":case"variable manquante":return r(o.explanation);case"condition":return{isNullable:[o.explanation.si,o.explanation.alors,o.explanation.sinon].some(a=>r(a).isNullable),type:r(o.explanation.alors).type??r(o.explanation.sinon).type};case"variations":{const a=o.explanation.map(({consequence:s})=>r(s));return{isNullable:a.some(s=>s.isNullable),type:a.map(s=>s.type).find(s=>s!==void 0)}}case"reference":return r(t[o.dottedName])}}return e.forEach(o=>{const a=t[o];r(a),a.explanation.parents.forEach(r)}),n}var Ob=e=>"missingVariables"in e?e.missingVariables:{},av=(e={})=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n+1])),fr=(e={},t={})=>Object.fromEntries([...Object.keys(e),...Object.keys(t)].map(n=>[n,(e[n]??0)+(t[n]??0)])),jt=e=>e.map(Ob).reduce(fr,{}),Xt=e=>({nodeValue:e,type:typeof e,isDefault:!0,nodeKind:"constant"}),yr={nodeKind:"constant",nodeValue:null,missingVariables:{},type:void 0,isNullable:!0},sv={nodeKind:"constant",nodeValue:void 0,missingVariables:{},type:void 0,isNullable:!1},Ga={...sv,type:"number"};function gn(e,t,n){let r,i;function o(a,s){r??(r=Y(n,fo({dottedName:"INLINE_MECANISM"}))),i??(i={});for(const c in t)"par défaut"in t[c]&&(i[c]=Y(t[c]["par défaut"],fo({})));Object.keys(t).length===1&&"valeur"in t&&(a={valeur:a});const l={};for(const c in a)l[c]=Y(a[c],s);const u=po(c=>{if(c.nodeKind!=="reference"||!(c.name in t))return;const p=c.name;if(p in l)return l[p];if(p in i)return i[p];throw new K("SyntaxError",`Il manque la clé '${p} dans le mécanisme ${e}`,{dottedName:p})})(r);return u.sourceMap={mecanismName:e,args:l},u}return o.nom=e,Object.assign(o,"name",{value:`parse${lv(e)}Inline`})}function xr(e,t,n){function r(i,o){Object.keys(t).length===1&&"valeur"in t&&(i={valeur:i});const a={};for(const l in i){const u=i[l];a[l]=Array.isArray(u)?u.map(c=>Y(c,o)):Y(u,o)}const s=Y(n(a),o);return s.sourceMap={mecanismName:e,args:a},s}return r.nom=e,Object.assign(r,"name",{value:`parse${lv(e)}Inline`})}function lv(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()).replace(/\s+/g,"")}var Ab=gn("abattement",{abattement:{},valeur:{}},{"-":["valeur","abattement"],plancher:0}),Rb=gn("applicable si",{"applicable si":{},valeur:{}},{condition:{si:"applicable si != non",alors:"valeur",sinon:yr}}),ln=(e,t=n=>n)=>{if(e.includes(" /")||e.includes("/ "))throw new Error(`L'unité "${e}" ne doit pas contenir d'espace avant et après "/"`);const[n,...r]=e.split("/"),i=a=>Lb(a.split(".").filter(Boolean).map(s=>t(s)));return{numerators:i(n),denominators:r.flatMap(a=>i(a))}},_b=/(\d+)(?!.*[A-Za-z])/g;function uv(e){const t={};return e.forEach(n=>{const r=n.match(_b);if(r!=null){const i=r[0],o=n.split(i)[0];t[o]=(t[o]??0)+ +i}else t[n]=(t[n]??0)+1}),t}function Lb(e){const t=uv(e);return Object.entries(t).flatMap(([n,r])=>Array(r).fill(n))}function Ib(e){const t=uv(e);return Object.entries(t).map(([n,r])=>r>1?`${n}${r}`:n)}var Ko=(e,t,n=r=>r)=>Ib(e.map(r=>n(r,t))).join("."),nf=2;function rt(e,t=nf,n=r=>r){if(e===null||typeof e!="object")return typeof e=="string"?n(e,t):e;const r=Es(e),{numerators:i=[],denominators:o=[]}=r,a=i.length>0,s=o.length>0;return!a&&!s?"":a&&!s?Ko(i,t,n):!a&&s?`/${Ko(o,1,n)}`:`${Ko(i,nf,n)}/${Ko(o,1,n)}`}var Bi={numerators:[],denominators:[]},Nn=(e,t)=>{if(e==="/"){if(t.length!==2)throw new K("InternalError","Infer units of a division with units.length !== 2)",{});return Nn("*",[t[0]||Bi,{numerators:(t[1]||Bi).denominators,denominators:(t[1]||Bi).numerators}])}const n=t.filter(Boolean);if(n.length<=1)return n[0];if(e==="*")return Es({numerators:n.flatMap(r=>(r==null?void 0:r.numerators)??[]),denominators:n.flatMap(r=>(r==null?void 0:r.denominators)??[])});if(e==="-"||e==="+")return t.find(r=>r)},cv=(e,t)=>Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>e[r]===t[r]):e===t,rf=(e,t=cv)=>n=>{const r=n.findIndex(i=>t(i,e));return n.filter((i,o)=>o!==r)},Es=(e,t=cv)=>[...e.numerators,...e.denominators].reduce(({numerators:r,denominators:i},o)=>r.find(a=>t(o,a))&&i.find(a=>t(o,a))?{numerators:rf(o,t)(r),denominators:rf(o,t)(i)}:{numerators:r,denominators:i},e),ha={"mois/an":12,"jour/an":365,"jour/mois":365/12,"trimestre/an":4,"mois/trimestre":3,"jour/trimestre":365/12*3,"€/k€":10**3,"g/kg":10**3,"mg/g":10**3,"mg/kg":10**6,"m/km":10**3,"cm/m":10**2,"mm/cm":10**1,"mm/m":10**3,"cm/km":10**5,"mm/km":10**6};function of(e,t){return ha[`${t}/${e}`]||ha[`${e}/${t}`]&&1/ha[`${e}/${t}`]}function Tu(e,t){let n=100**(t.filter(r=>r==="%").length-e.filter(r=>r==="%").length);return[n]=e.reduce(([r,i],o)=>{const a=i.findIndex(l=>!!of(o,l)),s=of(o,i[a])||1;return[r*s,[...i.slice(0,a+1),...i.slice(a+1)]]},[n,t]),n}var af={"kW.h":"kWh","mn/h":"noeud"};function Tb(e,t){return!e||!t?!1:e===t||e===af[t]||t===af[e]}function Eo(e,t,n){const r=rt(e),i=rt(t);if(!Tb(r,i)&&!zb(e,t))throw new K("EngineError",`Impossible de convertir l'unité '${r}' en '${i}'`,{});if(!n||e===void 0)return n;const[o,a]=sf(e||Bi),[s,l]=sf(t||Bi);return fv(n*a/l*Tu(o.numerators,s.numerators)*Tu(s.denominators,o.denominators))}var pv=$b(ha);function $b(e){return Object.keys(e).reduce((t,n)=>{const[r,i]=n.split("/"),o=t.findIndex(s=>s.has(r)),a=t.findIndex(s=>s.has(i));if(o>-1&&a>-1&&o!==a)throw new K("EngineError",`Invalid ratio ${n}`,{});return o===-1&&a===-1?t.push(new Set([r,i])):o>-1?t[o].add(i):a>-1&&t[a].add(r),t},[])}function dv(e,t){return e===t||pv.some(n=>n.has(e)&&n.has(t))}function fv(e){return+e.toFixed(16)}function mv(e){const{numerators:t,denominators:n}=Es(e,dv);return t.length&&t.every(r=>r==="%")?{numerators:["%"],denominators:n}:hv({numerators:t,denominators:n})}function sf(e,t=1){const n=Tu(e.numerators,e.denominators);return[Es(hv(e),dv),t&&fv(t*n)]}var hv=e=>({numerators:e.numerators.filter(t=>t!=="%"),denominators:e.denominators.filter(t=>t!=="%")});function zb(e,t){if(e==null||t==null)return!0;const n=u=>u.reduce((c,p)=>{const f=pv.findIndex(b=>b.has(p)),d=f===-1?p:""+f;return{...c,[d]:1+(c[d]??0)}},{}),[r,i,o,a]=[e.numerators,e.denominators,t.numerators,t.denominators].map(n),s=u=>[...new Set(u)],l=[r,i,o,a].map(Object.keys).flat();return s(l).every(u=>(r[u]||0)-(i[u]||0)===(o[u]||0)-(a[u]||0)||u==="%")}function lf(e,t){return+e.toFixed(t)}var Fb=function(e){var i;const t=gv(this.evaluateNode(e.explanation.valeur)),n=t.nodeValue;let r=e.explanation.arrondi;if(n!==!1&&(r=this.evaluateNode(r),typeof r.nodeValue=="number"&&!((i=rt(r.unit))!=null&&i.match(/décimales?/))))throw new K("EvaluationError",`L'unité ${rt(r.unit)} de l'arrondi est inconnu. Vous devez utiliser l'unité “décimales”`,{dottedName:this.cache._meta.evaluationRuleStack[0]});return{...e,nodeValue:typeof t.nodeValue!="number"||!("nodeValue"in r)?t.nodeValue:typeof r.nodeValue=="number"?lf(t.nodeValue,r.nodeValue):r.nodeValue===!0?lf(t.nodeValue,0):r.nodeValue===void 0?void 0:t.nodeValue,explanation:{valeur:t,arrondi:r},missingVariables:jt([t,r]),unit:t.unit}};function ks(e,t){return{explanation:{valeur:Y(e.valeur,t),arrondi:Y(e.arrondi,t)},nodeKind:ks.nom}}ks.nom="arrondi";$e(ks.nom,Fb);function gv(e){if(!e.unit)return e;const t=mv(e.unit);return or(t,e)}function or(e,t){return{...t,nodeValue:t.unit&&typeof t.nodeValue=="number"?Eo(t.unit,e,t.nodeValue):t.nodeValue,unit:e}}var bl=({style:e,maximumFractionDigits:t=2,minimumFractionDigits:n=0,language:r})=>i=>{const o=e==="currency"&&t>=2&&n===0&&!Number.isInteger(i)?2:n;return Intl.NumberFormat(r,{style:e,currency:"EUR",maximumFractionDigits:t,minimumFractionDigits:o}).format(i)};function Vb({maximumFractionDigits:e,minimumFractionDigits:t,language:n,formatUnit:r,unit:i,nodeValue:o}){if(typeof o!="number")return o;const a=i?rt(i,o,r):void 0;switch(a){case"€":return bl({style:"currency",maximumFractionDigits:e,minimumFractionDigits:t,language:n})(o);case"%":return bl({style:"percent",maximumFractionDigits:e,language:n})(o/100);default:return bl({style:"decimal",minimumFractionDigits:t,maximumFractionDigits:e,language:n})(o)+(typeof a=="string"?` ${a}`:"")}}function vv(e){return e&&e[0].toUpperCase()+e.slice(1)}var Db={fr:{true:"oui",false:"non"},en:{true:"yes",false:"no"}};function Dn(e,{language:t="fr",displayedUnit:n,formatUnit:r,precision:i=2}={}){let o=typeof e=="number"||typeof e>"u"||e===null?e:e.nodeValue;if(typeof o=="number"&&Number.isNaN(o))return"Erreur dans le calcul du nombre";if(o===void 0)return"Pas encore défini";if(o===null)return"Non applicable";if(typeof o=="string")return o.replace("\\n",` +`);if(typeof o=="boolean")return Db[t][o];if(typeof o=="number"){let a=typeof e=="number"||typeof e>"u"||!("unit"in e)?void 0:e.unit;if(a){const s=gv({unit:a,nodeValue:o});a=s.unit,o=s.nodeValue}return Vb({minimumFractionDigits:0,maximumFractionDigits:i,language:t,formatUnit:r,nodeValue:o,unit:n??a}).trim()}}var Jt={};ib(Jt,{contextNameToDottedName:()=>$u,cyclicDependencies:()=>Gb,decodeRuleName:()=>Jb,disambiguateReference:()=>wv,disambiguateReferenceNode:()=>Fu,encodeRuleName:()=>Xb,findCommonAncestor:()=>bv,getChildrenRules:()=>Zb,isAccessible:()=>Ss,isExperimental:()=>zu,nameLeaf:()=>yv,ruleParent:()=>xv,ruleParents:()=>ko,ruleWithDedicatedDocumentationPage:()=>ew,updateReferencesMapsFromReferenceNode:()=>up});function Ci(e,t){return e!=null&&Object.prototype.hasOwnProperty.call(e,t)}function uf(e){return function(){return e}}var qb="\0",cf="",pf=(e,t)=>{e[t]?e[t]++:e[t]=1},df=(e,t)=>{--e[t]||delete e[t]},_i=(e,t,n,r)=>{let i=""+t,o=""+n;if(!e&&i>o){const a=i;i=o,o=a}return i+cf+o+cf+(r===void 0?qb:r)},Mb=(e,t,n,r)=>{let i=""+t,o=""+n;if(!e&&i>o){const s=i;i=o,o=s}const a={v:i,w:o};return r&&(a.name=r),a},wl=(e,t)=>_i(e,t.v,t.w,t.name),Ub=class{constructor(e={}){Ce(this,"_nodeCount",0);Ce(this,"_edgeCount",0);Ce(this,"_isDirected");Ce(this,"_label");Ce(this,"_defaultNodeLabelFn");Ce(this,"_defaultEdgeLabelFn");Ce(this,"_nodes");Ce(this,"_in");Ce(this,"_preds");Ce(this,"_out");Ce(this,"_sucs");Ce(this,"_edgeObjs");Ce(this,"_edgeLabels");this._isDirected=Ci(e,"directed")?e.directed:!0,this._label=void 0,this._defaultNodeLabelFn=uf(void 0),this._defaultEdgeLabelFn=uf(void 0),this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}setGraph(e){return this._label=e,this}graph(){return this._label}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}setNode(e,t=void 0){return Ci(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}node(e){return this._nodes[e]}hasNode(e){return Ci(this._nodes,e)}successors(e){const t=this._sucs[e];if(t)return Object.keys(t)}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setEdge(e,t,n=void 0,r=void 0){e=""+e,t=""+t;const i=_i(this._isDirected,e,t,r);if(Ci(this._edgeLabels,i))return n!==void 0&&(this._edgeLabels[i]=n),this;this.setNode(e),this.setNode(t),this._edgeLabels[i]=n!==void 0?n:this._defaultEdgeLabelFn(e,t,r);const o=Mb(this._isDirected,e,t,r);return e=o.v,t=o.w,Object.freeze(o),this._edgeObjs[i]=o,pf(this._preds[t],e),pf(this._sucs[e],t),this._in[t][i]=o,this._out[e][i]=o,this._edgeCount++,this}edge(e,t,n){const r=arguments.length===1?wl(this._isDirected,arguments[0]):_i(this._isDirected,e,t,n);return this._edgeLabels[r]}hasEdge(e,t,n){const r=arguments.length===1?wl(this._isDirected,arguments[0]):_i(this._isDirected,e,t,n);return Ci(this._edgeLabels,r)}removeEdge(e,t,n){const r=arguments.length===1?wl(this._isDirected,arguments[0]):_i(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],df(this._preds[t],e),df(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}outEdges(e,t=void 0){const n=this._out[e];if(n){const r=Object.values(n);return t===void 0?r:r.filter(function(i){return i.w===t})}}};function Bb(e){let t=0;const n=[],r={},i=[];function o(a){const s=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(l){Object.prototype.hasOwnProperty.call(r,l)?r[l].onStack&&(s.lowlink=Math.min(s.lowlink,r[l].index)):(o(l),s.lowlink=Math.min(s.lowlink,r[l].lowlink))}),s.lowlink===s.index){const l=[];let u;do u=n.pop(),r[u].onStack=!1,l.push(u);while(a!==u);i.push(l)}}return e.nodes().forEach(function(a){Object.prototype.hasOwnProperty.call(r,a)||o(a)}),i}function Wb(e){return Bb(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}function Hb(e){const t=new Ub;return[...e.entries()].forEach(([n,r])=>{r.forEach(i=>{t.setEdge(n,i)})}),t}function Kb(e,t){var o;function*n(a){let s=a;for(;;)yield t[s++%t.length]}const r=[];for(let a=0;as.length>a.length?a:s)}function Gb(e){const{referencesMaps:t}=ga(e),n=Hb(t.referencesIn),i=Wb(n).map(s=>s.reverse()),o=i.map(s=>Kb(t.referencesIn,s)),a=i.map((s,l)=>Yb(n,s,o[l]));return[o,a]}var Qb=(e,t,n)=>{for(let r=0;r{e.outEdges(i).filter(({w:o})=>t.includes(o)).forEach(({v:o,w:a})=>{r.add(`"${o}" -> "${a}"`+(Qb(n,o,a)?" [color=red]":""))})}),`digraph Cycle { + ${[...r].join(`; + `)}; +}`}var mr=e=>e.split(" . "),lp=e=>e.join(" . "),yv=e=>{var t;return(t=mr(e).slice(-1))==null?void 0:t[0]},Xb=e=>e==null?void 0:e.replace(/\s\.\s/g,"/").replace(/-/g,"‑").replace(/\s/g,"-"),Jb=e=>e.replace(/\//g," . ").replace(/-/g," ").replace(/\u2011/g,"-"),$u=e=>e.endsWith("$SITUATION")?xv(e):e,xv=e=>lp(mr(e).slice(0,-1));function ko(e){return mr(e).slice(0,-1).map((t,n,r)=>lp(r.slice(0,n+1))).reverse()}var Zb=(e,t)=>Object.keys(e).filter(r=>r.startsWith(t)&&mr(r).length===mr(t).length+1);function bv(e,t){const n=mr(e),r=mr(t),i=n.findIndex((o,a)=>r[a]!==o);return i===-1?e:lp(n.slice(0,i))}function Ss(e,t,n){if(!(n in e))throw new K("InternalError",`La règle "${n}" n'existe pas`,{dottedName:n});const r=bv(t,n),i=[n,...ko(n),""];return i.slice(0,Math.max(i.indexOf(r)-1,0)).every(a=>!(a in e)||e[a].private===!1)}function zu(e,t){if(!(t in e))throw new K("InternalError",`La règle "${t}" n'existe pas`,{dottedName:t});return[t,...ko(t)].some(r=>{var i;return r in e&&((i=e[r].rawNode)==null?void 0:i.experimental)==="oui"})}function El(e,t){return e?e+" . "+t:t}function wv(e,t="",n){const r=ko(t);if(r.push(t),n.startsWith("^ . ")){const s=n.match(/^(\^ \. )+/)[0].length/4;n=n.replace(/^(\^ \. )+/,""),r.splice(-s)}const i=r.pop();r.unshift(i),r.push("");const o=r.find(s=>{const l=El(s,n);return!(l in e)||l===t?!1:Ss(e,t,l)});if(o!==void 0)return El(o,n);if(t.endsWith(n))return t;const a=r.map(s=>El(s,n));throw a.every(s=>!(s in e))?new K("SyntaxError",`La référence "${n}" est introuvable. +Vérifiez que l'orthographe et l'espace de nom sont corrects`,{dottedName:$u(t)}):new K("SyntaxError",`La règle "${a.find(s=>s in e)}" n'est pas accessible depuis "${t}". + Cela vient du fait qu'elle est privée ou qu'un de ses parent est privé`,{dottedName:$u(t)})}function ew(e){return e.virtualRule!==!0&&e.type!=="groupe"&&e.type!=="texte"&&e.type!=="paragraphe"&&e.type!=="notification"}function up(e,t,n){e.nodeKind==="reference"&&(ef(t.referencesIn,n??e.contextDottedName,e.dottedName),ef(t.rulesThatUse,e.dottedName,n??e.contextDottedName))}function Fu(e,t){if(e.nodeKind==="reference")return e.dottedName||(e.dottedName=wv(t,e.contextDottedName,e.name),e.title=t[e.dottedName].title,e.acronym=t[e.dottedName].rawNode.acronyme),e}function tw(e,t,n){const r=t.privé==="oui"||e.startsWith("[privé] ");e=e.replace(/^\[privé\] /,"");const i=[n.dottedName,e].filter(Boolean).join(" . "),o=yv(i),a=vv(t.titre??o);if(n.parsedRules[i])throw new K("EvaluationError",`La référence '${i}' a déjà été définie`,{dottedName:i});const s={};for(const p in t)uE.includes(p)&&(s[p]=t[p]);if("formule"in t&&(s.valeur=t.formule),!r&&!i.endsWith("$SITUATION")){s["dans la situation"]=`${i} . $SITUATION`,s.avec=Yt(s.avec)??{};const p=Yt(sv);p.isNullable=t["possiblement non applicable"]==="oui",s.avec["[privé] $SITUATION"]={valeur:p},s["par défaut"]!=null&&(s["par défaut"]={valeur:s["par défaut"],"variable manquante":i})}const l=n.dottedName;n.dottedName=i,n.parsedRules[i]=void 0;const u={valeur:Y(s,n),parents:ko(i).map(p=>({dottedName:p,nodeKind:"reference",contextDottedName:n.dottedName}))},c={};if(t.suggestions)for(const p in t.suggestions)c[p]=Y(t.suggestions[p],n);return n.parsedRules[i]={dottedName:i,replacements:[...pE(t["rend non applicable"],n),...Vv(t.remplace,n)],title:a,private:r,suggestions:c,nodeKind:"rule",explanation:u,rawNode:t,virtualRule:r},n.dottedName=l,n.parsedRules[i]}function Ev(e,t){for(const n in e){let r=e[n];if((typeof r=="string"||typeof r=="number")&&(r={valeur:`${r}`}),typeof r!="object")throw new K("SyntaxError",`Rule ${n} is incorrectly written. Please give it a proper value.`,{dottedName:n});const i=r===null?{}:Yt(r);tw(n,i,t)}}$e("rule",function(t){const{ruleDisabledByItsParent:n,nullableParent:r,parentMissingVariables:i}=kv(this,t);let o={...t.explanation.valeur,nodeValue:null,missingVariables:{}};return n||(this.cache._meta.evaluationRuleStack.filter(s=>s===t.dottedName).length>1?o={nodeValue:void 0}:(this.cache._meta.evaluationRuleStack.unshift(t.dottedName),o=this.evaluateNode(t.explanation.valeur),this.cache._meta.evaluationRuleStack.shift())),o.missingVariables??(o.missingVariables={}),nw(this,t,o),{...o,missingVariables:fr(o.missingVariables,i),...t,explanation:{parents:t.explanation.parents,valeur:o,nullableParent:r,ruleDisabledByItsParent:n}}});function nw(e,t,n){t.private===!0||!Ss(e.context.parsedRules,"",t.dottedName)||n.nodeValue===void 0&&!Object.keys(n.missingVariables).length&&(n.missingVariables[t.dottedName]=1)}function kv(e,t){var o,a,s;if(t.private)return{ruleDisabledByItsParent:!1,parentMissingVariables:{}};const n=e.context.nodesTypes,r=t.explanation.parents.find(l=>{var u,c;return((u=n.get(l))==null?void 0:u.isNullable)||((c=n.get(l))==null?void 0:c.type)==="boolean"});if(!r)return{ruleDisabledByItsParent:!1,parentMissingVariables:{}};if(!e.cache._meta.parentRuleStack.includes(t.dottedName)){e.cache._meta.parentRuleStack.unshift(t.dottedName);let l=Xt(!1);if((o=n.get(r))!=null&&o.isNullable&&(l=e.evaluateNode({nodeKind:"est non applicable",explanation:r})),l.nodeValue!==!0&&((a=n.get(r))==null?void 0:a.type)==="boolean"&&(l=e.evaluateNode({nodeKind:"operation",operator:"=",operationKind:"=",explanation:[r,Xt(!1)]})),e.cache._meta.parentRuleStack.shift(),l.nodeValue===!0)return{ruleDisabledByItsParent:!0,parentMissingVariables:l.missingVariables??{},nullableParent:r}}let i={};if(((s=n.get(r))==null?void 0:s.type)==="boolean"){const l=e.evaluateNode(r);return i=l.missingVariables??{},{ruleDisabledByItsParent:l.nodeValue===!1,parentMissingVariables:i,nullableParent:r}}return{ruleDisabledByItsParent:!1,parentMissingVariables:i,nullableParent:r}}function Sv(e,t){return Ev(e.avec,t),Y(e.valeur,t)}Sv.nom="avec";var cp=(e,t)=>e.map((n,r)=>{if(!n.plafond&&r>e.length)throw new K("SyntaxError",`La tranche n°${r} du barème n'a pas de plafond précisé. Seule la dernière tranche peut ne pas être plafonnée`,{dottedName:""});return{...n,...n.taux!==void 0?{taux:Y(n.taux,t)}:{},...n.montant!==void 0?{montant:Y(n.montant,t)}:{},plafond:"plafond"in n?Y(n.plafond,t):{nodeValue:1/0,nodeKind:"constant",type:"number",isNullable:!1}}});function pp({multiplicateur:e,assiette:t,parsedTranches:n}){return n.reduce(([r,i],o,a)=>{if(i)return[[...r,{...o,isAfterActive:!0}],i];const s=this.evaluateNode(o.plafond),l=r[a-1]?r[a-1].plafond:{nodeValue:0};let u=s.nodeValue===void 0||e.nodeValue===void 0?void 0:s.nodeValue*e.nodeValue;try{u=u===1/0||u===0?u:Eo(Nn("*",[s.unit,e.unit]),t.unit,u)}catch(b){ws(this.context.logger,`L'unité du plafond de la tranche n°${a+1} n'est pas compatible avec celle l'assiette`,{dottedName:this.cache._meta.evaluationRuleStack[0]},b)}const c=r[a-1]?r[a-1].plafondValue:0,p=c===void 0||t.nodeValue===void 0?void 0:c>t.nodeValue,f=[s,t,e,l];if(f.some(b=>b.nodeValue===void 0))return[[...r,{...o,plafond:s,plafondValue:u,plancherValue:c,nodeValue:void 0,isActive:void 0,isAfterActive:p,missingVariables:jt(f)}],!1];if(r[a-1]&&c&&u<=c)throw new K("EvaluationError",`Le plafond de la tranche n°${a+1} a une valeur inférieure à celui de la tranche précédente`,{dottedName:this.cache._meta.evaluationRuleStack[0]});const d={...o,plafond:s,plancherValue:c,plafondValue:u,isAfterActive:p,isActive:t.nodeValue>=c&&t.nodeValue{if(r.isAfterActive)return{...r,nodeValue:0};const i=n(r.taux),o=jt([i,r]);return[t.nodeValue,i.nodeValue,r.plafondValue,r.plancherValue].some(a=>a===void 0)?{...r,taux:i,nodeValue:void 0,missingVariables:o}:{...r,taux:i,..."unit"in t&&{unit:t.unit},nodeValue:(Math.min(t.nodeValue,r.plafondValue)-r.plancherValue)*Eo(i.unit,ln(""),i.nodeValue),missingVariables:o}})}var ow=function(e){const t=this.evaluateNode.bind(this),n=this.evaluateNode(e.explanation.assiette),r=this.evaluateNode(e.explanation.multiplicateur);if(r.nodeValue===0)throw new K("EvaluationError","Le multiplicateur ne peut pas être nul",{dottedName:this.cache._meta.evaluationRuleStack[0]});let i=e.explanation.tranches,o=n.nodeValue;return[0,void 0,null].includes(n.nodeValue)||(i=iw(pp.call(this,{parsedTranches:e.explanation.tranches,assiette:n,multiplicateur:r}),n,t),o=i.reduce((a,{nodeValue:s})=>s==null?void 0:a+s,0)),{...e,nodeValue:o,missingVariables:jt([n,r,...i]),explanation:{assiette:n,multiplicateur:r,tranches:i},unit:n.unit}};$e("barème",ow);var aw=function(e){let t;const n=this.evaluateNode(e.explanation.si);let r=e.explanation.alors,i=e.explanation.sinon;if("unit"in n)throw new K("EvaluationError","La condition doit être de type booléen",{dottedName:this.cache._meta.evaluationRuleStack[0]});if(n.nodeValue===!0)r=this.evaluateNode(e.explanation.alors),r.isActive=!0,t=r;else if(n.nodeValue===!1)i=this.evaluateNode(e.explanation.sinon),t=i;else if(n.nodeValue===null)t=n;else if(n.nodeValue===void 0)i=this.evaluateNode(e.explanation.sinon),r=this.evaluateNode(e.explanation.alors),t={...n,missingVariables:jt([i,r])};else throw new K("EvaluationError","La condition doit être de type booléen",{dottedName:this.cache._meta.evaluationRuleStack[0]});const o=t.unit??r.unit;return{nodeValue:t.nodeValue,missingVariables:fr(av(n.missingVariables),t.missingVariables),...o!=null?{unit:o}:{},...e,explanation:{si:n,alors:r,sinon:i}}};function Cv(e,t){return{explanation:{si:Y(e.si,t),alors:Y(e.alors,t),sinon:Y(e.sinon,t)},nodeKind:"condition"}}Cv.nom="condition";$e("condition",aw);function dp(e,t){const n=Y(e.valeur,t),r=Object.keys(e.contexte).map(o=>[Y(o,t),Y(e.contexte[o],t)]).sort(([o],[a])=>o.name.localeCompare(a.name)),i=lw(JSON.stringify(r));return{explanation:{valeur:n,contexte:r,subEngineId:i},nodeKind:dp.nom}}dp.nom="contexte";var sw=function(e){const t=Object.fromEntries(e.explanation.contexte.filter(([i,o])=>{const a=this.evaluateNode(i),s=this.evaluateNode(o);return a.nodeValue!==s.nodeValue||rt(a.unit)!==rt(s.unit)}).map(([i,o])=>[i.dottedName,o]));if(this.cache._meta.currentContexteSituation===JSON.stringify(t))return{...yr,...e};let n;this.context.subEngines.has(e.explanation.subEngineId)?n=this.context.subEngines.get(e.explanation.subEngineId):(n=this.shallowCopy(),n.context.subEngineId=e.explanation.subEngineId,this.context.subEngines.set(e.explanation.subEngineId,n),Object.keys(t).length&&(n.setSituation(t,{keepPreviousSituation:!0}),Object.entries(t).forEach(([i,o])=>{const a=this.cache.nodes.get(o);if(!a)throw new K("InternalError","The situation should have already been evaluated",{dottedName:this.context.dottedName});const s=n.context.parsedRules[i+" . $SITUATION"];if(!(s!=null&&s.explanation.valeur))throw new K("InternalError","The origin rule should be defined",{dottedName:this.context.dottedName});n.cache.nodes.set(s.explanation.valeur,a)}))),n.cache._meta.currentContexteSituation=JSON.stringify(t);const r=n.evaluateNode(e.explanation.valeur);return{...e,nodeValue:r.nodeValue,explanation:{...e.explanation,valeur:r},missingVariables:r.missingVariables,..."unit"in r&&{unit:r.unit}}};$e("contexte",sw);function lw(e){let t=0;for(let n=0,r=e.length;n+e<10?`0${e}`:""+e;function Pv(e,t,n){const r=new Date(+e,+t-1,+n);if(!+r||r.getDate()!==+n)throw new K("SyntaxError",`La date ${n}/${t}/${e} n'est pas valide`,{dottedName:""});return`${kl(n)}/${kl(t)}/${kl(e)}`}function ti(e){const[t,n,r]=Nv(e).split("/"),i=new Date(+r,+n-1,+t);return i.setMinutes(i.getMinutes()-i.getTimezoneOffset()),i}function uw(e){return Pv(e.getFullYear(),e.getMonth()+1,e.getDate())}function ff(e){return+e.slice(-4)}function mf(e){const[,t,n]=e.split("/");return`01/${(3*Math.floor((Number.parseInt(t,10)-1)/3)+1).toString().padStart(2,"0")}/${n}`}function jv(e,t){return(ti(t).getTime()-ti(e).getTime())/864e5}function Vu(e,t){const[n,r,i]=e.split("/").map(d=>+d),[o,a,s]=t.split("/").map(d=>+d),l=a-r+12*(s-i),u=new Date(i,r,0).getDate(),c=new Date(s,a,0).getDate(),p=(n-1)/u,f=o/c;return l-p+f}function Ov(e,t){const n=jv(e,t),r=c=>c%4===0&&c%100!==0||c%400===0,i=c=>c>=new Date(c.getFullYear(),2,1),o=ti(e),a=ti(t),s=o.getFullYear()+(i(o)?1:0),l=a.getFullYear()+(i(o)?0:-1),u=Array.from({length:l-s+1},(c,p)=>s+p).filter(r).length;return(n-u)/365}function cw(e,t){return Math.floor(Vu(mf(e),mf(t))/3)+1}function pw(e,t){const n="01/"+ff(e),r="01/"+ff(t);return Math.floor(Ov(n,r))+1}var dw=function(e){const t=this.evaluateNode(e.explanation.depuis),n=this.evaluateNode(e.explanation["jusqu'à"]),r=t.nodeValue,i=n.nodeValue;let o;if(r===null||i===null)o=null;else if(r===void 0||i===void 0)o=void 0;else switch(e.unit.numerators[0]){case"jour":o=jv(r,i);break;case"mois":o=Vu(r,i);break;case"an":o=Ov(r,i);break;case"trimestre":o=Vu(r,i)/3;break;case"trimestre civil":o=cw(r,i);break;case"année civile":o=pw(r,i);break}return typeof o=="number"&&(o=Math.max(0,o)),{...e,missingVariables:jt([t,n]),nodeValue:o,explanation:{depuis:t,"jusqu'à":n}}},hf=Xt(uw(new Date)),fw=(e,t)=>{const n={depuis:Y(e.depuis??hf,t),"jusqu'à":Y(e["jusqu'à"]??hf,t)},r=e.unité?ln(e.unité):ln("jour");if(r.denominators.length>0||r.numerators.length>1||!gf.includes(r.numerators[0]))throw new K("SyntaxError",`Seules les unités suivantes sont acceptées pour une durée : ${gf.join(", ")}. + L'unité fournie est: ${r.numerators[0]}`,{dottedName:t.dottedName});return{explanation:n,unit:r,nodeKind:"durée"}};$e("durée",dw);var gf=["mois","jour","an","trimestre","trimestre civil","année civile"];function Av(e,t){return{explanation:Y(e,t),nodeKind:"est non défini"}}Av.nom="est non défini";var mw=gn("est défini",{valeur:{}},{"=":[{"est non défini":"valeur"},"non"]}),hw=gn("est applicable",{valeur:{}},{"=":[{"est non applicable":"valeur"},"non"]}),gw=function(e){const t=this.evaluateNode(e.explanation);let n=!1;return t.nodeValue===void 0&&(n=!0),{...e,nodeValue:n,missingVariables:t.missingVariables,explanation:t}};$e("est non défini",gw);function Rv(e,t){return{explanation:Y(e,t),nodeKind:"est non applicable"}}Rv.nom="est non applicable";var Go=e=>({nodeKind:"est non applicable",explanation:e}),vw=function(e){var r,i,o,a;const t=e.explanation;if(((r=this.context.nodesTypes.get(t))==null?void 0:r.isNullable)===!1&&t.nodeKind!=="rule"&&t.nodeKind!=="reference")return{...e,nodeValue:!1,missingVariables:{}};if(this.cache.nodes.has(t)&&this.cache.nodes.get(t)!==void 0)return{...e,nodeValue:((i=this.cache.nodes.get(t))==null?void 0:i.nodeValue)===null,missingVariables:((o=this.cache.nodes.get(t))==null?void 0:o.missingVariables)??{}};switch(t.nodeKind){case"rule":{const{ruleDisabledByItsParent:s,parentMissingVariables:l}=kv(this,t);if(s)return{...e,nodeValue:!0,missingVariables:l};const u=this.evaluateNode(Go(t.explanation.valeur)),c=fr(l,u.missingVariables);return u.nodeValue===!1&&((a=this.context.nodesTypes.get(this.context.parsedRules[`${t.dottedName} . $SITUATION`]))!=null&&a.isNullable)&&!Object.keys(u.missingVariables).length&&(c[t.dottedName]=1),{...e,nodeValue:u.nodeValue,missingVariables:c}}case"reference":return{...this.evaluateNode(Go(this.context.parsedRules[t.dottedName])),...e};case"condition":return{...this.evaluateNode({...t,explanation:{si:t.explanation.si,alors:Go(t.explanation.alors),sinon:Go(t.explanation.sinon)}}),...e}}const n=this.evaluateNode(t);return{...e,nodeValue:n.nodeValue===void 0?void 0:n.nodeValue===null,missingVariables:n.missingVariables}};$e("est non applicable",vw);function yw(e,t){return{explanation:{assiette:Y(e.assiette,t),multiplicateur:e.multiplicateur?Y(e.multiplicateur,t):Xt(1),tranches:cp(e.tranches,t)},nodeKind:"grille"}}var xw=function(e){var l;const t=this.evaluateNode.bind(this),n=this.evaluateNode(e.explanation.assiette),r=this.evaluateNode(e.explanation.multiplicateur);if(r.nodeValue===0)throw new K("EvaluationError","Le multiplicateur ne peut pas être nul",{dottedName:this.cache._meta.evaluationRuleStack[0]});const i=pp.call(this,{parsedTranches:e.explanation.tranches,assiette:n,multiplicateur:r}).map(u=>{if(u.isActive===!1)return u;const c=t(u.montant);return{...u,montant:c,nodeValue:c.nodeValue,unit:c.unit,missingVariables:jt([c,u])}});let o;const a=i.find(u=>u.isActive);a?o=[a]:i[i.length-1].isAfterActive===!1?o=[{nodeValue:!1}]:o=i.filter(u=>u.isActive===void 0);const s=o[0]?o[0].isActive===void 0?void 0:o[0].nodeValue:!1;return{...e,nodeValue:s,missingVariables:jt([n,r,...o]),explanation:{...e.explanation,assiette:n,multiplicateur:r,tranches:i},unit:((l=o[0])==null?void 0:l.unit)??void 0}};$e("grille",xw);function _v(e,t,n,r=0,i=100,o=0){let a=t,s=n,l=a,u=e(a),c=e(s),p=u,f,d,b,y,k,h;for(;i-- >0;){if(b=s-a,Math.abs(p)=f&&Math.abs(u)>Math.abs(c)){let g,v;const C=l-s;a===l?(g=c/u,y=C*g,k=1-g):(k=u/p,g=c/p,v=c/u,y=v*(C*k*(k-g)-(s-a)*(g-1)),k=(k-1)*(g-1)*(v-1)),y>0?k=-k:y=-y,y<.75*C*k-Math.abs(f*k)/2&&y0?f:-f),a=s,u=c,s+=d,c=e(s),(c>0&&p>0||c<0&&p<0)&&(l=a,p=u),Math.abs(c){if(this.cache._meta.evaluationRuleStack.includes(h.dottedName))return!1;const g=t.evaluateNode(t.context.parsedRules[`${h.dottedName} . $SITUATION`]);return typeof g.nodeValue=="number"&&!(h.dottedName in g.missingVariables)});if(n===void 0)return{...e,nodeValue:void 0,missingVariables:{...Object.fromEntries(e.explanation.inversionCandidates.map(h=>[h.dottedName,1])),[e.explanation.ruleToInverse]:1}};const r=t.evaluateNode(n);let i=0;t.setSituation({[n.dottedName]:Ga},{keepPreviousSituation:!0}),t.cache.traversedVariablesStack=this.cache.traversedVariablesStack?[]:void 0;let o;const a=h=>(i++,t.setSituation({[e.explanation.ruleToInverse]:{nodeValue:h,nodeKind:"constant",type:"number",unit:r.unit}},{keepPreviousSituation:!0}),t.cache.traversedVariablesStack=this.cache.traversedVariablesStack?[]:void 0,o=t.evaluateNode(n),o),s=r.nodeValue;let l;const u=s,p=a(u).nodeValue,f=p>s?.9:1.2,d=p!==void 0?u*s*f/p:2e3,y=a(d).nodeValue,k=this.context.inversionMaxIterations??10;if(p!==void 0||y!==void 0){const h=P=>(P===u?p:P===d?y:a(P).nodeValue)-s,g=y!==void 0&&yp||p>s)?d:p!==void 0&&py||y>s)?u:e.explanation.min,v=y!==void 0&&y>s&&(ys&&(pe.explanation.max)&&(l=void 0)}if(l==null&&(this.cache.inversionFail=!0),this.cache.traversedVariablesStack){const h=this.cache.traversedVariablesStack[0];h&&(o.traversedVariables??[]).forEach(g=>h.add(g))}return{...e,nodeValue:l,unit:r.unit,explanation:{...e.explanation,inversionGoal:n,numberOfIteration:i,inversionFail:this.cache.inversionFail},missingVariables:o.missingVariables}},ww=(e,t)=>{let n=typeof e=="object"&&"avec"in e?e.avec:e;const r=typeof e=="object"&&"min"in e?e.min:-1e6,i=typeof e=="object"&&"max"in e?e.max:1e8,o=typeof e=="object"&&"tolérance d'erreur"in e?e["tolérance d'erreur"]:.1;if(e===null)throw new K("SyntaxError","Il manque les règles avec laquelle effectuer le calcul d'inversion dans le mécanisme `inversion numérique`",{dottedName:t.dottedName});return Array.isArray(n)||(n=[n]),{explanation:{ruleToInverse:t.dottedName,inversionCandidates:n.map(a=>({...Y(a,t)})),min:r,max:i,errorTolerance:o},nodeKind:"inversion"}};$e("inversion",bw);var Ew=xr("le maximum de",{valeur:{type:"liste"}},({valeur:e})=>e.reduce((t,n)=>({condition:{si:{"est non applicable":"$INTERNAL valeur"},alors:"$INTERNAL acc",sinon:{condition:{si:{ou:[{"est non applicable":"$INTERNAL acc"},{">":["$INTERNAL valeur","$INTERNAL acc"]}]},alors:"$INTERNAL valeur",sinon:"$INTERNAL acc"}}},avec:{"[privé] $INTERNAL valeur":{valeur:n},"[privé] $INTERNAL acc":{valeur:t}}}),yr)),kw=xr("le minimum de",{valeur:{type:"liste"}},({valeur:e})=>e.reduce((t,n)=>({condition:{si:{"est non applicable":"$INTERNAL valeur"},alors:"$INTERNAL acc",sinon:{condition:{si:{ou:[{"est non applicable":"$INTERNAL acc"},{"<":["$INTERNAL valeur","$INTERNAL acc"]}]},alors:"$INTERNAL valeur",sinon:"$INTERNAL acc"}}},avec:{"[privé] $INTERNAL valeur":{valeur:n},"[privé] $INTERNAL acc":{valeur:t}}}),yr));function Du(e){return e.reverse().reduce((t,n)=>({"+":[n,t]}),yr)}var Sw=xr("somme",{valeur:{type:"liste"}},({valeur:e})=>Du([...e])),Cw=xr("moyenne",{valeur:{type:"liste"}},({valeur:e})=>{const t=[...e];return{"/":[Du(t),Du(t.map(Nw))]}});function Nw(e){return{"applicable si":{"est applicable":e},valeur:1}}var Pw=gn("non applicable si",{"non applicable si":{},valeur:{}},{condition:{si:"non applicable si = non",alors:"valeur",sinon:yr}}),jw=(e,t)=>(Array.isArray(e)&&(e={possibilités:e}),{...e,explanation:e.possibilités.map(n=>Y(n,t)),context:t.dottedName,nodeKind:"une possibilité"});$e("une possibilité",e=>({...e,missingVariables:{[e.context]:1},nodeValue:void 0}));var Lv={"*":[(e,t)=>e*t,"×"],"/":[(e,t)=>e/t,"∕"],"+":[(e,t)=>e+t],"-":[(e,t)=>e-t,"−"],"<":[(e,t)=>ee<=t,"≤"],">":[(e,t)=>e>t],">=":[(e,t)=>e>=t,"≥"],"=":[(e,t)=>(e??!1)===(t??!1)],"!=":[(e,t)=>(e??!1)!==(t??!1),"≠"],et:[(e,t)=>(e??!1)&&(t??!1)],ou:[(e,t)=>(e??!1)||(t??!1)]},Ow=(e,t)=>(n,r)=>{const i=n.map(o=>Y(o,r));return{...n,nodeKind:"operation",operationKind:e,operator:t||e,explanation:i}},Aw=function(e){var l;let t=this.evaluateNode(e.explanation[0]),n={...e,missingVariables:{}};if(t.nodeValue===null&&["<",">","<=",">=","/","*","-","et"].includes(e.operationKind)||t.nodeValue===0&&["/","*"].includes(e.operationKind)||t.nodeValue===!1&&e.operationKind==="et"||t.nodeValue===!0&&e.operationKind==="ou")return{...n,nodeValue:e.operationKind==="et"?!1:t.nodeValue,missingVariables:t.missingVariables};let r=this.evaluateNode(e.explanation[1]);if(n.explanation=[t,r],e.operationKind==="/"&&r.nodeValue===0)throw new K("EvaluationError","Division by zero",{dottedName:this.cache._meta.evaluationRuleStack[0]});if(r.nodeValue===null&&["<",">","<=",">=","/","*","et"].includes(e.operationKind)||r.nodeValue===0&&["*"].includes(e.operationKind)||r.nodeValue===!1&&e.operationKind==="et"||r.nodeValue===!0&&e.operationKind==="ou")return{...n,nodeValue:e.operationKind==="et"?!1:r.nodeValue,missingVariables:r.missingVariables};n.missingVariables=jt([t,r]),(t.nodeValue===void 0||r.nodeValue===void 0)&&(n={...n,nodeValue:void 0});const i=["+","-"].includes(e.operationKind)&&rt(r.unit)==="%"&&rt(t.unit)!=="%";if(!("nodeValue"in n)&&!["/","*"].includes(e.operationKind)&&!i)try{t.unit&&"unit"in r?r=or(t.unit,r):r.unit&&(t=or(r.unit,t))}catch(u){ws(this.context.logger,`Dans l'expression '${e.operationKind}', la partie gauche (unité: ${rt(t.unit)}) n'est pas compatible avec la partie droite (unité: ${rt(r.unit)})`,{dottedName:this.cache._meta.evaluationRuleStack[0]},u)}const o=Lv[e.operationKind][0],a=t.nodeValue,s=r.nodeValue;if(n.nodeValue="nodeValue"in n?n.nodeValue:["<",">","<=",">=","*","/"].includes(e.operationKind)&&r.nodeValue===null?null:[a,s].every(u=>{var c;return typeof u=="string"&&((c=u.match)==null?void 0:c.call(u,/^[\d]{2}\/[\d]{2}\/[\d]{4}$/))})?o(ti(a).getTime(),ti(s).getTime()):o(a,s),e.operationKind==="*"&&((l=Nn("*",[t.unit,r.unit]))!=null&&l.numerators.includes("%"))){const u=Nn("*",[t.unit,r.unit]),c=n.nodeValue;return{...n,nodeValue:typeof c=="number"?c/100:c,unit:Nn("*",[u,{numerators:[],denominators:["%"]}])}}if(i){const u=Nn("*",[t.unit,r.unit]);return{...n,nodeValue:typeof t.nodeValue=="number"&&typeof r.nodeValue=="number"?t.nodeValue*(1+r.nodeValue/100*(e.operationKind==="-"?-1:1)):n.nodeValue,unit:Nn("*",[u,{numerators:[],denominators:["%"]}])}}return e.operationKind==="*"||e.operationKind==="/"||e.operationKind==="-"||e.operationKind==="+"?{...n,unit:Nn(e.operationKind,[t.unit,r.unit])}:n};$e("operation",Aw);var Rw=Object.fromEntries(Object.entries(Lv).map(([e,[,t]])=>[e,Ow(e,t)])),_w=Rw,Lw=gn("par défaut",{"par défaut":{},valeur:{}},{condition:{si:{"est non défini":"valeur"},alors:"par défaut",sinon:"valeur"}}),Iw=gn("plafond",{plafond:{},valeur:{}},{condition:{si:{et:["plafond != non","valeur > plafond"]},alors:"plafond",sinon:"valeur"}}),Tw=gn("plancher",{plancher:{},valeur:{}},{condition:{si:{et:["plancher != non","valeur < plancher"]},alors:"plancher",sinon:"valeur"}});function $w(e){return e.reduce((t,n)=>({"*":[n,t]}),Xt(1))}var vf=xr("produit",{valeur:{type:"liste"}},({valeur:e})=>({valeur:$w([...e]),"simplifier l'unité":"oui"})),zw=function(e){if(this.cache._meta.evaluationRuleStack.slice(1).includes(e.explanation.ruleToSolve))return{...Ga,...e};let t=0;const n=this.shallowCopy();n.cache._meta.parentRuleStack=[...this.cache._meta.parentRuleStack],n.cache._meta.evaluationRuleStack=[...this.cache._meta.evaluationRuleStack];const r=this.context.inversionMaxIterations??25,i=p=>(t++,n.setSituation({[e.explanation.ruleToSolve]:{...Ga,nodeValue:p}},{keepPreviousSituation:!0}),n.evaluateNode(e.explanation.valeur)),o=Symbol("inversion failed");let a=o;const s=1;let l=i(s);const u=l.nodeValue,c=l.unit;return u!==void 0&&(a=_v(b=>b===s?u-s:(l=i(b),l.nodeValue-b),-1e6,1e8,.5,r,2)),a===o&&(a=void 0,this.cache.inversionFail=!0),a!==void 0&&(l=i(a)),{...e,unit:c,nodeValue:a,explanation:{...e.explanation,valeur:l,numberOfIterations:t},missingVariables:l.missingVariables}};function Iv(e,t){return{explanation:{ruleToSolve:t.dottedName,valeur:Y(e.valeur,t)},nodeKind:"résoudre référence circulaire"}}Iv.nom="résoudre la référence circulaire";$e("résoudre référence circulaire",zw);function Tv(e,t){return{explanation:Y(e.valeur,t),nodeKind:"simplifier unité"}}Tv.nom="simplifier l'unité";$e("simplifier unité",function(t){const n=this.evaluateNode(t.explanation),r=n.nodeValue,i={...n,...t,explanation:n};if(r==null)return i;if(!n.unit)return{...i,unit:n.unit};const o=mv(n.unit);return{...i,nodeValue:typeof r=="number"?Eo(n.unit,o,r):r,unit:o}});var Fw=gn("dans la situation",{valeur:{},"dans la situation":{}},{condition:{si:{"est non défini":"dans la situation"},alors:"valeur",sinon:"dans la situation"}});function Vw(e,t){return{explanation:{assiette:Y(e.assiette,t),multiplicateur:e.multiplicateur?Y(e.multiplicateur,t):Xt(1),tranches:cp(e.tranches,t)},nodeKind:"taux progressif"}}var Dw=function(e){const t=this.evaluateNode.bind(this),n=this.evaluateNode(e.explanation.assiette),r=this.evaluateNode(e.explanation.multiplicateur);if(r.nodeValue===0)throw new K("EvaluationError","Division by zero",{dottedName:""});const i=pp.call(this,{parsedTranches:e.explanation.tranches,assiette:n,multiplicateur:r}),o={...e,explanation:{tranches:i,assiette:n,multiplicateur:r},unit:ln("%")},a=i[i.length-1];if(i.every(({isActive:g})=>g===!1)||a.isActive&&a.plafond.nodeValue===1/0){const g=or(ln("%"),t(a.taux)),{nodeValue:v,missingVariables:C}=g;return a.taux=g,a.nodeValue=v,a.missingVariables=C,{...o,nodeValue:v,missingVariables:C}}if(i.every(({isActive:g})=>g!==!0)||typeof n.nodeValue!="number")return{...o,nodeValue:void 0,missingVariables:jt(i)};const s=i.findIndex(({isActive:g})=>g===!0),l=i[s];l.taux=or(ln("%"),t(l.taux));const u=i[s-1];u&&(u.taux=or(ln("%"),t(u.taux)),u.isActive=!0);const c=u?u.taux:l.taux,p=[c,l.taux];if(p.some(g=>g.nodeValue===void 0))return l.nodeValue=void 0,{...o,nodeValue:void 0,missingVariables:jt(p)};const f=c.nodeValue,d=l.taux.nodeValue,b=l.plancherValue,y=l.plafondValue,k=(d-f)/(y-b),h=f+(n.nodeValue-b)*k;return l.nodeValue=h,{...o,nodeValue:h,missingVariables:{}}};$e("taux progressif",Dw);var fp="texte";function qu(e,t){const n=[];let r=0;for(const{0:i,index:o}of e.matchAll(/{{(.|\n)*?}}/g)){const a=i.slice(2,-2).trim(),s=Y(a,t);n.push(e.substring(r,o),s),r=(o??0)+i.length}return n.push(e.slice(r)),{nodeKind:fp,explanation:n}}qu.nom=fp;$e(fp,function(t){const n=t.explanation.map(r=>typeof r=="string"?r:this.evaluateNode(r));return{...t,explanation:n,missingVariables:jt(t.explanation.filter(r=>typeof r!="string")),nodeValue:n.map(r=>typeof r=="string"?r:Dn(r)).join("")}});var qw=xr("toutes ces conditions",{valeur:{type:"liste"}},({valeur:e})=>e.reduce((t,n)=>({et:[t,n]}),"oui")),Mw=xr("une de ces conditions",{valeur:{type:"liste"}},({valeur:e})=>e.reduce((t,n)=>({ou:[t,n]}),"non"));function Cs(e,t){const n=Y(e.valeur,t),r=ln(e.unité,t.getUnitKey);return{explanation:n,unit:r,nodeKind:Cs.nom}}Cs.nom="unité";$e(Cs.nom,function(t){const n=this.evaluateNode(t.explanation);let r=n.nodeValue;if(r!==null&&"unit"in t)try{r=Eo(n.unit,t.unit,n.nodeValue)}catch(i){ws(this.context.logger,"Erreur lors de la conversion d'unité explicite",{dottedName:this.cache._meta.evaluationRuleStack[0]},i)}return{...t,nodeValue:r,explanation:n,missingVariables:n.missingVariables}});function Ns(e,t){return{missingVariable:e["variable manquante"],nodeKind:Ns.nom,explanation:Y(e.valeur,t)}}Ns.nom="variable manquante";$e(Ns.nom,function(t){const n=this.evaluateNode(t.explanation),r=Object.values(n.missingVariables).reduce((i,o)=>i>o?i:o,0);return{...t,nodeValue:n.nodeValue,unit:n.unit,explanation:n,missingVariables:fr(n.missingVariables,{[t.missingVariable]:r+1})}});function Uw(e,t){return{explanation:e.map(({si:r,alors:i,sinon:o})=>o!==void 0?{consequence:Y(o,t),condition:Xt(!0)}:{consequence:Y(i,t),condition:Y(r,t)}),nodeKind:"variations"}}var Bw=function(e){const[t,n,r]=e.explanation.reduce(([i,o,a,s],{condition:l,consequence:u},c)=>{if(s===!0)return[i,[...o,{condition:l,consequence:u}],a,s];const p=this.evaluateNode(l),f=s===void 0?s:!s&&(p.nodeValue===void 0?void 0:p.nodeValue!==!1&&p.nodeValue!==null);if(f===!1||f===null)return[i,[...o,{condition:p,consequence:u}],a,s];let d;if(p.nodeValue!==!1&&p.nodeValue!==null&&(d=this.evaluateNode(u),a))try{d=or(a,d)}catch(b){ws(this.context.logger,`L'unité de la branche n° ${c+1} du mécanisme 'variations' n'est pas compatible avec celle d'une branche précédente`,{dottedName:this.cache._meta.evaluationRuleStack[0]},b)}return[f&&(d==null?void 0:d.nodeValue),[...o,{condition:p,consequence:d??u}],a||(d==null?void 0:d.unit),s||f]},[null,[],void 0,!1]);return{...e,nodeValue:t,...r!==void 0&&{unit:r},explanation:n,missingVariables:n.reduce((i,{condition:o,consequence:a})=>fr(i,fr(av(o.missingVariables),"nodeValue"in o&&o.nodeValue!==!1&&o.nodeValue!==null?a.missingVariables:{})),{})}};$e("variations",Bw);var Ww=iv(ab()),Qo=([e,,t,,n])=>({[t.value.toLowerCase()]:[e,n]}),Hw=([e,,t])=>({[e]:[Fr([{value:"0"}]),t]}),yf=e=>({variable:e.value}),xf=([{value:e}])=>{},Fr=([{value:e}])=>({constant:{type:"number",nodeValue:parseFloat(e)}}),Kw=e=>({...Fr(e),unité:e[2].value}),bf=([{value:e}])=>({constant:{type:"date",nodeValue:Nv(e)}}),Sl=([{value:e}])=>({constant:{type:"boolean",nodeValue:e==="oui"}}),wf=([{value:e}])=>({constant:{type:"string",nodeValue:e.slice(1,-1)}}),Gw=iv(sb());function Ne(e){return e[0]}var Qw="(?:(?:0?[1-9]|[12][0-9]|3[01])\\/)?(?:0?[1-9]|1[012])\\/\\d{4}",Yw="[a-zA-ZÀ-ſ€$%°]",Xw="[a-zA-ZÀ-ſ0-9',]",Mu=`${Yw}(?:[-']?${Xw}+)*`,Jw="-?(?:[1-9][0-9]+|[0-9])(?:\\.[0-9]+)?",ie=Gw.default.compile({"(":"(",")":")","[":"[","]":"]",comparison:[">","<",">=","<=","=","!="],date:new RegExp(Qw),boolean:["oui","non"],number:new RegExp(Jw),word:new RegExp(Mu),string:[/'.*'/,/".*"/],parentSelector:"^",JSONObject:/{.*}/,additionSubstraction:/[\+-]/,multiplicationDivision:["*","/"],dot:" . ",".":".",space:{match:/[\s]+/,lineBreaks:!0}}),Cr=e=>({value:e.map(t=>t&&t.value).join("")}),Ni=e=>Cr(e.flat()),Zw=ie,eE=[{name:"main",symbols:["Comparison"],postprocess:Ne},{name:"main",symbols:["NumericValue"],postprocess:Ne},{name:"main",symbols:["Date"],postprocess:Ne},{name:"main",symbols:["NonNumericTerminal"],postprocess:Ne},{name:"main",symbols:["JSONObject"],postprocess:Ne},{name:"NumericValue",symbols:["AdditionSubstraction"],postprocess:Ne},{name:"NumericValue",symbols:["Negation"],postprocess:Ne},{name:"NumericTerminal",symbols:["Variable"],postprocess:Ne},{name:"NumericTerminal",symbols:["number"],postprocess:Ne},{name:"Negation",symbols:[{literal:"-"},ie.has("space")?{type:"space"}:space,"Parentheses"],postprocess:Hw},{name:"Parentheses",symbols:[{literal:"("},ie.has("space")?{type:"space"}:space,"NumericValue",ie.has("space")?{type:"space"}:space,{literal:")"}],postprocess:([,,e])=>e},{name:"Parentheses",symbols:[{literal:"("},"NumericValue",{literal:")"}],postprocess:([,e])=>e},{name:"Parentheses",symbols:["NumericTerminal"],postprocess:Ne},{name:"Date",symbols:["Variable"],postprocess:Ne},{name:"Date",symbols:[ie.has("date")?{type:"date"}:bf],postprocess:bf},{name:"Comparison",symbols:["Comparable",ie.has("space")?{type:"space"}:space,ie.has("comparison")?{type:"comparison"}:comparison,ie.has("space")?{type:"space"}:space,"Comparable"],postprocess:Qo},{name:"Comparison",symbols:["Date",ie.has("space")?{type:"space"}:space,ie.has("comparison")?{type:"comparison"}:comparison,ie.has("space")?{type:"space"}:space,"Date"],postprocess:Qo},{name:"Comparable$subexpression$1",symbols:["AdditionSubstraction"]},{name:"Comparable$subexpression$1",symbols:["NonNumericTerminal"]},{name:"Comparable",symbols:["Comparable$subexpression$1"],postprocess:([[e]])=>e},{name:"NonNumericTerminal",symbols:[ie.has("boolean")?{type:"boolean"}:Sl],postprocess:Sl},{name:"NonNumericTerminal",symbols:[ie.has("string")?{type:"string"}:wf],postprocess:wf},{name:"Variable",symbols:["VariableWithoutParentSelector"],postprocess:([e])=>yf(e)},{name:"Variable$ebnf$1",symbols:[]},{name:"Variable$ebnf$1$subexpression$1",symbols:[ie.has("parentSelector")?{type:"parentSelector"}:parentSelector,ie.has("dot")?{type:"dot"}:dot],postprocess:Cr},{name:"Variable$ebnf$1",symbols:["Variable$ebnf$1","Variable$ebnf$1$subexpression$1"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"Variable",symbols:["Variable$ebnf$1","VariableWithoutParentSelector"],postprocess:e=>yf(Ni(e))},{name:"VariableWithoutParentSelector$ebnf$1",symbols:[]},{name:"VariableWithoutParentSelector$ebnf$1$subexpression$1",symbols:[ie.has("dot")?{type:"dot"}:dot,"Words"],postprocess:Cr},{name:"VariableWithoutParentSelector$ebnf$1",symbols:["VariableWithoutParentSelector$ebnf$1","VariableWithoutParentSelector$ebnf$1$subexpression$1"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"VariableWithoutParentSelector",symbols:["Words","VariableWithoutParentSelector$ebnf$1"],postprocess:e=>Ni(e)},{name:"Words$ebnf$1$subexpression$1$ebnf$1",symbols:[ie.has("space")?{type:"space"}:space],postprocess:Ne},{name:"Words$ebnf$1$subexpression$1$ebnf$1",symbols:[],postprocess:function(e){return null}},{name:"Words$ebnf$1$subexpression$1",symbols:["Words$ebnf$1$subexpression$1$ebnf$1","WordOrNumber"],postprocess:Cr},{name:"Words$ebnf$1",symbols:["Words$ebnf$1$subexpression$1"]},{name:"Words$ebnf$1$subexpression$2$ebnf$1",symbols:[ie.has("space")?{type:"space"}:space],postprocess:Ne},{name:"Words$ebnf$1$subexpression$2$ebnf$1",symbols:[],postprocess:function(e){return null}},{name:"Words$ebnf$1$subexpression$2",symbols:["Words$ebnf$1$subexpression$2$ebnf$1","WordOrNumber"],postprocess:Cr},{name:"Words$ebnf$1",symbols:["Words$ebnf$1","Words$ebnf$1$subexpression$2"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"Words",symbols:["WordOrKeyword","Words$ebnf$1"],postprocess:Ni},{name:"Words",symbols:[ie.has("word")?{type:"word"}:Mu],postprocess:Ne},{name:"WordOrKeyword",symbols:[ie.has("word")?{type:"word"}:Mu],postprocess:Ne},{name:"WordOrKeyword",symbols:[ie.has("boolean")?{type:"boolean"}:Sl],postprocess:Ne},{name:"WordOrNumber",symbols:["WordOrKeyword"],postprocess:Ne},{name:"WordOrNumber",symbols:[ie.has("number")?{type:"number"}:Fr],postprocess:Ne},{name:"Unit$ebnf$1",symbols:[]},{name:"Unit$ebnf$1",symbols:["Unit$ebnf$1","UnitNumerator"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"Unit$ebnf$2",symbols:[]},{name:"Unit$ebnf$2",symbols:["Unit$ebnf$2","UnitDenominator"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"Unit",symbols:["Unit$ebnf$1","Unit$ebnf$2"],postprocess:Ni},{name:"UnitNumerator",symbols:["Words"],postprocess:Ne},{name:"UnitNumerator",symbols:[{literal:"."},"UnitNumerator"],postprocess:Cr},{name:"UnitDenominator$ebnf$1",symbols:[]},{name:"UnitDenominator$ebnf$1$subexpression$1",symbols:[ie.has("space")?{type:"space"}:space]},{name:"UnitDenominator$ebnf$1",symbols:["UnitDenominator$ebnf$1","UnitDenominator$ebnf$1$subexpression$1"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"UnitDenominator$ebnf$2",symbols:["UnitNumerator"]},{name:"UnitDenominator$ebnf$2",symbols:["UnitDenominator$ebnf$2","UnitNumerator"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"UnitDenominator",symbols:["UnitDenominator$ebnf$1",{literal:"/"},"UnitDenominator$ebnf$2"],postprocess:Ni},{name:"AdditionSubstraction",symbols:["AdditionSubstraction",ie.has("space")?{type:"space"}:space,ie.has("additionSubstraction")?{type:"additionSubstraction"}:additionSubstraction,ie.has("space")?{type:"space"}:space,"MultiplicationDivision"],postprocess:Qo},{name:"AdditionSubstraction",symbols:["MultiplicationDivision"],postprocess:Ne},{name:"MultiplicationDivision",symbols:["MultiplicationDivision",ie.has("space")?{type:"space"}:space,ie.has("multiplicationDivision")?{type:"multiplicationDivision"}:multiplicationDivision,ie.has("space")?{type:"space"}:space,"Parentheses"],postprocess:Qo},{name:"MultiplicationDivision",symbols:["Parentheses"],postprocess:Ne},{name:"number",symbols:[ie.has("number")?{type:"number"}:Fr],postprocess:Fr},{name:"number$ebnf$1$subexpression$1",symbols:[ie.has("space")?{type:"space"}:space]},{name:"number$ebnf$1",symbols:["number$ebnf$1$subexpression$1"],postprocess:Ne},{name:"number$ebnf$1",symbols:[],postprocess:function(e){return null}},{name:"number",symbols:[ie.has("number")?{type:"number"}:Fr,"number$ebnf$1","Unit"],postprocess:Kw},{name:"JSONObject",symbols:[ie.has("JSONObject")?{type:"JSONObject"}:xf],postprocess:xf}],tE="main",nE={Lexer:Zw,ParserRules:eE,ParserStart:tE},{Grammar:rE,Parser:iE}=Ww.default,oE=rE.fromCompiled(nE),Uu=new iE(oE),aE=Uu.save();function $v(e,t){const n=(e+"").replace(/\s*\n\s*/g," ").trim();try{Uu.restore(aE);const[r]=Uu.feed(n).results;if(r==null)throw new K("InternalError",` +Un problème est survenu lors du parsing de l'expression \`${n}\` : + + le parseur Nearley n'a pas réussi à parser l'expression. +`,{dottedName:t});return r}catch(r){throw r instanceof K?r:new K("SyntaxError",`\`${n}\` n'est pas une expression valide`,{dottedName:t},r)}}function sE(e,t){if(!t.dottedName)throw new K("InternalError","Une référence ne peut pas exister en dehors d'une règle (`context.dottedName` est vide)",{dottedName:e});if(!e)throw new K("SyntaxError","Une référence ne peut pas être vide",{dottedName:t.dottedName});return{nodeKind:"reference",name:e,contextDottedName:t.dottedName}}$e("reference",function(t){if(!t.dottedName)throw new bs(t);const n=this.evaluateNode(this.context.parsedRules[t.dottedName]);return delete n.sourceMap,{...n,...t}});function Y(e,t){if(e==null)throw new K("SyntaxError",` + Une des valeurs de la formule est vide. + Vérifiez que tous les champs à droite des deux points sont remplis`,{dottedName:t.dottedName});if(typeof e=="boolean")throw new K("SyntaxError",` +Les valeurs booléennes true / false ne sont acceptées. +Utilisez leur contrepartie française : 'oui' / 'non'`,{dottedName:t.dottedName});const n=typeof e=="object"?e:$v(e,t.dottedName);return"nodeKind"in n?n:{...lE(n,t),rawNode:e}}function Ef(e,t){if(Array.isArray(e))throw new K("SyntaxError",` +Il manque le nom du mécanisme pour le tableau : [${e.map(a=>`'${a}'`).join(", ")}] +Les mécanisme possibles sont : 'somme', 'le maximum de', 'le minimum de', 'toutes ces conditions', 'une de ces conditions'. + `,{dottedName:t.dottedName});const n=Object.keys(e);if(n.length>1)throw new K("SyntaxError",` +Les mécanismes suivants se situent au même niveau : ${n.map(a=>`'${a}'`).join(", ")} +Cela vient probablement d'une erreur dans l'indentation + `,{dottedName:t.dottedName});if(n.length===0)return{nodeKind:"constant",nodeValue:void 0};const r=n[0],i=e[r],o=Fv[r];if(!o)throw new K("SyntaxError",`Le mécanisme "${r}" est inconnu. + +Vérifiez qu'il n'y ait pas d'erreur dans l'orthographe du nom.`,{dottedName:t.dottedName});try{return o(i,t)}catch(a){throw a instanceof K?a:new K("SyntaxError",r?`➡️ Dans le mécanisme ${r} +${a.message}`:a.message,{dottedName:t.dottedName})}}var zv=[dp,Ns,Sv,Rb,Pw,ks,Cs,Tv,Tw,Iw,Lw,Fw,Iv,Ab];function lE(e,t){const n=zv.find(o=>o.nom in e);if(!n)return Ef(e,t);const{[n.nom]:r,...i}=e;return Ef({[n.nom]:{valeur:i,[n.nom]:r}},t)}var Fv={..._w,...zv.reduce((e,t)=>({[t.nom]:t,...e}),{}),"inversion numérique":ww,"le maximum de":Ew,"le minimum de":kw,"taux progressif":Vw,"toutes ces conditions":qw,"est non défini":Av,"est non applicable":Rv,"est applicable":hw,"est défini":mw,"une de ces conditions":Mw,"une possibilité":jw,condition:Cv,barème:rw,durée:fw,grille:yw,multiplication:vf,produit:vf,somme:Sw,moyenne:Cw,[qu.nom]:qu,valeur:Y,variable:sE,variations:Uw,constant:e=>({type:e.type,fullPrecision:!0,isNullable:e.nodeValue==null,missingVariables:{},nodeValue:e.nodeValue,nodeKind:"constant"})},uE=Object.keys(Fv),cE=0,Yo={};function Vv(e,t){return e?(Array.isArray(e)?e:[e]).map(n=>{typeof n=="string"&&(n={"références à":n});const r=Y(n["références à"],t),[i,o]=[n.dans??[],n["sauf dans"]??[]].map(a=>Array.isArray(a)?a:[a]).map(a=>a.map(s=>Y(s,t)));if(n.priorité!=null&&(typeof n.priorité!="number"||n.priorité<0))throw new K("SyntaxError","La priorité du remplacement doit être un nombre positif",t);return{nodeKind:"replacementRule",rawNode:n,priority:n.priorité,definitionRule:Y(t.dottedName,t),replacedReference:r,replaceByNonApplicable:!1,whiteListedNames:i,blackListedNames:o,remplacementRuleId:cE++}}):[]}function pE(e,t){const n=Vv(e,t);return n.forEach(r=>r.replaceByNonApplicable=!0),n}function dE(e){const t={};for(const n in e){const r=e[n];for(const i of r.replacements){if(!i.replacedReference.dottedName)throw new bs(i);const o=i.replacedReference.dottedName;t[o]=[...t[o]??[],i]}}return t}function fE({newRules:e,previousReplacements:t,parsedRules:n,referencesMaps:r}){const i=dE(e),o=new Set([]);for(const c in i){const p=r.rulesThatUse.get(c)??[];for(const f of p)o.add(f)}const a=new Set(Object.keys(e).filter(c=>[...r.referencesIn.get(c)??new Set].some(p=>(t[p]??[]).length))),s=ub(t,i);if(!a.size&&!o.size)return[n,s];const l=kf(t,r),u=kf(i,r);return a.forEach(c=>{n[c]=l(n[c])}),o.forEach(c=>{n[c]=u(n[c])}),[n,s]}function kf(e,t){return po((n,r)=>{if(n.nodeKind==="replacementRule"||n.nodeKind==="inversion"||n.nodeKind==="une possibilité")return!1;if(n.nodeKind==="contexte")return{...n,explanation:{...n.explanation,valeur:r(n.explanation.valeur),contexte:n.explanation.contexte.map(([i,o])=>[i,r(o)])}};if(n.nodeKind==="reference"){if(!n.dottedName)throw new bs(n);const i=mE(n,e[n.dottedName]??[]);return ov(o=>(up(o,t,n.contextDottedName),"continue"))(i),i}})}function mE(e,t){const n=t.filter(({definitionRule:o})=>o.dottedName!==e.contextDottedName).filter(({whiteListedNames:o})=>!o.length||o.some(a=>e.contextDottedName.startsWith(a.dottedName))).filter(({blackListedNames:o})=>!o.length||o.every(a=>!e.contextDottedName.startsWith(a.dottedName))).reverse().sort((o,a)=>{const s=(a.priority??0)-(o.priority??0);return s!==0?s:a.definitionRule.dottedName.localeCompare(o.definitionRule.dottedName)});if(!n.length)return e;const r=n.map(o=>o.remplacementRuleId).join("-");if(Yo[r])return Yo[r];const i={nodeKind:"variations",explanation:[...n.map(({definitionRule:o,replaceByNonApplicable:a})=>a?{condition:o,consequence:yr}:{condition:hE(o),consequence:o}),{condition:Dv,consequence:e}]};return i.sourceMap={mecanismName:"replacement",args:{applicableReplacements:n,originalNode:e}},Yo[r]=i,Yo[r]}function hE(e){return{nodeKind:"condition",explanation:{si:{nodeKind:"est non applicable",explanation:e},alors:gE,sinon:Dv}}}var Dv=Xt(!0),gE=Xt(!1);function fo(e){return{dottedName:"",logger:console,getUnitKey:t=>t,parsedRules:{},referencesMaps:{referencesIn:new Map,rulesThatUse:new Map},nodesTypes:new WeakMap,rulesReplacements:{},subEngines:new Map,subEngineId:void 0,strict:{situation:!0,noOrphanRule:!0,...e.strict},...e}}function Cl(e){return Object.assign({},e,{parsedRules:Yt(e.parsedRules),referencesMaps:{referencesIn:new Map(e.referencesMaps.referencesIn),rulesThatUse:new Map(e.referencesMaps.rulesThatUse)},subEngines:new Map})}function ga(e,t=fo({})){if(typeof e=="string")throw new K("EngineError","Publicodes does not parse yaml rule sets itself anymore. Please provide a parsed js object. E.g. the `eemeli/yaml` package.",{});const n=Yt(e),r=fo(t),i=r.parsedRules;r.parsedRules={},Ev(n,r);let o={};for(const c in i)o[c]=i[c];for(const c in r.parsedRules)o[c]=r.parsedRules[c];const[a,s]=vE(o,r.parsedRules,r.referencesMaps,!r.strict.noOrphanRule);let l;[o,l]=fE({parsedRules:o,newRules:a,referencesMaps:s,previousReplacements:r.rulesReplacements});const u=jb(Object.keys(a),o,r.nodesTypes);return{parsedRules:o,nodesTypes:u,referencesMaps:s,rulesReplacements:l}}function vE(e,t,n,r){const i=po(s=>Fu(s,e)),o=po(s=>{const l=Fu(s,e);return l&&up(l,n),l});return[cb(s=>{if(s.nodeKind==="replacementRule")return i(s);if(s.nodeKind==="rule"){const l=s.explanation.parents.find(u=>!(u.dottedName in e));if(!r&&l)throw new K("SyntaxError",`La règle parente "${l.dottedName}" n'existe pas`,{dottedName:s.dottedName})}return o(s)},t),n]}function yE(e,t,n,r,i){var o;if(e!==void 0){if(n!==void 0){(o=n.traversedVariables)==null||o.forEach(a=>{var s;return(s=e[0])==null?void 0:s.add(a)});return}i&&e.unshift(new Set),t.nodeKind==="reference"&&t.dottedName&&t.dottedName in r&&e[0].add(t.dottedName)}}function xE(e,t){return!!e&&(e.length===0||t.nodeKind==="rule")}function bE(e,t,n){e!==void 0&&n&&(t.traversedVariables=Array.from(e.shift()??[]),e.length>0&&t.traversedVariables.forEach(r=>{e[0].add(r)}))}function wE(e,t,n){var o,a,s,l,u;const r=typeof n=="string"?$v(n,t):void 0,i=e.getParsedRules();return!(r&&"constant"in r&&r.constant.type==="string"&&!(`${t} . ${r.constant.nodeValue}`in i)&&((o=i[t].rawNode)!=null&&o["une possibilité"]||(s=(a=i[t].rawNode)==null?void 0:a.formule)!=null&&s["une possibilité"]||(u=(l=i[t].rawNode)==null?void 0:l.valeur)!=null&&u["une possibilité"]))}var Xo=()=>({_meta:{evaluationRuleStack:[],parentRuleStack:[]},traversedVariablesStack:void 0,nodes:new Map}),EE=class qv{constructor(t={},n={}){Ce(this,"baseContext");Ce(this,"context");Ce(this,"publicParsedRules");Ce(this,"publicSituation");Ce(this,"cache",Xo());Ce(this,"checkExperimentalRule",ov(t=>(t.nodeKind==="reference"&&zu(this.context.parsedRules,t.dottedName)&&Zd(this.baseContext.logger,t.dottedName),"continue")));const r=n.strict??!0,i={dottedName:"",...n,strict:typeof r=="boolean"?{situation:r,noOrphanRule:n.allowOrphanRules===!0?!1:r}:r};this.baseContext=fo({...i,...ga(t,i)}),this.context=this.baseContext,this.publicParsedRules={};for(const o in this.baseContext.parsedRules){const a=this.baseContext.parsedRules[o];!a.private&&Ss(this.baseContext.parsedRules,"",o)&&(this.publicParsedRules[o]=a)}this.publicSituation={}}resetCache(){this.cache=Xo()}setSituation(t={},n={}){this.resetCache();const r=n.keepPreviousSituation??!1,i=n.strict??this.baseContext.strict.situation??!0;let o=Object.entries(t).filter(([s,l])=>{const u=this.checkSituationRule(s,l);if(!u)return!0;if(i)throw u;return this.baseContext.logger.error(u.message),!1});const a=this.context;if(r||(this.context=Cl(this.baseContext),this.publicSituation={}),i){const s=this.parseSituationRules(o);if(s)throw this.context=a,s}else o=o.filter(s=>{const l=this.parseSituationRules([s]);return l&&this.baseContext.logger.error(l.message),!l});return this.publicSituation=Object.assign(this.publicSituation,Object.fromEntries(o)),Object.keys(this.publicSituation).forEach(s=>{zu(this.context.parsedRules,s)&&Zd(this.baseContext.logger,s),this.checkExperimentalRule(this.context.parsedRules[`${s} . $SITUATION`])}),this}inversionFail(){return!!this.cache.inversionFail}getRule(t){if(!(t in this.baseContext.parsedRules))throw new K("UnknownRule",`La règle '${t}' n'existe pas`,{dottedName:t});if(!(t in this.publicParsedRules))throw new K("PrivateRule",`La règle ${t} est une règle privée.`,{dottedName:t});return this.publicParsedRules[t]}getParsedRules(){return this.publicParsedRules}getSituation(){return this.publicSituation}evaluate(t){const n=this.cache.nodes.get(t);if(n)return n;this.context=Object.assign(this.context,ga({"[privé] $EVALUATION":t&&typeof t=="object"&&"nodeKind"in t?{valeur:t}:t},this.context)),this.checkExperimentalRule(this.context.parsedRules.$EVALUATION),this.cache._meta=Xo()._meta;const r=this.evaluateNode(this.context.parsedRules.$EVALUATION.explanation.valeur);return this.cache.nodes.set(t,r),r}evaluateNode(t){const n=this.cache.nodes.get(t);let r=!1;if(this.cache.traversedVariablesStack&&(r=xE(this.cache.traversedVariablesStack,t),yE(this.cache.traversedVariablesStack,t,n,this.publicParsedRules,r)),n!==void 0)return n;if(!Ui[t.nodeKind])throw new K("EvaluationError",`Unknown "nodeKind": ${t.nodeKind}`,{dottedName:""});const i=Ui[t.nodeKind].call(this,t);return this.cache.traversedVariablesStack&&bE(this.cache.traversedVariablesStack,i,r),this.cache.nodes.set(t,i),i}shallowCopy(){const t=new qv;return t.baseContext=Cl(this.baseContext),t.context=Cl(this.context),t.publicParsedRules=this.publicParsedRules,t.publicSituation=Yt(this.publicSituation),t.cache={...Xo(),nodes:new Map(this.cache.nodes)},t}checkSituationRule(t,n){if(!(t in this.baseContext.parsedRules)){const r=`'${t}' n'existe pas dans la base de règle.`;return new K("SituationError",r,{dottedName:t})}if(this.baseContext.parsedRules[t].private){const r=`La règle ${t} est une règle privée.`;return new K("SituationError",r,{dottedName:t})}if(!wE(this,t,n)){const r=`La valeur ${n} ne fait pas parti des possibilités listées dans la base de règles.`;return new K("SituationError",r,{dottedName:t})}return!1}parseSituationRules(t){const n=Object.fromEntries(t.map(([r,i])=>[`[privé] ${r} . $SITUATION`,i&&typeof i=="object"&&"nodeKind"in i?{valeur:i}:i]));try{const r=ga(n,this.context);return this.context=Object.assign(this.context,r),!1}catch(r){return new K("SituationError",r.message,{dottedName:r.dottedName})}}},kE=EE;const SE="modulepreload",CE=function(e){return"/"+e},Sf={},NE=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(s=>{if(s=CE(s),s in Sf)return;Sf[s]=!0;const l=s.endsWith(".css"),u=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${u}`))return;const c=document.createElement("link");if(c.rel=l?"stylesheet":SE,l||(c.as="script",c.crossOrigin=""),c.href=s,a&&c.setAttribute("nonce",a),document.head.appendChild(c),l)return new Promise((p,f)=>{c.addEventListener("load",p),c.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${s}`)))})}))}return i.then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})};var it=function(){return it=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0?De(pi,--Ot):0,ri--,Le===10&&(ri=1,js--),Le}function Dt(){return Le=Ot2||Wu(Le)>3?"":" "}function $E(e,t){for(;--t&&Dt()&&!(Le<48||Le>102||Le>57&&Le<65||Le>70&&Le<97););return As(e,ya()+(t<6&&ar()==32&&Dt()==32))}function Hu(e){for(;Dt();)switch(Le){case e:return Ot;case 34:case 39:e!==34&&e!==39&&Hu(Le);break;case 40:e===41&&Hu(e);break;case 92:Dt();break}return Ot}function zE(e,t){for(;Dt()&&e+Le!==57;)if(e+Le===84&&ar()===47)break;return"/*"+As(t,Ot-1)+"*"+hp(e===47?e:Dt())}function FE(e){for(;!Wu(ar());)Dt();return As(e,Ot)}function VE(e){return IE(xa("",null,null,null,[""],e=LE(e),0,[0],e))}function xa(e,t,n,r,i,o,a,s,l){for(var u=0,c=0,p=a,f=0,d=0,b=0,y=1,k=1,h=1,g=0,v="",C=i,P=o,w=r,N=v;k;)switch(b=g,g=Dt()){case 40:if(b!=108&&De(N,p-1)==58){va(N+=Z(Nl(g),"&","&\f"),"&\f",Bv(u?s[u-1]:0))!=-1&&(h=-1);break}case 34:case 39:case 91:N+=Nl(g);break;case 9:case 10:case 13:case 32:N+=TE(b);break;case 92:N+=$E(ya()-1,7);continue;case 47:switch(ar()){case 42:case 47:Li(DE(zE(Dt(),ya()),t,n,l),l);break;default:N+="/"}break;case 123*y:s[u++]=Wt(N)*h;case 125*y:case 59:case 0:switch(g){case 0:case 125:k=0;case 59+c:h==-1&&(N=Z(N,/\f/g,"")),d>0&&Wt(N)-p&&Li(d>32?Pf(N+";",r,n,p-1,l):Pf(Z(N," ","")+";",r,n,p-2,l),l);break;case 59:N+=";";default:if(Li(w=Nf(N,t,n,u,c,i,s,v,C=[],P=[],p,o),o),g===123)if(c===0)xa(N,t,w,w,C,o,p,s,P);else switch(f===99&&De(N,3)===110?100:f){case 100:case 108:case 109:case 115:xa(e,w,w,r&&Li(Nf(e,w,w,0,0,i,s,v,i,C=[],p,P),P),i,P,p,s,r?C:P);break;default:xa(N,w,w,w,[""],P,0,s,P)}}u=c=d=0,y=h=1,v=N="",p=a;break;case 58:p=1+Wt(N),d=b;default:if(y<1){if(g==123)--y;else if(g==125&&y++==0&&_E()==125)continue}switch(N+=hp(g),g*y){case 38:h=c>0?1:(N+="\f",-1);break;case 44:s[u++]=(Wt(N)-1)*h,h=1;break;case 64:ar()===45&&(N+=Nl(Dt())),f=ar(),c=p=Wt(v=N+=FE(ya())),g++;break;case 45:b===45&&Wt(N)==2&&(y=0)}}return o}function Nf(e,t,n,r,i,o,a,s,l,u,c,p){for(var f=i-1,d=i===0?o:[""],b=Hv(d),y=0,k=0,h=0;y0?d[g]+" "+v:Z(v,/&\f/g,d[g])))&&(l[h++]=C);return Os(e,t,n,i===0?Ps:s,l,u,c,p)}function DE(e,t,n,r){return Os(e,t,n,Mv,hp(RE()),ni(e,2,-2),0,r)}function Pf(e,t,n,r,i){return Os(e,t,n,mp,ni(e,0,r),ni(e,r+1,-1),r,i)}function Gv(e,t,n){switch(OE(e,t)){case 5103:return le+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return le+e+e;case 4789:return Wi+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return le+e+Wi+e+ye+e+e;case 5936:switch(De(e,t+11)){case 114:return le+e+ye+Z(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return le+e+ye+Z(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return le+e+ye+Z(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return le+e+ye+e+e;case 6165:return le+e+ye+"flex-"+e+e;case 5187:return le+e+Z(e,/(\w+).+(:[^]+)/,le+"box-$1$2"+ye+"flex-$1$2")+e;case 5443:return le+e+ye+"flex-item-"+Z(e,/flex-|-self/g,"")+(rn(e,/flex-|baseline/)?"":ye+"grid-row-"+Z(e,/flex-|-self/g,""))+e;case 4675:return le+e+ye+"flex-line-pack"+Z(e,/align-content|flex-|-self/g,"")+e;case 5548:return le+e+ye+Z(e,"shrink","negative")+e;case 5292:return le+e+ye+Z(e,"basis","preferred-size")+e;case 6060:return le+"box-"+Z(e,"-grow","")+le+e+ye+Z(e,"grow","positive")+e;case 4554:return le+Z(e,/([^-])(transform)/g,"$1"+le+"$2")+e;case 6187:return Z(Z(Z(e,/(zoom-|grab)/,le+"$1"),/(image-set)/,le+"$1"),e,"")+e;case 5495:case 3959:return Z(e,/(image-set\([^]*)/,le+"$1$`$1");case 4968:return Z(Z(e,/(.+:)(flex-)?(.*)/,le+"box-pack:$3"+ye+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+le+e+e;case 4200:if(!rn(e,/flex-|baseline/))return ye+"grid-column-align"+ni(e,t)+e;break;case 2592:case 3360:return ye+Z(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,rn(r.props,/grid-\w+-end/)})?~va(e+(n=n[t].value),"span",0)?e:ye+Z(e,"-start","")+e+ye+"grid-row-span:"+(~va(n,"span",0)?rn(n,/\d+/):+rn(n,/\d+/)-+rn(e,/\d+/))+";":ye+Z(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return rn(r.props,/grid-\w+-start/)})?e:ye+Z(Z(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Z(e,/(.+)-inline(.+)/,le+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Wt(e)-1-t>6)switch(De(e,t+1)){case 109:if(De(e,t+4)!==45)break;case 102:return Z(e,/(.+:)(.+)-([^]+)/,"$1"+le+"$2-$3$1"+Wi+(De(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~va(e,"stretch",0)?Gv(Z(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Z(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,l,u){return ye+i+":"+o+u+(a?ye+i+"-span:"+(s?l:+l-+o)+u:"")+e});case 4949:if(De(e,t+6)===121)return Z(e,":",":"+le)+e;break;case 6444:switch(De(e,De(e,14)===45?18:11)){case 120:return Z(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+le+(De(e,14)===45?"inline-":"")+"box$3$1"+le+"$2$3$1"+ye+"$2box$3")+e;case 100:return Z(e,":",":"+ye)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Z(e,"scroll-","scroll-snap-")+e}return e}function Ya(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case mp:e.return=Gv(e.value,e.length,n);return;case Uv:return Ya([kn(e,{value:Z(e.value,"@","@"+le)})],r);case Ps:if(e.length)return AE(n=e.props,function(i){switch(rn(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Sr(kn(e,{props:[Z(i,/:(read-\w+)/,":"+Wi+"$1")]})),Sr(kn(e,{props:[i]})),Bu(e,{props:Cf(n,r)});break;case"::placeholder":Sr(kn(e,{props:[Z(i,/:(plac\w+)/,":"+le+"input-$1")]})),Sr(kn(e,{props:[Z(i,/:(plac\w+)/,":"+Wi+"$1")]})),Sr(kn(e,{props:[Z(i,/:(plac\w+)/,ye+"input-$1")]})),Sr(kn(e,{props:[i]})),Bu(e,{props:Cf(n,r)});break}return""})}}var WE={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},dt={},ii=typeof process<"u"&&dt!==void 0&&(dt.REACT_APP_SC_ATTR||dt.SC_ATTR)||"data-styled",Qv="active",Yv="data-styled-version",Rs="6.1.8",gp=`/*!sc*/ +`,vp=typeof window<"u"&&"HTMLElement"in window,HE=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&dt!==void 0&&dt.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&dt.REACT_APP_SC_DISABLE_SPEEDY!==""?dt.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&dt.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&dt!==void 0&&dt.SC_DISABLE_SPEEDY!==void 0&&dt.SC_DISABLE_SPEEDY!==""&&dt.SC_DISABLE_SPEEDY!=="false"&&dt.SC_DISABLE_SPEEDY),_s=Object.freeze([]),oi=Object.freeze({});function KE(e,t,n){return n===void 0&&(n=oi),e.theme!==n.theme&&e.theme||t||n.theme}var Xv=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),GE=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,QE=/(^-|-$)/g;function jf(e){return e.replace(GE,"-").replace(QE,"")}var YE=/(a)(d)/gi,Jo=52,Of=function(e){return String.fromCharCode(e+(e>25?39:97))};function Ku(e){var t,n="";for(t=Math.abs(e);t>Jo;t=t/Jo|0)n=Of(t%Jo)+n;return(Of(t%Jo)+n).replace(YE,"$1-$2")}var Pl,Jv=5381,Vr=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Zv=function(e){return Vr(Jv,e)};function XE(e){return Ku(Zv(e)>>>0)}function JE(e){return e.displayName||e.name||"Component"}function jl(e){return typeof e=="string"&&!0}var ey=typeof Symbol=="function"&&Symbol.for,ty=ey?Symbol.for("react.memo"):60115,ZE=ey?Symbol.for("react.forward_ref"):60112,ek={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},tk={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},ny={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},nk=((Pl={})[ZE]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Pl[ty]=ny,Pl);function Af(e){return("type"in(t=e)&&t.type.$$typeof)===ty?ny:"$$typeof"in e?nk[e.$$typeof]:ek;var t}var rk=Object.defineProperty,ik=Object.getOwnPropertyNames,Rf=Object.getOwnPropertySymbols,ok=Object.getOwnPropertyDescriptor,ak=Object.getPrototypeOf,_f=Object.prototype;function ry(e,t,n){if(typeof t!="string"){if(_f){var r=ak(t);r&&r!==_f&&ry(e,r,n)}var i=ik(t);Rf&&(i=i.concat(Rf(t)));for(var o=Af(e),a=Af(t),s=0;s0?" Args: ".concat(t.join(", ")):""))}var sk=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,o=i;t>=o;)if((o<<=1)<0)throw So(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=i;a=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),o=i+r,a=i;a=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(k+="".concat(h,","))}),l+="".concat(b).concat(y,'{content:"').concat(k,'"}').concat(gp)},c=0;c0?".".concat(t):f},c=l.slice();c.push(function(f){f.type===Ps&&f.value.includes("&")&&(f.props[0]=f.props[0].replace(yk,n).replace(r,u))}),a.prefix&&c.push(BE),c.push(qE);var p=function(f,d,b,y){d===void 0&&(d=""),b===void 0&&(b=""),y===void 0&&(y="&"),t=y,n=d,r=new RegExp("\\".concat(n,"\\b"),"g");var k=f.replace(xk,""),h=VE(b||d?"".concat(b," ").concat(d," { ").concat(k," }"):k);a.namespace&&(h=ay(h,a.namespace));var g=[];return Ya(h,ME(c.concat(UE(function(v){return g.push(v)})))),g};return p.hash=l.length?l.reduce(function(f,d){return d.name||So(15),Vr(f,d.name)},Jv).toString():"",p}var wk=new oy,Qu=bk(),sy=gt.createContext({shouldForwardProp:void 0,styleSheet:wk,stylis:Qu});sy.Consumer;gt.createContext(void 0);function Tf(){return _.useContext(sy)}var Ek=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=Qu);var a=r.name+o.hash;i.hasNameForId(r.id,a)||i.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,xp(this,function(){throw So(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Qu),this.name+t.hash},e}(),kk=function(e){return e>="A"&&e<="Z"};function $f(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,a)){var s=r(o,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,s)}i=nr(i,a),this.staticRulesId=a}else{for(var l=Vr(this.baseHash,r.hash),u="",c=0;c>>0);n.hasNameForId(this.componentId,d)||n.insertRules(this.componentId,d,r(u,".".concat(d),void 0,this.componentId)),i=nr(i,d)}}return i},e}(),cy=gt.createContext(void 0);cy.Consumer;var Ol={};function Pk(e,t,n){var r=yp(e),i=e,o=!jl(e),a=t.attrs,s=a===void 0?_s:a,l=t.componentId,u=l===void 0?function(C,P){var w=typeof C!="string"?"sc":jf(C);Ol[w]=(Ol[w]||0)+1;var N="".concat(w,"-").concat(XE(Rs+w+Ol[w]));return P?"".concat(P,"-").concat(N):N}(t.displayName,t.parentComponentId):l,c=t.displayName,p=c===void 0?function(C){return jl(C)?"styled.".concat(C):"Styled(".concat(JE(C),")")}(e):c,f=t.displayName&&t.componentId?"".concat(jf(t.displayName),"-").concat(t.componentId):t.componentId||u,d=r&&i.attrs?i.attrs.concat(s).filter(Boolean):s,b=t.shouldForwardProp;if(r&&i.shouldForwardProp){var y=i.shouldForwardProp;if(t.shouldForwardProp){var k=t.shouldForwardProp;b=function(C,P){return y(C,P)&&k(C,P)}}else b=y}var h=new Nk(n,f,r?i.componentStyle:void 0);function g(C,P){return function(w,N,A){var B=w.attrs,W=w.componentStyle,D=w.defaultProps,S=w.foldedComponentIds,R=w.styledComponentId,T=w.target,$=gt.useContext(cy),U=Tf(),q=w.shouldForwardProp||U.shouldForwardProp,O=KE(N,$,D)||oi,z=function(we,te,pe){for(var Re,je=it(it({},te),{className:void 0,theme:pe}),We=0;Wem.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000",className:e,role:"img",children:[m.jsx("path",{d:"M0 0h24v24H0V0z",fill:"none"}),m.jsx("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})]}),jk=ee.div` + overflow: hidden; + border-radius: 6px; + border: 1px solid #bbb; +`,fy=ee.h4` + font-size: 16px; + font-weight: 700; + margin: 2rem 0px 1rem; + font-size: 1.25rem; + line-height: 1.75rem; + + button { + display: flex; + flex-wrap: nowrap; + flex-direction: row; + align-content: center; + align-items: center; + justify-content: space-between; + text-align: left; + width: 100%; + height: 50px; + border: none; + padding: 1.5rem; + cursor: pointer; + font-size: 1rem; + font-weight: bold; + + &:hover { + text-decoration: underline; + } + } +`,Ok=ee.div` + border: 0 solid #bbb; + ${({i:e})=>e>0&&si` + border-top-width: 1px; + `} + + & ${fy} { + margin: 0; + } +`,Ak=ee.div` + display: ${({open:e})=>e?"block":"none"}; + margin: 1.5rem; +`,Rk=ee(dy)` + display: inline-block; + width: 25px; + transition: transform 0.1s; + height: 25px; + transform: rotate(${({$isOpen:e})=>e?"180deg":"360deg"}); +`,_k=({items:e})=>{const[t,n]=_.useState([]),r=i=>()=>n(o=>(o[i]=!o[i],[...o]));return m.jsx(jk,{children:e.map(({id:i,title:o,children:a},s)=>m.jsxs(Ok,{id:i,i:s,children:[m.jsx(fy,{children:m.jsxs("button",{onClick:r(s),children:[m.jsx("span",{children:o}),m.jsx(Rk,{$isOpen:t[s]})]})}),m.jsx("div",{children:m.jsx(Ak,{open:!!t[s],children:a})})]},i))})},Lk=ee.div` + position: relative; + :hover button, + :focus-within button { + opacity: 1; + } +`,Ik=ee.div` + position: absolute; + right: 0; + top: 0; + margin: 0.5rem; + line-height: 0; + + & button { + margin: 0; + padding: 1px 3px; + transition: opacity ease-in-out 0.1s; + opacity: 0.25; + + :hover { + cursor: pointer; + } + :not(:last-child) { + margin-right: 0.5rem; + } + } +`,Tk=ee.pre` + overflow: auto; + padding: 0.5rem; + background-color: #e6e9ec; + border-radius: 0.25rem; +`,$k=({tabs:e})=>{const[t,n]=_.useState(),r=Object.keys(e),i=t??r[0];return m.jsxs(Lk,{children:[m.jsxs(Ik,{children:[typeof navigator<"u"&&navigator.clipboard&&m.jsx("button",{onClick:()=>navigator.clipboard.writeText(e[i]),children:"copier"}),r.length>1&&r.filter(o=>o!==i).map(o=>m.jsx("button",{onClick:()=>n(o),children:o},o))]}),m.jsx(Tk,{children:m.jsx("code",{children:e[i]})})]})};function zk({references:e}){return e?m.jsx("ul",{children:Object.entries(e).map(([t,n])=>m.jsxs("li",{style:{display:"flex",alignItems:"center"},children:[m.jsx("a",{href:n,target:"_blank",style:{marginRight:"1rem"},rel:"noreferrer",children:vv(t)}),m.jsx("span",{className:"ui__ label",children:n})]},t))}):null}var Fk=({children:e})=>m.jsx("p",{children:e}),Vk=e=>m.jsx("a",{...e}),my=(e={})=>{const t={References:zk,Text:Fk,Code:$k,Accordion:_k,Link:Vk};return Object.fromEntries([...Object.keys(t),...Object.keys(e)].map(n=>[n,e[n]??t[n]]).filter(([,n])=>n))},vn=_.createContext(my()),hy=_.createContext("/documentation"),bp=_.createContext(void 0),br=_.createContext(void 0),yn=()=>{const e=_.useContext(br);if(!e)throw new Error("Engine expected");return e},{encodeRuleName:Dk}=Jt;function qk({dottedName:e,engine:t,currentEngineId:n,documentationPath:r,displayIcon:i=!1,linkComponent:o,children:a,...s}){var b;const l=_.useContext(vn),u=Jt.findCommonAncestor(_.useContext(bp)??e,e),c=o||l.Link;if(!c)throw new Error("You must provide a component.");const p=t.context.parsedRules[e],f=r+"/"+Dk(e),d=[...Jt.ruleParents(e).reverse().filter(y=>y.startsWith(`${u} . `)).map(y=>{var k;return(k=t.context.parsedRules[y])==null?void 0:k.title.trim()}),(b=p.title)==null?void 0:b.trim()].join(" › ");if(!p)throw new Error(`Unknown rule: ${e}`);return m.jsxs(c,{...s,"aria-label":s["aria-label"]??(p.title&&p.title+", voir les détails du calcul pour : "+p.title),to:f+(n?`?currentEngineId=${n}`:""),children:[a||d||p.dottedName.split(" . ").slice(-1)[0]," ",i&&p.rawNode.icônes&&m.jsx("span",{children:p.rawNode.icônes})]})}function mn(e){const t=yn(),n=_.useContext(hy),r=typeof window<"u"&&new URLSearchParams(window.location.search).get("currentEngineId"),i=e.useSubEngine!==!1&&(e.currentEngineId||t.context.subEngineId||r&&Number.parseInt(r))||void 0;return m.jsx(qk,{engine:t,currentEngineId:i,documentationPath:n,...e})}var wp=({value:e,prefixed:t,children:n})=>m.jsxs("div",{children:[t&&n,m.jsx("div",{className:"value",style:{position:"relative",margin:"1rem 0"},children:m.jsx(ne,{node:e})}),!t&&n]});function Mk(e){return m.jsx(wp,{value:e.explanation.valeur,children:m.jsxs("p",{children:[m.jsx("strong",{children:"Arrondi : "}),m.jsx(ne,{node:e.explanation.arrondi})]})})}var Co=({data:e,unit:t})=>m.jsx(Uk,{className:"node-value-pointer",title:e===null?"Non applicable":"","aria-label":e===null?"Valeur non applicable":"",children:e===null?m.jsx("span",{"aria-hidden":!0,children:"-"}):Dn({nodeValue:e,unit:t})}),Uk=ee.span` + background: white; + border-bottom: 0 !important; + font-size: 0.875rem; + line-height: 1.25rem; + margin: 0 0.2rem; + flex-shrink: 0; + padding: 0.1rem 0.2rem; + text-decoration: none !important; + box-shadow: + 0px 1px 2px 1px #d9d9d9, + 0 0 0 1px #d9d9d9; + border: 1px solid #f8f9fa; + border-radius: 0.2rem; +`,Bk={"applicable si":"#7B1FA2","non applicable si":"#7B1FA2","est applicable":"#00796B","est non applicable":"#00796B","est défini":"#00796B","est non défini":"#00796B",somme:"#18457B",plafond:"#EF6C00",plancher:"#EF6C00",abattement:"#B73731",produit:"#2ecc71","une de ces conditions":"#3498db","toutes ces conditions":"#3498db","le maximum de":"#795548","le minimum de":"#795548",variations:"#FF9800","par défaut":"#00695C","taux progressif":"#795548",barème:"#9B296F",grille:"#AD1457",avec:"#2653ce"},gy=e=>Bk[e]||"palevioletred";function xn({name:e,value:t,children:n,unit:r,displayName:i=!0}){return m.jsxs(Wk,{mecanismName:e,children:[i&&m.jsx(Hk,{name:e,children:e}),m.jsxs("div",{children:[n,t!==void 0&&m.jsxs(Gk,{children:[m.jsx("small",{children:" = "}),m.jsx(Co,{data:t,unit:r})]})]})]})}var Wk=ee.div` + border: 1px solid; + max-width: 100%; + border-radius: 3px; + padding: 0.5rem 1rem; + position: relative; + flex: 1; + flex-direction: column; + text-align: left; + border-color: ${({mecanismName:e})=>gy(e)}; + .properties > li { + margin: 1rem 0; + } +`,Hk=({name:e,inline:t=!1,children:n})=>m.jsx(m.Fragment,{children:m.jsx(Kk,{name:e,inline:t,target:"_blank",href:`https://publi.codes/docs/api/mécanismes#${e}`,children:n})}),Kk=ee.a` + background-color: ${({name:e})=>gy(e)} !important; + font-size: inherit; + display: inline-block; + font-weight: inherit; + width: fit-content; + font-family: inherit; + padding: 0.4rem 0.6rem !important; + color: white !important; + transition: hover 0.2s; + :hover { + color: white; + } + ${e=>e.inline?si` + border-radius: 0.3rem; + margin-bottom: 0.5rem; + `:si` + top: -0.5rem; + position: relative; + margin-left: -1rem; + border-radius: 0 !important; + border-bottom-right-radius: 0.3rem !important; + ::first-letter { + text-transform: capitalize; + } + `} + :hover { + opacity: 0.8; + } +`,Gk=ee.div` + text-align: right; + margin-top: 1rem; + font-weight: bold; +`;function Qk({nodeValue:e,explanation:t,unit:n}){return m.jsx(xn,{name:"barème",value:e,unit:n,children:m.jsx(Sp,{children:m.jsxs("ul",{className:"properties",children:[m.jsx(Ep,{explanation:t}),m.jsx(kp,{tranches:t.tranches,multiplicateur:t.multiplicateur}),e!=null&&t.tranches.length>2&&m.jsxs(m.Fragment,{children:[m.jsx("b",{children:"Taux moyen : "}),m.jsx(Co,{data:100*e/(t.assiette.nodeValue??1),unit:ln("%")})]})]})})})}var Ep=({explanation:e})=>{const t=e.multiplicateur;return m.jsxs(m.Fragment,{children:[m.jsxs("li",{children:[m.jsx("span",{className:"key",children:"Assiette : "}),m.jsx("span",{className:"value",children:m.jsx(ne,{node:e.assiette})})]},"assiette"),t&&!t.isDefault&&m.jsxs("li",{children:[m.jsx("span",{className:"key",children:"Multiplicateur : "}),m.jsx("span",{className:"value",children:m.jsx(ne,{node:t})})]},"multiplicateur")]})},kp=({tranches:e,multiplicateur:t})=>{const n=e.find(({isActive:r})=>r);return e.length?m.jsxs("table",{className:"tranches",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Plafonds des tranches"}),"taux"in e[0]&&m.jsx("th",{children:"Taux"}),("montant"in e[0]||(n==null?void 0:n.nodeValue)!=null)&&m.jsx("th",{children:"Montant"})]})}),m.jsx("tbody",{children:e.map((r,i)=>m.jsx(Yk,{tranche:r,multiplicateur:t},i))})]}):null},Yk=({tranche:e,multiplicateur:t})=>{const n=e.isActive;return m.jsxs("tr",{className:`tranche ${n?"activated":""}`,children:[m.jsx("td",{children:e.plafond.nodeValue===1/0?"Au-delà du dernier plafond":m.jsxs(m.Fragment,{children:["Inférieur à ",m.jsx(ne,{node:e.plafond}),t&&!t.isDefault&&m.jsxs(m.Fragment,{children:[" × ",m.jsx(ne,{node:t})]})]})},"tranche"),"taux"in e&&m.jsx("td",{children:m.jsx(ne,{node:e.taux})},"taux"),(e.nodeValue!=null||"montant"in e)&&m.jsx("td",{children:"montant"in e?m.jsx(ne,{node:e.montant}):m.jsx(Co,{data:e.nodeValue,unit:e.unit})},"value")]})},Sp=ee.div` + table { + margin: 1em 0; + width: 100%; + text-align: left; + font-weight: 400; + } + table td { + padding: 0.1em 0.4em; + } + table th { + font-weight: 600; + } + table th:first-letter { + text-transform: uppercase; + } + .tranche:nth-child(2n) { + background: var(--lightestColor); + } + .tranche.activated { + background: var(--lighterColor); + font-weight: bold; + } +`;function Xk(e){const t=_.useContext(br),{dottedName:n,nodeValue:r,unit:i}=e,o=t==null?void 0:t.context.parsedRules[e.dottedName];if(!o)throw new Error(`Unknown rule: ${n}`);const[a,s]=_.useState(!0),l=_.useContext(Xu);return e.dottedName===e.contextDottedName+" . "+e.name&&!e.name.includes(" . ")&&o.virtualRule?m.jsx(ne,{node:t==null?void 0:t.evaluate(o)}):m.jsxs("div",{style:{display:"flex",flex:l?1:"initial",flexDirection:"column",maxWidth:"100%"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"baseline",flexWrap:"wrap",justifyContent:"space-between"},children:[m.jsx("span",{style:{paddingRight:"0.2rem"},children:m.jsx(mn,{dottedName:n})}),m.jsxs("div",{style:{flex:1,display:"flex",alignItems:"baseline"},children:[l&&m.jsxs(m.Fragment,{children:[m.jsx(Jk,{onClick:()=>s(!a),"aria-expanded":!a,className:"publicodes_btn-small","aria-label":a?"Déplier, afficher le détail":"Replier, afficher le détail",children:a?"Déplier":"Replier"}),m.jsx(Zk,{})]}),r!==void 0&&m.jsx(Co,{data:r,unit:i})]})]})," ",!a&&m.jsx("div",{children:m.jsx(Xu.Provider,{value:!1,children:m.jsx(ne,{node:t==null?void 0:t.evaluate(o)})})})]})}var Xu=_.createContext(!1),Jk=ee.button` + text-transform: none !important; +`,Zk=ee.div` + @media (max-width: 500px) { + /* border: none; */ + } + margin: 0.5rem; + flex: 1; + border-bottom: 2px dotted lightgray; +`;function No({sourceMap:e,nodeValue:t,unit:n}){const{args:r,mecanismName:i}=e,o="valeur"in r&&i in r&&Object.keys(r).length===2,a="valeur"in r&&Object.keys(r).length===1;return m.jsxs(m.Fragment,{children:[o&&m.jsx(ea,{node:r.valeur}),m.jsx("div",{style:{marginTop:o?"1rem":0},children:m.jsx(xn,{name:i,value:t,unit:n,children:o?m.jsx(ea,{node:r[i],mecanismName:i}):a?m.jsx(ea,{node:r.valeur,mecanismName:i}):m.jsx("ul",{children:Object.entries(r).map(([s,l])=>m.jsxs("li",{style:{display:"flex",alignItems:"baseline",padding:"0.25rem 0"},children:[m.jsxs("span",{children:[s," : "]}),m.jsx("span",{children:m.jsx(ea,{node:l})})]},s))})})})]})}function ea({node:e,mecanismName:t}){if(Array.isArray(e)){const n=t==="produit"?"×":t==="somme"?"+":void 0;return m.jsx(tS,{explanation:e,hideNotApplicable:t!=="produit",sign:n})}return m.jsx(ne,{node:e})}var eS=e=>{var n;const t=(n=_.useContext(br))==null?void 0:n.evaluate(e).nodeValue;return t===null||t===0};function tS({explanation:e,hideNotApplicable:t=!0,sign:n}){const[r,i]=e.reduce((l,u)=>(l[t&&eS(u)?1:0].push(u),l),[[],[]]),[o,a]=_.useState(r.length===0),s=_.useMemo(()=>"notApplicableExplanation"+Math.random().toString(36).substring(7),[]);return m.jsxs(m.Fragment,{children:[m.jsx(Vf,{$sign:n,children:r.map((l,u)=>m.jsx(Df,{node:l},u))}),i.length>0&&r.length!==0&&m.jsx(nS,{style:{textAlign:"right"},children:m.jsx("button",{"aria-expanded":o,"aria-controls":s,className:"publicodes_btn-small",onClick:()=>a(!o),children:o?"Masquer les valeurs non applicable":"Voir toute la liste"})}),o&&m.jsx(Vf,{id:s,$sign:n,$showFirst:r.length>0,children:i.map((l,u)=>m.jsx(Df,{node:l},u))})]})}var nS=ee.div` + margin: 0.5rem 0; + margin-left: 1rem; +`,Vf=ee.ul` + margin: 0; + margin-left: 1rem; + + ${({$sign:e,$showFirst:t})=>e&&!t&&si` + & > li:first-child::marker { + content: ''; + } + `} + ${({$sign:e})=>e&&si` + & > li::marker { + font-weight: bold; + content: '${e} '; + } + `} +`;function Df({node:e}){return m.jsx(rS,{style:{padding:"0.25rem 0"},children:m.jsx(Xu.Provider,{value:!0,children:m.jsx(ne,{node:e})})})}var rS=ee.li` + > * { + width: 100%; + } +`;function iS(e){return m.jsx(No,{...e,sourceMap:{mecanismName:e.nodeKind,args:e.explanation}})}function oS({nodeValue:e,type:t,fullPrecision:n,unit:r}){return e===void 0?null:e===null?m.jsx("span",{className:"value",children:Dn({nodeValue:e})}):n?m.jsx("span",{className:t,children:Dn({nodeValue:e,unit:r},{precision:5})}):m.jsx("span",{className:"value",children:Dn({nodeValue:e,unit:r})})}function aS({explanation:e}){const t=yn(),n=e.subEngineId?t.context.subEngines.get(e.subEngineId)??t:t;return m.jsxs(m.Fragment,{children:[m.jsxs(xn,{name:"contexte",children:[m.jsx("p",{children:"Ce calcul est effectué en changeant les valeurs des règles suivantes :"}),m.jsx(sS,{children:e.contexte.map(([r,i])=>m.jsxs(_.Fragment,{children:[m.jsx("dt",{children:m.jsx(mn,{dottedName:r.dottedName})}),m.jsxs("dd",{children:[m.jsx("span",{"aria-hidden":!0,children:" = "}),m.jsx(ne,{node:i})]})]},r.dottedName))})]}),m.jsx(br.Provider,{value:n,children:m.jsx(ne,{node:e.valeur})})]})}var sS=ee.dl` + display: grid; + grid-template-columns: auto 1fr; + gap: 0.6rem; + line-height: 1.75; + dd { + margin: 0; + display: flex; + gap: 0.5rem; + } + @media (max-width: 600px) { + grid-template-columns: auto; + line-height: initial; + dd { + justify-content: flex-end; + margin-bottom: 0.5rem; + } + } +`;function lS(e){return m.jsx(No,{...e,sourceMap:{mecanismName:e.nodeKind,args:e.explanation}})}function uS(e){return m.jsx(No,{...e,sourceMap:{mecanismName:e.nodeKind,args:{valeur:e.explanation}}})}function cS(e){return m.jsx(No,{...e,sourceMap:{mecanismName:e.nodeKind,args:{valeur:e.explanation}}})}function pS({nodeValue:e,explanation:t,unit:n}){return m.jsx(Sp,{children:m.jsx(xn,{name:"grille",value:e,unit:n,children:m.jsxs("ul",{className:"properties",children:[m.jsx(Ep,{explanation:t}),m.jsx(kp,{tranches:t.tranches,multiplicateur:t.multiplicateur})]})})})}function dS({nodeValue:e,explanation:t}){const n=yn();return m.jsx(xn,{name:"inversion numérique",value:e,children:n.cache.inversionFail&&t.inversionGoal?m.jsxs(m.Fragment,{children:[m.jsx("p",{children:"Cette valeur devrait pouvoir être estimée à partir d’une autre variable qui possède une formule de calcul et dont la valeur a été fixée dans la simulation :"}),m.jsx(ne,{node:t.inversionGoal}),m.jsx("p",{children:"Malheureusement, il a été impossible de retrouver une valeur pour cette formule qui permette d’atterrir sur la valeur demandée."})]}):t.inversionGoal?m.jsxs(m.Fragment,{children:[m.jsx("p",{children:"Cette valeur a été estimée à partir d’une autre variable qui possède une formule de calcul et dont la valeur a été fixée dans la simulation :"}),m.jsx(ne,{node:t.inversionGoal})]}):m.jsxs(m.Fragment,{children:[m.jsx("p",{children:"Cette formule de calcul n’existe pas, mais on peut la calculer par inversion en utilisant les formules des règles suivantes :"}),m.jsx("ul",{id:"inversionsPossibles",children:t.inversionCandidates.map(r=>m.jsx("li",{children:m.jsx(ne,{node:r})},r.dottedName))})]})})}function fS({nodeValue:e,explanation:t,operator:n,unit:r}){const i=t[0].nodeValue===0&&n==="−"&&t[0].nodeKind==="constant";return m.jsxs(mS,{className:"operation",role:"math",children:[m.jsx("span",{children:"("}),!i&&m.jsxs(m.Fragment,{children:[m.jsx(ne,{node:t[0]})," "]}),n," ",m.jsx(ne,{node:t[1]}),e!=null&&m.jsxs("span",{className:"result",children:[m.jsx("small",{children:" = "}),m.jsx(Co,{data:e,unit:r})]}),m.jsx("span",{children:")"})]})}var mS=ee.div` + display: flex; + flex-wrap: wrap; + gap: 0.125rem; + > .operation ::before, + > .operation ::after { + content: ''; + } + .result { + margin-left: 0.2rem; + } + .operation .result { + display: none; + } +`;function hS(e){const t=yn(),n=e.sourceMap,r=n.args.originalNode,i=n.args.applicableReplacements.find(({definitionRule:l})=>t.evaluate(l).nodeValue===e.nodeValue);if(!i||i.replaceByNonApplicable)return r.nodeValue=e.nodeValue,m.jsx(ne,{node:r});const[o,a]=_.useState(!1),s=_.useId();return m.jsx(m.Fragment,{children:m.jsxs("span",{style:{display:"inline-flex",maxWidth:"100%"},children:[m.jsxs("span",{style:{display:"flex",flexDirection:"column",flex:"1 1 0%"},children:[o&&m.jsx("span",{id:s,style:{opacity:"0.6",textDecoration:"line-through"},children:m.jsx(ne,{node:r})}),m.jsx(ne,{node:i.definitionRule})]}),m.jsx("div",{style:{marginLeft:"0.4rem"},children:m.jsx("button",{onClick:()=>a(!o),type:"button",className:"publicodes_btn-small","aria-expanded":o,"aria-controls":s,title:o?"Cacher la valeur d’origine":"Voir la valeur d’origine",children:"🔄"})})]})})}function gS(e){return m.jsxs("span",{children:["Remplace ",m.jsx(ne,{node:e.replacedReference})," ",e.rawNode.dans&&m.jsxs(m.Fragment,{children:["dans"," ",e.whiteListedNames.map((t,n)=>m.jsx(ne,{node:t},n)).join(", ")]}),e.rawNode["sauf dans"]&&m.jsxs(m.Fragment,{children:["sauf dans"," ",e.blackListedNames.map((t,n)=>m.jsx(ne,{node:t},n)).join(", ")]})]})}function vS({explanation:e,dottedName:t}){return m.jsx(xS,{children:m.jsx(bp.Provider,{value:t,children:m.jsx(yS,{children:m.jsx(ne,{node:e.valeur})})})})}var yS=ee.div` + border-left: 1rem solid hsl(220, 60%, 97.5%); + padding-left: 1rem; + margin-left: -2rem; +`,xS=ee.div` + margin-top: 0.5rem; + margin-bottom: 1rem; + display: flex; + flex-direction: column; +`;function bS({explanation:e}){return m.jsxs(xn,{name:"résoudre la référence circulaire",value:e.valeur,children:[m.jsxs("p",{children:[" ","Cette valeur a été retrouvé en résolvant la référence circulaire dans la formule ci dessous :"," "]}),m.jsx(ne,{node:e.valeur})]})}function wS({sourceMap:e}){const t=_.useContext(br),n=t==null?void 0:t.evaluate(e.args["dans la situation"]);return(n==null?void 0:n.nodeValue)!==void 0?m.jsx(wp,{prefixed:!0,value:e.args.valeur,children:m.jsxs("p",{children:[m.jsx("strong",{children:"Valeur renseignée dans la simulation : "}),m.jsx(ne,{node:n.explanation.valeur})]})}):m.jsx(ne,{node:e.args.valeur})}function ES({nodeValue:e,explanation:t,unit:n}){return m.jsx(Sp,{children:m.jsx(xn,{name:"taux progressif",value:e,unit:n,children:m.jsxs("ul",{className:"properties",children:[m.jsx(Ep,{explanation:t}),m.jsx(kp,{tranches:t.tranches,multiplicateur:t.multiplicateur})]})})})}function kS({explanation:e}){return m.jsx("p",{children:e.map(t=>typeof t=="string"?t:m.jsx(SS,{children:m.jsx(ne,{node:t})},t.rawNode))})}var SS=ee.span` + border: 1px solid rgba(0, 0, 0, 0.1); + padding: 0.2rem; + position: relative; + border-radius: 0.15rem; + background-color: rgba(0, 0, 0, 0.05); +`;function CS({explanation:e}){return m.jsx(xn,{name:"une possibilité parmi",value:void 0,children:m.jsx("ul",{children:e.map((t,n)=>m.jsx("li",{children:m.jsx(ne,{node:t})},n))})})}function NS({nodeValue:e,explanation:t,unit:n}){return t.nodeKind==="constant"?Dn({nodeValue:e,unit:n}):t.nodeKind==="reference"?m.jsxs(m.Fragment,{children:[m.jsx(ne,{node:t})," ",rt(n)]}):m.jsx(wp,{value:t,children:m.jsxs("p",{children:[m.jsx("strong",{children:"Unité : "}),rt(n)]})})}function PS({nodeValue:e,explanation:t,unit:n}){const r=t.findIndex(({condition:s})=>s.nodeValue===!0);let i;r!==void 0&&(i=t[r],t=[...t.slice(0,r),...t.slice(r+1)]);const[o,a]=_.useState(!i);return m.jsx(xn,{name:"variations",unit:n,value:e,children:m.jsxs("ul",{children:[i&&m.jsxs("li",{children:[m.jsx(qf,{...i}),m.jsx("span",{style:{paddingLeft:"1rem"},children:m.jsxs("button",{className:"publicodes_btn-small",onClick:()=>a(!o),children:[o?"Masquer":"Afficher"," les autres cas"]})})]}),o&&m.jsx(m.Fragment,{children:t.map((s,l)=>m.jsx("li",{children:m.jsx(qf,{...s})},l))})]})})}function qf({condition:e,consequence:t}){return m.jsx(AS,{children:m.jsxs(OS,{children:[m.jsx(jS,{children:e.nodeKind==="constant"&&e.nodeValue===!0?m.jsx(Uf,{children:"Par défaut : "}):m.jsxs(m.Fragment,{children:[m.jsx(Uf,{children:"Condition : "}),m.jsx(Mf,{children:m.jsx(ne,{node:e})})]})}),m.jsx(Mf,{children:m.jsx(ne,{node:t})})]})})}var Mf=ee.div``,Uf=ee.span` + font-weight: bold; +`,jS=ee.div` + padding-bottom: 1rem; + padding-top: 0.5rem; + display: flex; + align-items: baseline; +`,OS=ee.div` + border-left: 1rem solid hsl(36, 60%, 97%); + padding-left: 1rem; + margin-left: -1rem; +`,AS=ee.div` + padding: 1rem 0; +`,RS={constant:oS,arrondi:Mk,barème:Qk,durée:lS,grille:pS,inversion:dS,operation:fS,texte:kS,reference:Xk,"est non applicable":uS,"est non défini":cS,rule:vS,condition:iS,"dans la situation":wS,contexte:aS,replacement:hS,replacementRule:gS,"taux progressif":ES,"une possibilité":CS,"résoudre référence circulaire":bS,unité:NS,"variable manquante":e=>m.jsx(ne,{node:e.explanation}),variations:PS};function ne({node:e}){var a,s;const t=((a=e.sourceMap)==null?void 0:a.mecanismName)??e.nodeKind,n=yn(),i=po(l=>"nodeValue"in l||l.nodeKind==="replacementRule"?!1:n.evaluateNode(l),!1)(e),o=RS[t]??((s=e.sourceMap)!=null&&s.mecanismName?No:void 0);if(!o)throw new Error(`Unknown visualisation: ${t}`);return m.jsx(o,{...i})}var{encodeRuleName:_S}=Jt;function LS({engine:e,dottedName:t}){const n=IS(e,t);if(typeof window<"u"&&window.location.host==="publi.codes")return null;const r="Afficher la règle dans le bac à sable Publicodes";return m.jsx("p",{style:{textAlign:"right"},children:m.jsxs("a",{target:"_blank",href:n,"aria-label":`${r}, nouvelle fenêtre`,rel:"noreferrer",children:[m.jsx("span",{"aria-hidden":!0,children:"✍️"})," ",r]})})}var IS=(e,t)=>{const n=Array.from(e.context.referencesMaps.referencesIn.get(t)??[]),r=e.evaluateNode(e.context.parsedRules[t]),i={[t]:Object.fromEntries(Object.entries(r.rawNode).filter(([l])=>l!=="nom"))},o=Object.fromEntries(n.filter(l=>l!==t&&!l.endsWith(" . $SITUATION")).map(l=>[l,TS(r)])),a=encodeURIComponent(JSON.stringify({rules:i,situation:o}));return`${typeof window<"u"&&location.hostname==="localhost"?"":"https://publi.codes"}/studio/${_S(t)}#${a}`};function TS(e){const t=Dn(e).replace(/\s\/\s/g,"/").replace(/(\d)\s(\d)/g,"$1$2").replace(",",".");return t.match(/^[0-9]/)||t==="Oui"||t==="Non"?t.toLowerCase():t==="-"?"non":`'${t}'`}var Ja=ee.ul` + padding: 0; + max-height: 400px; + overflow: auto; + list-style: none; +`,Za=ee.li` + position: relative; + padding-left: 1.5rem; + + &::before { + content: '●'; + font-size: 80%; + display: inline-block; + position: absolute; + left: 0; + width: 1.5rem; + text-align: center; + color: #b3b3b3; + margin-bottom: 0.5rem; + } +`;function $S({rule:e,engine:t,dottedName:n,situation:r={},apiDocumentationUrl:i,apiEvaluateUrl:o,npmPackage:a}){const{Accordion:s}=_.useContext(vn),l=[{title:"Règle et situation",id:"rule-situation",children:m.jsxs(m.Fragment,{children:[m.jsx(zS,{engine:t,dottedName:n}),m.jsx(FS,{situation:r})]})},i&&o||a?{title:"Réutiliser ce calcul ("+[i&&o?"API REST":null,a?"Paquet NPM":null].filter(u=>u!==null).join(" / ")+")",id:"usage",children:m.jsxs(m.Fragment,{children:[Jt.isExperimental(t.baseContext.parsedRules,n)&&m.jsxs(BS,{children:[m.jsx("h4",{children:"⚠️ Cette règle est tagguée comme experimentale ⚠️"}),m.jsx("p",{children:"Cela veut dire qu’elle peut être modifiée, renommée, ou supprimée sans qu’il n’y ait de changement de version majeure dans l’API."})]}),a&&m.jsx(VS,{rule:e,situation:r,dottedName:n,npmPackage:a}),i&&o&&m.jsx(DS,{situation:r,dottedName:n,apiDocumentationUrl:i,apiEvaluateUrl:o})]})}:null,{title:"Dépendances et effets de la règle",id:"dependencies-effects",children:m.jsxs(m.Fragment,{children:[m.jsx(qS,{selfMissing:Object.keys(e.missingVariables)}),m.jsx(MS,{engine:t,dottedName:n,ruleIsNotDefined:e.nodeValue===void 0}),m.jsx(US,{engine:t,dottedName:n,replacements:e.replacements})]})}].filter(u=>u!==null);return m.jsx(s,{items:l})}function zS({engine:e,dottedName:t}){const{Code:n}=_.useContext(vn);return m.jsxs("section",{children:[m.jsx("h4",{children:"Règle actuelle"}),m.jsx(n,{tabs:{dottedName:t}}),m.jsx(LS,{dottedName:t,engine:e})]})}function FS({situation:e}){const{Code:t}=_.useContext(vn),n=Object.keys(e),r={json:JSON.stringify(e,null,2)};return m.jsxs("section",{children:[m.jsx("h4",{children:"Situation actuelle"}),n.length?m.jsx("p",{children:"Voici les données que vous avez saisies dans notre simulateur sous forme de JSON."}):m.jsx("p",{children:"Votre situation est pour l’instant vide, vous n’avez probablement pas encore fait de simulation."}),m.jsx(t,{tabs:r})]})}var Bf="Retrouvez ce paquet sur NPM",Wf="moteur Publicodes";function VS({rule:e,situation:t,dottedName:n,npmPackage:r}){const{Code:i,Link:o}=_.useContext(vn),a={npmPackage:`// npm i publicodes ${r} + +import Engine, { formatValue } from 'publicodes' +import rules from '${r}' + +const engine = new Engine(rules) +engine.setSituation(${JSON.stringify(t,null,2)}) + +// ${e.title} +const evaluation = engine.evaluate(${JSON.stringify(n)}) + +console.log(formatValue(evaluation)) +`};return m.jsxs("section",{children:[m.jsx("h4",{children:"Lancer un calcul avec Publicodes"}),m.jsxs("p",{children:["Vous pouvez installer notre package de règles pour l’utiliser avec le"," ",m.jsx(o,{"aria-label":`${Wf}, accéder au site publi.codes, nouvelle fenêtre`,href:"https://publi.codes/",children:Wf})," ","et ainsi effectuer vos propres calculs. Voici un exemple avec votre situation et la règle actuelle :"]}),m.jsx(i,{tabs:a}),m.jsx("p",{style:{textAlign:"right"},children:m.jsxs(o,{href:"https://www.npmjs.com/package/"+r,"aria-label":`${Bf}, accéder à la page npm du package Publicodes, nouvelle fenêtre`,children:[m.jsx("span",{"aria-hidden":!0,children:"📦"})," ",Bf]})})]})}var Hf="En savoir plus sur notre API REST";function DS({situation:e,dottedName:t,apiDocumentationUrl:n,apiEvaluateUrl:r}){const{Code:i,Link:o}=_.useContext(vn),a={expressions:[t],situation:e},s={curl:`curl '${r}' \\ + -H 'accept: application/json' \\ + -H 'content-type: application/json' \\ + --data-raw $'${JSON.stringify(a).replace(/'/g,"'\\''")}' \\ + --compressed`,"fetch js":`const request = await fetch("${r}", { + "headers": { "content-type": "application/json" }, + "method": "POST", + "body": JSON.stringify(${JSON.stringify(a,null,2)}), +}) +const { evaluate } = await request.json() + +console.log(evaluate)`};return m.jsxs("section",{children:[m.jsx("h4",{children:"Utiliser notre API REST"}),m.jsx("p",{children:"Vous trouverez ici un exemple d’utilisation de notre API REST via curl ou un fetch javascript."}),m.jsx(i,{tabs:s}),n&&m.jsx("p",{style:{textAlign:"right"},children:m.jsxs(o,{to:n,"aria-label":`${Hf}, accéder à la documentation, nouvelle fenêtre`,children:[m.jsx("span",{"aria-hidden":!0,children:"👩‍💻"})," ",Hf]})})]})}function qS({selfMissing:e}){return m.jsxs("section",{children:[m.jsx("h4",{children:"Données manquantes"}),e!=null&&e.length?m.jsxs(m.Fragment,{children:[m.jsx("p",{children:"Les règles suivantes sont nécessaires pour le calcul mais n’ont pas été saisies dans la situation. Leur valeur par défaut est utilisée."}),m.jsx(Ja,{children:e.map(t=>m.jsx(Za,{children:m.jsx(mn,{dottedName:t})},t))})]}):m.jsx("p",{children:"Il n’y a pas de données manquante."})]})}var vy=(e,t)=>e&&"replacements"in e&&e.replacements.some(({replacedReference:n})=>n.dottedName===t);function MS({engine:e,dottedName:t,ruleIsNotDefined:n=!1}){const r=Array.from(e.context.referencesMaps.rulesThatUse.get(t)??[]).filter(i=>i!=="$EVALUATION"&&i in e.context.parsedRules&&!e.context.parsedRules[i].private&&!vy(e.context.parsedRules[i],t));return m.jsxs("section",{children:[m.jsx("h4",{children:"Règles qui ont besoin de cette valeur"}),r.length?m.jsxs(m.Fragment,{children:[m.jsxs("p",{children:["Les règles suivantes ont besoin de la règle courante pour être calculées :",n&&m.jsxs(m.Fragment,{children:[" ","La règle courante n’étant pas encore définie, c’est sa valeur par défaut qui est utilisée pour déterminer la valeur de ces règles."]})]}),m.jsx(Ja,{children:r.map(i=>m.jsx(Za,{children:m.jsx(mn,{dottedName:i})},i))})]}):m.jsx("p",{children:"Aucune règle n’utilise cette valeur."})]})}function US({engine:e,dottedName:t,replacements:n}){const r=Array.from(e.context.referencesMaps.rulesThatUse.get(t)??[]).filter(i=>i!=="$EVALUATION"&&i in e.context.parsedRules&&!e.context.parsedRules[i].private&&vy(e.context.parsedRules[i],t));return m.jsxs(m.Fragment,{children:[m.jsxs("section",{children:[m.jsx("h4",{children:"Effets sur d’autres règles"}),n.length?m.jsxs(m.Fragment,{children:[m.jsx("p",{children:"Une règle peut avoir des effets sur d’autres règles afin de modifier leur comportement."}),m.jsx(Ja,{children:n.map(i=>m.jsx(Za,{style:{marginBottom:"0.5rem"},children:m.jsx(ne,{node:i})},i.replacedReference.dottedName))})]}):m.jsx("p",{children:"Cette règle ne modifie aucune autre règle."})]}),m.jsxs("section",{children:[m.jsx("h4",{children:"Règles qui peuvent avoir un effet sur cette valeur"}),r.length?m.jsxs(m.Fragment,{children:[m.jsx("p",{children:"Les règles suivantes peuvent remplacer la valeur de la règle courante :"}),m.jsx(Ja,{children:r.map(i=>m.jsx(Za,{children:m.jsx(mn,{dottedName:i})},i))})]}):m.jsx("p",{children:"Aucune autre règle n’a d’effets sur cette valeur."})]})]})}var BS=ee.div``;function WS({title:e,description:t}){const{Head:n}=_.useContext(vn);return n?m.jsxs(n,{children:[m.jsx("title",{children:e}),m.jsx("meta",{property:"og:type",content:"article"}),m.jsx("meta",{property:"og:title",content:e}),t&&m.jsx("meta",{property:"og:description",content:t}),t&&m.jsx("meta",{name:"description",content:t})]}):null}function HS({dottedName:e}){const t=yn(),{title:n,rawNode:{description:r,question:i,icônes:o}}=t.context.parsedRules[e],a=o?n+" "+o:n;return m.jsxs("header",{children:[m.jsx(WS,{title:a,description:r||i}),m.jsxs("div",{children:[m.jsx("span",{id:"rules-nav-open-nav-button"}),Jt.ruleParents(e).reverse().map(s=>m.jsxs("span",{children:[m.jsx(mn,{dottedName:s,displayIcon:!0}),m.jsx("span",{"aria-hidden":!0,children:" › "})]},s))]}),m.jsx("h1",{children:m.jsx(mn,{dottedName:e,displayIcon:!0})})]})}var KS=_.lazy(()=>NE(()=>import("./RulesSearch-AGDNDU76-B0fJI113.js"),[])),GS=({dottedName:e,searchBar:t,mobileMenuPortalId:n,openNavButtonPortalId:r})=>{const o=yn().getParsedRules(),a=Object.keys(o),[s,l]=_.useState(!1),u=h=>Object.fromEntries([[h,!0],...Jt.ruleParents(h).map(g=>[g,!0])]),[c,p]=_.useState(u(e));_.useEffect(()=>{p(h=>({...h,...u(e)}))},[e]);const f=_.useCallback(h=>{p(g=>g[h]?Object.fromEntries(Object.entries(g).map(([v,C])=>v.startsWith(h)?[v,!1]:[v,C])):{...g,[h]:!g[h]})},[]),d=typeof window>"u"?null:r&&window.document.getElementById(r)||window.document.getElementById("rules-nav-open-nav-button"),b=m.jsxs(XS,{$open:s,children:[m.jsx(JS,{$open:s,onClick:()=>{l(h=>!h)}}),d&&Xd.createPortal(m.jsx(ZS,{onClick:()=>l(!0),children:"Toutes les règles"}),d),m.jsxs(eC,{$open:s,children:[t?m.jsx(_.Suspense,{fallback:m.jsx("p",{children:"Chargement..."}),children:m.jsx(KS,{})}):null,m.jsx("ul",{children:a.sort((h,g)=>h.localeCompare(g)).map(h=>{const g=Jt.ruleParent(h);if(h.split(" . ").length>1&&!c[g])return null;const v=h in c&&c[h];return m.jsx(YS,{ruleDottedName:h,open:v,active:e===h,onClickDropdown:f},h)})})]})]}),y=typeof window<"u"&&window.matchMedia(`(max-width: ${Bn.lg})`).matches,k=typeof window<"u"&&n?window.document.getElementById(n):null;return y&&k?Xd.createPortal(b,k):b},QS=({ruleDottedName:e,open:t,active:n,onClickDropdown:r})=>{const o=yn().getParsedRules(),a=Object.keys(o).reduce((u,c)=>c.startsWith(e+" . ")&&c.split(" . ").length===e.split(" . ").length+1?u+1:u,0),s=_.useRef(!0),l=_.useRef(null);return _.useEffect(()=>{var u,c;if(s.current){s.current=!1;return}(c=(u=l.current)==null?void 0:u.scrollIntoView)==null||c.call(u,{behavior:"auto",block:"nearest",inline:"start"})},[n]),m.jsx("li",{ref:n?l:void 0,style:{paddingLeft:(e.split(" . ").length-1)*16},className:(a>0?"dropdown ":"")+(n?"active ":""),children:m.jsxs("span",{className:"content",children:[a>0&&m.jsx(tC,{"aria-label":t?"Replier le sous-menu":"Déplier le sous-menu","aria-expanded":t,onClick:()=>r(e),children:m.jsx(nC,{$open:t})}),m.jsx(mn,{dottedName:e,displayIcon:!0})]})},e)},YS=_.memo(QS),Bn={sm:"576px",md:"768px",lg:"992px",xl:"1200px"},XS=ee.div` + z-index: 200; + overflow: auto; + position: sticky; + top: 0; + + @media (min-width: ${Bn.lg}) { + max-width: 50%; + flex-shrink: 0; + } +`,JS=ee.div` + background: rgb(0 0 0 / 25%); + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + z-index: 200; + transition: ease-in-out 0.25s; + transition-property: visibility, opacity; + visibility: ${({$open:e})=>e?"visible":"hidden"}; + opacity: ${({$open:e})=>e?"1":"0"}; + + @media (min-width: ${Bn.lg}) { + display: none; + } +`,ZS=ee.button` + margin: 0.25rem 0; + margin-right: 0.5rem; + background: none; + border: 1px solid rgb(29, 66, 140); + border-radius: 3px; + color: rgb(29, 66, 140); + padding: 0.5rem; + display: inline-block; + + &:hover { + background-color: rgb(219, 231, 255); + } + @media (min-width: ${Bn.lg}) { + display: none; + } +`,eC=ee.nav` + @media (min-width: ${Bn.lg}) { + flex-shrink: 0; + } + border-right: 1px solid #e6e6e6; + overflow: auto; + max-height: calc(100vh - 2rem); + position: sticky; + top: 0; + @media (max-width: ${Bn.lg}) { + position: fixed; + top: 0; + left: 0; + padding-top: 1rem; + bottom: 0; + z-index: 200; + max-height: initial; + background: white; + max-width: 80vw; + height: 100%; + + transition: all ease-in-out 0.25s; + ${({$open:e})=>e?"":"transform: translateX(-100%);"} + } + + ul { + flex-wrap: nowrap; + margin: 0; + + padding: 0; + list-style: none; + li { + margin-bottom: 3px; + max-width: 350px; + .content { + border-radius: 3px; + padding: 3px 1rem; + display: flex; + width: fit-content; + align-items: center; + flex-direction: row; + flex-wrap: nowrap; + } + + &.active .content { + background-color: #e6e6e6; + } + &:not(.active) a { + font-weight: normal; + } + &:not(.dropdown) .content:before { + content: ' '; + display: inline-block; + background-color: #b3b3b3; + min-width: 0.5rem; + min-height: 0.5rem; + border-radius: 0.5rem; + margin-left: 0.5rem; + margin-right: 1.25rem; + pointer-events: none; + } + } + } +`,tC=ee.button` + margin-right: 0.75rem; + flex-shrink: 0; + background: none; + border: 1px solid #b3b3b3; + border-radius: 2rem; + width: 1.5rem; + height: 1.5rem; + color: #999; + padding: 0; + display: inline-block; +`,nC=ee(dy)` + width: 100%; + transition: transform 0.1s; + height: 100%; + transform: rotate(${({$open:e})=>e?"0deg":"-90deg"}); +`;function rC({documentationPath:e,rulePath:t,engine:n,renderers:r,searchBar:i,language:o,apiDocumentationUrl:a,apiEvaluateUrl:s,npmPackage:l,mobileMenuPortalId:u,openNavButtonPortalId:c,showDevSection:p=!0}){const f=typeof window<"u"&&new URLSearchParams(window.location.search).get("currentEngineId"),d=_.useRef(r);return _.useEffect(()=>{d.current!==r&&(d.current=r)},[r]),m.jsx(br.Provider,{value:n,children:m.jsx(hy.Provider,{value:e,children:m.jsx(vn.Provider,{value:my(r),children:m.jsx(iC,{dottedName:Jt.decodeRuleName(t),subEngineId:f?parseInt(f,10):void 0,language:o,apiDocumentationUrl:a,apiEvaluateUrl:s,npmPackage:l,mobileMenuPortalId:u,openNavButtonPortalId:c,showDevSection:p,searchBar:i})})})})}function iC({dottedName:e,language:t,subEngineId:n,searchBar:r=!1,apiDocumentationUrl:i,apiEvaluateUrl:o,npmPackage:a,mobileMenuPortalId:s,openNavButtonPortalId:l,showDevSection:u}){const c=yn(),{References:p,Text:f}=_.useContext(vn),d=c.context.subEngines,b=n&&d.has(n),y=b?d.get(n):c;if(!(e in y.context.parsedRules))return m.jsx("p",{children:"Cette règle est introuvable dans la base"});y.resetCache(),y.cache.traversedVariablesStack=[];const k=y.evaluateNode(y.context.parsedRules[e]),{description:h,question:g}=k.rawNode,{valeur:v,nullableParent:C,ruleDisabledByItsParent:P}=k.explanation,w=sC(y,k),N=p==null?void 0:p({references:k.rawNode.références,dottedName:k.dottedName});return m.jsx(br.Provider,{value:y,children:m.jsxs(oC,{id:"documentation-rule-root",children:[m.jsx(GS,{dottedName:e,mobileMenuPortalId:s,openNavButtonPortalId:l,searchBar:r}),m.jsx(aC,{children:m.jsxs(bp.Provider,{value:e,children:[m.jsx(HS,{dottedName:e}),m.jsx("section",{children:m.jsx(f,{children:h||g||""})}),m.jsxs("p",{style:{fontSize:"1.25rem",lineHeight:"2rem"},children:["Valeur : ",Dn(k,{language:t}),k.nodeValue===void 0&&k.unit&&m.jsxs(m.Fragment,{children:[m.jsx("br",{}),"Unité : ",rt(k.unit)]})]}),P&&C&&m.jsx(m.Fragment,{children:m.jsxs("blockquote",{children:["Cette règle est ",m.jsx("strong",{children:"non applicable"})," car elle appartient à l’espace de nom :"," ",m.jsx(ne,{node:C})]})}),b&&m.jsxs("div",{style:{margin:"1rem 0",padding:"0rem 1rem",display:"flex",justifyContent:"flex-end",columnGap:"1rem",alignItems:"baseline",flexWrap:"wrap",background:"hsl(220, 60%, 97.5%)",borderRadius:"0.25rem"},children:[m.jsxs("p",{children:["Vous naviguez la documentation avec un"," ",m.jsx("strong",{children:"contexte"})," d’évaluation"," ",m.jsx("strong",{children:"spécifique"}),"."]}),m.jsx("div",{style:{flex:1}}),m.jsx("p",{style:{textAlign:"right",marginTop:0},children:m.jsx(mn,{dottedName:e,useSubEngine:!1,children:"Retourner à la version de base"})})]}),m.jsx("h2",{children:"Comment cette donnée est-elle calculée ?"}),m.jsx("div",{id:"documentation-rule-explanation",children:m.jsx(ne,{node:v})}),k.rawNode.note&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:"Note"}),m.jsx("div",{children:m.jsx(f,{children:k.rawNode.note})})]}),N&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:"Références"}),N]}),m.jsx("br",{}),u&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:"Informations techniques"}),m.jsx(f,{children:"Si vous êtes développeur/euse vous trouverez ci-dessous des informations techniques utiles pour l’intégration de cette règle dans votre application."}),m.jsx($S,{engine:y,situation:w,dottedName:e,rule:k,apiDocumentationUrl:i,apiEvaluateUrl:o,npmPackage:a})]})]})})]})})}var oC=ee.div` + display: flex; + flex-wrap: nowrap; + align-items: flex-start; + @media (max-width: ${Bn.lg}) { + flex-direction: column; + } +`,aC=ee.article` + flex-shrink: 1; + max-width: 100%; + @media (min-width: ${Bn.lg}) { + min-width: 0; + padding-left: 1rem; + border-left: 1px solid #e6e6e6; + margin-left: -1px; + } +`;function sC(e,t){const n=e.getSituation();return Object.fromEntries(Object.entries(n).filter(([i])=>{var o;return i===t.dottedName?!0:(o=t.traversedVariables)==null?void 0:o.includes(i)}))}/** + * @remix-run/router v1.15.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ho(){return ho=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function yy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function uC(){return Math.random().toString(36).substr(2,8)}function Gf(e,t){return{usr:e.state,key:e.key,idx:t}}function Ju(e,t,n,r){return n===void 0&&(n=null),ho({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?di(t):t,{state:n,key:t&&t.key||r||uC()})}function es(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function di(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function cC(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=Rn.Pop,l=null,u=c();u==null&&(u=0,a.replaceState(ho({},a.state,{idx:u}),""));function c(){return(a.state||{idx:null}).idx}function p(){s=Rn.Pop;let k=c(),h=k==null?null:k-u;u=k,l&&l({action:s,location:y.location,delta:h})}function f(k,h){s=Rn.Push;let g=Ju(y.location,k,h);u=c()+1;let v=Gf(g,u),C=y.createHref(g);try{a.pushState(v,"",C)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(C)}o&&l&&l({action:s,location:y.location,delta:1})}function d(k,h){s=Rn.Replace;let g=Ju(y.location,k,h);u=c();let v=Gf(g,u),C=y.createHref(g);a.replaceState(v,"",C),o&&l&&l({action:s,location:y.location,delta:0})}function b(k){let h=i.location.origin!=="null"?i.location.origin:i.location.href,g=typeof k=="string"?k:es(k);return g=g.replace(/ $/,"%20"),Te(h,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,h)}let y={get action(){return s},get location(){return e(i,a)},listen(k){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Kf,p),l=k,()=>{i.removeEventListener(Kf,p),l=null}},createHref(k){return t(i,k)},createURL:b,encodeLocation(k){let h=b(k);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:f,replace:d,go(k){return a.go(k)}};return y}var Qf;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Qf||(Qf={}));function pC(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?di(t):t,i=Cp(r.pathname||"/",n);if(i==null)return null;let o=xy(e);dC(o);let a=null;for(let s=0;a==null&&s{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(Te(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=qn([r,l.relativePath]),c=n.concat(l);o.children&&o.children.length>0&&(Te(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),xy(o.children,t,c,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:xC(u,o.index),routesMeta:c})};return e.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let l of by(o.path))i(o,a,l)}),t}function by(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=by(r.join("/")),s=[];return s.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function dC(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:bC(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const fC=/^:[\w-]+$/,mC=3,hC=2,gC=1,vC=10,yC=-2,Yf=e=>e==="*";function xC(e,t){let n=e.split("/"),r=n.length;return n.some(Yf)&&(r+=yC),t&&(r+=hC),n.filter(i=>!Yf(i)).reduce((i,o)=>i+(fC.test(o)?mC:o===""?gC:vC),r)}function bC(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function wC(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let a=0;a{let{paramName:f,isOptional:d}=c;if(f==="*"){let y=s[p]||"";a=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const b=s[p];return d&&!b?u[f]=void 0:u[f]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:a,pattern:e}}function kC(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),yy(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function SC(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return yy(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Cp(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function CC(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?di(e):e;return{pathname:n?n.startsWith("/")?n:NC(n,t):t,search:OC(r),hash:AC(i)}}function NC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Al(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function PC(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wy(e,t){let n=PC(e);return t?n.map((r,i)=>i===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ey(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=di(e):(i=ho({},e),Te(!i.pathname||!i.pathname.includes("?"),Al("?","pathname","search",i)),Te(!i.pathname||!i.pathname.includes("#"),Al("#","pathname","hash",i)),Te(!i.search||!i.search.includes("#"),Al("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let p=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),p-=1;i.pathname=f.join("/")}s=p>=0?t[p]:"/"}let l=CC(i,s),u=a&&a!=="/"&&a.endsWith("/"),c=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const qn=e=>e.join("/").replace(/\/\/+/g,"/"),jC=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),OC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,AC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function RC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ky=["post","put","patch","delete"];new Set(ky);const _C=["get",...ky];new Set(_C);/** + * React Router v6.22.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),_.useCallback(function(u,c){if(c===void 0&&(c={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let p=Ey(u,JSON.parse(a),o,c.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:qn([t,p.pathname])),(c.replace?r.replace:r.push)(p,c.state,c)},[t,r,a,o,e])}function zC(){let{matches:e}=_.useContext(Gn),t=e[e.length-1];return t?t.params:{}}function Ny(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=_.useContext(wr),{matches:i}=_.useContext(Gn),{pathname:o}=Is(),a=JSON.stringify(wy(i,r.v7_relativeSplatPath));return _.useMemo(()=>Ey(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function FC(e,t){return VC(e,t)}function VC(e,t,n,r){Po()||Te(!1);let{navigator:i}=_.useContext(wr),{matches:o}=_.useContext(Gn),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let u=Is(),c;if(t){var p;let k=typeof t=="string"?di(t):t;l==="/"||(p=k.pathname)!=null&&p.startsWith(l)||Te(!1),c=k}else c=u;let f=c.pathname||"/",d=f;if(l!=="/"){let k=l.replace(/^\//,"").split("/");d="/"+f.replace(/^\//,"").split("/").slice(k.length).join("/")}let b=pC(e,{pathname:d}),y=BC(b&&b.map(k=>Object.assign({},k,{params:Object.assign({},s,k.params),pathname:qn([l,i.encodeLocation?i.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?l:qn([l,i.encodeLocation?i.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),o,n,r);return t&&y?_.createElement(Ls.Provider,{value:{location:go({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Rn.Pop}},y):y}function DC(){let e=GC(),t=RC(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),n?_.createElement("pre",{style:i},n):null,null)}const qC=_.createElement(DC,null);class MC extends _.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?_.createElement(Gn.Provider,{value:this.props.routeContext},_.createElement(Sy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function UC(e){let{routeContext:t,match:n,children:r}=e,i=_.useContext(Np);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement(Gn.Provider,{value:t},r)}function BC(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let a=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let c=a.findIndex(p=>p.route.id&&(s==null?void 0:s[p.route.id]));c>=0||Te(!1),a=a.slice(0,Math.min(a.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((c,p,f)=>{let d,b=!1,y=null,k=null;n&&(d=s&&p.route.id?s[p.route.id]:void 0,y=p.route.errorElement||qC,l&&(u<0&&f===0?(b=!0,k=null):u===f&&(b=!0,k=p.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,f+1)),g=()=>{let v;return d?v=y:b?v=k:p.route.Component?v=_.createElement(p.route.Component,null):p.route.element?v=p.route.element:v=c,_.createElement(UC,{match:p,routeContext:{outlet:c,matches:h,isDataRoute:n!=null},children:v})};return n&&(p.route.ErrorBoundary||p.route.errorElement||f===0)?_.createElement(MC,{location:n.location,revalidation:n.revalidation,component:y,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}var Py=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Py||{}),ts=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ts||{});function WC(e){let t=_.useContext(Np);return t||Te(!1),t}function HC(e){let t=_.useContext(LC);return t||Te(!1),t}function KC(e){let t=_.useContext(Gn);return t||Te(!1),t}function jy(e){let t=KC(),n=t.matches[t.matches.length-1];return n.route.id||Te(!1),n.route.id}function GC(){var e;let t=_.useContext(Sy),n=HC(ts.UseRouteError),r=jy(ts.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function QC(){let{router:e}=WC(Py.UseNavigateStable),t=jy(ts.UseNavigateStable),n=_.useRef(!1);return Cy(()=>{n.current=!0}),_.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,go({fromRouteId:t},o)))},[e,t])}function Zu(e){Te(!1)}function YC(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Rn.Pop,navigator:o,static:a=!1,future:s}=e;Po()&&Te(!1);let l=t.replace(/^\/*/,"/"),u=_.useMemo(()=>({basename:l,navigator:o,static:a,future:go({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=di(r));let{pathname:c="/",search:p="",hash:f="",state:d=null,key:b="default"}=r,y=_.useMemo(()=>{let k=Cp(c,l);return k==null?null:{location:{pathname:k,search:p,hash:f,state:d,key:b},navigationType:i}},[l,c,p,f,d,b,i]);return y==null?null:_.createElement(wr.Provider,{value:u},_.createElement(Ls.Provider,{children:n,value:y}))}function XC(e){let{children:t,location:n}=e;return FC(ec(t),n)}new Promise(()=>{});function ec(e,t){t===void 0&&(t=[]);let n=[];return _.Children.forEach(e,(r,i)=>{if(!_.isValidElement(r))return;let o=[...t,i];if(r.type===_.Fragment){n.push.apply(n,ec(r.props.children,o));return}r.type!==Zu&&Te(!1),!r.props.index||!r.props.children||Te(!1);let a={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=ec(r.props.children,o)),n.push(a)}),n}/** + * React Router DOM v6.22.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function tc(){return tc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function ZC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function e2(e,t){return e.button===0&&(!t||t==="_self")&&!ZC(e)}const t2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],n2="6";try{window.__reactRouterVersion=n2}catch{}const r2="startTransition",Xf=B0[r2];function i2(e){let{basename:t,children:n,future:r,window:i}=e,o=_.useRef();o.current==null&&(o.current=lC({window:i,v5Compat:!0}));let a=o.current,[s,l]=_.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},c=_.useCallback(p=>{u&&Xf?Xf(()=>l(p)):l(p)},[l,u]);return _.useLayoutEffect(()=>a.listen(c),[a,c]),_.createElement(YC,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a,future:r})}const o2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",a2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Oy=_.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:a,state:s,target:l,to:u,preventScrollReset:c,unstable_viewTransition:p}=t,f=JC(t,t2),{basename:d}=_.useContext(wr),b,y=!1;if(typeof u=="string"&&a2.test(u)&&(b=u,o2))try{let v=new URL(window.location.href),C=u.startsWith("//")?new URL(v.protocol+u):new URL(u),P=Cp(C.pathname,d);C.origin===v.origin&&P!=null?u=P+C.search+C.hash:y=!0}catch{}let k=IC(u,{relative:i}),h=s2(u,{replace:a,state:s,target:l,preventScrollReset:c,relative:i,unstable_viewTransition:p});function g(v){r&&r(v),v.defaultPrevented||h(v)}return _.createElement("a",tc({},f,{href:b||k,onClick:y||o?r:g,ref:n,target:l}))});var Jf;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Jf||(Jf={}));var Zf;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Zf||(Zf={}));function s2(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a,unstable_viewTransition:s}=t===void 0?{}:t,l=TC(),u=Is(),c=Ny(e,{relative:a});return _.useCallback(p=>{if(e2(p,n)){p.preventDefault();let f=r!==void 0?r:es(u)===es(c);l(e,{replace:f,state:i,preventScrollReset:o,relative:a,unstable_viewTransition:s})}},[u,l,c,r,i,n,e,o,a,s])}const em=["http","https","mailto","tel"];function l2(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let i=-1;for(;++ii||(i=t.indexOf("#"),i!==-1&&r>i)?t:"javascript:void(0)"}/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */var u2=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)};const Ay=hr(u2);function Hi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?tm(e.position):"start"in e||"end"in e?tm(e):"line"in e||"column"in e?nc(e):""}function nc(e){return nm(e&&e.line)+":"+nm(e&&e.column)}function tm(e){return nc(e&&e.start)+"-"+nc(e&&e.end)}function nm(e){return e&&typeof e=="number"?e:1}class At extends Error{constructor(t,n,r){const i=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const a=r.indexOf(":");a===-1?i[1]=r:(i[0]=r.slice(0,a),i[1]=r.slice(a+1))}n&&("type"in n||"position"in n?n.position&&(o=n.position):"start"in n||"end"in n?o=n:("line"in n||"column"in n)&&(o.start=n)),this.name=Hi(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}At.prototype.file="";At.prototype.name="";At.prototype.reason="";At.prototype.message="";At.prototype.stack="";At.prototype.fatal=null;At.prototype.column=null;At.prototype.line=null;At.prototype.source=null;At.prototype.ruleId=null;At.prototype.position=null;const Bt={basename:c2,dirname:p2,extname:d2,join:f2,sep:"/"};function c2(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jo(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function p2(e){if(jo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function d2(e){jo(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.charCodeAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function f2(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function h2(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function jo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const g2={cwd:v2};function v2(){return"/"}function rc(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function y2(e){if(typeof e=="string")e=new URL(e);else if(!rc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return x2(e)}function x2(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||Ea.call(t,i)},um=function(t,n){om&&n.name==="__proto__"?om(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},cm=function(t,n){if(n==="__proto__")if(Ea.call(t,n)){if(am)return am(t,n).value}else return;return t[n]},w2=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});la.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(u){const c=u;if(s&&n)throw c;return i(c)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const S2=Iy().freeze(),Ly={}.hasOwnProperty;function Iy(){const e=E2(),t=[];let n={},r,i=-1;return o.data=a,o.Parser=void 0,o.Compiler=void 0,o.freeze=s,o.attachers=t,o.use=l,o.parse=u,o.stringify=c,o.run=p,o.runSync=f,o.process=d,o.processSync=b,o;function o(){const y=Iy();let k=-1;for(;++k{if(w||!N||!A)P(w);else{const B=o.stringify(N,A);B==null||(P2(B)?A.value=B:A.result=B),P(w,A)}});function P(w,N){w||!N?v(w):g?g(N):k(null,N)}}}function b(y){let k;o.freeze(),Il("processSync",o.Parser),Tl("processSync",o.Compiler);const h=Pi(y);return o.process(h,g),mm("processSync","process",k),h;function g(v){k=!0,im(v)}}}function dm(e,t){return typeof e=="function"&&e.prototype&&(C2(e.prototype)||t in e.prototype)}function C2(e){let t;for(t in e)if(Ly.call(e,t))return!0;return!1}function Il(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function Tl(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function $l(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fm(e){if(!ic(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function mm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Pi(e){return N2(e)?e:new Ry(e)}function N2(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function P2(e){return typeof e=="string"||Ay(e)}const j2={};function O2(e,t){const n=j2,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ty(e,r,i)}function Ty(e,t,n){if(A2(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return hm(e.children,t,n)}return Array.isArray(e)?hm(e,t,n):""}function hm(e,t,n){const r=[];let i=-1;for(;++ii?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o0?(Zt(e,e.length,0,t),e):t}const gm={}.hasOwnProperty;function R2(e){const t={};let n=-1;for(;++na))return;const N=t.events.length;let A=N,B,W;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(B){W=t.events[A][1].end;break}B=!0}for(h(r),w=N;wv;){const P=n[C];t.containerState=P[1],P[0].exit.call(t,e)}n.length=v}function g(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function B2(e,t,n){return ge(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ym(e){if(e===null||lt(e)||V2(e))return 1;if(F2(e))return 2}function Pp(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p=Object.assign({},e[r][1].end),f=Object.assign({},e[n][1].start);xm(p,-l),xm(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:p,end:Object.assign({},e[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:f},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},s.end),u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=kt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=kt(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),u=kt(u,Pp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=kt(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=kt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Zt(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&se(w)?ge(e,g,"linePrefix",o+1)(w):g(w)}function g(w){return w===null||Q(w)?e.check(wm,y,C)(w):(e.enter("codeFlowValue"),v(w))}function v(w){return w===null||Q(w)?(e.exit("codeFlowValue"),g(w)):(e.consume(w),v)}function C(w){return e.exit("codeFenced"),t(w)}function P(w,N,A){let B=0;return W;function W($){return w.enter("lineEnding"),w.consume($),w.exit("lineEnding"),D}function D($){return w.enter("codeFencedFence"),se($)?ge(w,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):S($)}function S($){return $===s?(w.enter("codeFencedFenceSequence"),R($)):A($)}function R($){return $===s?(B++,w.consume($),R):B>=a?(w.exit("codeFencedFenceSequence"),se($)?ge(w,T,"whitespace")($):T($)):A($)}function T($){return $===null||Q($)?(w.exit("codeFencedFence"),N($)):A($)}}}function nN(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const zl={name:"codeIndented",tokenize:iN},rN={tokenize:oN,partial:!0};function iN(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ge(e,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):Q(u)?e.attempt(rN,a,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||Q(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function oN(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ge(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):Q(a)?i(a):n(a)}}const aN={name:"codeText",tokenize:uN,resolve:sN,previous:lN};function sN(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Dy(e,t,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return p;function p(h){return h===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(h),e.exit(o),f):h===null||h===32||h===41||oc(h)?n(h):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(h))}function f(h){return h===62?(e.enter(o),e.consume(h),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===62?(e.exit("chunkString"),e.exit(s),f(h)):h===null||h===60||Q(h)?n(h):(e.consume(h),h===92?b:d)}function b(h){return h===60||h===62||h===92?(e.consume(h),d):d(h)}function y(h){return!c&&(h===null||h===41||lt(h))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(h)):c999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):Q(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),p(d))}function p(d){return d===null||d===91||d===93||Q(d)||s++>999?(e.exit("chunkString"),c(d)):(e.consume(d),l||(l=!se(d)),d===92?f:p)}function f(d){return d===91||d===92||d===93?(e.consume(d),s++,p):p(d)}}function My(e,t,n,r,i,o){let a;return s;function s(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,l):n(f)}function l(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(o),u(f))}function u(f){return f===a?(e.exit(o),l(a)):f===null?n(f):Q(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ge(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===a||f===null||Q(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?p:c)}function p(f){return f===a||f===92?(e.consume(f),c):c(f)}}function Ki(e,t){let n;return r;function r(i){return Q(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):se(i)?ge(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function Hr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const gN={name:"definition",tokenize:yN},vN={tokenize:xN,partial:!0};function yN(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),a(d)}function a(d){return qy.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=Hr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return lt(d)?Ki(e,u)(d):u(d)}function u(d){return Dy(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(vN,p,p)(d)}function p(d){return se(d)?ge(e,f,"whitespace")(d):f(d)}function f(d){return d===null||Q(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function xN(e,t,n){return r;function r(s){return lt(s)?Ki(e,i)(s):n(s)}function i(s){return My(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return se(s)?ge(e,a,"whitespace")(s):a(s)}function a(s){return s===null||Q(s)?t(s):n(s)}}const bN={name:"hardBreakEscape",tokenize:wN};function wN(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Q(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const EN={name:"headingAtx",tokenize:SN,resolve:kN};function kN(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Zt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function SN(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(e.consume(c),a):c===null||lt(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||Q(c)?(e.exit("atxHeading"),t(c)):se(c)?ge(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||lt(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}const CN=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],km=["pre","script","style","textarea"],NN={name:"htmlFlow",tokenize:AN,resolveTo:ON,concrete:!0},PN={tokenize:_N,partial:!0},jN={tokenize:RN,partial:!0};function ON(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function AN(e,t,n){const r=this;let i,o,a,s,l;return u;function u(E){return c(E)}function c(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),p}function p(E){return E===33?(e.consume(E),f):E===47?(e.consume(E),o=!0,y):E===63?(e.consume(E),i=3,r.interrupt?t:x):Kt(E)?(e.consume(E),a=String.fromCharCode(E),k):n(E)}function f(E){return E===45?(e.consume(E),i=2,d):E===91?(e.consume(E),i=5,s=0,b):Kt(E)?(e.consume(E),i=4,r.interrupt?t:x):n(E)}function d(E){return E===45?(e.consume(E),r.interrupt?t:x):n(E)}function b(E){const ae="CDATA[";return E===ae.charCodeAt(s++)?(e.consume(E),s===ae.length?r.interrupt?t:S:b):n(E)}function y(E){return Kt(E)?(e.consume(E),a=String.fromCharCode(E),k):n(E)}function k(E){if(E===null||E===47||E===62||lt(E)){const ae=E===47,we=a.toLowerCase();return!ae&&!o&&km.includes(we)?(i=1,r.interrupt?t(E):S(E)):CN.includes(a.toLowerCase())?(i=6,ae?(e.consume(E),h):r.interrupt?t(E):S(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):o?g(E):v(E))}return E===45||ht(E)?(e.consume(E),a+=String.fromCharCode(E),k):n(E)}function h(E){return E===62?(e.consume(E),r.interrupt?t:S):n(E)}function g(E){return se(E)?(e.consume(E),g):W(E)}function v(E){return E===47?(e.consume(E),W):E===58||E===95||Kt(E)?(e.consume(E),C):se(E)?(e.consume(E),v):W(E)}function C(E){return E===45||E===46||E===58||E===95||ht(E)?(e.consume(E),C):P(E)}function P(E){return E===61?(e.consume(E),w):se(E)?(e.consume(E),P):v(E)}function w(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),l=E,N):se(E)?(e.consume(E),w):A(E)}function N(E){return E===l?(e.consume(E),l=null,B):E===null||Q(E)?n(E):(e.consume(E),N)}function A(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||lt(E)?P(E):(e.consume(E),A)}function B(E){return E===47||E===62||se(E)?v(E):n(E)}function W(E){return E===62?(e.consume(E),D):n(E)}function D(E){return E===null||Q(E)?S(E):se(E)?(e.consume(E),D):n(E)}function S(E){return E===45&&i===2?(e.consume(E),U):E===60&&i===1?(e.consume(E),q):E===62&&i===4?(e.consume(E),F):E===63&&i===3?(e.consume(E),x):E===93&&i===5?(e.consume(E),z):Q(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(PN,H,R)(E)):E===null||Q(E)?(e.exit("htmlFlowData"),R(E)):(e.consume(E),S)}function R(E){return e.check(jN,T,H)(E)}function T(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),$}function $(E){return E===null||Q(E)?R(E):(e.enter("htmlFlowData"),S(E))}function U(E){return E===45?(e.consume(E),x):S(E)}function q(E){return E===47?(e.consume(E),a="",O):S(E)}function O(E){if(E===62){const ae=a.toLowerCase();return km.includes(ae)?(e.consume(E),F):S(E)}return Kt(E)&&a.length<8?(e.consume(E),a+=String.fromCharCode(E),O):S(E)}function z(E){return E===93?(e.consume(E),x):S(E)}function x(E){return E===62?(e.consume(E),F):E===45&&i===2?(e.consume(E),x):S(E)}function F(E){return E===null||Q(E)?(e.exit("htmlFlowData"),H(E)):(e.consume(E),F)}function H(E){return e.exit("htmlFlow"),t(E)}}function RN(e,t,n){const r=this;return i;function i(a){return Q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function _N(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ts,t,n)}}const LN={name:"htmlText",tokenize:IN};function IN(e,t,n){const r=this;let i,o,a;return s;function s(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),l}function l(x){return x===33?(e.consume(x),u):x===47?(e.consume(x),P):x===63?(e.consume(x),v):Kt(x)?(e.consume(x),A):n(x)}function u(x){return x===45?(e.consume(x),c):x===91?(e.consume(x),o=0,b):Kt(x)?(e.consume(x),g):n(x)}function c(x){return x===45?(e.consume(x),d):n(x)}function p(x){return x===null?n(x):x===45?(e.consume(x),f):Q(x)?(a=p,q(x)):(e.consume(x),p)}function f(x){return x===45?(e.consume(x),d):p(x)}function d(x){return x===62?U(x):x===45?f(x):p(x)}function b(x){const F="CDATA[";return x===F.charCodeAt(o++)?(e.consume(x),o===F.length?y:b):n(x)}function y(x){return x===null?n(x):x===93?(e.consume(x),k):Q(x)?(a=y,q(x)):(e.consume(x),y)}function k(x){return x===93?(e.consume(x),h):y(x)}function h(x){return x===62?U(x):x===93?(e.consume(x),h):y(x)}function g(x){return x===null||x===62?U(x):Q(x)?(a=g,q(x)):(e.consume(x),g)}function v(x){return x===null?n(x):x===63?(e.consume(x),C):Q(x)?(a=v,q(x)):(e.consume(x),v)}function C(x){return x===62?U(x):v(x)}function P(x){return Kt(x)?(e.consume(x),w):n(x)}function w(x){return x===45||ht(x)?(e.consume(x),w):N(x)}function N(x){return Q(x)?(a=N,q(x)):se(x)?(e.consume(x),N):U(x)}function A(x){return x===45||ht(x)?(e.consume(x),A):x===47||x===62||lt(x)?B(x):n(x)}function B(x){return x===47?(e.consume(x),U):x===58||x===95||Kt(x)?(e.consume(x),W):Q(x)?(a=B,q(x)):se(x)?(e.consume(x),B):U(x)}function W(x){return x===45||x===46||x===58||x===95||ht(x)?(e.consume(x),W):D(x)}function D(x){return x===61?(e.consume(x),S):Q(x)?(a=D,q(x)):se(x)?(e.consume(x),D):B(x)}function S(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,R):Q(x)?(a=S,q(x)):se(x)?(e.consume(x),S):(e.consume(x),T)}function R(x){return x===i?(e.consume(x),i=void 0,$):x===null?n(x):Q(x)?(a=R,q(x)):(e.consume(x),R)}function T(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||lt(x)?B(x):(e.consume(x),T)}function $(x){return x===47||x===62||lt(x)?B(x):n(x)}function U(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function q(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),O}function O(x){return se(x)?ge(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):z(x)}function z(x){return e.enter("htmlTextData"),a(x)}}const Op={name:"labelEnd",tokenize:DN,resolveTo:VN,resolveAll:FN},TN={tokenize:qN},$N={tokenize:MN},zN={tokenize:UN};function FN(e){let t=-1;for(;++t=3&&(u===null||Q(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),se(u)?ge(e,s,"whitespace")(u):s(u))}}const et={name:"list",tokenize:JN,continuation:{tokenize:ZN},exit:tP},YN={tokenize:nP,partial:!0},XN={tokenize:eP,partial:!0};function JN(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(d){const b=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:ac(d)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(ka,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return ac(d)&&++a<10?(e.consume(d),l):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Ts,r.interrupt?n:c,e.attempt(YN,f,p))}function c(d){return r.containerState.initialBlankLine=!0,o++,f(d)}function p(d){return se(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),f):n(d)}function f(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function ZN(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ts,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ge(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!se(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(XN,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ge(e,e.attempt(et,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function eP(e,t,n){const r=this;return ge(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function tP(e){e.exit(this.containerState.type)}function nP(e,t,n){const r=this;return ge(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!se(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Sm={name:"setextUnderline",tokenize:iP,resolveTo:rP};function rP(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=a,e.push(["exit",a,t]),e}function iP(e,t,n){const r=this;let i;return o;function o(u){let c=r.events.length,p;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){p=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),se(u)?ge(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Q(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const oP={tokenize:aP};function aP(e){const t=this,n=e.attempt(Ts,r,e.attempt(this.parser.constructs.flowInitial,i,ge(e,e.attempt(this.parser.constructs.flow,i,e.attempt(pN,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const sP={resolveAll:By()},lP=Uy("string"),uP=Uy("text");function Uy(e){return{tokenize:t,resolveAll:By(e==="text"?cP:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(c){return u(c)?o(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const p=i[c];let f=-1;if(p)for(;++f-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function fP(e,t){let n=-1;const r=[];let i;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const PP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jP(e){return e.replace(PP,OP)}function OP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Wy(n.slice(o?2:1),o?16:10)}return jp(n)||e}const Hy={}.hasOwnProperty,AP=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),RP(n)(NP(SP(n).document().write(CP()(e,t,!0))))};function RP(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(qp),autolinkProtocol:D,autolinkEmail:D,atxHeading:s(Fp),blockQuote:s(ut),characterEscape:D,characterReference:D,codeFenced:s(ct),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(ct,l),codeText:s(v0,l),codeTextData:D,data:D,codeFlowValue:D,definition:s(y0),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(x0),hardBreakEscape:s(Vp),hardBreakTrailing:s(Vp),htmlFlow:s(Dp,l),htmlFlowData:D,htmlText:s(Dp,l),htmlTextData:D,image:s(b0),label:l,link:s(qp),listItem:s(w0),listItemValue:b,listOrdered:s(Mp,d),listUnordered:s(Mp),paragraph:s(E0),reference:we,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(Fp),strong:s(k0),thematicBreak:s(C0)},exit:{atxHeading:c(),atxHeadingSequence:N,autolink:c(),autolinkEmail:We,autolinkProtocol:je,blockQuote:c(),characterEscapeValue:S,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:Re,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:y,codeFencedFenceMeta:k,codeFlowValue:S,codeIndented:c(v),codeText:c(q),codeTextData:S,data:S,definition:c(),definitionDestinationString:w,definitionLabelString:C,definitionTitleString:P,emphasis:c(),hardBreakEscape:c(T),hardBreakTrailing:c(T),htmlFlow:c($),htmlFlowData:S,htmlText:c(U),htmlTextData:S,image:c(z),label:F,labelText:x,lineEnding:R,link:c(O),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:te,resourceDestinationString:H,resourceTitleString:E,resource:ae,setextHeading:c(W),setextHeadingLineSequence:B,setextHeadingText:A,strong:c(),thematicBreak:c()}};Ky(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(j){let V={type:"root",children:[]};const G={stack:[V],tokenStack:[],config:t,enter:u,exit:p,buffer:l,resume:f,setData:o,getData:a},de=[];let fe=-1;for(;++fe0){const Lt=G.tokenStack[G.tokenStack.length-1];(Lt[1]||Nm).call(G,void 0,Lt[0])}for(V.position={start:En(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:En(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe{const r=this.data("settings");return AP(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function IP(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function TP(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` +`}]}function $P(e,t){const n=t.value?t.value+` +`:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};r&&(i.className=["language-"+r]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function zP(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FP(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fi(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Gy(e,t){const n=String(t.identifier).toUpperCase(),r=fi(n.toLowerCase()),i=e.footnoteOrder.indexOf(n);let o;i===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,o=e.footnoteOrder.length):(e.footnoteCounts[n]++,o=i+1);const a=e.footnoteCounts[n],s={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,s);const l={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,l),e.applyData(t,l)}function VP(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},Gy(e,{type:"footnoteReference",identifier:i,position:t.position})}function DP(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qP(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function Qy(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return{type:"text",value:"!["+t.alt+r};const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function MP(e,t){const n=e.definition(t.identifier);if(!n)return Qy(e,t);const r={src:fi(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function UP(e,t){const n={src:fi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function BP(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function WP(e,t){const n=e.definition(t.identifier);if(!n)return Qy(e,t);const r={href:fi(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function HP(e,t){const n={href:fi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function KP(e,t,n){const r=e.all(t),i=n?GP(n):Yy(t),o={},a=[];if(typeof t.checked=="boolean"){const c=r[0];let p;c&&c.type==="element"&&c.tagName==="p"?p=c:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function QP(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i-1?r.offset:null}}}function ej(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Ap(t.children[1]),l=Rp(t.children[t.children.length-1]);s.line&&l.line&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function tj(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Om(t.slice(i),i>0,!1)),o.join("")}function Om(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Pm||o===jm;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Pm||o===jm;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ij(e,t){const n={type:"text",value:rj(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function oj(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const aj={blockquote:IP,break:TP,code:$P,delete:zP,emphasis:FP,footnoteReference:Gy,footnote:VP,heading:DP,html:qP,imageReference:MP,image:UP,inlineCode:BP,linkReference:WP,link:HP,listItem:KP,list:QP,paragraph:YP,root:XP,strong:JP,table:ej,tableCell:nj,tableRow:tj,text:ij,thematicBreak:oj,toml:ta,yaml:ta,definition:ta,footnoteDefinition:ta};function ta(){return null}const Jy=function(e){if(e==null)return cj;if(typeof e=="string")return uj(e);if(typeof e=="object")return Array.isArray(e)?sj(e):lj(e);if(typeof e=="function")return $s(e);throw new Error("Expected function, string, or object as test")};function sj(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let f=[],d,b,y;if((!t||i(s,l,u[u.length-1]||null))&&(f=mj(n(s,u)),f[0]===Am))return f;if(s.children&&f[0]!==dj)for(b=(r?s.children.length:-1)+o,y=u.concat(s);b>-1&&b{const i=_m(r.identifier);i&&!Rm.call(t,i)&&(t[i]=r)}),n;function n(r){const i=_m(r);return i&&Rm.call(t,i)?t[i]:null}}function _m(e){return String(e||"").toUpperCase()}const ns={}.hasOwnProperty;function vj(e,t){const n=t||{},r=n.allowDangerousHtml||!1,i={};return a.dangerous=r,a.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,a.footnoteLabel=n.footnoteLabel||"Footnotes",a.footnoteLabelTagName=n.footnoteLabelTagName||"h2",a.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},a.footnoteBackLabel=n.footnoteBackLabel||"Back to content",a.unknownHandler=n.unknownHandler,a.passThrough=n.passThrough,a.handlers={...aj,...n.handlers},a.definition=gj(e),a.footnoteById=i,a.footnoteOrder=[],a.footnoteCounts={},a.patch=yj,a.applyData=xj,a.one=s,a.all=l,a.wrap=wj,a.augment=o,_p(e,"footnoteDefinition",u=>{const c=String(u.identifier).toUpperCase();ns.call(i,c)||(i[c]=u)}),a;function o(u,c){if(u&&"data"in u&&u.data){const p=u.data;p.hName&&(c.type!=="element"&&(c={type:"element",tagName:"",properties:{},children:[]}),c.tagName=p.hName),c.type==="element"&&p.hProperties&&(c.properties={...c.properties,...p.hProperties}),"children"in c&&c.children&&p.hChildren&&(c.children=p.hChildren)}if(u){const p="type"in u?u:{position:u};hj(p)||(c.position={start:Ap(p),end:Rp(p)})}return c}function a(u,c,p,f){return Array.isArray(p)&&(f=p,p={}),o(u,{type:"element",tagName:c,properties:p||{},children:f||[]})}function s(u,c){return Zy(a,u,c)}function l(u){return Lp(a,u)}}function yj(e,t){e.position&&(t.position=ZP(e))}function xj(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Zy(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return ns.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:Lp(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):bj(e,t)}function Lp(e,t){const n=[];if("children"in t){const r=t.children;let i=-1;for(;++i0&&n.push({type:"text",value:` +`}),n}function Ej(e){const t=[];let n=-1;for(;++n1?"-"+s:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};s>1&&p.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(s)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(p)}const u=i[i.length-1];if(u&&u.type==="element"&&u.tagName==="p"){const p=u.children[u.children.length-1];p&&p.type==="text"?p.value+=" ":u.children.push({type:"text",value:" "}),u.children.push(...l)}else i.push(...l);const c={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+a},children:e.wrap(i,!0)};e.patch(r,c),t.push(c)}if(t.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:e.footnoteLabel}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(t,!0)},{type:"text",value:` +`}]}}function e0(e,t){const n=vj(e,t),r=n.one(e,null),i=Ej(n);return i&&r.children.push({type:"text",value:` +`},i),Array.isArray(r)?{type:"root",children:r}:r}const kj=function(e,t){return e&&"run"in e?Sj(e,t):Cj(e||t)};function Sj(e,t){return(n,r,i)=>{e.run(e0(n,t),r,o=>{i(o)})}}function Cj(e){return t=>e0(t,e)}var t0={exports:{}},Nj="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Pj=Nj,jj=Pj;function n0(){}function r0(){}r0.resetWarningCache=n0;var Oj=function(){function e(r,i,o,a,s,l){if(l!==jj){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r0,resetWarningCache:n0};return n.PropTypes=n,n};t0.exports=Oj();var Aj=t0.exports;const X=hr(Aj);class Oo{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Oo.prototype.property={};Oo.prototype.normal={};Oo.prototype.space=null;function i0(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&Tj.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Im,Vj);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Im.test(o)){let a=o.replace($j,Fj);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Ip}return new i(r,t)}function Fj(e){return"-"+e.toLowerCase()}function Vj(e){return e.charAt(1).toUpperCase()}const Tm={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Dj=i0([s0,a0,c0,p0,Lj],"html"),qj=i0([s0,a0,c0,p0,Ij],"svg");function Mj(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{_p(t,"element",(n,r,i)=>{const o=i;let a;if(e.allowedElements?a=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(a=e.disallowedElements.includes(n.tagName)),!a&&e.allowElement&&typeof r=="number"&&(a=!e.allowElement(n,r,o)),a&&typeof r=="number")return e.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}var d0={exports:{}},ce={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Tp=Symbol.for("react.element"),$p=Symbol.for("react.portal"),zs=Symbol.for("react.fragment"),Fs=Symbol.for("react.strict_mode"),Vs=Symbol.for("react.profiler"),Ds=Symbol.for("react.provider"),qs=Symbol.for("react.context"),Uj=Symbol.for("react.server_context"),Ms=Symbol.for("react.forward_ref"),Us=Symbol.for("react.suspense"),Bs=Symbol.for("react.suspense_list"),Ws=Symbol.for("react.memo"),Hs=Symbol.for("react.lazy"),Bj=Symbol.for("react.offscreen"),f0;f0=Symbol.for("react.module.reference");function _t(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Tp:switch(e=e.type,e){case zs:case Vs:case Fs:case Us:case Bs:return e;default:switch(e=e&&e.$$typeof,e){case Uj:case qs:case Ms:case Hs:case Ws:case Ds:return e;default:return t}}case $p:return t}}}ce.ContextConsumer=qs;ce.ContextProvider=Ds;ce.Element=Tp;ce.ForwardRef=Ms;ce.Fragment=zs;ce.Lazy=Hs;ce.Memo=Ws;ce.Portal=$p;ce.Profiler=Vs;ce.StrictMode=Fs;ce.Suspense=Us;ce.SuspenseList=Bs;ce.isAsyncMode=function(){return!1};ce.isConcurrentMode=function(){return!1};ce.isContextConsumer=function(e){return _t(e)===qs};ce.isContextProvider=function(e){return _t(e)===Ds};ce.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Tp};ce.isForwardRef=function(e){return _t(e)===Ms};ce.isFragment=function(e){return _t(e)===zs};ce.isLazy=function(e){return _t(e)===Hs};ce.isMemo=function(e){return _t(e)===Ws};ce.isPortal=function(e){return _t(e)===$p};ce.isProfiler=function(e){return _t(e)===Vs};ce.isStrictMode=function(e){return _t(e)===Fs};ce.isSuspense=function(e){return _t(e)===Us};ce.isSuspenseList=function(e){return _t(e)===Bs};ce.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===zs||e===Vs||e===Fs||e===Us||e===Bs||e===Bj||typeof e=="object"&&e!==null&&(e.$$typeof===Hs||e.$$typeof===Ws||e.$$typeof===Ds||e.$$typeof===qs||e.$$typeof===Ms||e.$$typeof===f0||e.getModuleId!==void 0)};ce.typeOf=_t;d0.exports=ce;var Wj=d0.exports;const Hj=hr(Wj);function Kj(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}function Gj(e){return e.join(" ").trim()}function Qj(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var zp={exports:{}},$m=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Yj=/\n/g,Xj=/^\s*/,Jj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Zj=/^:\s*/,eO=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,tO=/^[;\s]*/,nO=/^\s+|\s+$/g,rO=` +`,zm="/",Fm="*",Jn="",iO="comment",oO="declaration",aO=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(b){var y=b.match(Yj);y&&(n+=y.length);var k=b.lastIndexOf(rO);r=~k?b.length-k:r+b.length}function o(){var b={line:n,column:r};return function(y){return y.position=new a(b),u(),y}}function a(b){this.start=b,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(b){var y=new Error(t.source+":"+n+":"+r+": "+b);if(y.reason=b,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(b){var y=b.exec(e);if(y){var k=y[0];return i(k),e=e.slice(k.length),y}}function u(){l(Xj)}function c(b){var y;for(b=b||[];y=p();)y!==!1&&b.push(y);return b}function p(){var b=o();if(!(zm!=e.charAt(0)||Fm!=e.charAt(1))){for(var y=2;Jn!=e.charAt(y)&&(Fm!=e.charAt(y)||zm!=e.charAt(y+1));)++y;if(y+=2,Jn===e.charAt(y-1))return s("End of comment missing");var k=e.slice(2,y-2);return r+=2,i(k),e=e.slice(y),r+=2,b({type:iO,comment:k})}}function f(){var b=o(),y=l(Jj);if(y){if(p(),!l(Zj))return s("property missing ':'");var k=l(eO),h=b({type:oO,property:Vm(y[0].replace($m,Jn)),value:k?Vm(k[0].replace($m,Jn)):Jn});return l(tO),h}}function d(){var b=[];c(b);for(var y;y=f();)y!==!1&&(b.push(y),c(b));return b}return u(),d()};function Vm(e){return e?e.replace(nO,Jn):Jn}var sO=aO;function m0(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=sO(e),o=typeof t=="function",a,s,l=0,u=i.length;l0?gt.createElement(d,l,p):gt.createElement(d,l)}function dO(e){let t=-1;for(;++t for more info)`),delete na[o]}const t=S2().use(LP).use(e.remarkPlugins||[]).use(kj,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(Mj,e),n=new Ry;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=gt.createElement(gt.Fragment,{},h0({options:e,schema:Dj,listDepth:0},r));return e.className&&(i=gt.createElement("div",{className:e.className},i)),i}g0.propTypes={children:X.string,className:X.string,allowElement:X.func,allowedElements:X.arrayOf(X.string),disallowedElements:X.arrayOf(X.string),unwrapDisallowed:X.bool,remarkPlugins:X.arrayOf(X.oneOfType([X.object,X.func,X.arrayOf(X.oneOfType([X.bool,X.string,X.object,X.func,X.arrayOf(X.any)]))])),rehypePlugins:X.arrayOf(X.oneOfType([X.object,X.func,X.arrayOf(X.oneOfType([X.bool,X.string,X.object,X.func,X.arrayOf(X.any)]))])),sourcePos:X.bool,rawSourcePos:X.bool,skipHtml:X.bool,includeElementIndex:X.bool,transformLinkUri:X.oneOfType([X.func,X.bool]),linkTarget:X.oneOfType([X.func,X.string]),transformImageUri:X.func,components:X.object};const yO={titre:"Informations sur la voiture",description:`Pour calculer l'empreinte carbone de votre voiture, nous avons besoin de +quelques informations concernant le véhicule que vous utilisez. +`},xO={titre:"Usage de la voiture",description:`Pour affiner le calcul, il est nécessaire de préciser l'usage que vous +avez de votre voiture. +`},bO={titre:"Nos Gestes Climat",description:`Ce modèle utilise une partie des règles de calcul du modèle de [Nos +Gestes Climat](https://nosgestesclimat.fr) pour calculer l'empreinte +CO2e. +`},wO={titre:"Empreinte carbone de votre voiture",description:`Empreinte carbone de l'utilisation de votre voiture par an et par +personne. +`,valeur:"ngc . transport . voiture",contexte:{"ngc . transport . voiture . utilisateur":"'propriétaire'","ngc . transport . voiture . gabarit":"voiture . gabarit","ngc . transport . voiture . motorisation":"voiture . motorisation","ngc . transport . voiture . thermique . carburant":"voiture . thermique . carburant","ngc . transport . voiture . km":"usage . distance totale","ngc . transport . voiture . voyageurs":1},unité:"kgCO2e/an/personne"},EO={},kO={voiture:yO,"voiture . motorisation":{question:"Quel type de voiture possédez-vous ?","par défaut":"'thermique'",formule:{"une possibilité":{"choix obligatoire":"oui",possibilités:["thermique","hybride","électrique"]}}},"voiture . motorisation . thermique":{titre:"Thermique (diesel/essence/GPL)"},"voiture . motorisation . électrique":{titre:"Électrique"},"voiture . motorisation . hybride":{titre:"Hybride"},"voiture . thermique":{titre:"Voiture thermique"},"voiture . thermique . carburant":{question:"Quel type de carburant utilise-t-elle ?","applicable si":{"toutes ces conditions":[{"une de ces conditions":["motorisation = 'thermique'","motorisation = 'hybride'"]}]},description:`Pour comprendre les différents types de carburants, [cet article +pédagogique](https://www.francetvinfo.fr/economie/automobile/essence/les-carburants-changent-de-nom-a-la-pompe-voici-comment-vous-y-retrouver_2967013.html) +est très utile. + +[Cet +article](https://www.ecologie.gouv.fr/carburants-et-combustibles-autorises-en-france) +du ministère de l'Écologie explique plus en détail les carburants légaux +en France. + +> Attention, si le type de carburant fait varier de façon significative +> l'empreinte climat au litre, la consommation en litre par 100km elle +> aussi varie. Veillez à saisir une consommation au litre basée sur votre +> moyenne réelle. +`,formule:{"une possibilité":{"choix obligatoire":"oui",possibilités:["gazole B7 ou B10","essence E5 ou E10","essence E85","GPL"]}},"par défaut":"'essence E5 ou E10'",note:`La domination du couple gazole-essence est écrasante +[source](https://www.leprogres.fr/magazine-automobile/2021/03/27/quels-sont-les-carburants-les-plus-utilises-dans-votre-commune). + +Par contre, parmi les véhicules neufs, l'essence domine aujourd'hui. + +Le facteur d'émission associé au biocarburant E85 n'est pas représentatif +des conséquences environnementales liées à l'utilisation des biocarburants. +En effet, au vu des problématiques liées au changement d'affectation des +sols et autres impacts environnementaux liés à la culture du maïs par +exemple, les **biocarburants** ne sont pas pris en compte (le facteur +d'émission de la base carbone étant particulièrement incertain). Voir nos +discussions +[ici](https://github.com/incubateur-ademe/nosgestesclimat/pull/1324). + +Le GPL (Gaz de Pétrole Liquéfiés) est un [résidu de l'extraction du pétrole +qui était autrefois +brûlé](https://fr.wikipedia.org/wiki/Gaz_de_p%C3%A9trole_liqu%C3%A9fi%C3%A9). +Il a une empreinte carbone par litre moins importante que les véhicules +essence ou diesel, par contre sa consommation est légèrement supérieure, ce +qui compense légèrement le gain. Mais si les rejets de CO2e sont au final +presque équivalents entre le GPL et les autres carburants, c'est [du côté +de l'émission de particules +nocives](https://agirpourlatransition.ademe.fr/particuliers/conso/conso-responsable/comment-choisir-voiture-deux-roues-moins-polluant) +que le GPL est un bien meilleur élève que les autres carburants thermiques. +`},"voiture . thermique . carburant . gazole B7 ou B10":{titre:"Gazole (B7 ou B10)"},"voiture . thermique . carburant . essence E5 ou E10":{titre:"Essence (E5 ou E10)"},"voiture . thermique . carburant . essence E85":{titre:"Essence E85 (biocarburants)"},"voiture . thermique . carburant . GPL":{titre:"GPL (Gaz de Pétrole Liquéfiés)"},"voiture . gabarit":{question:"Quel est son gabarit ?",formule:{"une possibilité":{"choix obligatoire":"oui",possibilités:["petite","moyenne","VUL","berline","SUV"]}},"par défaut":"'berline'",note:`Nous considérons que la voiture par défaut est une "Berline", en témoigne +[une étude menée par AAA +Data](https://www.alphabet.com/fr-fr/parc-automobile-roulant-les-donnees-cles) +qui indique que "Si les SUV ont représenté 38 % des ventes de véhicules en +2019, ils ne représentent que 16 % de la totalité des véhicules en +circulation, loin derrière les berlines qui comptent pour 58 %, soit 23 +millions de véhicules." +`},"voiture . gabarit . petite":{titre:"Petite",description:"Citadine type Zoé, Fiat 500"},"voiture . gabarit . moyenne":{titre:"Moyenne",description:"Modèle au dessus de la petite citadine, type Mégane, Golf"},"voiture . gabarit . VUL":{titre:"Véhicule utilitaire",description:"Camionette de type Kangoo ou Partner jusqu'au Trafic et Vito"},"voiture . gabarit . berline":{titre:"Berline",description:"Une voiture longue, type 308, Tesla Model 3, Audi A3"},"voiture . gabarit . SUV":{titre:"SUV",description:'Sport utility vehicle", type 4x4 urbain'},usage:xO,"usage . distance totale":{titre:"Distance totale parcourue à l'année par votre voiture",somme:["quotidien . distance calculée","vacances . distance calculée"],unité:"km/an"},"usage . quotidien":{titre:"Usage quotidien",description:`Renseignez les informations concernant l'usage au quotidien de votre +voiture. + +Par exemple, pour aller au travail, faire les courses ou transporter vos +enfants à l'école. +`},"usage . quotidien . distance calculée":{titre:"Distance parcourue par personne au quotidien",formule:"(distance * commun . jours par an) / nb personne",unité:"km/an/personne"},"usage . quotidien . distance":{question:"Combien de kilomètres parcourez-vous en moyenne par jours ?","par défaut":33,unité:"km/jour",note:`D'après [cette article du +Monde](https://www.lemonde.fr/les-decodeurs/article/2023/01/22/qui-pourrait-se-passer-de-sa-voiture-six-graphiques-pour-analyser-nos-trajets-du-quotidien_6158829_4355770.html) +s'appuyant sur la +[thèse](https://chair-energy-prosperity.org/publications/travail-de-these-decarboner-transports-dici-2050/) +d'Aurélien Bigo, les trajets du quotidien sont en moyenne de 33km/jour en +2019. +`},"usage . quotidien . nb personne":{question:"Combien de personnes en moyenne sont dans la voiture lors de ces trajets ?","par défaut":1.5,unité:"personne"},"usage . vacances":{titre:"Usage pour les vacances",description:`Renseignez les informations concernant l'usage de votre voiture pour les +vacances. + +Par exemple, les déplacements pour les vacances d'été ou d'hiver ou +encore pour les week-ends. +`},"usage . vacances . distance calculée":{titre:"Distance parcourue par personne pour les vacances",formule:"distance / nb personne",unité:"km/an/personne"},"usage . vacances . distance":{question:"Combien de kilomètres parcourez-vous en moyenne pour vos vacances par an ?","par défaut":500,unité:"km/an"},"usage . vacances . nb personne":{question:"Combien de personnes en moyenne sont dans la voiture lors de ces trajets ?","par défaut":3,unité:"personne"},"ngc . transport . voiture":{titre:"voiture",icônes:"🚘",formule:{variations:[{si:"km = 0",alors:0},{sinon:{variations:[{si:{"est défini":"utilisateur"},alors:{variations:[{si:{"une de ces conditions":["utilisateur = 'propriétaire'","utilisateur = 'régulier non propriétaire'"]},alors:"empreinte calculée"},{si:"utilisateur = 'non régulier'",alors:"empreinte moyenne non régulier"}]}},{sinon:"empreinte moyenne"}]}}]},unité:"kgCO2e",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +![](https://upload.wikimedia.org/wikipedia/commons/9/9a/Congestion_caused_by_a_road_accident%2C_Algarve%2C_Portugal.jpg) + +La voiture est aujourd'hui en France essentiellement thermique (essence, diesel), bien que l'électrique progresse lentement. + +Pourtant, électrique ou thermique, elle reste un moyen de déplacement très peu efficient : +**il s'agit en moyenne de déplacer un humain de 80kg dans une boîte en métal de 1200kg**. + +Un peu comme si chaque midi, nous faisions à manger pour 10 avant de jeter 90% de la nourriture, ou que nous décidions de chauffer tout le pâté de maisons plutôt que l'intérieur de chacune des 10 maisons. + +Notons finalement qu'il est important de prendre en compte à la fois l'usage (les km parcourus) et la construction de ce véhicule de plus d'une tonne de matériaux divers. +`},"ngc . transport . voiture . km":{titre:"Km en voiture",question:"Quelle distance parcourez-vous à l'année en voiture ?",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Ne comptez que les kilomètres de déplacement personnel (courses, loisirs, famille, etc.) et de déplacement domicile travail pour rejoindre votre lieu de travail habituel. + +Par exemple, si vous êtes en mission professionnelle dans un autre département ou un autre pays, cela rentre dans la comptabilité de votre entreprise : ne le comptez pas ici. +`,"par défaut":8210,unité:"km",plancher:0,suggestions:{zéro:0,vacances:2e3,"10km / jour":3600,"1000km / mois":12e3,"20 000km / an":2e4}},"ngc . transport . voiture . utilisateur":{question:"Utilisez-vous majoritairement la même voiture pour vous déplacer ?","applicable si":"km > 0",formule:{"une possibilité":{"choix obligatoire":"oui",possibilités:["propriétaire","régulier non propriétaire","non régulier"]}},description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Deux données sont importantes dans le cadre du calcul de l'empreinte liée à la construction : + +- L'usage ou non d'un même véhicule pour tous les kilomètres parcourus (si non : on vous attribue un véhicule "moyen") +- La propriété ou non dudit véhicule s'il s'agit toujours du même + +Nous avons fait le choix d'attribuer l'empreinte de construction au pro-rata des kilomètres parcourus. Mais cette approche avait deux défauts : + +- Elle était extrêmement avantageuse pour les petits rouleurs, alors que leur véhicule qui roule moins peut s'user plus vite (un moteur a besoin de tourner régulièrement) et donc avoir une durée de vie inférieure. +- Elle ne permettait pas de valoriser l'engagement de ne pas disposer de son propre véhicule, et de pratiquer à la place l'autopartage, ou la location ponctuelle (car l'empreinte de construction était la même, que l'on soit propriétaire ou non). + +> Pour pallier ces deux problèmes, et mieux représenter qu'un véhicule possédé mais sous-utilisé s'use plus vite et mérite une empreinte de construction plus importante, **nous appliquons un seuil pour la partie construction de l'empreinte, pour les propriétaires**. +`},"ngc . transport . voiture . empreinte calculée":{formule:"(usage + construction) / voyageurs",unité:"kgCO2e",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . empreinte moyenne non régulier":{valeur:"voiture . empreinte calculée",contexte:{"voiture . utilisateur":"'régulier non propriétaire'","voiture . gabarit":"'berline'","voiture . motorisation":"'thermique'","voiture . thermique . carburant":"'essence E5 ou E10'","voiture . thermique . consommation aux 100":{valeur:"voiture . thermique . consommation estimée",contexte:{"voiture . utilisateur":"'régulier non propriétaire'","voiture . gabarit":"'berline'","voiture . motorisation":"'thermique'","voiture . thermique . carburant":"'essence E5 ou E10'"}}},description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . empreinte moyenne":{valeur:"voiture . empreinte calculée",contexte:{"voiture . utilisateur":"'propriétaire'","voiture . gabarit":"'berline'","voiture . motorisation":"'thermique'","voiture . thermique . carburant":"'essence E5 ou E10'","voiture . thermique . consommation aux 100":{valeur:"voiture . thermique . consommation estimée",contexte:{"voiture . utilisateur":"'propriétaire'","voiture . gabarit":"'berline'","voiture . motorisation":"'thermique'","voiture . thermique . carburant":"'essence E5 ou E10'"}}},description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . utilisateur . propriétaire":{titre:"Oui et j'en suis propriétaire",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Vous faites la grande majorité de vos trajets avec un même véhicule que vous possédez.`},"ngc . transport . voiture . utilisateur . régulier non propriétaire":{titre:"Oui mais ce n'est pas la mienne",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Vous utilisez presque systématiquement la voiture d'un ami, de votre grand-mère, ou le même véhicule en autopartage.`},"ngc . transport . voiture . utilisateur . non régulier":{titre:"Non, je change souvent (autopartage, proches, taxi...)",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Vous ne disposez pas de votre propre véhicule et les usages sont tous différents.`},"ngc . transport . voiture . usage":{titre:"Usage de la voiture",formule:"usage au kilomètre * km",unité:"kgCO2e",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . construction":{titre:"Construction de la voiture",formule:{variations:[{si:{"toutes ces conditions":["voiture . utilisateur = 'propriétaire'","km < seuil km"]},alors:"construction au kilomètre * seuil km"},{sinon:"construction au kilomètre * km"}]},unité:"kgCO2e",note:`Pour le moment, nous ne considérons pas l'amortissement complet d'une voiture (c'est-à-dire que nous n'avons pas l'info de l'âge ou le kilométrage complet de la voiture donc sa contruction ne sera jamais nulle). +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . voyageurs":{titre:"Nombre de voyageurs",question:"Quel est le nombre moyen de voyageurs dans la voiture ?","applicable si":"km > 0",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Une voiture consomme à peu près autant qu'elle ait 1, 2 ou 5 voyageurs à bord. Voyager à plusieurs, c'est donc potentiellement diviser par 5 l'empreinte individuelle ! + +🤔 Mais cette question n'est pas facile : il est probable que dans une année vous soyez parti en vacances à 3, ayez pris la voiture quotidiennement tout seul, etc. + +Essayez d'estimer une moyenne approximative : si tous les jours vous prenez la voiture tout seul, mettez 1 ou 1,2. +Si vous ne la prenez qu'en famille ou entre amis, mettez 3 ou 4. + +> Dans une prochaine évolution du simulateur, nous pourrons séparer les questions par type de trajets : vacances, domicile-travail, quotidiens avec un nombre de voyageurs personnalisable. + +Bien sûr, si vous vous faites conduire ou si vous prenez le taxi, le chauffeur ne compte pas, car il est au service de votre déplacement. +`,plancher:1,avertissement:`Le nombre de voyageurs ne peut pas être nul. Au volant de votre voiture, vous en êtes le premier voyageur. +`,"par défaut":1.2,suggestions:{"je suis seul":1,deux:2,cinq:5}},"ngc . transport . voiture . usage au kilomètre":{formule:"empreinte au kilomètre + base au kilomètre",unité:"kgCO2e/km",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . empreinte au kilomètre":{formule:{variations:[{si:{"est défini":"utilisateur"},alors:{variations:[{si:{"une de ces conditions":["utilisateur = 'propriétaire'","utilisateur = 'régulier non propriétaire'"]},alors:"empreinte au kilomètre calculée"},{si:"utilisateur = 'non régulier'",alors:"empreinte au kilomètre non régulier"}]}},{sinon:"empreinte au kilomètre moyenne"}]},description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . base au kilomètre":{"applicable si":{"toutes ces conditions":[{"est défini":"utilisateur"},{"une de ces conditions":["utilisateur = 'propriétaire'","utilisateur = 'régulier non propriétaire'"]}]},titre:"Entretien et climatisation au kilomètre",formule:"entretien pondéré + climatisation",unité:"kgCO2e/km",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . empreinte au kilomètre calculée":{formule:{variations:[{si:"motorisation = 'thermique'",alors:"thermique . empreinte au kilomètre"},{si:"motorisation = 'hybride'",alors:"thermique . empreinte au kilomètre * 0.85"},{si:"motorisation = 'électrique'",alors:"électrique . empreinte au kilomètre"}]},unité:"kgCO2e/km",note:`Pour la voiture hybride, nous n'avons pour l'instant pas utilisé les valeurs de la base bilan-GES, car elles sont compliquées à interpréter : + - la catégorie "hybride rechargeable" a une empreinte étonnamment faible (du niveau de l'électrique), mais surtout 0 émission à la combustion. Ce serait donc un véhicule essence qui n'utilise pas d'essence à l'usage ? [Un sujet récent] sur le forum de bilan-GES n'explique pas l'incohérence. + - la différence entre Hybride full Prius et Hybride full P2 n'est pas expliquée + - dans ces 2 catégories, il n'y a pas l'entrée de gamme. + +L'étude FNH-Carbone4 pourrait être utilisée pour l'empreinte au km des véhicules hybrides rechargeables. Voici l'hypothèse structurante retenue : + +> Répartition des modes de roulage (thermique / électrique) pour les hybrides : 50% / 50% en 2016 + +Mais on notera la controverse récente sur l'empreinte des véhicules hybrides rechargeable suite à [une étude](https://www.transportenvironment.org/press/les-hybrides-rechargeables-au-cœur-d’un-nouveau-scandale-d’émissions-des-tests-révèlent-des) de Transport & Environnement faisant état d'une empreinte réelle incomparable à l'empreinte annoncée par les constructeurs. + +Nous avons donc pour l'instant retenu le calcul du calculateur MicMac qui est la base de Nos Gestes Climat, dont la source est malheureusement inaccessible : + +> Hybride : enlever 15% aux consommations ci-dessus (source ADEME: http://www2.ademe.fr/servlet/KBaseShow?catid=13655) +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . empreinte au kilomètre non régulier":{valeur:"voiture . empreinte au kilomètre calculée",contexte:{"voiture . utilisateur":"'régulier non propriétaire'","voiture . gabarit":"'berline'","voiture . motorisation":"'thermique'","voiture . thermique . carburant":"'essence E5 ou E10'","voiture . thermique . consommation aux 100":{valeur:"voiture . thermique . consommation estimée",contexte:{"voiture . utilisateur":"'régulier non propriétaire'","voiture . gabarit":"'berline'","voiture . motorisation":"'thermique'","voiture . thermique . carburant":"'essence E5 ou E10'"}}},description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . empreinte au kilomètre moyenne":{valeur:"voiture . empreinte au kilomètre calculée",contexte:{"voiture . utilisateur":"'propriétaire'","voiture . gabarit":"'berline'","voiture . motorisation":"'thermique'","voiture . thermique . carburant":"'essence E5 ou E10'","voiture . thermique . consommation aux 100":{valeur:"voiture . thermique . consommation estimée",contexte:{"voiture . utilisateur":"'propriétaire'","voiture . gabarit":"'berline'","voiture . motorisation":"'thermique'","voiture . thermique . carburant":"'essence E5 ou E10'"}}},description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . motorisation":{question:"Quel type de voiture utilisez-vous ?","applicable si":{"toutes ces conditions":[{"est défini":"utilisateur"},{"une de ces conditions":["utilisateur = 'propriétaire'","utilisateur = 'régulier non propriétaire'"]},"km > 0"]},description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +💡 **Si vous utilisez plusieurs voitures (par exemple dans le cas où vous n'en possédez pas une), choisissez la réponse la plus représentative de votre usage.**`,"par défaut":"'thermique'",formule:{"une possibilité":{"choix obligatoire":"oui",possibilités:["thermique","hybride","électrique"]}}},"ngc . transport . voiture . thermique . empreinte au kilomètre":{titre:"empreinte au km thermique",formule:"consommation au kilomètre * empreinte au litre",note:"Cette méthode de calcul, plutôt qu'un barème gabarit -> empreinte au km, permet à l'utilisateur qui connait la consommation moyenne réelle de sa voiture de la saisir pour plus de précision.",unité:"kgCO2e/km",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . électrique . empreinte au kilomètre":{titre:"empreinte au km électrique",unité:"kgCO2e/km",formule:"consommation au kilomètre * logement . électricité . intensité carbone équivalente",note:`Nous considérons ici le mix électrique moyen français. La majorité des possesseurs de voitures électriques rechargent leur véhicule chez eux avec une tarification heure creuses, qui est plus avantageuse financièrement et correspond d'ailleurs aux moments où la demande en électricité est moins forte et le mix électrique moins carboné (les centrales gaz ne sont pas sollicitées). +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . motorisation . thermique":{titre:"Thermique (diesel/essence/GPL)",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . motorisation . hybride":{titre:"Hybride",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . motorisation . électrique":{titre:"Électrique",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . consommation au kilomètre":{formule:"consommation aux 100 / 100 km/centkm",unité:"l/km",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . empreinte au litre":{description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Les empreintes sont disponibles de façon assez détaillée sur [la base carbone](https://bilans-ges.ademe.fr/fr/basecarbone/donnees-consulter/liste-element?recherche=diesel), ici par exemple pour le "diesel". Idem pour "essence". +Pour les retrouver facilement, filtrez par unité "kgCO2e/litre" et par géographie "France continentale". + +À noter que pour le gazole, le FE choisi est la moyenne entre le gazole B7 et le gazole B10. +`,formule:{variations:[{si:"carburant = 'gazole B7 ou B10'",alors:{moyenne:["3.1 kgCO2e/l","3.04 kgCO2e/l"]}},{si:"carburant = 'essence E5 ou E10'",alors:2.7},{si:"carburant = 'essence E85'",alors:1.11},{si:"carburant = 'GPL'",alors:1.86}]},unité:"kgCO2e/l"},"ngc . transport . voiture . thermique . consommation aux 100":{question:"Connaissez-vous la consommation moyenne de la voiture ?","applicable si":{"toutes ces conditions":[{"est défini":"utilisateur"},{"une de ces conditions":["utilisateur = 'propriétaire'","utilisateur = 'régulier non propriétaire'"]},{"une de ces conditions":["motorisation = 'thermique'","motorisation = 'hybride'"]},"km > 0"]},description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +**💡 Si vous utilisez plusieurs voitures (par exemple dans le cas où vous n'en possédez pas une), choisissez la réponse la plus représentative de votre usage.** +`,suggestions:{"5 l/100km":5,"7 l/100km":7,"9 l/100km":9},"par défaut":"consommation estimée",unité:"l/centkm",note:"Les suggestions de réponse sont à la louche, à préciser et sourcer."},"ngc . transport . voiture . thermique . consommation estimée":{titre:"Consommation estimée voiture",note:`> Si nous avons travaillé les propositions de consommation moyenne, l'idéal au vu de l'impact de cette donnée est bien que l'utilisateur ou l'utilisatrice saisisse sa propre consommation réelle, moyennée sur son usage. + +Pour obtenir nos propositions pour les voitures individuelles, nous avons croisé deux sources de données : + +- Les données moyennes de consommation des véhicules essence et diesel, [fournies par l'ADEME](https://carlabelling.ademe.fr/chiffrescles/r/evolutionConsoMoyenne) +- Les données des "meilleures consommations" par gabarit et par carburant, fournies par [cet article de CAROOM](https://www.caroom.fr/guide/voiture-neuve/comment-choisir/carburant/faible-consommation): + +Nous n'avons pas trouvé d'autre source pour obtenir la consommation moyenne par type de véhicule. Dans l'article de CAROOM, sont donnés les chiffres des meilleures performances par véhicule: + + | | E5 ou E10 | Diesel | % circulation | + |------------------|-----------|--------|---------------| + | Petite | 5,07 | 3,65 | 25,29% | + | Moyenne | 4,70 | 3,75 | 10,30% | + | Berline | 4,70 | 3,75 | 49,81% | + | SUV | 5,08 | 4,14 | 14,60% | + | Moyenne pondérée | 4,85 | 3,78 | | + +D'un autre côté, nous avons les données fournies par l'ADEME qui donnent des consommations moyennes de 6,8 L/100km pour une essence, 5 L/100km pour un diesel. +On remarque bien que les consommations moyennes calculées via les données de CAROOM (4,85 L/100km et 3,78 L/100km) sont bien plus basses que celles +de l'ADEME, ce sont les voitures les plus performantes. + +Nous avons donc retravaillé les chiffres via un ratio (conso moyenne / conso moyenne performante) pour mettre à jour les consommations moyennes par véhicules : +A titre d'exemple, pour une citadine essence, on obtient le chiffre de 7,11 L/100km via la formule suivante : 5,07 / 4,85 * 6,8. + +- Moyennes corrigées (et utilisées dans NGC): + + | | E5 ou E10 | Diesel | % circulation | + |------------------|-----------|--------|---------------| + | Petite | 7,11 | 4,83 | 25,29% | + | Moyenne | 6,59 | 4,96 | 10,30% | + | Berline | 6,59 | 4,96 | 49,81% | + | SUV | 7,13 | 5,48 | 14,60% | + | Moyenne pondérée | 6,80 | 5,00 | | + +Pour les véhicules utilitaires légers, nous avons utilisé cette source : +- [Consommation des véhicules utilitaires légers](https://www.webfleet.com/fr_fr/webfleet/blog/consommation-utilitaire/) + +> Nous avons bien noté que la consomation d'une citadine essence est plus élevée que celle d'une berline, ce qui semble contre-intuitif mais nous n'avons pas d'autres sources pour l'instant. + +Enfin, pour obtenir les consommations des véhicules roulant à l'essence E85, nous avons appliqué une **surconsommation de 25%** par rapport aux véhicules essence, chiffre qui semble faire consensus. + +De même, pour obtenir les consommations des véhicules roulant au GPL, nous avons appliqué une **surconsommation de 15%** par rapport aux véhicules essence, sauf pour le GPL, véhicule pour lequel nous avons déjà la données. +`,unité:"l/centkm",formule:{variations:[{si:"gabarit = 'petite'",alors:{variations:[{si:"thermique . carburant = 'gazole B7 ou B10'",alors:"petite diesel"},{si:"thermique . carburant = 'essence E5 ou E10'",alors:"petite essence"},{si:"thermique . carburant = 'essence E85'",alors:"petite essence * 1.25"},{si:"thermique . carburant = 'GPL'",alors:"petite essence * 1.15"}]}},{si:"gabarit = 'moyenne'",alors:{variations:[{si:"thermique . carburant = 'gazole B7 ou B10'",alors:"moyenne diesel"},{si:"thermique . carburant = 'essence E5 ou E10'",alors:"moyenne essence"},{si:"thermique . carburant = 'essence E85'",alors:"moyenne essence * 1.25"},{si:"thermique . carburant = 'GPL'",alors:"moyenne essence * 1.15"}]}},{si:"gabarit = 'VUL'",alors:{variations:[{si:"thermique . carburant = 'gazole B7 ou B10'",alors:"VUL diesel"},{si:"thermique . carburant = 'essence E5 ou E10'",alors:"VUL essence"},{si:"thermique . carburant = 'essence E85'",alors:"VUL essence * 1.25"},{si:"thermique . carburant = 'GPL'",alors:13}]}},{si:"gabarit = 'berline'",alors:{variations:[{si:"thermique . carburant = 'gazole B7 ou B10'",alors:"moyenne diesel"},{si:"thermique . carburant = 'essence E5 ou E10'",alors:"moyenne essence"},{si:"thermique . carburant = 'essence E85'",alors:"moyenne essence * 1.25"},{si:"thermique . carburant = 'GPL'",alors:"moyenne essence * 1.15"}]}},{si:"gabarit = 'SUV'",alors:{variations:[{si:"thermique . carburant = 'gazole B7 ou B10'",alors:"SUV diesel"},{si:"thermique . carburant = 'essence E5 ou E10'",alors:"SUV essence"},{si:"thermique . carburant = 'essence E85'",alors:"SUV essence * 1.25"},{si:"thermique . carburant = 'GPL'",alors:"SUV essence * 1.15"}]}}]},description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . gabarit":{question:"Quel est le gabarit de la voiture ?","applicable si":{"toutes ces conditions":[{"est défini":"utilisateur"},{"une de ces conditions":["utilisateur = 'propriétaire'","utilisateur = 'régulier non propriétaire'"]},"km > 0"]},description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +**💡 Si vous utilisez plusieurs voitures (par exemple dans le cas où vous n'en possédez pas une), choisissez la réponse la plus représentative de votre usage.** + +Plus une voiture est lourde et haute donc avec une forte prise au vent, plus elle consomme donc plus elle pollue ! +`,"par défaut":"'berline'",note:`Nous considérons que la voiture par défaut est une "Berline", en témoigne [une étude menée par AAA Data](https://www.alphabet.com/fr-fr/parc-automobile-roulant-les-donnees-cles) +qui indique que "Si les SUV ont représenté 38 % des ventes de véhicules en 2019, ils ne représentent que 16 % de la totalité des véhicules en circulation, loin derrière les berlines qui comptent pour 58 %, soit 23 millions de véhicules." +`,formule:{"une possibilité":{"choix obligatoire":"oui",possibilités:["petite","moyenne","VUL","berline","SUV"]}}},"ngc . transport . voiture . thermique . carburant":{question:"Quel type de carburant votre voiture consomme-t-elle ?","applicable si":{"toutes ces conditions":[{"est défini":"utilisateur"},{"une de ces conditions":["utilisateur = 'propriétaire'","utilisateur = 'régulier non propriétaire'"]},{"une de ces conditions":["motorisation = 'thermique'","motorisation = 'hybride'"]},"km > 0"]},description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Pour comprendre les différents types de carburants, [cet article pédagogique](https://www.francetvinfo.fr/economie/automobile/essence/les-carburants-changent-de-nom-a-la-pompe-voici-comment-vous-y-retrouver_2967013.html) est très utile. + +[Cet article](https://www.ecologie.gouv.fr/carburants-et-combustibles-autorises-en-france) du ministère de l'Écologie explique plus en détail les carburants légaux en France. + +> Attention, si le type de carburant fait varier de façon significative l'empreinte climat au litre, la consommation en litre par 100km elle aussi varie. Veillez à saisir une consommation au litre basée sur votre moyenne réelle. +`,"par défaut":"'essence E5 ou E10'",formule:{"une possibilité":{"choix obligatoire":"oui",possibilités:["gazole B7 ou B10","essence E5 ou E10","essence E85","GPL"]}},note:`La domination du couple gazole-essence est écrasante [source](https://www.leprogres.fr/magazine-automobile/2021/03/27/quels-sont-les-carburants-les-plus-utilises-dans-votre-commune). + +Par contre, parmi les véhicules neufs, l'essence domine aujourd'hui. + +Le facteur d'émission associé au biocarburant E85 n'est pas représentatif des conséquences environnementales liées à l'utilisation des biocarburants. +En effet, au vu des problématiques liées au changement d'affectation des sols et autres impacts environnementaux liés à la culture du maïs par exemple, les **biocarburants** ne sont pas pris en compte +(le facteur d'émission de la base carbone étant particulièrement incertain). Voir nos discussions [ici](https://github.com/incubateur-ademe/nosgestesclimat/pull/1324). + +Le GPL (Gaz de Pétrole Liquéfiés) est un [résidu de l'extraction du pétrole qui était autrefois brûlé](https://fr.wikipedia.org/wiki/Gaz_de_p%C3%A9trole_liqu%C3%A9fi%C3%A9). +Il a une empreinte carbone par litre moins importante que les véhicules essence ou diesel, par contre sa consommation est légèrement supérieure, ce qui compense légèrement le gain. +Mais si les rejets de CO2e sont au final presque équivalents entre le GPL et les autres carburants, c'est [du côté de l'émission de particules nocives](https://agirpourlatransition.ademe.fr/particuliers/conso/conso-responsable/comment-choisir-voiture-deux-roues-moins-polluant) que le GPL est un bien meilleur élève que les autres carburants thermiques. +`},"ngc . transport . voiture . thermique . consommation estimée . petite diesel":{titre:"Consommation moyenne petite voiture diesel",formule:4.83,unité:"l/centkm",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . consommation estimée . petite essence":{titre:"Consommation moyenne petite voiture essence",formule:7.11,unité:"l/centkm",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . consommation estimée . moyenne diesel":{titre:'Consommation moyenne voiture "moyenne" diesel',formule:4.96,unité:"l/centkm",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . consommation estimée . moyenne essence":{titre:'Consommation moyenne voiture "moyenne" essence',formule:6.59,unité:"l/centkm",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . consommation estimée . VUL diesel":{titre:"Consommation moyenne VUL diesel",formule:7.7,unité:"l/centkm",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . consommation estimée . VUL essence":{titre:"Consommation moyenne VUL essence",formule:9,unité:"l/centkm",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . consommation estimée . SUV diesel":{titre:"Consommation moyenne SUV diesel",formule:5.48,unité:"l/centkm",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . consommation estimée . SUV essence":{titre:"Consommation moyenne SUV essence",formule:7.13,unité:"l/centkm",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . gabarit . petite":{titre:"Petite",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Citadine type Zoé, Fiat 500`},"ngc . transport . voiture . gabarit . moyenne":{titre:"Moyenne",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Modèle au dessus de la petite citadine, type Mégane, Golf`},"ngc . transport . voiture . gabarit . VUL":{titre:"Véhicule utilitaire",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Camionette de type Kangoo ou Partner jusqu'au Trafic et Vito`},"ngc . transport . voiture . gabarit . berline":{titre:"Berline",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Une voiture longue, type 308, Tesla Model 3, Audi A3`},"ngc . transport . voiture . gabarit . SUV":{titre:"SUV",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +"Sport utility vehicle", type 4x4 urbain +`},"ngc . transport . voiture . thermique . carburant . gazole B7 ou B10":{titre:"Gazole (B7 ou B10)",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . carburant . essence E5 ou E10":{titre:"Essence (E5 ou E10)",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . carburant . essence E85":{titre:"Essence E85 (biocarburants)",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . thermique . carburant . GPL":{titre:"GPL (Gaz de Pétrole Liquéfiés)",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . électrique . consommation au kilomètre":{formule:"consommation aux 100 / 100 km/centkm",unité:"kWh/km",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . électricité . intensité carbone équivalente":{formule:{variations:[{si:"photovoltaique . présent",alors:{variations:[{si:"photovoltaique . production >= consommation totale",alors:"photovoltaique . intensité carbone"},{si:"photovoltaique . production < consommation totale",alors:{somme:["(photovoltaique . production / consommation totale) * photovoltaique . intensité carbone","((consommation totale - photovoltaique . production) / consommation totale) * réseau . intensité carbone"]}}]}},{sinon:"réseau . intensité carbone"}]},description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . électrique . consommation aux 100":{titre:"Consommation électrique au km",question:"Connaissez-vous la consommation moyenne de la voiture ?","applicable si":{"toutes ces conditions":[{"est défini":"utilisateur"},{"une de ces conditions":["utilisateur = 'propriétaire'","utilisateur = 'régulier non propriétaire'"]},"motorisation = 'électrique'","km > 0"]},suggestions:{"15 kWh/100km":15,"20 kWh/100km":20,"25 kWh/100km":25},"par défaut":"consommation estimée",unité:"kWh/centkm",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . électrique . consommation estimée":{variations:[{si:"gabarit = 'petite'",alors:15},{si:"gabarit = 'moyenne'",alors:17},{si:"gabarit = 'berline'",alors:25},{si:"gabarit = 'SUV'",alors:25},{si:"gabarit = 'VUL'",alors:25}],unité:"kWh/centkm",note:"Données moyennes fournies par le service Transport et Mobilité de l'ADEME.",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . électricité . photovoltaique . présent":{"non applicable si":"logement . type = 'appartement'",question:"Votre logement dispose-t-il de panneaux photovoltaïques ?","par défaut":"non",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . électricité . photovoltaique . production":{"applicable si":"photovoltaique . présent",icônes:"🌞⚡️",question:"Quelle est la production annuelle d'électricité de vos panneaux solaires photovoltaïques, qu'elle soit autoconsommée ou réinjectée dans le réseau ?",plancher:0,"par défaut":"logement . surface * 30 Wc/m2 * logement . électricité . photovoltaique . production estimée via la puissance installée . facteur",unité:"kWh",suggestions:{"1000 kWh":1e3,"2000 kWh":2e3,"4000 kWh":4e3,"6000 kWh":6e3},aide:"logement . électricité . photovoltaique . production estimée via la puissance installée . saisie",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Nous parlons bien ici de toute l'énergie produite par vos panneaux, que vous la consommiez ou non. +La façon de disposer de ce chiffre varie selon votre installation. La plupart des installations présentes disposent d'une application de suivi de production qui devrait vous fournir cette donnée. + +> Nous proposons des suggestions via le nombre de panneaux en considérant que la puissance moyenne d'un panneau solaire est de 400 Wc environ, avec une production de 1300 kWh/kWc. +`,note:`Par défaut, on propose une production qui varie selon la surface du logement en considèrant qu'un logement de 100 m² possède une installation de 3 kWc, soit une puissance installée de 0,03 kWc/m². +`},"ngc . logement . électricité . consommation totale":{formule:{somme:["photovoltaique . autoconsommation","réseau . consommation"]},description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . électricité . photovoltaique . intensité carbone":{formule:.0291,unité:"kgCO2e/kWh",note:"D'après l'ADEME, nous considérons que la zone H1C (est de la France) est représentative d'un logement moyen standard en France, ce qui correspond à une empreinte moyenne de 29,1 gCO2e / kWh produit.",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . électricité . réseau . intensité carbone":{formule:"commun . intensité électricité",unité:"kgCO2e/kWh",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Nous utilisons ici l'empreinte moyenne du mix de la région de simulation. + +Nous pourrions faire mieux, en séparant la partie chauffage de l'air et le reste de la consommation du logement, car le chauffage est utilisé principalement l'hiver, au moment où les centrales à charbon et gaz tournent davantage et empirent l'empreinte du mix. Mais cela demanderait pour les foyers chauffés à l'électricité de trouver ces deux valeurs et les renseigner, chose peu évidente. + +> L'intensité du chauffage résidentiel est ainsi définie à 80gCO2e/kWh en France par la RE2020, [source](https://www.batiactu.com/edito/facteur-energie-primaire-contenu-carbone-electricite-58485.php). +`},"ngc . logement . type":{question:"Dans quel type de logement vivez-vous ?",formule:{"une possibilité":{"choix obligatoire":"oui",possibilités:["maison","appartement"]}},"par défaut":"'moyen'",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +L'augmentation de l'habitat en appartements peut nous faire oublier que la maison reste le logement majoritaire des foyers français en 2018. + +Cette information influence notamment l'empreinte de construction, mais aussi les possibilités de travaux d'isolation par exemple. + +> Si vous vivez dans un habitat original, par exemple un camping-car / un camion / une péniche, pas de problème : choisissez "appartement" et saisissez les m² de ce qui constitue quand même votre logement. +`,note:`En 2018, l’habitat individuel représente 56 % des logements ([Source INSEE](https://www.insee.fr/fr/statistiques/3676693?sommaire=3696937)) : il est majoritaire parmi les résidences principales comme parmi les résidences secondaires et logements occasionnels. Après avoir progressé entre 1999 et 2008 sa part recule légèrement, car le nombre de logements collectifs augmente plus vite que celui des logements individuels du fait des évolutions récentes de la construction neuve. +Notons qu'il s'agit d'une proportion de logements ; or on peut s'attendre (à vérifier) à ce que les maisons contiennent davantage de gens en moyenne que les appartements, ce qui renforce le choix de la valeur par défaut. +`},"ngc . logement . type . maison":{description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . type . appartement":{description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . surface":{titre:"Surface",question:"Quelle est la surface de votre logement ?",plancher:1,avertissement:`La surface de votre logement ne peut-être nulle. +`,"par défaut":{variations:[{si:"logement . type = 'appartement'",alors:"parc français . surface moyenne appartement"},{si:"logement . type = 'maison'",alors:"parc français . surface moyenne maison"},{sinon:"parc français . surface moyenne"}]},note:`Valeur par défaut obtenue dans [ce jeu de données du Ceren et SDES](https://www.statistiques.developpement-durable.gouv.fr/consommation-denergie-par-usage-du-residentiel). + +> Les logements ont une surface moyenne d’environ 91 m2. + +> Si vous vivez dans un logement original, par exemple un camping-car / un camion / une péniche, renseignez simplement les m² de ce logement. +`,suggestions:{studio:25,"3 pièces":70,"6 pièces":130,"château 🏰":1e3},unité:"m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . électricité . photovoltaique . production estimée via la puissance installée . facteur":{formule:1.3,unité:"kWh/Wc",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface moyenne appartement":{titre:"Surface moyenne par appartement",formule:"surface totale appartements / nombre appartements",unité:"m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface moyenne maison":{titre:"Surface moyenne par maison",formule:"surface totale maisons / nombre maisons",unité:"m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface moyenne":{titre:"Surface moyenne par logement",formule:"surface totale / nombre logements",unité:"m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface totale appartements":{formule:819081251,unité:"m2",note:"Surface totale habitable en France",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . nombre appartements":{titre:"Nombre d'appartements en France",formule:13142142,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface totale maisons":{formule:1887756548,unité:"m2",note:"Surface totale habitable en France",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . nombre maisons":{titre:"Nombre de maisons en France",formule:16699885,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface totale":{formule:"surface totale appartements + surface totale maisons",unité:"m2",note:"Surface totale habitable en France",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . nombre logements":{titre:"Nombre de logements en France",formule:"nombre appartements + nombre maisons",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . électricité . photovoltaique . autoconsommation":{formule:"production * part autoconsommation",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . électricité . réseau . consommation":{question:"Quelle est la consommation annuelle d'électricité (réseau) de votre foyer ?",aide:"logement . électricité . réseau . consommation estimée via le coût . saisie",plancher:0,unité:"kWh","par défaut":"consommation par défaut",note:"on considère que seule la consommation d'électricité liée au chauffage est dépendante de la surface du logement",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Astuce : vous trouverez la consommation annuelle d'électricité sur vos factures ou sur votre compte en ligne sur le site de votre fournisseur. + +Pour rappel, si vous vivez dans plusieurs logements (par exemple, si vous avez une résidence secondaire), essayez de "ramener" ces consommations dans celles du logement principal afin d'avoir l'estimation la plus juste possible. +`},"ngc . logement . électricité . photovoltaique . part autoconsommation":{"applicable si":{"toutes ces conditions":["photovoltaique . présent","photovoltaique . production > 0"]},question:"Quelle part de cette électricité produite consommez-vous ?",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Si vous consommez toute votre production, renseignez 100%. Si vous revendez toute votre production, vous pouvez mettre 0. Dans tous les cas, il vous sera demandé par la suite votre consommation d'électricité du réseau et votre production sera prise en compte indirectement dans le calcul de vos émissions. +`,"par défaut":30,plancher:0,plafond:100,unité:"%",suggestions:{"je réinjecte tout dans le réseau":0,"le quart de ma production":25,"la moitié de ma production":50,"je consomme 100% de ce que je produis":100}},"ngc . logement . électricité . réseau . consommation par défaut":{titre:"Consommation par défaut électricité",note:`Dans l'état actuel du test NGC, la question du chauffage est posée après la question de la consommation d'électricité. Or, la valeur par défaut de cette question dépend du mode de chauffage. Si l'utilisateur répond "Je ne sais pas" à cette question, il y a des chances que la valeur attribuée change après coup. +`,formule:{variations:[{si:"logement . chauffage . choix utilisateur = non",alors:"surface * (parc français . consommation électricité autre par m2 + parc français . surface . part électricité * parc français . chauffage . consommation électricité par m2)"},{si:{"toutes ces conditions":["logement . chauffage . choix utilisateur = oui",{"est défini":"logement . chauffage . électricité . présent"},{"est défini":"logement . chauffage . PAC . présent"},"logement . chauffage . électricité . présent","logement . chauffage . PAC . présent"]},alors:"surface * (parc français . consommation électricité autre par m2 + parc français . chauffage . consommation électricité par m2)"},{si:{"toutes ces conditions":["logement . chauffage . choix utilisateur = oui",{"est défini":"logement . chauffage . électricité . présent"},{"est défini":"logement . chauffage . PAC . présent"},"logement . chauffage . électricité . présent","logement . chauffage . PAC . présent = non"]},alors:"surface * (parc français . consommation électricité autre par m2 + parc français . chauffage . consommation électricité hors PAC par m2)"},{si:{"toutes ces conditions":["logement . chauffage . choix utilisateur = oui",{"est défini":"logement . chauffage . électricité . présent"},{"est défini":"logement . chauffage . PAC . présent"},"logement . chauffage . électricité . présent = non","logement . chauffage . PAC . présent"]},alors:"surface * (parc français . consommation électricité autre par m2 + parc français . chauffage . consommation électricité PAC par m2)"},{sinon:"surface * parc français . consommation électricité autre par m2"}]},description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . chauffage . choix utilisateur":{titre:"Choix utilisateur pour le chauffage",formule:{"une de ces conditions":[{"est défini":"électricité . présent"},{"est défini":"PAC . présent"},{"est défini":"gaz . présent"},{"est défini":"réseau de chaleur . présent"},{"est défini":"bouteille gaz . présent"},{"est défini":"citerne propane . présent"},{"est défini":"fioul . présent"},{"est défini":"bois . présent"}]},description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . consommation électricité autre par m2":{formule:"consommation électricité autre / surface totale",unité:"kWh/m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface . part électricité":{formule:"électricité / surface",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . chauffage . consommation électricité par m2":{formule:"consommation électricité / surface . électricité",note:"électricité + pompe à chaleur",unité:"kWh/m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . chauffage . électricité . présent":{question:"Votre logement est-il chauffé à l'électricité ?",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . chauffage . PAC . présent":{question:"Votre logement est-il chauffé via une pompe à chaleur ?",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . chauffage . consommation électricité hors PAC par m2":{formule:"consommation électricité hors PAC / surface . électricité hors PAC",unité:"kWh/m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . chauffage . consommation électricité PAC par m2":{formule:"consommation électricité PAC / surface . électricité PAC",unité:"kWh/m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . chauffage . gaz . présent":{question:"Votre logement est-il chauffé au gaz ?",note:`Bien que le chauffage majoritaire en France soit électrique [source](https://fr.statista.com/statistiques/856283/types-chauffage-logement-principal-france), nous mettons ici la valeur par défaut à oui pour se rapprocher de la moyenne d'empreinte du logement. + +On touche aux limites actuelles de ce système de situation par défaut. +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . chauffage . réseau de chaleur . présent":{question:"Votre logement est-il chauffé via un réseau de chaleur ?",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . chauffage . bouteille gaz . présent":{question:"Utilisez-vous des bouteille de gaz ?",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . chauffage . citerne propane . présent":{question:"Votre logement est-il chauffé via une citerne de propane ?",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . chauffage . fioul . présent":{question:"Votre logement est-il chauffé au fioul ?",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . logement . chauffage . bois . présent":{question:"Votre logement est-il chauffé au bois ?",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . consommation électricité autre":{formule:"74810546534 + 2000000000",note:"spécifique + climatisation",unité:"kWh",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface . électricité":{formule:980364088,unité:"m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface":{titre:"Surface totale par somme des énergies",formule:{somme:["électricité","gaz","fioul","bois","réseau de chaleur","GPL"]},note:"on considère ici toutes les sources d'énergie servant à chauffer le parc français.",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface . gaz":{formule:957251338,unité:"m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface . fioul":{formule:296898719,unité:"m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface . bois":{formule:319546177,unité:"m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface . réseau de chaleur":{formule:97385759,unité:"m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface . GPL":{formule:47600352,unité:"m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . chauffage . consommation électricité":{formule:"chauffage + ecs + cuisson",note:"électricité et pompe à chaleur",unité:"kWh",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . chauffage . consommation électricité . chauffage":{titre:"conso électrique liée au chauffage",formule:54859667824,unité:"kWh",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . chauffage . consommation électricité . ecs":{titre:"conso électrique liée à l'eau chaude sanitaire",formule:23584851016,unité:"kWh",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . chauffage . consommation électricité . cuisson":{titre:"conso électrique liée à la cuisson",formule:11416870555,unité:"kWh",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . chauffage . consommation électricité hors PAC":{formule:"consommation électricité hors PAC . chauffage + surface . part hors PAC électricité * (consommation électricité . ecs + consommation électricité . cuisson)",unité:"kWh",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface . électricité hors PAC":{formule:"surface . électricité - surface . électricité PAC",unité:"m2",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . chauffage . consommation électricité hors PAC . chauffage":{titre:"conso électrique hors PAC liée au chauffage",formule:"consommation électricité . chauffage - consommation électricité PAC . chauffage",unité:"kWh",note:"Cette consommation est compris dans `consommation électricité . chauffage`.",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface . part hors PAC électricité":{formule:"surface . électricité hors PAC / surface . électricité",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . chauffage . consommation électricité PAC . chauffage":{titre:"conso électrique via PAC liée au chauffage",formule:14077969585,unité:"kWh",note:"Cette consommation est compris dans `consommation électricité . chauffage`.",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface . électricité PAC":{formule:301589218,unité:"m2",note:"Cette surface est compris dans `surface . électricité`.",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . chauffage . consommation électricité PAC":{formule:"consommation électricité PAC . chauffage + surface . part PAC électricité * (consommation électricité . ecs + consommation électricité . cuisson)",unité:"kWh",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . parc français . surface . part PAC électricité":{formule:"surface . électricité PAC / surface . électricité",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . commun . intensité électricité":{titre:"Intensité carbone du mix électrique français",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + + +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/publicodes-commun\`](https://github.com/incubateur-ademe/publicodes-commun). + + +Intensité moyenne, tous types de consommations confondues, année 2022.`,formule:.052,unité:"kgCO2e/kWh",note:`Ici, on parle du mix électrique de consommation. +Le chiffre est issu de la Base Empreinte (Electricité/2022 - mix moyen/consommation) dont la méthodologie est décrite dans la [documentation](https://prod-basecarbonesolo.ademe-dri.fr/documentation/UPLOAD_DOC_FR/). +La v2.6 de MicMac donnait une valeur de 12.4gCO2e/kWh pour les fournisseurs d'électricité "verte", mais cette valeur semble correspondre à un calcul théorique sur l'année, et non pas à un calcul réel, minute par minute. +`},"ngc . transport . voiture . entretien pondéré":{formule:{variations:[{si:"motorisation = 'thermique'",alors:"entretien"},{si:"motorisation = 'hybride'",alors:"entretien * 0.90"},{si:"motorisation = 'électrique'",alors:"entretien * 0.75"}]},unité:"kgCO2e/km",note:`Plusieurs sources s'accordent pour dire que l'entretien d'un véhicule électrique est inférieur à celui d'un véhicule thermique de 25%. Comme [celle-ci](https://izi-by-edf.fr/blog/voiture-hybride-entretien/). + +Pour ce qui est d'un véhicule hybride, son entretien se situe entre celui d'un véhicule électrique et celui d'un véhicule thermique. Cela dépend de l'utilisation du moteur électrique ou thermique. +Nous choisissons de partir sur une hypothèse conservatrice de -10% de coût d'entretien par rapport aux véhicules thermiques. +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . climatisation":{formule:"(émissions gaz fluorés transport / nombre véhicules circulation) / transport . voiture . km annuels moyen",unité:"kgCO2e/km",note:`L'idée ici est de prendre en compte une part des émissions liées aux gaz fluorés issus des climatisations des véhicules +en France via le total des émissions dues à ces gaz sur le secteur du transport (voitures et VUL diesel, essence, GNV, GPL, électrique). +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . entretien":{formule:"((empreinte branche . G45 * 1000000 kgCO2e/ktCO2e * 0.07) / nombre véhicules circulation) / transport . voiture . km annuels moyen",unité:"kgCO2e/km",note:`Dans le poste G45, nous prenons la part Entretien et réparation de véhicules automobiles (7%). +Nous le divisons par le nombre de véhicules en circulation, puis par 12200 km (la moyenne de km effectués par véhicule) pour obtenir une empreinte en kgCO2e / km. +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . empreinte branche . G45":{description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Commerce et réparation d'automobiles et de motocycles + +> La description ci-dessous correspond à la part de chaque sous-classe de la branche G45 (en % de chiffre d'affaire) + +- **Commerce de véhicules automobiles (67%)** + - Commerce de voitures et de véhicules automobiles légers (94%) + - Commerce d'autres véhicules automobiles (6%) +- **Entretien et réparation de véhicules automobiles (8%)** +- **Commerce d'équipements automobiles (24%)** + - Commerce de gros d'équipements automobiles (67%) + - Commerce de détail d'équipements automobiles (33%) +- **Commerce et réparation de motocycles (2%)**`,formule:6988,titre:"Commerce et réparation d'automobiles et de motocycles (France)",unité:"ktCO2e"},"ngc . transport . voiture . nombre véhicules circulation":{formule:"véhicules légers + VUL",note:`Ce chiffre concerne les véhicules en circulation (voitures et VUL). +Il est issu des [Données sur le parc automobile français au 1er janvier 2023](https://www.statistiques.developpement-durable.gouv.fr/donnees-sur-le-parc-automobile-francais-au-1er-janvier-2023?rubrique=&dossier=1348). + +Nous considérons néanmoins les données pour l'année 2022 car la distance moyenne parcourue par véhicule n'est dispo que pour 2022. + +Nous avons choisi de ne pas prendre en compte la catégorisation pro/perso dans de nombreux véhicules professionels sont utilisés également pour les trajets perso et domicile travail (que nous prenons en compte dans le calculateur). +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . km annuels moyen":{formule:{somme:["km annuels moyen . véhicules légers * nombre véhicules circulation . véhicules légers / nombre véhicules circulation","km annuels moyen . VUL * nombre véhicules circulation . VUL / nombre véhicules circulation"]},unité:"km",note:`Ce chiffre concerne les véhicules en circulation (voitures et VUL). +Il est issu des [Données sur le parc automobile français au 1er janvier 2023](https://www.statistiques.developpement-durable.gouv.fr/donnees-sur-le-parc-automobile-francais-au-1er-janvier-2023?rubrique=&dossier=1348). + +Nous considérons néanmoins les données pour l'année 2022 car la distance moyenne parcourue par véhicule n'est dispo que pour 2022. + +Nous avons choisi de ne pas prendre en compte la catégorisation pro/perso dans de nombreux véhicules professionels sont utilisés également pour les trajets perso et domicile travail (que nous prenons en compte dans le calculateur). +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . nombre véhicules circulation . véhicules légers":{formule:38814659,note:`Ce chiffre est issu des [Données sur le parc automobile français au 1er janvier 2023](https://www.statistiques.developpement-durable.gouv.fr/donnees-sur-le-parc-automobile-francais-au-1er-janvier-2023?rubrique=&dossier=1348). + +Nous considérons néanmoins les données pour l'année 2022 car la distance moyenne parcourue par véhicule n'est dispo que pour 2022. +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . nombre véhicules circulation . VUL":{formule:6384963,note:`Ce chiffre est issu des [Données sur le parc automobile français au 1er janvier 2023](https://www.statistiques.developpement-durable.gouv.fr/donnees-sur-le-parc-automobile-francais-au-1er-janvier-2023?rubrique=&dossier=1348). + +Nous considérons néanmoins les données pour l'année 2022 car la distance moyenne parcourue par véhicule n'est dispo que pour 2022. +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . km annuels moyen . véhicules légers":{formule:11957,unité:"km",note:`Ce chiffre concerne les véhicules en circulation (voitures et VUL). +Il est issu des [Données sur le parc automobile français au 1er janvier 2023](https://www.statistiques.developpement-durable.gouv.fr/donnees-sur-le-parc-automobile-francais-au-1er-janvier-2023?rubrique=&dossier=1348). + +Nous considérons néanmoins les données pour l'année 2022 car la distance moyenne parcourue par véhicule n'est dispo que pour 2022. +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . km annuels moyen . VUL":{formule:13793,unité:"km",note:`Ce chiffre concerne les véhicules en circulation (voitures et VUL). +Il est issu des [Données sur le parc automobile français au 1er janvier 2023](https://www.statistiques.developpement-durable.gouv.fr/donnees-sur-le-parc-automobile-francais-au-1er-janvier-2023?rubrique=&dossier=1348). + +Nous considérons néanmoins les données pour l'année 2022 car la distance moyenne parcourue par véhicule n'est dispo que pour 2022. +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . climatisation . émissions gaz fluorés transport":{titre:"Emissions nationales dûes aux climatisations des voitures et VUL",formule:1374e6,unité:"kgCO2e",note:`Ce chiffre provient de l'étude [SECTEN](https://www.citepa.org/fr/secten/) (le rapport de référence sur les émissions de gaz à effet de serre et de polluants atmosphériques en France). + +D'après l'excel [Données par substance de gaz à effet de serre (GES) édition 2023, onglet "GF-UE_total"](https://www.citepa.org/wp-content/uploads/publications/secten/2023/Citepa_gaz_a_effet_de_serre_v2.zip), +les émissions de gaz fluorés pour le secteur du transport (provenant des équipements de réfrigération et d'air conditionné, utilisant des halocarbures ou du SF6), sont de 1374 ktCO₂e. +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . construction . seuil km":{formule:"voiture . durée de vie en km / durée de vie moyenne",plafond:"voiture . km annuels moyen",unité:"km",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . construction au kilomètre":{formule:"barème construction * amortissement",unité:"kgCO2e/km",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . durée de vie en km":{formule:{variations:[{si:"gabarit = 'petite'",alors:15e4},{si:{"une de ces conditions":["gabarit = 'moyenne'","gabarit = 'berline'"]},alors:225e3},{sinon:27e4}]},unité:"km",note:`Nous nous appuyons sur le référentiel (durée de vie, kilométrage) que reprend la [plateforme automobile de préconisations européennes](https://pfa-auto.fr/wp-content/uploads/2023/04/DT_Me%CC%81thodologie_2023_V15_FRANCAIS.pdf), avec les segments suivants : + +- Gabarit "petit" : correspondant au segment A, soit 150000 km +- Gabarit "moyen" : correspondant au segment B ou C, soit 225000 km +- Gabarit "VUL" : correspondant au segment CDV (Car-Derived Vehicle), soit 270000 km +- Gabarit "berline" : correspondant au segment B ou C, soit 225000 km +- Gabarit "SUV" : correspondant au segment E ou F, soit 270000 km + +Pour le moment, nous ne faisons pas la différence entre thermique et électrique. C'est une hypothèse très forte. +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . durée de vie moyenne":{formule:20,note:`On considère que l'âge moyen d'une voiture qui part à la casse est de 20 ans. Néanmoins, c'est une hypothèse forte car on peut légitimement penser qu'une voiture électrique possède une durée de vie plus longue qu'une voiture thermique. Il faudrait cependant considérer une valeur plus importante également pour la durée de vie en km. +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . barème construction":{formule:{variations:[{si:"motorisation = 'thermique'",alors:"barème thermique"},{si:"motorisation = 'électrique'",alors:"barème électrique"},{si:"motorisation = 'hybride'",alors:"barème hybride"}]},unité:"kgCO2e",description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +![](https://i.imgur.com/uIlZcEjl.jpg) + +Une voiture est un gros, très gros objet, qui pèse souvent plus d'une tonne et demie. En conséquence, sa construction a une empreinte importante. + +En particulier, la construction d'une voiture électrique de gamme équivalente à une thermique émet plus de gaz à effet de serre. C'est notamment dû à la batterie et son poids important. + +Malgré cela, en France, sur la durée de vie de la voiture et donc les km parcourus, le choix de la voiture électrique est nettement mieux pour le climat. + +Mieux, mais loin d'être faible ! Aujourd'hui, il ne s'agit plus seulement de comparer des solutions techniques entre elles, il s'agit d'évaluer ses achats par rapport aux objectifs climat. +`,note:`Les données autour des émissions liées à la fabrication de véhicules sont nombreuses et variées. La première approche utilisait l'étude [FNH-Carbone4](https://github.com/betagouv/ecolab-data/files/5945898/vehicule_electrique_rapport.pdf) qui propose des facteurs d'émissions pour la construction pour 2 gabarits, en distinguant les véhicules thermiques, électriques et hybrides. Certaines données pour le véhicules paraissaient incohérentes, et nous avions besoin, d'un point de vue méthodologique, de plus de finesse dans le calcul de l'empreinte des véhicules électriques. + +C'est pouquoi, désormais, nous adoptons l'approche suivante: + +- Pour les véhicules thermiques, nous utilisons les données de la Base Empreinte de l'ADEME donnant une valeur de 4,5 kgCO2e/kg pour la construction d'une voiture. Nous appliquons ce facteur à la masse de la voiture pour obtenir l'empreinte de la construction, masse étant déterminée par le gabarit du véhicule. +- Pour les véhicules électriques, nous calculons l'empreinte de la batterie en fonction de sa capacité, puis nous ajoutons l'empreinte de la construction d'une voiture thermique de gamme équivalente. +- Pour les véhicules hybrides, nous utilisons les mêmes données que pour les véhicules électriques (hypothèse forte, voir note sur le barème hybride). +`},"ngc . transport . voiture . amortissement":{description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +Les discussions ont été animées sur l'amortissement de la voiture. Précédemment, dans le but de décourager l'achat neuf, un amortissement non linéaire avait été imaginé, fortement dégressif dans le temps, sur 10 ans. +Cet amortissement non linéaire avait le mérite de décourager l'achat, et de bien faire comprendre à l'utilisateur qu'une grande partie de l'empreinte du véhicule est liée à sa production, donc à l'achat neuf. + +Mais cet amortissement non linéaire n'était pas évident à comprendre pour les utilisateurs, et manquait son objectif pédagogique. +Par ailleurs, il occasionnait un double-discours dans Nos Gestes Climat, car dans les actions proposées aux propriétaires de voitures, nous proposons l'achat d'un véhicule électrique, or celui-ci est fortement pénalisant s'il est acheté neuf dans l'empreinte carbone individuelle. + +Enfin, il était, dans le simulateur Nos Gestes Climat, une exception : tous les autres biens amortis le sont de manière linéaire (l'empreinte de construction est divisée par la durée de vie du bien). + +Nous avions donc fait le choix de revenir pour la voiture à un amortissement linéaire sur la durée de vie de la voiture, une durée de vie en années. + +Mais ce fonctionnement ne nous convenait toujours pas : en effet, elle pénalisait beaucoup les petits rouleurs, et ne paraissait pas très juste par rapport à la réalité d'un véhicule, dont la durée de vie s'exprime plutôt en km. + +C'est donc, finalement, ce choix-là que nous avons fait : l'amortissement du véhicule est fonction du nombre de km parcourus, au regard du nombre de km maximal correspondant au gabarit du véhicule. +`,formule:"1 / durée de vie en km"},"ngc . transport . voiture . barème construction . barème thermique":{formule:{variations:[{si:"gabarit = 'petite'",alors:"empreinte par kg * gabarit . petite . poids"},{si:"gabarit = 'moyenne'",alors:"empreinte par kg * gabarit . moyenne . poids"},{si:"gabarit = 'VUL'",alors:"empreinte par kg * gabarit . VUL . poids"},{si:"gabarit = 'berline'",alors:"empreinte par kg * gabarit . berline . poids"},{si:"gabarit = 'SUV'",alors:"empreinte par kg * gabarit . SUV . poids"}]},unité:"kgCO2e",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . barème construction . barème électrique":{formule:"barème thermique + batterie",unité:"kgCO2e",note:`La construction d'une voiture électrique émet plus de gaz à effet de serre qu'une voiture thermique de gamme équivalente. +Cela est dû à la production de la batterie, qui est très énergivore et à une empreinte carbone importante. + +> Ce surplus d'émissions est d'environ +50% (mais varie d'environ +20% à plus d'une multiplication par 2 selon les études). +https://bonpote.com/la-voiture-electrique-solution-ideale-pour-le-climat/ +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . barème construction . barème hybride":{formule:"barème thermique + batterie",unité:"kgCO2e",note:`On fait l'hypothèse forte que la construction d'un véhicule hybride correspond à l'empreinte d'un véhicule électrique équipé d'une petite batterie. Néanmoins, le calcul est plus complexe, notamment car le type de véhicule hybride (rechargeable ou non) sur la composition de la voiture. On a également 2 moteurs... +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . barème construction . barème thermique . empreinte par kg":{formule:4.5,unité:"kgCO2e/kg",note:"Facteur d'émission issu de la Base Empreinte.",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . gabarit . petite . poids":{formule:1e3,unité:"kg",note:"Les valeurs de poids sont tirées du simulateur [carculator](https://carculator.readthedocs.io/en/latest/modeling.html#size-classes) qui utilise le papier [Cost and well-to-wheel implications of the vehicle fleet CO2 emission regulation in the European Union, Christian and others, 2014](https://www.sciencedirect.com/science/article/abs/pii/S0965856414000494?via%3Dihub)",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . gabarit . moyenne . poids":{formule:1500,unité:"kg",note:"Les valeurs de poids sont tirées du simulateur [carculator](https://carculator.readthedocs.io/en/latest/modeling.html#size-classes) qui utilise le papier [Cost and well-to-wheel implications of the vehicle fleet CO2 emission regulation in the European Union, Christian and others, 2014](https://www.sciencedirect.com/science/article/abs/pii/S0965856414000494?via%3Dihub)",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . gabarit . VUL . poids":{formule:1750,unité:"kg",note:"Les valeurs de poids sont tirées du simulateur [carculator](https://carculator.readthedocs.io/en/latest/modeling.html#size-classes) qui utilise le papier [Cost and well-to-wheel implications of the vehicle fleet CO2 emission regulation in the European Union, Christian and others, 2014](https://www.sciencedirect.com/science/article/abs/pii/S0965856414000494?via%3Dihub)",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . gabarit . berline . poids":{formule:1750,unité:"kg",note:"Les valeurs de poids sont tirées du simulateur [carculator](https://carculator.readthedocs.io/en/latest/modeling.html#size-classes) qui utilise le papier [Cost and well-to-wheel implications of the vehicle fleet CO2 emission regulation in the European Union, Christian and others, 2014](https://www.sciencedirect.com/science/article/abs/pii/S0965856414000494?via%3Dihub)",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . gabarit . SUV . poids":{formule:2e3,unité:"kg",note:"Les valeurs de poids sont tirées du simulateur [carculator](https://carculator.readthedocs.io/en/latest/modeling.html#size-classes) qui utilise le papier [Cost and well-to-wheel implications of the vehicle fleet CO2 emission regulation in the European Union, Christian and others, 2014](https://www.sciencedirect.com/science/article/abs/pii/S0965856414000494?via%3Dihub)",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . barème construction . barème électrique . batterie":{formule:"capacité * barème construction . batterie . empreinte par kWh",unité:"kgCO2e",note:`L'empreinte carbone d'une batterie augmente avec sa capacité, car une capacité plus élevée nécessite l'utilisation d'un plus grand nombre de cellules lithium-ion. + +La capacité de la batterie est exprimée en kWh, elle peut varier considérablement selon les modèles de voitures électriques. +Pour réduire l'impact de la voiture électrique il faut privilégier les modèles avec une batterie de petite capacité. +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . barème construction . barème électrique . batterie . capacité":{"applicable si":{"toutes ces conditions":[{"est défini":"utilisateur"},{"une de ces conditions":["utilisateur = 'propriétaire'","utilisateur = 'régulier non propriétaire'"]},"motorisation = 'électrique'"]},description:` +> ℹ️ Cette règle provient du modèle [\`@incubateur-ademe/nosgestesclimat\`](https://github.com/incubateur-ademe/nosgestesclimat). + + +La capacité de la batterie est exprimée en kWh, elle varie considérablement selon les modèles de véhicules. + +Les constructeurs distinguent parfois une capacité brute et une capacité nette, réellement disponible. Si vous avez les deux valeurs, choisissez la capacité brute. +`,unité:"kWh","par défaut":{variations:[{si:{"une de ces conditions":["gabarit = 'petite'","gabarit = 'moyenne'"]},alors:40},{si:{"une de ces conditions":["gabarit = 'berline'","gabarit = 'SUV'","gabarit = 'VUL'"]},alors:65}]},suggestions:{"petite autonomie":40,"autonomie moyenne":65,"grande autonomie":100}},"ngc . transport . voiture . barème construction . batterie . empreinte par kWh":{formule:100,unité:"kgCO2e/kWh",note:`Les études académiques sur l'empreinte carbone des batteries des véhicules électriques sont nombreuses, mais leurs résultats sont très variables. + +Les valeurs varient de 60 kgCO2e/kWh à 150 kgCO2e/kWh. Une [méta-étude de l'IFPEN](https://www.sciencedirect.com/science/article/abs/pii/S0959652622006291) +(Institut Français du Pétrole et des Énergies Nouvelles) calcule une valeur médiane de 83 kgCO2e/kWh, en précisant que les résultats différent selons les chimies de batteries, +les pays de productions, le pays des auteurs de l'étude, et que même ces facteurs intégrés il reste une grande variabilité des résultats. + +Compte tenu de l'incertitude et des variations observées dans les études, nous adoptons une valeur prudente de 100 kgCO2e/kWh pour l'empreinte carbone des batteries. + +[Étude Carbone 4 sur l'empreinte des batteries (en)](https://www.carbone4.com/publication-liion-battery-carbon-footprint) +`,description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . barème construction . barème hybride . batterie":{formule:"capacité * barème construction . batterie . empreinte par kWh",unité:"kgCO2e",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},"ngc . transport . voiture . barème construction . barème hybride . capacité":{valeur:40,unité:"kWh",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/nosgestesclimat`](https://github.com/incubateur-ademe/nosgestesclimat)."},ngc:bO,empreinte:wO,"empreinte . petite électrique":{titre:"Petite voiture électrique",valeur:"ngc . transport . voiture",contexte:{"ngc . transport . voiture . utilisateur":"'propriétaire'","ngc . transport . voiture . gabarit":"'petite'","ngc . transport . voiture . motorisation":"'électrique'","ngc . transport . voiture . km":"usage . distance totale","ngc . transport . voiture . voyageurs":1},unité:"kgCO2e/an/personne"},"empreinte . moyenne électrique":{titre:"Moyenne voiture électrique",valeur:"ngc . transport . voiture",contexte:{"ngc . transport . voiture . utilisateur":"'propriétaire'","ngc . transport . voiture . gabarit":"'moyenne'","ngc . transport . voiture . motorisation":"'électrique'","ngc . transport . voiture . km":"usage . distance totale","ngc . transport . voiture . voyageurs":1},unité:"kgCO2e/an/personne"},"empreinte . VUL électrique":{titre:"Véhicule Ultra Léger électrique",valeur:"ngc . transport . voiture",contexte:{"ngc . transport . voiture . utilisateur":"'propriétaire'","ngc . transport . voiture . gabarit":"'VUL'","ngc . transport . voiture . motorisation":"'électrique'","ngc . transport . voiture . km":"usage . distance totale","ngc . transport . voiture . voyageurs":1},unité:"kgCO2e/an/personne"},"empreinte . berline électrique":{titre:"Berline électrique",valeur:"ngc . transport . voiture",contexte:{"ngc . transport . voiture . utilisateur":"'propriétaire'","ngc . transport . voiture . gabarit":"'berline'","ngc . transport . voiture . motorisation":"'électrique'","ngc . transport . voiture . km":"usage . distance totale","ngc . transport . voiture . voyageurs":1},unité:"kgCO2e/an/personne"},"empreinte . SUV électrique":{titre:"SUV électrique",valeur:"ngc . transport . voiture",contexte:{"ngc . transport . voiture . utilisateur":"'propriétaire'","ngc . transport . voiture . gabarit":"'SUV'","ngc . transport . voiture . motorisation":"'électrique'","ngc . transport . voiture . km":"usage . distance totale","ngc . transport . voiture . voyageurs":1},unité:"kgCO2e/an/personne"},"voiture . coût":{somme:["achat lissé","entretien","carburant","extras"]},"voiture . coût . achat lissé":{"par défaut":"voiture . coût . achat / voiture . durée de vie",unité:"€/an"},"voiture . coût . achat":{"par défaut":25e3,unité:"€"},"voiture . durée de vie":{"par défaut":15,unité:"an"},"voiture . coût . entretien":{"par défaut":600,unité:"€/an"},"voiture . coût . carburant":{"par défaut":300,unité:"€/mois"},"voiture . coût . extras":{"par défaut":50,unité:"€/mois"},"commun . jours par an":{titre:"Nombre de jours par an",formule:365,unité:"jour",description:"> ℹ️ Cette règle provient du modèle [`@incubateur-ademe/publicodes-commun`](https://github.com/incubateur-ademe/publicodes-commun)."},"ngc . transport":{},"ngc . transport . voiture . thermique":{},"ngc . transport . voiture . électrique":{},"ngc . logement . électricité":{},"ngc . logement":{},"ngc . logement . électricité . photovoltaique":{},"ngc . logement . électricité . réseau":{},"ngc . logement . électricité . photovoltaique . production estimée via la puissance installée":{},"ngc . parc français":{},"ngc . logement . chauffage":{},"ngc . parc français . chauffage":{},"ngc . logement . chauffage . électricité":{},"ngc . logement . chauffage . PAC":{},"ngc . logement . chauffage . gaz":{},"ngc . logement . chauffage . réseau de chaleur":{},"ngc . logement . chauffage . bouteille gaz":{},"ngc . logement . chauffage . citerne propane":{},"ngc . logement . chauffage . fioul":{},"ngc . logement . chauffage . bois":{},"ngc . commun":{},"ngc . empreinte branche":{},"ngc . transport . voiture . barème construction . batterie":{},commun:EO},SO=new kE(kO);console.log("Engine instantiated");const rs="/publicodes-voiture",pc="empreinte";function CO(){const e=zC()["*"],{current:t}=_.useRef({Link:Oy,Text:({children:n})=>m.jsx(g0,{children:n})});return console.log(`Rendering rule ${e??pc}`),m.jsx("div",{children:m.jsx(rC,{documentationPath:`${rs}/doc`,rulePath:e??pc,searchBar:!0,engine:SO,renderers:t,language:"fr",npmPackage:"publicodes-voiture"})})}function NO(){return m.jsxs("div",{children:[m.jsx("h1",{children:"Documentation"}),m.jsx("ul",{children:m.jsx("li",{children:m.jsx(Oy,{to:`${rs}/doc/${pc}`,children:"Accéder à la documentation"})})})]})}function PO(){return m.jsx("div",{className:"App",children:m.jsxs(XC,{children:[m.jsx(Zu,{path:`${rs}/`,element:m.jsx(NO,{})}),m.jsx(Zu,{path:`${rs}/doc/*`,element:m.jsx(CO,{})})]})})}const jO=ql.createRoot(document.getElementById("root"));jO.render(m.jsx(gt.StrictMode,{children:m.jsx(i2,{children:m.jsx(PO,{})})}));export{bp as D,mn as R,ee as a,m as j,_ as r,yn as u}; diff --git a/index.html b/index.html new file mode 100644 index 0000000..9b530c1 --- /dev/null +++ b/index.html @@ -0,0 +1,49 @@ + + + + + + + + + + publicodes-voiture - Documentation + + + + + +
+ +