TP_JO2024/home/dist/component/component.module.min.js
2024-03-27 17:19:37 +01:00

3 lines
46 KiB
JavaScript

/*! DSFR v1.11.2 | SPDX-License-Identifier: MIT | License-Filename: LICENSE.md | restricted use (see terms and conditions) */
const e="fr",t="dsfr",s=window[t],i=s.internals.ns.selector("accordion"),n=s.internals.ns.selector("collapse"),r={GROUP:s.internals.ns.selector("accordions-group"),ACCORDION:i,COLLAPSE:`${i} > ${n}, ${i} > *:not(${i}):not(${n}) > ${n}, ${i} > *:not(${i}):not(${n}) > *:not(${i}):not(${n}) > ${n}`,COLLAPSE_LEGACY:`${i} ${n}`,BUTTON:`${i}__btn`};class a extends s.core.Instance{static get instanceClassName(){return"Accordion"}get collapsePrimary(){return this.element.children.map((e=>e.getInstance("CollapseButton"))).filter((e=>null!==e&&e.hasClass(r.BUTTON)))[0]}}class o extends s.core.CollapsesGroup{static get instanceClassName(){return"AccordionsGroup"}validate(e){const t=e.node.matches(s.internals.legacy.isLegacy?r.COLLAPSE_LEGACY:r.COLLAPSE);return super.validate(e)&&t}}s.accordion={Accordion:a,AccordionSelector:r,AccordionsGroup:o},s.internals.register(s.accordion.AccordionSelector.GROUP,s.accordion.AccordionsGroup),s.internals.register(s.accordion.AccordionSelector.ACCORDION,s.accordion.Accordion);const l={EQUISIZED_BUTTON:`${s.internals.ns.selector("btns-group--equisized")} ${s.internals.ns.selector("btn")}`,EQUISIZED_GROUP:s.internals.ns.selector("btns-group--equisized")};s.button={ButtonSelector:l},s.internals.register(s.button.ButtonSelector.EQUISIZED_BUTTON,s.core.Equisized),s.internals.register(s.button.ButtonSelector.EQUISIZED_GROUP,s.core.EquisizedsGroup);class c extends s.core.Instance{static get instanceClassName(){return"CardDownload"}init(){this.addAscent(s.core.AssessEmission.UPDATE,(e=>{this.descend(s.core.AssessEmission.UPDATE,e)})),this.addAscent(s.core.AssessEmission.ADDED,(()=>{this.descend(s.core.AssessEmission.ADDED)}))}}const h={DOWNLOAD:s.internals.ns.selector("card--download"),DOWNLOAD_DETAIL:`${s.internals.ns.selector("card--download")} ${s.internals.ns.selector("card__end")} ${s.internals.ns.selector("card__detail")}`};s.card={CardSelector:h,CardDownload:c},s.internals.register(s.card.CardSelector.DOWNLOAD,s.card.CardDownload),s.internals.register(s.card.CardSelector.DOWNLOAD_DETAIL,s.core.AssessDetail);const d={SEGMENTED:s.internals.ns.selector("segmented"),SEGMENTED_ELEMENTS:s.internals.ns.selector("segmented__elements"),SEGMENTED_ELEMENT:s.internals.ns.selector("segmented__element input"),SEGMENTED_LEGEND:s.internals.ns.selector("segmented__legend")},u={ADDED:s.internals.ns.emission("segmented","added"),REMOVED:s.internals.ns.emission("segmented","removed")};class g extends s.core.Instance{static get instanceClassName(){return"Segmented"}init(){this.elements=this.node.querySelector(d.SEGMENTED_ELEMENTS),this.legend=this.node.querySelector(d.SEGMENTED_LEGEND),this.addAscent(u.ADDED,this.resize.bind(this)),this.addAscent(u.REMOVED,this.resize.bind(this)),this._isLegendInline=this.legend&&this.legend.classList.contains(`${s.prefix}-segmented__legend--inline`),this.isResizing=!0}resize(){const e=`${s.prefix}-segmented--vertical`,t=`${s.prefix}-segmented__legend--inline`;this.removeClass(e),this._isLegendInline&&(this.legend.classList.add(t),(this.node.offsetWidth>this.node.parentNode.offsetWidth||this.elements.scrollWidth+this.legend.offsetWidth+16>this.node.parentNode.offsetWidth)&&this.legend.classList.remove(t)),this.elements.offsetWidth>this.node.parentNode.offsetWidth||this.elements.scrollWidth>this.node.parentNode.offsetWidth?this.addClass(e):this.removeClass(e)}}class m extends s.core.Instance{static get instanceClassName(){return"SegmentedElement"}init(){this.ascend(u.ADDED)}dispose(){this.ascend(u.REMOVED)}}s.segmented={SegmentedSelector:d,SegmentedEmission:u,SegmentedElement:m,Segmented:g},s.internals.register(s.segmented.SegmentedSelector.SEGMENTED,s.segmented.Segmented),s.internals.register(s.segmented.SegmentedSelector.SEGMENTED_ELEMENT,s.segmented.SegmentedElement);const p={BREADCRUMB:s.internals.ns.selector("breadcrumb"),BUTTON:s.internals.ns.selector("breadcrumb__button")};class _ extends s.core.Instance{constructor(){super(),this.count=0,this.focusing=this.focus.bind(this)}static get instanceClassName(){return"Breadcrumb"}init(){this.getCollapse(),this.isResizing=!0}get proxy(){const e=this;return Object.assign(super.proxy,{focus:e.focus.bind(e),disclose:e.collapse.disclose.bind(e.collapse)})}getCollapse(){const e=this.collapse;e?e.listen(s.core.DisclosureEvent.DISCLOSE,this.focusing):this.addAscent(s.core.DisclosureEmission.ADDED,this.getCollapse.bind(this))}resize(){const e=this.collapse,t=this.links;e&&t.length&&(this.isBreakpoint(s.core.Breakpoints.MD)?e.buttonHasFocus&&t[0].focus():t.indexOf(document.activeElement)>-1&&e.focus())}get links(){return[...this.querySelectorAll("a[href]")]}get collapse(){return this.element.getDescendantInstances(s.core.Collapse.instanceClassName,null,!0)[0]}focus(){this.count=0,this._focus()}_focus(){const e=this.links[0];e&&(e.focus(),this.request(this.verify.bind(this)))}verify(){if(this.count++,this.count>100)return;const e=this.links[0];e&&document.activeElement!==e&&this._focus()}get collapsePrimary(){return this.element.children.map((e=>e.getInstance("CollapseButton"))).filter((e=>null!==e&&e.hasClass(p.BUTTON)))[0]}}s.breadcrumb={BreadcrumbSelector:p,Breadcrumb:_},s.internals.register(s.breadcrumb.BreadcrumbSelector.BREADCRUMB,s.breadcrumb.Breadcrumb);const E={TOOLTIP:s.internals.ns.selector("tooltip"),SHOWN:s.internals.ns.selector("tooltip--shown"),BUTTON:s.internals.ns.selector("btn--tooltip")},b=1,S=2;class T extends s.core.PlacementReferent{constructor(){super(),this._state=0}static get instanceClassName(){return"TooltipReferent"}init(){if(super.init(),this.listen("focusin",this.focusIn.bind(this)),this.listen("focusout",this.focusOut.bind(this)),!this.matches(E.BUTTON)){const e=this.mouseover.bind(this);this.listen("mouseover",e),this.placement.listen("mouseover",e);const t=this.mouseout.bind(this);this.listen("mouseout",t),this.placement.listen("mouseout",t)}this.addEmission(s.core.RootEmission.KEYDOWN,this._keydown.bind(this)),this.listen("click",this._click.bind(this)),this.addEmission(s.core.RootEmission.CLICK,this._clickOut.bind(this))}_click(){this.focus()}_clickOut(e){this.node.contains(e)||this.blur()}_keydown(e){if(e===s.core.KeyCodes.ESCAPE)this.blur(),this.close()}close(){this.state=0}get state(){return this._state}set state(e){this._state!==e&&(this.isShown=e>0,this._state=e)}focusIn(){this.state|=b}focusOut(){this.state&=~b}mouseover(){this.state|=S}mouseout(){this.state&=~S}}const A=t=>`${e}-${t}`;A.selector=(e,t)=>(void 0===t&&(t="."),`${t}${A(e)}`),(A.attr=e=>`data-${A(e)}`).selector=(e,t)=>{let s=A.attr(e);return void 0!==t&&(s+=`="${t}"`),`[${s}]`},A.event=e=>`${t}.${e}`,A.emission=(e,t)=>`emission:${e}.${t}`;const f={SHOW:A.event("show"),HIDE:A.event("hide")},N="hidden",L="shown",D="hiding";class I extends s.core.Placement{constructor(){super(s.core.PlacementMode.AUTO,[s.core.PlacementPosition.TOP,s.core.PlacementPosition.BOTTOM],[s.core.PlacementAlign.CENTER,s.core.PlacementAlign.START,s.core.PlacementAlign.END]),this.modifier="",this._state=N}static get instanceClassName(){return"Tooltip"}init(){super.init(),this.register(`[aria-describedby="${this.id}"]`,T),this.listen("transitionend",this.transitionEnd.bind(this))}transitionEnd(){this._state===D&&(this._state=N,this.isShown=!1)}get isShown(){return super.isShown}set isShown(e){if(this.isEnabled)switch(!0){case e:this._state=L,this.addClass(E.SHOWN),this.dispatch(f.SHOW),super.isShown=!0;break;case this.isShown&&!e&&this._state===L:this._state=D,this.removeClass(E.SHOWN);break;case this.isShown&&!e&&this._state===N:this.dispatch(f.HIDE),super.isShown=!1}}render(){super.render();let e=this.referentRect.center-this.rect.center;const t=.5*this.rect.width-8;e<-t&&(e=-t),e>t&&(e=t),this.setProperty("--arrow-x",`${e.toFixed(2)}px`)}}s.tooltip={Tooltip:I,TooltipSelector:E,TooltipEvent:f},s.internals.register(s.tooltip.TooltipSelector.TOOLTIP,s.tooltip.Tooltip);class C extends s.core.Instance{static get instanceClassName(){return"ToggleInput"}get isChecked(){return this.node.checked}}class v extends s.core.Instance{static get instanceClassName(){return"ToggleStatusLabel"}init(){this.register(`input[id="${this.getAttribute("for")}"]`,C),this.update(),this.isSwappingFont=!0}get proxy(){return Object.assign(super.proxy,{update:this.update.bind(this)})}get input(){return this.getRegisteredInstances("ToggleInput")[0]}update(){this.node.style.removeProperty("--toggle-status-width");const e=this.input.isChecked,t=getComputedStyle(this.node,":before");let s=parseFloat(t.width);this.input.node.checked=!e;const i=getComputedStyle(this.node,":before"),n=parseFloat(i.width);n>s&&(s=n),this.input.node.checked=e,this.node.style.setProperty("--toggle-status-width",s/16+"rem")}swapFont(e){this.update()}}const R={STATUS_LABEL:`${s.internals.ns.selector("toggle__label")}${s.internals.ns.attr.selector("checked-label")}${s.internals.ns.attr.selector("unchecked-label")}`};s.toggle={ToggleStatusLabel:v,ToggleSelector:R},s.internals.register(s.toggle.ToggleSelector.STATUS_LABEL,s.toggle.ToggleStatusLabel);const y=s.internals.ns.selector("sidemenu__item"),O=s.internals.ns.selector("collapse"),P={LIST:s.internals.ns.selector("sidemenu__list"),COLLAPSE:`${y} > ${O}, ${y} > *:not(${y}):not(${O}) > ${O}, ${y} > *:not(${y}):not(${O}) > *:not(${y}):not(${O}) > ${O}`,COLLAPSE_LEGACY:`${y} ${O}`,ITEM:s.internals.ns.selector("sidemenu__item"),BUTTON:s.internals.ns.selector("sidemenu__btn")};class x extends s.core.CollapsesGroup{static get instanceClassName(){return"SidemenuList"}validate(e){return super.validate(e)&&e.node.matches(s.internals.legacy.isLegacy?P.COLLAPSE_LEGACY:P.COLLAPSE)}}class w extends s.core.Instance{static get instanceClassName(){return"SidemenuItem"}get collapsePrimary(){return this.element.children.map((e=>e.getInstance("CollapseButton"))).filter((e=>null!==e&&e.hasClass(P.BUTTON)))[0]}}s.sidemenu={SidemenuList:x,SidemenuItem:w,SidemenuSelector:P},s.internals.register(s.sidemenu.SidemenuSelector.LIST,s.sidemenu.SidemenuList),s.internals.register(s.sidemenu.SidemenuSelector.ITEM,s.sidemenu.SidemenuItem);const k={MODAL:s.internals.ns.selector("modal"),SCROLL_DIVIDER:s.internals.ns.selector("scroll-divider"),BODY:s.internals.ns.selector("modal__body"),TITLE:s.internals.ns.selector("modal__title")};class M extends s.core.DisclosureButton{constructor(){super(s.core.DisclosureType.OPENED)}static get instanceClassName(){return"ModalButton"}}const G={CONCEALING_BACKDROP:s.internals.ns.attr("concealing-backdrop")};class $ extends s.core.Disclosure{constructor(){super(s.core.DisclosureType.OPENED,k.MODAL,M,"ModalsGroup"),this._isActive=!1,this.scrolling=this.resize.bind(this,!1),this.resizing=this.resize.bind(this,!0)}static get instanceClassName(){return"Modal"}init(){super.init(),this._isDialog="DIALOG"===this.node.tagName,this.isScrolling=!1,this.listenClick(),this.addEmission(s.core.RootEmission.KEYDOWN,this._keydown.bind(this))}_keydown(e){if(e===s.core.KeyCodes.ESCAPE)this._escape()}_escape(){switch(document.activeElement?document.activeElement.tagName:void 0){case"INPUT":case"LABEL":case"TEXTAREA":case"SELECT":case"AUDIO":case"VIDEO":break;default:this.isDisclosed&&(this.conceal(),this.focus())}}retrieved(){this._ensureAccessibleName()}get body(){return this.element.getDescendantInstances("ModalBody","Modal")[0]}handleClick(e){e.target===this.node&&"false"!==this.getAttribute(G.CONCEALING_BACKDROP)&&this.conceal()}disclose(e){return!!super.disclose(e)&&(this.body&&this.body.activate(),this.isScrollLocked=!0,this.setAttribute("aria-modal","true"),this.setAttribute("open","true"),this._isDialog||this.activateModal(),!0)}conceal(e,t){return!!super.conceal(e,t)&&(this.isScrollLocked=!1,this.removeAttribute("aria-modal"),this.removeAttribute("open"),this.body&&this.body.deactivate(),this._isDialog||this.deactivateModal(),!0)}get isDialog(){return this._isDialog}set isDialog(e){this._isDialog=e}activateModal(){this._isActive||(this._isActive=!0,this._hasDialogRole="dialog"===this.getAttribute("role"),this._hasDialogRole||this.setAttribute("role","dialog"))}deactivateModal(){this._isActive&&(this._isActive=!1,this._hasDialogRole||this.removeAttribute("role"))}_setAccessibleName(e,t){const s=this.retrieveNodeId(e,t);this.warn(`add reference to ${t} for accessible name (aria-labelledby)`),this.setAttribute("aria-labelledby",s)}_ensureAccessibleName(){if(this.hasAttribute("aria-labelledby")||this.hasAttribute("aria-label"))return;this.warn("missing accessible name");const e=this.node.querySelector(k.TITLE),t=this.primaryButtons[0];switch(!0){case null!==e:this._setAccessibleName(e,"title");break;case void 0!==t:this.warn("missing required title, fallback to primary button"),this._setAccessibleName(t,"primary")}}}const H=['[tabindex="0"]',"a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details","iframe"].join(),U=['[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'].join(),B=(e,t)=>{if(!(e instanceof Element))return!1;const s=window.getComputedStyle(e);if(!s)return!1;if("hidden"===s.visibility)return!1;for(void 0===t&&(t=e);t.contains(e);){if("none"===s.display)return!1;e=e.parentElement}return!0};class W{constructor(e,t){this.element=null,this.activeElement=null,this.onTrap=e,this.onUntrap=t,this.waiting=this.wait.bind(this),this.handling=this.handle.bind(this),this.focusing=this.maintainFocus.bind(this),this.current=null}get trapped(){return null!==this.element}trap(e){this.trapped&&this.untrap(),this.element=e,this.isTrapping=!0,this.wait(),this.onTrap&&this.onTrap()}wait(){B(this.element)?this.trapping():window.requestAnimationFrame(this.waiting)}trapping(){if(!this.isTrapping)return;this.isTrapping=!1;const e=this.focusables;e.length&&-1===e.indexOf(document.activeElement)&&e[0].focus(),this.element.setAttribute("aria-modal",!0),window.addEventListener("keydown",this.handling),document.body.addEventListener("focus",this.focusing,!0)}stun(e){for(const t of e.children)t!==this.element&&(t.contains(this.element)?this.stun(t):this.stunneds.push(new F(t)))}maintainFocus(e){if(!this.element.contains(e.target)){const t=this.focusables;if(0===t.length)return;const s=t[0];e.preventDefault(),s.focus()}}handle(e){if(9!==e.keyCode)return;const t=this.focusables;if(0===t.length)return;const s=t[0],i=t[t.length-1],n=t.indexOf(document.activeElement);e.shiftKey?!this.element.contains(document.activeElement)||n<1?(e.preventDefault(),i.focus()):(document.activeElement.tabIndex>0||t[n-1].tabIndex>0)&&(e.preventDefault(),t[n-1].focus()):this.element.contains(document.activeElement)&&n!==t.length-1&&-1!==n?document.activeElement.tabIndex>0&&(e.preventDefault(),t[n+1].focus()):(e.preventDefault(),s.focus())}get focusables(){let e=s.internals.dom.querySelectorAllArray(this.element,H);const t=s.internals.dom.querySelectorAllArray(document.documentElement,'input[type="radio"]');if(t.length){const s={};for(const e of t){const t=e.getAttribute("name");void 0===s[t]&&(s[t]=new z(t)),s[t].push(e)}e=e.filter((e=>{if("input"!==e.tagName.toLowerCase()||"radio"!==e.getAttribute("type").toLowerCase())return!0;const t=e.getAttribute("name");return s[t].keep(e)}))}const i=s.internals.dom.querySelectorAllArray(this.element,U);i.sort(((e,t)=>e.tabIndex-t.tabIndex));const n=e.filter((e=>-1===i.indexOf(e)));return i.concat(n).filter((e=>"-1"!==e.tabIndex&&B(e,this.element)))}untrap(){this.trapped&&(this.isTrapping=!1,this.element.removeAttribute("aria-modal"),window.removeEventListener("keydown",this.handling),document.body.removeEventListener("focus",this.focusing,!0),this.element=null,this.onUntrap&&this.onUntrap())}dispose(){this.untrap()}}class F{constructor(e){this.element=e,this.inert=e.getAttribute("inert"),this.element.setAttribute("inert","")}unstun(){null===this.inert?this.element.removeAttribute("inert"):this.element.setAttribute("inert",this.inert)}}class z{constructor(e){this.name=e,this.buttons=[]}push(e){this.buttons.push(e),(e===document.activeElement||e.checked||void 0===this.selected)&&(this.selected=e)}keep(e){return this.selected===e}}class V extends s.core.DisclosuresGroup{constructor(){super("Modal",!1),this.focusTrap=new W}static get instanceClassName(){return"ModalsGroup"}apply(e,t){super.apply(e,t),null===this.current?this.focusTrap.untrap():this.focusTrap.trap(this.current.node)}}class q extends s.core.Instance{static get instanceClassName(){return"ModalBody"}init(){this.listen("scroll",this.divide.bind(this))}activate(){this.isResizing=!0,this.resize()}deactivate(){this.isResizing=!1}divide(){this.node.scrollHeight>this.node.clientHeight?this.node.offsetHeight+this.node.scrollTop>=this.node.scrollHeight?this.removeClass(k.SCROLL_DIVIDER):this.addClass(k.SCROLL_DIVIDER):this.removeClass(k.SCROLL_DIVIDER)}resize(){this.adjust(),this.request(this.adjust.bind(this))}adjust(){const e=32*(this.isBreakpoint(s.core.Breakpoints.MD)?2:1);this.isLegacy?this.style.maxHeight=window.innerHeight-e+"px":this.style.setProperty("--modal-max-height",window.innerHeight-e+"px"),this.divide()}}s.modal={Modal:$,ModalButton:M,ModalBody:q,ModalsGroup:V,ModalSelector:k},s.internals.register(s.modal.ModalSelector.MODAL,s.modal.Modal),s.internals.register(s.modal.ModalSelector.BODY,s.modal.ModalBody),s.internals.register(s.core.RootSelector.ROOT,s.modal.ModalsGroup);const K={TOGGLE:s.internals.ns.emission("password","toggle"),ADJUST:s.internals.ns.emission("password","adjust")};class X extends s.core.Instance{static get instanceClassName(){return"PasswordToggle"}init(){this.listenClick(),this.ascend(K.ADJUST,this.width),this.isSwappingFont=!0,this._isChecked=this.isChecked}get width(){const e=getComputedStyle(this.node.parentNode);return parseInt(e.width)}get isChecked(){return this.node.checked}set isChecked(e){this._isChecked=e,this.ascend(K.TOGGLE,e)}handleClick(){this.isChecked=!this._isChecked}swapFont(e){this.ascend(K.ADJUST,this.width)}}class Y extends s.core.Instance{static get instanceClassName(){return"Password"}init(){this.addAscent(K.TOGGLE,this.toggle.bind(this)),this.addAscent(K.ADJUST,this.adjust.bind(this))}toggle(e){this.descend(K.TOGGLE,e)}adjust(e){this.descend(K.ADJUST,e)}}const j={PASSWORD:s.internals.ns.selector("password"),INPUT:s.internals.ns.selector("password__input"),LABEL:s.internals.ns.selector("password__label"),TOOGLE:`${s.internals.ns.selector("password__checkbox")} input[type="checkbox"]`};class J extends s.core.Instance{static get instanceClassName(){return"PasswordInput"}init(){this.addDescent(K.TOGGLE,this.toggle.bind(this)),this._isRevealed="password"===this.hasAttribute("type"),this.listen("keydown",this.capslock.bind(this)),this.listen("keyup",this.capslock.bind(this))}toggle(e){this.isRevealed=e,this.setAttribute("type",e?"text":"password")}get isRevealed(){return this._isRevealed}capslock(e){e&&"function"!=typeof e.getModifierState||(e.getModifierState("CapsLock")?this.node.parentNode.setAttribute(s.internals.ns.attr("capslock"),""):this.node.parentNode.removeAttribute(s.internals.ns.attr("capslock")))}set isRevealed(e){this._isRevealed=e,this.setAttribute("type",e?"text":"password")}}class Q extends s.core.Instance{static get instanceClassName(){return"PasswordLabel"}init(){this.addDescent(K.ADJUST,this.adjust.bind(this))}adjust(e){const t=Math.ceil(e/16);this.node.style.paddingRight=t+"rem"}}s.password={Password:Y,PasswordToggle:X,PasswordSelector:j,PasswordInput:J,PasswordLabel:Q},s.internals.register(s.password.PasswordSelector.INPUT,s.password.PasswordInput),s.internals.register(s.password.PasswordSelector.PASSWORD,s.password.Password),s.internals.register(s.password.PasswordSelector.TOOGLE,s.password.PasswordToggle),s.internals.register(s.password.PasswordSelector.LABEL,s.password.PasswordLabel);const Z=s.internals.ns.selector("nav__item"),ee=s.internals.ns.selector("collapse"),te={NAVIGATION:s.internals.ns.selector("nav"),COLLAPSE:`${Z} > ${ee}, ${Z} > *:not(${Z}):not(${ee}) > ${ee}, ${Z} > *:not(${Z}):not(${ee}) > *:not(${Z}):not(${ee}) > ${ee}`,COLLAPSE_LEGACY:`${Z} ${ee}`,ITEM:Z,ITEM_RIGHT:`${Z}--align-right`,MENU:s.internals.ns.selector("menu"),BUTTON:s.internals.ns.selector("nav__btn"),TRANSLATE_BUTTON:s.internals.ns.selector("translate__btn")};class se extends s.core.Instance{constructor(){super(),this._isRightAligned=!1}static get instanceClassName(){return"NavigationItem"}init(){this.addAscent(s.core.DisclosureEmission.ADDED,this.calculate.bind(this)),this.addAscent(s.core.DisclosureEmission.REMOVED,this.calculate.bind(this)),this.isResizing=!0,this.calculate()}resize(){this.calculate()}calculate(){const e=this.element.getDescendantInstances(s.core.Collapse.instanceClassName,null,!0)[0];if(e&&this.isBreakpoint(s.core.Breakpoints.LG)&&e.element.node.matches(te.MENU)){const t=this.element.node.parentElement.getBoundingClientRect().right,s=e.element.node.getBoundingClientRect().width,i=this.element.node.getBoundingClientRect().left;this.isRightAligned=i+s>t}else this.isRightAligned=!1}get isRightAligned(){return this._isRightAligned}set isRightAligned(e){this._isRightAligned!==e&&(this._isRightAligned=e,e?s.internals.dom.addClass(this.element.node,te.ITEM_RIGHT):s.internals.dom.removeClass(this.element.node,te.ITEM_RIGHT))}get collapsePrimary(){return this.element.children.map((e=>e.getInstance("CollapseButton"))).filter((e=>null!==e&&(e.hasClass(te.BUTTON)||e.hasClass(te.TRANSLATE_BUTTON))))[0]}}const ie={NONE:-1,INSIDE:0,OUTSIDE:1};class ne extends s.core.CollapsesGroup{static get instanceClassName(){return"Navigation"}init(){super.init(),this.clicked=!1,this.out=!1,this.addEmission(s.core.RootEmission.CLICK,this._handleRootClick.bind(this)),this.listen("mousedown",this.handleMouseDown.bind(this)),this.listenClick({capture:!0}),this.isResizing=!0}validate(e){return super.validate(e)&&e.element.node.matches(s.internals.legacy.isLegacy?te.COLLAPSE_LEGACY:te.COLLAPSE)}handleMouseDown(e){this.isBreakpoint(s.core.Breakpoints.LG)&&-1!==this.index&&this.current&&(this.position=this.current.node.contains(e.target)?ie.INSIDE:ie.OUTSIDE,this.requestPosition())}handleClick(e){!e.target.matches("a, button")||e.target.matches("[aria-controls]")||e.target.matches(s.core.DisclosureSelector.PREVENT_CONCEAL)||(this.index=-1)}_handleRootClick(e){this.isBreakpoint(s.core.Breakpoints.LG)&&(this.node.contains(e)||(this.out=!0,this.requestPosition()))}requestPosition(){this.isRequesting||(this.isRequesting=!0,this.request(this.getPosition.bind(this)))}getPosition(){if(this.out)switch(this.position){case ie.OUTSIDE:this.index=-1;break;case ie.INSIDE:this.current&&!this.current.node.contains(document.activeElement)&&this.current.focus();break;default:this.index>-1&&!this.current.hasFocus&&(this.index=-1)}this.request(this.requested.bind(this))}requested(){this.position=ie.NONE,this.out=!1,this.isRequesting=!1}get index(){return super.index}set index(e){-1===e&&this.current&&this.current.hasFocus&&this.current.focus(),super.index=e}get canUngroup(){return!this.isBreakpoint(s.core.Breakpoints.LG)}resize(){this.update()}}s.navigation={Navigation:ne,NavigationItem:se,NavigationMousePosition:ie,NavigationSelector:te},s.internals.register(s.navigation.NavigationSelector.NAVIGATION,s.navigation.Navigation),s.internals.register(s.navigation.NavigationSelector.ITEM,s.navigation.NavigationItem);class re extends s.core.DisclosureButton{constructor(){super(s.core.DisclosureType.SELECT)}static get instanceClassName(){return"TabButton"}handleClick(e){super.handleClick(e),this.focus()}apply(e){super.apply(e),this.isPrimary&&(this.setAttribute("tabindex",e?"0":"-1"),e&&this.list&&this.list.focalize(this))}get list(){return this.element.getAscendantInstance("TabsList","TabsGroup")}}const ae={TAB:s.internals.ns.selector("tabs__tab"),GROUP:s.internals.ns.selector("tabs"),PANEL:s.internals.ns.selector("tabs__panel"),LIST:s.internals.ns.selector("tabs__list"),SHADOW:s.internals.ns.selector("tabs__shadow"),SHADOW_LEFT:s.internals.ns.selector("tabs__shadow--left"),SHADOW_RIGHT:s.internals.ns.selector("tabs__shadow--right"),PANEL_START:s.internals.ns.selector("tabs__panel--direction-start"),PANEL_END:s.internals.ns.selector("tabs__panel--direction-end")},oe="direction-start",le="direction-end",ce="none";class he extends s.core.Disclosure{constructor(){super(s.core.DisclosureType.SELECT,ae.PANEL,re,"TabsGroup"),this._direction=ce,this._isPreventingTransition=!1}static get instanceClassName(){return"TabPanel"}get direction(){return this._direction}set direction(e){if(e!==this._direction){switch(this._direction){case oe:this.removeClass(ae.PANEL_START);break;case le:this.removeClass(ae.PANEL_END);break;case ce:break;default:return}switch(this._direction=e,this._direction){case oe:this.addClass(ae.PANEL_START);break;case le:this.addClass(ae.PANEL_END)}}}get isPreventingTransition(){return this._isPreventingTransition}set isPreventingTransition(e){this._isPreventingTransition!==e&&(e?this.addClass(s.internals.motion.TransitionSelector.NONE):this.removeClass(s.internals.motion.TransitionSelector.NONE),this._isPreventingTransition=!0===e)}translate(e,t){this.isPreventingTransition=t,this.direction=e}reset(){this.group&&this.group.retrieve(!0)}_electPrimaries(e){return this.group&&this.group.list?super._electPrimaries(e).filter((e=>this.group.list.node.contains(e.node))):[]}}const de="tab_keys_left",ue="tab_keys_right",ge="tab_keys_home",me="tab_keys_end",pe={PRESS_KEY:s.internals.ns.emission("tab","press_key"),LIST_HEIGHT:s.internals.ns.emission("tab","list_height")};class _e extends s.core.DisclosuresGroup{constructor(){super("TabPanel")}static get instanceClassName(){return"TabsGroup"}init(){super.init(),this.listen("transitionend",this.transitionend.bind(this)),this.addAscent(pe.PRESS_KEY,this.pressKey.bind(this)),this.addAscent(pe.LIST_HEIGHT,this.setListHeight.bind(this)),this.isRendering=!0}getIndex(e=0){super.getIndex(e)}get list(){return this.element.getDescendantInstances("TabsList","TabsGroup",!0)[0]}setListHeight(e){this.listHeight=e}transitionend(e){this.isPreventingTransition=!0}get buttonHasFocus(){return this.members.some((e=>e.buttonHasFocus))}pressKey(e){switch(e){case de:this.pressLeft();break;case ue:this.pressRight();break;case ge:this.pressHome();break;case me:this.pressEnd()}}pressRight(){this.buttonHasFocus&&(this.index<this.length-1?this.index++:this.index=0,this.focus())}pressLeft(){this.buttonHasFocus&&(this.index>0?this.index--:this.index=this.length-1,this.focus())}pressHome(){this.buttonHasFocus&&(this.index=0,this.focus())}pressEnd(){this.buttonHasFocus&&(this.index=this.length-1,this.focus())}focus(){this.current&&this.current.focus()}apply(){for(let e=0;e<this._index;e++)this.members[e].translate(oe);this.current&&this.current.translate(ce);for(let e=this._index+1;e<this.length;e++)this.members[e].translate(le);this.isPreventingTransition=!1}get isPreventingTransition(){return this._isPreventingTransition}set isPreventingTransition(e){this._isPreventingTransition!==e&&(e?this.addClass(s.internals.motion.TransitionSelector.NONE):this.removeClass(s.internals.motion.TransitionSelector.NONE),this._isPreventingTransition=!0===e)}render(){if(null===this.current)return;this.node.scrollTop=0,this.node.scrollLeft=0;const e=Math.round(this.current.node.offsetHeight);this.panelHeight!==e&&(this.panelHeight=e,this.style.setProperty("--tabs-height",this.panelHeight+this.listHeight+"px"))}}class Ee extends s.core.Instance{static get instanceClassName(){return"TabsList"}init(){this.listen("scroll",this.scroll.bind(this)),this.listenKey(s.core.KeyCodes.RIGHT,this.ascend.bind(this,pe.PRESS_KEY,ue),!0,!0),this.listenKey(s.core.KeyCodes.LEFT,this.ascend.bind(this,pe.PRESS_KEY,de),!0,!0),this.listenKey(s.core.KeyCodes.HOME,this.ascend.bind(this,pe.PRESS_KEY,ge),!0,!0),this.listenKey(s.core.KeyCodes.END,this.ascend.bind(this,pe.PRESS_KEY,me),!0,!0),this.isResizing=!0}focalize(e){const t=e.getRect(),s=this.getRect(),i=this.node.scrollLeft;t.left<s.left?this.node.scrollTo(i-s.left+t.left-16,0):t.right>s.right&&this.node.scrollTo(i-s.right+t.right+16,0)}get isScrolling(){return this._isScrolling}set isScrolling(e){this._isScrolling!==e&&(this._isScrolling=e,this.apply())}apply(){this._isScrolling?(this.addClass(ae.SHADOW),this.scroll()):(this.removeClass(ae.SHADOW_RIGHT),this.removeClass(ae.SHADOW_LEFT),this.removeClass(ae.SHADOW))}scroll(){const e=this.node.scrollLeft,t=e<=16,s=this.node.scrollWidth-this.node.clientWidth-16,i=Math.abs(e)>=s,n="rtl"===document.documentElement.getAttribute("dir"),r=n?ae.SHADOW_RIGHT:ae.SHADOW_LEFT,a=n?ae.SHADOW_LEFT:ae.SHADOW_RIGHT;t?this.removeClass(r):this.addClass(r),i?this.removeClass(a):this.addClass(a)}resize(){this.isScrolling=this.node.scrollWidth>this.node.clientWidth+16;const e=this.getRect().height;this.setProperty("--tabs-list-height",`${e}px`),this.ascend(pe.LIST_HEIGHT,e)}dispose(){this.isScrolling=!1}}s.tab={TabPanel:he,TabButton:re,TabsGroup:_e,TabsList:Ee,TabSelector:ae,TabEmission:pe},s.internals.register(s.tab.TabSelector.PANEL,s.tab.TabPanel),s.internals.register(s.tab.TabSelector.GROUP,s.tab.TabsGroup),s.internals.register(s.tab.TabSelector.LIST,s.tab.TabsList);const be={SCROLLABLE:s.internals.ns.emission("table","scrollable"),CHANGE:s.internals.ns.emission("table","change"),CAPTION_HEIGHT:s.internals.ns.emission("table","captionheight")};class Se extends s.core.Instance{static get instanceClassName(){return"Table"}init(){this.addAscent(be.CAPTION_HEIGHT,this.setCaptionHeight.bind(this))}setCaptionHeight(e){this.setProperty("--table-offset",`calc(${e}px + 1rem)`)}}const Te={TABLE:s.internals.ns.selector("table"),SHADOW:s.internals.ns.selector("table__shadow"),SHADOW_LEFT:s.internals.ns.selector("table__shadow--left"),SHADOW_RIGHT:s.internals.ns.selector("table__shadow--right"),ELEMENT:`${s.internals.ns.selector("table")}:not(${s.internals.ns.selector("table--no-scroll")}) table`,CAPTION:`${s.internals.ns.selector("table")} table caption`};class Ae extends s.core.Instance{static get instanceClassName(){return"TableElement"}init(){this.listen("scroll",this.scroll.bind(this)),this.content=this.querySelector("tbody"),this.isResizing=!0}get isScrolling(){return this._isScrolling}set isScrolling(e){this._isScrolling!==e&&(this._isScrolling=e,e?(this.addClass(Te.SHADOW),this.scroll()):(this.removeClass(Te.SHADOW),this.removeClass(Te.SHADOW_LEFT),this.removeClass(Te.SHADOW_RIGHT)))}scroll(){const e=this.node.scrollLeft<=8,t=this.content.offsetWidth-this.node.offsetWidth-8,s=Math.abs(this.node.scrollLeft)>=t,i="rtl"===document.documentElement.getAttribute("dir"),n=i?Te.SHADOW_RIGHT:Te.SHADOW_LEFT,r=i?Te.SHADOW_LEFT:Te.SHADOW_RIGHT;e?this.removeClass(n):this.addClass(n),s?this.removeClass(r):this.addClass(r)}resize(){this.isScrolling=this.content.offsetWidth>this.node.offsetWidth}dispose(){this.isScrolling=!1}}class fe extends s.core.Instance{static get instanceClassName(){return"TableCaption"}init(){this.height=0,this.isResizing=!0}resize(){const e=this.getRect().height;this.height!==e&&(this.height=e,this.ascend(be.CAPTION_HEIGHT,e))}}s.table={Table:Se,TableElement:Ae,TableCaption:fe,TableSelector:Te},s.internals.register(s.table.TableSelector.TABLE,s.table.Table),s.internals.register(s.table.TableSelector.ELEMENT,s.table.TableElement),s.internals.register(s.table.TableSelector.CAPTION,s.table.TableCaption);const Ne={DISMISS:s.internals.ns.event("dismiss")};class Le extends s.core.Instance{static get instanceClassName(){return"TagDismissible"}init(){this.listenClick()}handleClick(){switch(this.focusClosest(),s.mode){case s.Modes.ANGULAR:case s.Modes.REACT:case s.Modes.VUE:this.request(this.verify.bind(this));break;default:this.remove()}this.dispatch(Ne.DISMISS)}verify(){document.body.contains(this.node)&&this.warn(`a TagDismissible has just been dismissed and should be removed from the dom. In ${s.mode} mode, the api doesn't handle dom modification. An event ${Ne.DISMISS} is dispatched by the element to trigger the removal`)}}const De={PRESSABLE:`${s.internals.ns.selector("tag")}[aria-pressed]`,DISMISSIBLE:`${s.internals.ns.selector("tag--dismiss")}`};s.tag={TagDismissible:Le,TagSelector:De,TagEvent:Ne},s.internals.register(s.tag.TagSelector.PRESSABLE,s.core.Toggle),s.internals.register(s.tag.TagSelector.DISMISSIBLE,s.tag.TagDismissible);const Ie=s.internals.ns.selector("transcription"),Ce={TRANSCRIPTION:Ie,BUTTON:`${Ie}__btn`};class ve extends s.core.Instance{static get instanceClassName(){return"Transcription"}get collapsePrimary(){return this.element.children.map((e=>e.getInstance("CollapseButton"))).filter((e=>null!==e&&e.hasClass(Ce.BUTTON)))[0]}}s.transcription={Transcription:ve,TranscriptionSelector:Ce},s.internals.register(s.transcription.TranscriptionSelector.TRANSCRIPTION,s.transcription.Transcription);class Re extends s.core.Instance{static get instanceClassName(){return"TileDownload"}init(){this.addAscent(s.core.AssessEmission.UPDATE,(e=>{this.descend(s.core.AssessEmission.UPDATE,e)})),this.addAscent(s.core.AssessEmission.ADDED,(()=>{this.descend(s.core.AssessEmission.ADDED)}))}}const ye={DOWNLOAD:s.internals.ns.selector("tile--download"),DOWNLOAD_DETAIL:`${s.internals.ns.selector("tile--download")} ${s.internals.ns.selector("tile__detail")}`};s.tile={TileSelector:ye,TileDownload:Re},s.internals.register(s.tile.TileSelector.DOWNLOAD,s.tile.TileDownload),s.internals.register(s.tile.TileSelector.DOWNLOAD_DETAIL,s.core.AssessDetail);const Oe={RANGE:s.internals.ns.selector("range"),RANGE_SM:s.internals.ns.selector("range--sm"),RANGE_STEP:s.internals.ns.selector("range--step"),RANGE_DOUBLE:s.internals.ns.selector("range--double"),RANGE_DOUBLE_STEP:s.internals.ns.selector("range--double")+s.internals.ns.selector("range--step"),RANGE_INPUT:s.internals.ns.selector("range input[type=range]:nth-of-type(1)"),RANGE_INPUT2:`${s.internals.ns.selector("range--double")} input[type=range]:nth-of-type(2)`,RANGE_OUTPUT:s.internals.ns.selector("range__output"),RANGE_MIN:s.internals.ns.selector("range__min"),RANGE_MAX:s.internals.ns.selector("range__max"),RANGE_PREFIX:s.internals.ns.attr("prefix"),RANGE_SUFFIX:s.internals.ns.attr("suffix")},Pe={VALUE:s.internals.ns.emission("range","value"),VALUE2:s.internals.ns.emission("range","value2"),OUTPUT:s.internals.ns.emission("range","output"),CONSTRAINTS:s.internals.ns.emission("range","constraints"),MIN:s.internals.ns.emission("range","min"),MAX:s.internals.ns.emission("range","max"),STEP:s.internals.ns.emission("range","step"),PREFIX:s.internals.ns.emission("range","prefix"),SUFFIX:s.internals.ns.emission("range","suffix"),DISABLED:s.internals.ns.emission("range","disabled"),ENABLE_POINTER:s.internals.ns.emission("range","enable_pointer")};class xe{constructor(){this._width=0,this._min=0,this._max=0,this._value=0,this._thumbSize=24,this._innerWidth=0,this._prefix="",this._suffix="",this._background={}}configure(e){e&&(this._prefix=e._prefix,this._suffix=e._suffix,this._width=e.width,this.setConstraints(e._constraints),this.value=e.value,this.update())}setPrefix(e){this._prefix=null!==e?e:""}setSuffix(e){this._suffix=null!==e?e:""}_decorate(e){return`${this._prefix}${e}${this._suffix}`}get width(){return this._width}set width(e){this._width=e}get isSm(){return this._isSm}set isSm(e){this._isSm!==e&&(this._isSm=e,this.setThumbSize(e?16:24),this.update())}setThumbSize(e,t=1){this._thumbSize=e,this._innerPadding=e*t}get textValue(){return this._decorate(this._value)}get value(){return this._value}set value(e){this._value=e}get outputX(){return this._outputX}setConstraints(e){this._constraints=e,this._min=e.min,this._max=e.max,this._step=e.step,this._rangeWidth=e.rangeWidth}get min(){return this._min}get textMin(){return this._decorate(this._min)}get max(){return this._max}get textMax(){return this._decorate(this._max)}get step(){return this._step}get output(){return{text:this.textValue,transform:`translateX(${this._translateX}px) translateX(-${this._centerPercent}%)`}}_getRatio(e){return(e-this._min)/this._rangeWidth}get progress(){return this._progress}update(){this._update()}_update(){this._innerWidth=this._width-this._innerPadding;const e=this._getRatio(this._value);this._translateX=e*this._width,this._centerPercent=100*e,this._progress={right:`${(this._innerWidth*e+.5*this._innerPadding).toFixed(2)}px`}}}class we extends xe{get stepWidth(){return`${this._stepWidth.toFixed(3)}px`}_update(){super._update();const e=this._rangeWidth/this._step;for(this._stepWidth=this._innerWidth/e;this._stepWidth<4;)this._stepWidth*=2}}class ke extends xe{get value2(){return this._value}set value2(e){this._value2!==e&&(this._value2=e,this.update())}get textValue(){return`${this._decorate(this._value)} - ${this._decorate(this._value2)}`}setThumbSize(e){super.setThumbSize(e,2)}_update(){super._update();const e=this._getRatio(.5*(this._value+this._value2));this._translateX=e*this._width,this._centerPercent=100*e;const t=this._getRatio(this._value),s=this._getRatio(this._value2);this._progress={left:`${(this._innerWidth*t+.25*this._innerPadding).toFixed(2)}px`,right:`${(this._innerWidth*s+.75*this._innerPadding).toFixed(2)}px`}}}class Me extends ke{get stepWidth(){return`${this._stepWidth.toFixed(3)}px`}_update(){super._update();const e=this._rangeWidth/this._step;this._stepWidth=this._innerWidth/e,this._stepWidth<4&&(this._stepWidth*=Math.ceil(4/this._stepWidth))}}const Ge="step",$e="double",He="double-step",Ue="default";class Be extends s.core.Instance{static get instanceClassName(){return"Range"}init(){this._retrieveType(),this._retrieveSize(),this.isLegacy?(this.isResizing=!0,this.isMouseMoving=!0):(this._observer=new ResizeObserver(this.resize.bind(this)),this._observer.observe(this.node)),this.addAscent(Pe.CONSTRAINTS,this.setConstraints.bind(this)),this.addAscent(Pe.VALUE,this.setValue.bind(this)),this.addAscent(Pe.VALUE2,this.setValue2.bind(this)),this.getAttribute(Oe.RANGE_PREFIX)&&this.setPrefix(this.getAttribute(Oe.RANGE_PREFIX)),this.getAttribute(Oe.RANGE_SUFFIX)&&this.setSuffix(this.getAttribute(Oe.RANGE_SUFFIX)),this.update()}_retrieveType(){switch(!0){case this.matches(Oe.RANGE_DOUBLE_STEP):case this.matches(Oe.RANGE_DOUBLE):this.type=$e;break;case this.matches(Oe.RANGE_STEP):this.type=Ge;break;default:this.type=Ue}}set type(e){if(this._type===e)return;this._type=e;const t=this._model;switch(this._type){case He:this._model=new Me;break;case $e:this._model=new ke;break;case Ge:this._model=new we;break;default:this._model=new xe}this._model.configure(t)}get type(){return this._type}_retrieveSize(){this._model.isSm=this.matches(Oe.RANGE_SM)}resize(){this._retrieveWidth(),this.update()}_retrieveWidth(){this._model.width=this.getRect().width}setValue(e){switch(this._model.value=e,this._type){case He:case $e:this.descend(Pe.VALUE,e)}this.update()}setValue2(e){this._model.value2=e,this.descend(Pe.VALUE2,e),this.update()}setConstraints(e){this._model.setConstraints(e),this.update(),this.descend(Pe.CONSTRAINTS,e)}setPrefix(e){this._model.setPrefix(e),this.update()}setSuffix(e){this._model.setSuffix(e),this.update()}mutate(e){switch(!0){case e.includes("class"):this._retrieveType(),this._retrieveSize();break;case e.includes(Oe.RANGE_PREFIX):case e.includes(Oe.RANGE_SUFFIX):this._model.setPrefix(this.getAttribute(Oe.RANGE_PREFIX)),this._model.setSuffix(this.getAttribute(Oe.RANGE_SUFFIX)),this.update()}}update(){this._model.update(),this.descend(Pe.OUTPUT,this._model.output),this.descend(Pe.MIN,this._model.textMin),this.descend(Pe.MAX,this._model.textMax);const e=this._model.progress;e.left?this.style.setProperty("--progress-left",e.left):this.style.removeProperty("--progress-left"),e.right?(this.style.setProperty("--progress-right",e.right),this.isLegacy&&e.left&&(this.style.setProperty("background-position-x",e.left),this.style.setProperty("background-size",`${parseFloat(e.right)-parseFloat(e.left)}px ${this._model.isSm?"8px":"12px"}`))):(this.style.removeProperty("--progress-right"),this.isLegacy&&(this.style.removeProperty("background-size"),this.style.removeProperty("background-position-x"))),this._model.stepWidth?this.style.setProperty("--step-width",this._model.stepWidth):this.style.removeProperty("--step-width")}mouseMove(e){if(this._type!==$e&&this._type!==He)return;const t=e.x-this.getRect().left;this.descend(Pe.ENABLE_POINTER,(parseFloat(this._model.progress.right)-parseFloat(this._model.progress.left))/2+parseFloat(this._model.progress.left)<t?2:1)}dispose(){this._observer.disconnect()}}class We{constructor(e){this._min=isNaN(e.min)?0:e.min,this._max=isNaN(e.max)?100:e.max,this._step=isNaN(e.step)?1:e.step,this._rangeWidth=this._max-this._min}get min(){return this._min}get max(){return this._max}get step(){return this._step}get rangeWidth(){return this._rangeWidth}test(e,t,s){return this._min===e&&this._max===t&&this._step===s}}class Fe extends s.core.Instance{static get instanceClassName(){return"RangeInput"}init(){this._init(),this.node.value=this.getAttribute("value"),this._changing=this.change.bind(this),this._listenerType=this.isLegacy?"change":"input",this.listen(this._listenerType,this._changing),this.isLegacy&&this.addDescent(Pe.ENABLE_POINTER,this._enablePointer.bind(this)),this.change()}_init(){this._pointerId=1,this.request((()=>{this.hasAttribute("min")||this.setAttribute("min",0),this.ascend(Pe.CONSTRAINTS,new We(this.node)),this.ascend(Pe.DISABLED,this.node.disabled)})),this.addDescent(Pe.VALUE2,this.setValue.bind(this))}_enablePointer(e){const t=e===this._pointerId;this._isPointerEnabled!==t&&(this._isPointerEnabled=t,t?this.style.removeProperty("pointer-events"):this.style.setProperty("pointer-events","none"))}setValue(e){parseFloat(this.node.value)>e&&(this.node.value=e,this.change())}change(){this.ascend(Pe.VALUE,parseFloat(this.node.value))}mutate(e){e.includes("disabled")&&this.ascend(Pe.DISABLED,this.node.disabled),(e.includes("min")||e.includes("max")||e.includes("step"))&&(this.ascend(Pe.CONSTRAINTS,new We(this.node)),this.change())}dispose(){this._listenerType&&this.unlisten(this._listenerType,this._changing)}}class ze extends s.core.Instance{static get instanceClassName(){return"RangeOutput"}init(){this.addDescent(Pe.OUTPUT,this.change.bind(this))}change(e){this.node.innerText=e.text,this.node.style.transform=e.transform}}class Ve extends s.core.Instance{static get instanceClassName(){return"RangeLimit"}init(){switch(!0){case this.matches(Oe.RANGE_MIN):this.addDescent(Pe.MIN,this.change.bind(this));break;case this.matches(Oe.RANGE_MAX):this.addDescent(Pe.MAX,this.change.bind(this))}}change(e){this.node.innerText=e}}s.range={Range:Be,RangeInput:Fe,RangeInput2:class extends Fe{static get instanceClassName(){return"RangeInput2"}_init(){this._pointerId=2,this.addDescent(Pe.CONSTRAINTS,this.setConstraints.bind(this)),this.addDescent(Pe.VALUE,this.setValue.bind(this))}setValue(e){parseFloat(this.node.value)<e&&(this.node.value=e,this.change())}change(){this.ascend(Pe.VALUE2,parseFloat(this.node.value))}setConstraints(e){this.node.min=e.min,this.node.max=e.max,this.node.step=e.step,this.change()}mutate(e){}},RangeOutput:ze,RangeLimit:Ve,RangeEmission:Pe,RangeSelector:Oe},s.internals.register(s.range.RangeSelector.RANGE,s.range.Range),s.internals.register(s.range.RangeSelector.RANGE_INPUT,s.range.RangeInput),s.internals.register(s.range.RangeSelector.RANGE_INPUT2,s.range.RangeInput2),s.internals.register(s.range.RangeSelector.RANGE_OUTPUT,s.range.RangeOutput),s.internals.register(s.range.RangeSelector.RANGE_MIN,s.range.RangeLimit),s.internals.register(s.range.RangeSelector.RANGE_MAX,s.range.RangeLimit);const qe={HEADER:s.internals.ns.selector("header"),TOOLS_LINKS:s.internals.ns.selector("header__tools-links"),MENU_LINKS:s.internals.ns.selector("header__menu-links"),BUTTONS:`${s.internals.ns.selector("header__tools-links")} ${s.internals.ns.selector("btns-group")}, ${s.internals.ns.selector("header__tools-links")} ${s.internals.ns.selector("links-group")}`,MODALS:`${s.internals.ns.selector("header__search")}${s.internals.ns.selector("modal")}, ${s.internals.ns.selector("header__menu")}${s.internals.ns.selector("modal")}`};class Ke extends s.core.Instance{static get instanceClassName(){return"HeaderLinks"}init(){const e=this.queryParentSelector(qe.HEADER);this.toolsLinks=e.querySelector(qe.TOOLS_LINKS),this.menuLinks=e.querySelector(qe.MENU_LINKS);const t="-mobile",i=this.toolsLinks.innerHTML.replace(/ +/g," "),n=this.menuLinks.innerHTML.replace(/ +/g," ");let r=i.match(/id="(.*?)"/gm)||[];r=r.map((e=>e.replace('id="',"").replace('"',"")));const a=i.match(/aria-controls="(.*?)"/gm);let o=i.replace(/id="(.*?)"/gm,'id="$1'+t+'"');if(a)for(const e of a){const s=e.replace('aria-controls="',"").replace('"',"");r.includes(s)&&(o=o.replace(`aria-controls="${s}"`,`aria-controls="${s+t}"`))}if(o!==n)switch(s.mode){case s.Modes.ANGULAR:case s.Modes.REACT:case s.Modes.VUE:this.warn(`header__tools-links content is different from header__menu-links content.\nAs you're using a dynamic framework, you should handle duplication of this content yourself, please refer to documentation:\n${s.header.doc}`);break;default:this.menuLinks.innerHTML=o}}}class Xe extends s.core.Instance{static get instanceClassName(){return"HeaderModal"}init(){this.isResizing=!0}resize(){this.isBreakpoint(s.core.Breakpoints.LG)?this.deactivateModal():this.activateModal()}activateModal(){const e=this.element.getInstance("Modal");e&&(e.isEnabled=!0,this.listenClick({capture:!0}))}deactivateModal(){const e=this.element.getInstance("Modal");e&&(e.conceal(),e.isEnabled=!1,this.unlistenClick({capture:!0}))}handleClick(e){if(e.target.matches("a, button")&&!e.target.matches("[aria-controls]")&&!e.target.matches(s.core.DisclosureSelector.PREVENT_CONCEAL)){this.element.getInstance("Modal").conceal()}}}s.header={HeaderLinks:Ke,HeaderModal:Xe,HeaderSelector:qe,doc:"https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/en-tete"},s.internals.register(s.header.HeaderSelector.TOOLS_LINKS,s.header.HeaderLinks),s.internals.register(s.header.HeaderSelector.MODALS,s.header.HeaderModal);const Ye={DISPLAY:s.internals.ns.selector("display"),RADIO_BUTTONS:`input[name="${s.internals.ns("radios-theme")}"]`,FIELDSET:s.internals.ns.selector("fieldset")};class je extends s.core.Instance{static get instanceClassName(){return"Display"}init(){if(this.radios=this.querySelectorAll(Ye.RADIO_BUTTONS),s.scheme){this.changing=this.change.bind(this);for(const e of this.radios)e.addEventListener("change",this.changing);this.addDescent(s.scheme.SchemeEmission.SCHEME,this.apply.bind(this)),this.ascend(s.scheme.SchemeEmission.ASK)}else this.querySelector(Ye.FIELDSET).setAttribute("disabled","")}get scheme(){return this._scheme}set scheme(e){if(this._scheme!==e&&s.scheme)switch(e){case s.scheme.SchemeValue.SYSTEM:case s.scheme.SchemeValue.LIGHT:case s.scheme.SchemeValue.DARK:this._scheme=e;for(const t of this.radios)t.checked=t.value===e;this.ascend(s.scheme.SchemeEmission.SCHEME,e)}}change(){for(const e of this.radios)if(e.checked)return void(this.scheme=e.value)}apply(e){this.scheme=e}dispose(){for(const e of this.radios)e.removeEventListener("change",this.changing)}}s.display={Display:je,DisplaySelector:Ye},s.internals.register(s.display.DisplaySelector.DISPLAY,s.display.Display);
//# sourceMappingURL=component.module.min.js.map