{"version":3,"file":"dsfr.nomodule.min.js","sources":["../../src/core/script/api/state.js","../../.config/config.js","../../src/core/script/api/inspect/inspector.js","../../src/core/script/api/options/starters.js","../../src/core/script/api/options/options.js","../../src/core/script/api/utilities/collection.js","../../src/core/script/api/module.js","../../src/core/script/api/utilities/namespace.js","../../src/core/script/api/utilities/dom/query-selector.js","../../src/core/script/api/register/registration.js","../../src/core/script/api/register/register.js","../../src/core/script/api/stage/element.js","../../src/core/script/api/stage/root.js","../../src/core/script/api/stage/stage.js","../../src/core/script/api/render/renderer.js","../../src/core/script/api/resize/resizer.js","../../src/core/script/api/scroll/scroll-locker.js","../../src/core/script/api/load/load.js","../../src/core/script/api/engine.js","../../src/core/script/api/utilities/dom/classes.js","../../src/core/script/api/utilities/dom/index.js","../../src/core/script/api/utilities/support/browser-support.js","../../src/core/script/api/utilities/support/index.js","../../src/core/script/api/utilities/property/complete-assign.js","../../src/core/script/api/utilities/property/index.js","../../src/core/script/api/internals.js","../../src/core/script/api/api.js","../../src/core/script/api/utilities/emitter.js","../../src/core/script/api/register/breakpoints.js","../../src/core/script/api/register/instance.js","../../src/core/script/api/register/key-codes.js","../../src/core/script/disclosure/disclosure-event.js","../../src/core/script/disclosure/disclosure-emission.js","../../src/core/script/disclosure/disclosure.js","../../src/core/script/disclosure/disclosure-button.js","../../src/core/script/disclosure/disclosures-group.js","../../src/core/script/disclosure/disclosure-type.js","../../src/core/script/collapse/collapse-button.js","../../src/core/script/collapse/collapse-selector.js","../../src/core/script/collapse/collapse.js","../../src/core/script/collapse/collapses-group.js","../../src/core/script/equisized/equisized-emission.js","../../src/core/script/equisized/equisized.js","../../src/core/script/equisized/equisizeds-group.js","../../src/core/script/action/toggle/toggle-event.js","../../src/core/script/action/toggle/toggle.js","../../src/core/script/inject/inject-svg.js","../../src/core/script/api/utilities/attribute.js","../../src/core/script/inject/inject-svg-selector.js","../../src/core/index.js","../../src/core/main.js","../../src/core/api.js","../../src/scheme/script/scheme/scheme-value.js","../../src/scheme/script/scheme/scheme-attribute.js","../../src/scheme/script/scheme/scheme-theme.js","../../src/scheme/script/scheme/scheme-emission.js","../../src/scheme/script/scheme/scheme.js","../../src/scheme/script/scheme/scheme-selector.js","../../src/scheme/index.js","../../src/scheme/main.js","../../src/component/accordion/script/accordion/accordion-selector.js","../../src/component/accordion/script/accordion/accordions-group.js","../../src/component/accordion/index.js","../../src/component/accordion/main.js","../../src/component/button/script/button/button-selector.js","../../src/component/button/index.js","../../src/component/button/main.js","../../src/component/breadcrumb/script/breadcrumb/breadcrumb.js","../../src/component/breadcrumb/script/breadcrumb/breadcrumb-selector.js","../../src/component/breadcrumb/index.js","../../src/component/breadcrumb/main.js","../../src/component/toggle/script/toggle/toggle-input.js","../../src/component/toggle/script/toggle/toggle-status-label.js","../../src/component/toggle/script/toggle/toggle-selector.js","../../src/component/toggle/index.js","../../src/component/toggle/main.js","../../src/component/sidemenu/script/sidemenu/sidemenu-selector.js","../../src/component/sidemenu/script/sidemenu/sidemenu-list.js","../../src/component/sidemenu/index.js","../../src/component/sidemenu/main.js","../../src/component/modal/script/modal/modal-selector.js","../../src/component/modal/script/modal/modal-button.js","../../src/component/modal/script/modal/modal-attribute.js","../../src/component/modal/script/modal/modal.js","../../src/component/modal/script/modal/focus-trap.js","../../src/component/modal/script/modal/modals-group.js","../../src/component/modal/script/modal/modal-body.js","../../src/component/modal/index.js","../../src/component/modal/main.js","../../src/component/navigation/script/navigation/navigation-selector.js","../../src/component/navigation/script/navigation/navigation-item.js","../../src/component/navigation/script/navigation/navigation-mouse-position.js","../../src/component/navigation/script/navigation/navigation.js","../../src/component/navigation/index.js","../../src/component/navigation/main.js","../../src/component/tab/script/tab/tab-button.js","../../src/component/tab/script/tab/tab-selector.js","../../src/component/tab/script/tab/tab-panel.js","../../src/component/tab/script/tab/tabs-group.js","../../src/component/tab/script/tab/tabs-list.js","../../src/component/tab/index.js","../../src/component/tab/main.js","../../src/component/table/script/table/table-emission.js","../../src/component/table/script/table/table.js","../../src/component/table/script/table/table-selector.js","../../src/component/table/script/table/table-element.js","../../src/component/table/script/table/table-caption.js","../../src/component/table/index.js","../../src/component/table/main.js","../../src/component/tag/script/tag/tag-selector.js","../../src/component/tag/index.js","../../src/component/tag/main.js","../../src/component/header/script/header/header-selector.js","../../src/component/header/script/header/header-links.js","../../src/component/header/script/header/header-modal.js","../../src/component/header/index.js","../../src/component/header/main.js","../../src/component/display/script/display/display-selector.js","../../src/component/display/script/display/display.js","../../src/component/display/index.js","../../src/component/display/main.js","../../src/legacy/script/polyfill-io/custom-event-polyfill.min.js","../../src/legacy/script/polyfill-io/add-event-listener-polyfill.min.js","../../src/legacy/script/polyfill-io/foreach-polyfill.min.js","../../src/legacy/script/polyfill-io/contains-polyfill.min.js","../../src/legacy/script/polyfill-io/matches-polyfill.min.js","../../src/core/legacy.js"],"sourcesContent":["class State {\n constructor () {\n this.modules = {};\n }\n\n create (ModuleClass) {\n const module = new ModuleClass();\n this.modules[module.type] = module;\n }\n\n getModule (type) {\n return this.modules[type];\n }\n\n add (type, item) {\n this.modules[type].add(item);\n }\n\n remove (type, item) {\n this.modules[type].remove(item);\n }\n\n get isActive () {\n return this._isActive;\n }\n\n set isActive (value) {\n if (value === this._isActive) return;\n this._isActive = value;\n const values = Object.keys(this.modules).map((e) => {\n return this.modules[e];\n });\n if (value) {\n for (const module of values) {\n module.activate();\n }\n } else {\n for (const module of values) {\n module.deactivate();\n }\n }\n }\n\n get isLegacy () {\n return this._isLegacy;\n }\n\n set isLegacy (value) {\n if (value === this._isLegacy) return;\n this._isLegacy = value;\n }\n}\n\nconst state = new State();\n\nexport default state;\n","const config = {\r\n prefix: 'fr',\r\n namespace: 'dsfr',\r\n organisation: '@gouvfr',\r\n version: '1.2.1'\r\n};\r\n\r\nexport default config;\r\n","import state from '../state.js';\nimport config from '../../../config.js';\n\nclass LogLevel {\n constructor (level, light, dark, logger) {\n this.level = level;\n this.light = light;\n this.dark = dark;\n\n switch (logger) {\n case 'warn':\n this.logger = console.warn;\n break;\n\n case 'error':\n this.logger = console.error;\n break;\n\n default:\n this.logger = console.log;\n }\n }\n\n log (...values) {\n const message = new Message(config.namespace);\n for (const value of values) message.add(value);\n this.print(message);\n }\n\n print (message) {\n message.setColor(this.color);\n this.logger.apply(console, message.getMessage());\n }\n\n get color () {\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? this.dark : this.light;\n }\n}\n\nclass Message {\n constructor (domain) {\n this.inputs = ['%c'];\n this.styles = ['font-family:Marianne', 'line-height: 1.5'];\n this.objects = [];\n\n if (domain) this.add(`${domain} :`);\n }\n\n add (value) {\n switch (typeof value) {\n case 'object':\n case 'function':\n this.inputs.push('%o ');\n this.objects.push(value);\n break;\n\n default:\n this.inputs.push(`${value} `);\n }\n }\n\n setColor (color) {\n this.styles.push(`color:${color}`);\n }\n\n getMessage () {\n return [this.inputs.join(''), this.styles.join(';'), ...this.objects];\n }\n}\n\nconst LEVELS = {\n trace: new LogLevel(0, '#616161', '#989898'),\n debug: new LogLevel(1, '#000091', '#8B8BFF'),\n info: new LogLevel(2, '#007c3b', '#00ed70'),\n warn: new LogLevel(3, '#ba4500', '#fa5c00', 'warn'),\n error: new LogLevel(4, '#D80600', '#FF4641', 'error')\n};\n\nclass Inspector {\n constructor () {\n this.level = 2;\n\n for (const id in LEVELS) {\n const level = LEVELS[id];\n this[id] = (...msgs) => {\n if (this.level <= level.level) level.log.apply(level, msgs);\n };\n this[id].print = level.print.bind(level);\n }\n }\n\n state () {\n const message = new Message();\n message.add(state);\n this.trace.print(message);\n }\n\n tree () {\n const stage = state.getModule('stage');\n if (!stage) return;\n const message = new Message();\n this._branch(stage.root, 0, message);\n this.trace.print(message);\n }\n\n _branch (element, space, message) {\n let branch = '';\n if (space > 0) {\n let indent = '';\n for (let i = 0; i < space; i++) indent += ' ';\n // branch += indent + '|\\n';\n branch += indent + '└─ ';\n }\n branch += `[${element.id}] ${element.html}`;\n message.add(branch);\n message.add({ '@': element });\n message.add('\\n');\n for (const child of element.children) branch += this._branch(child, space + 1, message);\n }\n}\n\nconst inspector = new Inspector();\n\nexport default inspector;\n","export const startAtDomContentLoaded = (callback) => {\n if (document.readyState !== 'loading') window.requestAnimationFrame(callback);\n else document.addEventListener('DOMContentLoaded', callback);\n};\n\nexport const startAuto = (callback) => {\n // detect\n startAtDomContentLoaded(callback);\n};\n","import inspector from '../inspect/inspector.js';\nimport { startAtDomContentLoaded, startAuto } from './starters.js';\n\nexport const Modes = {\n AUTO: 'auto',\n MANUAL: 'manual',\n RUNTIME: 'runtime',\n LOADED: 'loaded',\n VUE: 'vue',\n ANGULAR: 'angular',\n REACT: 'react'\n};\n\nclass Options {\n constructor () {\n this._mode = Modes.AUTO;\n this.isStarted = false;\n this.starting = this.start.bind(this);\n this.preventManipulation = false;\n }\n\n configure (settings = {}, start) {\n this.startCallback = start;\n if (settings.verbose === true) inspector.level = 0;\n this.mode = settings.mode || Modes.AUTO;\n }\n\n set mode (value) {\n switch (value) {\n case Modes.AUTO:\n this.preventManipulation = false;\n startAuto(this.starting);\n break;\n\n case Modes.LOADED:\n this.preventManipulation = false;\n startAtDomContentLoaded(this.starting);\n break;\n\n case Modes.RUNTIME:\n this.preventManipulation = false;\n this.start();\n break;\n\n case Modes.MANUAL:\n this.preventManipulation = false;\n break;\n\n case Modes.VUE:\n this.preventManipulation = true;\n break;\n\n case Modes.ANGULAR:\n this.preventManipulation = true;\n break;\n\n case Modes.REACT:\n this.preventManipulation = true;\n break;\n\n default:\n inspector.error('Illegal mode');\n return;\n }\n\n this._mode = value;\n inspector.info(`mode set to ${value}`);\n }\n\n get mode () {\n return this._mode;\n }\n\n start () {\n inspector.info('start');\n this.startCallback();\n }\n}\n\nconst options = new Options();\nexport default options;\n","class Collection {\n constructor () {\n this._collection = [];\n }\n\n forEach (callback) {\n this._collection.forEach(callback);\n }\n\n map (callback) {\n return this._collection.map(callback);\n }\n\n get length () {\n return this._collection.length;\n }\n\n add (collectable) {\n if (this._collection.indexOf(collectable) > -1) return false;\n this._collection.push(collectable);\n if (this.onAdd) this.onAdd();\n if (this.onPopulate && this._collection.length === 1) this.onPopulate();\n return true;\n }\n\n remove (collectable) {\n const index = this._collection.indexOf(collectable);\n if (index === -1) return false;\n this._collection.splice(index, 1);\n if (this.onRemove) this.onRemove();\n if (this.onEmpty && this._collection.length === 0) this.onEmpty();\n }\n\n execute (...args) {\n for (const collectable of this._collection) if (collectable) collectable.apply(null, args);\n }\n\n clear () {\n this._collection.length = 0;\n }\n\n clone () {\n const clone = new Collection();\n clone._collection = this._collection.slice();\n return clone;\n }\n\n get collection () {\n return this._collection;\n }\n}\n\nexport { Collection };\n","import { Collection } from './utilities/collection.js';\n\nclass Module extends Collection {\n constructor (type) {\n super();\n this.type = type;\n this.isActive = false;\n }\n\n activate () {}\n deactivate () {}\n}\n\nexport { Module };\n","import config from '../../../config.js';\n\nconst ns = name => `${config.prefix}-${name}`;\n\nns.selector = (name, notation) => {\n if (notation === undefined) notation = '.';\n return `${notation}${ns(name)}`;\n};\n\nns.attr = (name) => `data-${ns(name)}`;\n\nns.attr.selector = (name, value) => {\n let result = ns.attr(name);\n if (value !== undefined) result += `=\"${value}\"`;\n return `[${result}]`;\n};\n\nns.event = (type) => `${config.namespace}.${type}`;\n\nns.emission = (domain, type) => `emission:${domain}.${type}`;\n\nexport default ns;\n","export const querySelectorAllArray = (element, selectors) => Array.prototype.slice.call(element.querySelectorAll(selectors));\n\nexport const queryParentSelector = (element, selectors) => {\n const parent = element.parentElement;\n if (parent.matches(selectors)) return parent;\n if (parent === document.documentElement) return null;\n return queryParentSelector(parent, selectors);\n};\n","import { Collection } from '../utilities/collection.js';\nimport state from '../state.js';\nimport ns from '../utilities/namespace.js';\nimport { querySelectorAllArray } from '../utilities/dom/query-selector';\n\nclass Registration {\n constructor (selector, InstanceClass, creator) {\n this.selector = selector;\n this.InstanceClass = InstanceClass;\n this.creator = creator;\n this.instances = new Collection();\n this.isIntroduced = false;\n this._instanceClassName = this.InstanceClass.instanceClassName;\n this._instanceClassNames = this.getInstanceClassNames(this.InstanceClass);\n this._property = this._instanceClassName.substring(0, 1).toLowerCase() + this._instanceClassName.substring(1);\n const dashed = this._instanceClassName\n .replace(/[^a-zA-Z0-9]+/g, '-')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .replace(/([0-9])([^0-9])/g, '$1-$2')\n .replace(/([^0-9])([0-9])/g, '$1-$2')\n .toLowerCase();\n this._attribute = ns.attr(`js-${dashed}`);\n }\n\n getInstanceClassNames (InstanceClass) {\n const prototype = Object.getPrototypeOf(InstanceClass);\n if (!prototype || prototype.instanceClassName === 'Instance') return [InstanceClass.instanceClassName];\n return [...this.getInstanceClassNames(prototype), InstanceClass.instanceClassName];\n }\n\n hasInstanceClassName (instanceClassName) {\n return this._instanceClassNames.indexOf(instanceClassName) > -1;\n }\n\n introduce () {\n if (this.isIntroduced) return;\n this.isIntroduced = true;\n state.getModule('stage').parse(document.documentElement, this);\n }\n\n parse (node, nonRecursive) {\n const nodes = [];\n if (node.matches && node.matches(this.selector)) nodes.push(node);\n // eslint-disable-next-line no-useless-call\n if (!nonRecursive && node.querySelectorAll && node.querySelector(this.selector)) nodes.push.apply(nodes, querySelectorAllArray(node, this.selector));\n return nodes;\n }\n\n create (element) {\n if (!element.node.matches(this.selector)) return;\n const instance = new this.InstanceClass();\n this.instances.add(instance);\n return instance;\n }\n\n remove (instance) {\n this.instances.remove(instance);\n }\n\n dispose () {\n const instances = this.instances.collection;\n for (let i = instances.length - 1; i > -1; i--) instances[i]._dispose();\n this.creator = null;\n }\n\n get instanceClassName () {\n return this._instanceClassName;\n }\n\n get instanceClassNames () {\n return this._instanceClassNames;\n }\n\n get property () {\n return this._property;\n }\n\n get attribute () {\n return this._attribute;\n }\n}\n\nexport { Registration };\n","import { Module } from '../module.js';\nimport { Registration } from './registration.js';\nimport state from '../state.js';\n\nclass Register extends Module {\n constructor () {\n super('register');\n }\n\n register (selector, InstanceClass, creator) {\n const registration = new Registration(selector, InstanceClass, creator);\n this.add(registration);\n if (state.isActive) registration.introduce();\n return registration;\n }\n\n activate () {\n for (const registration of this.collection) registration.introduce();\n }\n\n remove (registration) {\n registration.dispose();\n super.remove(registration);\n }\n}\n\nexport { Register };\n","import state from '../state.js';\nimport inspector from '../inspect/inspector.js';\n\nlet count = 0;\n\nclass Element {\n constructor (node, id) {\n if (!id) {\n count++;\n this.id = count;\n } else this.id = id;\n this.node = node;\n this.attributeNames = [];\n this.instances = [];\n this._children = [];\n this._parent = null;\n this._projects = [];\n }\n\n get proxy () {\n const scope = this;\n if (!this._proxy) {\n this._proxy = {\n id: this.id,\n get parent () {\n return scope.parent ? scope.parent.proxy : null;\n },\n get children () {\n return scope.children.map((child) => child.proxy);\n }\n };\n\n for (const instance of this.instances) this._proxy[instance.registration.property] = instance.proxy;\n }\n return this._proxy;\n }\n\n get html () {\n const end = this.node.outerHTML.indexOf('>');\n return this.node.outerHTML.substring(0, end + 1);\n }\n\n project (registration) {\n if (this._projects.indexOf(registration) === -1) this._projects.push(registration);\n }\n\n populate () {\n const projects = this._projects.slice();\n this._projects.length = 0;\n for (const registration of projects) this.create(registration);\n }\n\n create (registration) {\n if (this.hasInstance(registration.instanceClassName)) {\n // inspector.debug(`failed creation, instance of ${registration.instanceClassName} already exists on element [${this.id}]`);\n return;\n }\n inspector.debug(`create instance of ${registration.instanceClassName} on element [${this.id}]`);\n const instance = registration.create(this);\n this.instances.push(instance);\n instance._config(this, registration);\n if (this._proxy) this._proxy[registration.property] = instance.proxy;\n }\n\n remove (instance) {\n const index = this.instances.indexOf(instance);\n if (index > -1) this.instances.splice(index, 1);\n if (this._proxy) delete this._proxy[instance.registration.property];\n }\n\n get parent () {\n return this._parent;\n }\n\n get ascendants () {\n return [this.parent, ...this.parent.ascendants];\n }\n\n get children () {\n return this._children;\n }\n\n get descendants () {\n const descendants = [...this._children];\n this._children.forEach(child => descendants.push(...child.descendants));\n return descendants;\n }\n\n // TODO : emit ascendant et descendant de changement ?\n\n addChild (child, index) {\n if (this._children.indexOf(child) > -1) return null;\n child._parent = this;\n if (!isNaN(index) && index > -1 && index < this._children.length) this._children.splice(index, 0, child);\n else this._children.push(child);\n return child;\n }\n\n removeChild (child) {\n const index = this._children.indexOf(child);\n if (index === -1) return null;\n child._parent = null;\n this._children.splice(index, 1);\n }\n\n emit (type, data) {\n const elements = state.getModule('stage').collection;\n const response = [];\n for (const element of elements) response.push(...element._emit(type, data));\n return response;\n }\n\n _emit (type, data) {\n const response = [];\n for (const instance of this.instances) response.push(...instance._emitter.emit(type, data));\n return response;\n }\n\n ascend (type, data) {\n if (this._parent) return this._parent._ascend(type, data);\n return [];\n }\n\n _ascend (type, data) {\n const response = [];\n for (const instance of this.instances) response.push(...instance._ascent.emit(type, data));\n if (this._parent) response.push(...this._parent._ascend(type, data));\n return response;\n }\n\n descend (type, data) {\n const response = [];\n for (const child of this._children) response.push(...child._descend(type, data));\n return response;\n }\n\n _descend (type, data) {\n const response = [];\n for (const instance of this.instances) response.push(...instance._descent.emit(type, data));\n for (const child of this._children) response.push(...child._descend(type, data));\n return response;\n }\n\n getInstance (instanceClassName) {\n for (const instance of this.instances) if (instance.registration.hasInstanceClassName(instanceClassName)) return instance;\n return null;\n }\n\n hasInstance (instanceClassName) {\n return this.getInstance(instanceClassName) !== null;\n }\n\n getDescendantInstances (instanceClassName, stopAtInstanceClassName, stopAtFirstInstance) {\n if (!instanceClassName) return [];\n const instances = [];\n for (const child of this._children) {\n const instance = child.getInstance(instanceClassName);\n if (instance) {\n instances.push(instance);\n if (stopAtFirstInstance) continue;\n }\n if ((!stopAtInstanceClassName || !child.hasInstance(stopAtInstanceClassName)) && child.children.length) instances.push.apply(instances, child.getDescendantInstances(instanceClassName, stopAtInstanceClassName, stopAtFirstInstance));\n }\n return instances;\n }\n\n getAscendantInstance (instanceClassName, stopAtInstanceClassName) {\n if (!instanceClassName || !this._parent) return null;\n const instance = this._parent.getInstance(instanceClassName);\n if (instance) return instance;\n if (stopAtInstanceClassName && this._parent.hasInstance(stopAtInstanceClassName)) return null;\n return this._parent.getAscendantInstance(instanceClassName, stopAtInstanceClassName);\n }\n\n dispose () {\n for (const instance of this.instances) instance._dispose();\n this.instances.length = 0;\n state.remove('stage', this);\n this.parent.removeChild(this);\n this._children.length = 0;\n inspector.debug(`remove element [${this.id}] ${this.html}`);\n }\n\n prepare (attributeName) {\n if (this.attributeNames.indexOf(attributeName) === -1) this.attributeNames.push(attributeName);\n }\n\n examine () {\n const attributeNames = this.attributeNames.slice();\n this.attributeNames.length = 0;\n for (let i = this.instances.length - 1; i > -1; i--) this.instances[i].examine(attributeNames);\n }\n}\n\nexport { Element };\n","import { Element } from './element.js';\nimport ns from '../utilities/namespace.js';\n\nclass Root extends Element {\n constructor () {\n super(document.documentElement, 'root');\n this.node.setAttribute(ns.attr('js'), true);\n }\n}\n\nconst RootSelector = {\n ROOT: ':root'\n};\n\nexport { Root, RootSelector };\n","import state from '../state.js';\nimport { Element } from './element.js';\nimport { Module } from '../module.js';\nimport { Root } from './root.js';\nimport inspector from '../inspect/inspector.js';\n\nclass Stage extends Module {\n constructor () {\n super('stage');\n this.root = new Root();\n super.add(this.root);\n this.observer = new MutationObserver(this.mutate.bind(this));\n this.modifications = [];\n this.willModify = false;\n this.modifying = this.modify.bind(this);\n }\n\n hasElement (node) {\n for (const element of this.collection) if (element.node === node) return true;\n return false;\n }\n\n getElement (node) {\n for (const element of this.collection) if (element.node === node) return element;\n const element = new Element(node);\n this.add(element);\n inspector.debug(`add element [${element.id}] ${element.html}`);\n return element;\n }\n\n getProxy (node) {\n if (!this.hasElement(node)) return null;\n const element = this.getElement(node);\n return element.proxy;\n }\n\n add (element) {\n super.add(element);\n this.put(element, this.root);\n }\n\n put (element, branch) {\n let index = 0;\n for (let i = branch.children.length - 1; i > -1; i--) {\n const child = branch.children[i];\n const position = element.node.compareDocumentPosition(child.node);\n if (position & Node.DOCUMENT_POSITION_CONTAINS) {\n this.put(element, child);\n return;\n } else if (position & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n branch.removeChild(child);\n element.addChild(child, 0);\n } else if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n index = i + 1;\n break;\n }\n }\n\n branch.addChild(element, index);\n }\n\n activate () {\n this.observer.observe(document.documentElement, { childList: true, subtree: true, attributes: true });\n }\n\n deactivate () {\n this.observer.disconnect();\n }\n\n mutate (mutations) {\n const examinations = [];\n mutations.forEach((mutation) => {\n switch (mutation.type) {\n case 'childList':\n mutation.removedNodes.forEach((node) => this.dispose(node));\n mutation.addedNodes.forEach((node) => this.parse(node));\n break;\n\n case 'attributes':\n if (this.hasElement(mutation.target)) {\n const element = this.getElement(mutation.target);\n element.prepare(mutation.attributeName);\n if (examinations.indexOf(element) === -1) examinations.push(element);\n for (const descendant of element.descendants) if (examinations.indexOf(descendant) === -1) examinations.push(descendant);\n }\n if (this.modifications.indexOf(mutation.target) === -1) this.modifications.push(mutation.target);\n break;\n }\n });\n\n examinations.forEach(element => element.examine());\n if (this.modifications.length && !this.willModify) {\n this.willModify = true;\n window.requestAnimationFrame(this.modifying);\n }\n }\n\n modify () {\n this.willModify = false;\n const targets = this.modifications.slice();\n this.modifications.length = 0;\n for (const target of targets) if (document.documentElement.contains(target)) this.parse(target);\n }\n\n dispose (node) {\n const disposables = [];\n this.forEach((element) => {\n if (node.contains(element.node)) disposables.push(element);\n });\n\n for (const disposable of disposables) {\n disposable.dispose();\n this.remove(disposable);\n }\n }\n\n parse (node, registration, nonRecursive) {\n const registrations = registration ? [registration] : state.getModule('register').collection;\n const creations = [];\n\n for (const registration of registrations) {\n const nodes = registration.parse(node, nonRecursive);\n\n for (const n of nodes) {\n const element = this.getElement(n);\n element.project(registration);\n if (creations.indexOf(element) === -1) creations.push(element);\n }\n }\n\n for (const element of creations) element.populate();\n }\n}\n\nexport { Stage };\n","import state from '../state.js';\nimport { Module } from '../module.js';\nimport { Collection } from '../utilities/collection.js';\n\nclass Renderer extends Module {\n constructor () {\n super('render');\n this.rendering = this.render.bind(this);\n this.nexts = new Collection();\n }\n\n activate () {\n window.requestAnimationFrame(this.rendering);\n }\n\n request (instance) {\n this.nexts.add(instance);\n }\n\n render () {\n if (!state.isActive) return;\n window.requestAnimationFrame(this.rendering);\n this.forEach((instance) => instance.render());\n if (!this.nexts.length) return;\n const nexts = this.nexts.clone();\n this.nexts.clear();\n nexts.forEach((instance) => instance.next());\n }\n}\n\nexport { Renderer };\n","import { Module } from '../module.js';\n\nclass Resizer extends Module {\n constructor () {\n super('resize');\n this.requireResize = false;\n this.resizing = this.resize.bind(this);\n const requesting = this.request.bind(this);\n if (document.fonts) {\n document.fonts.ready.then(requesting);\n }\n window.addEventListener('resize', requesting);\n window.addEventListener('orientationchange', requesting);\n }\n\n activate () {\n this.request();\n }\n\n request () {\n if (this.requireResize) return;\n this.requireResize = true;\n window.requestAnimationFrame(this.resizing);\n }\n\n resize () {\n if (!this.requireResize) return;\n this.forEach((instance) => instance.resize());\n this.requireResize = false;\n }\n}\n\nexport { Resizer };\n","import ns from '../utilities/namespace.js';\nimport { Module } from '../module.js';\n\nclass ScrollLocker extends Module {\n constructor () {\n super('lock');\n this._isLocked = false;\n this._scrollY = 0;\n this.onPopulate = this.lock.bind(this);\n this.onEmpty = this.unlock.bind(this);\n }\n\n get isLocked () {\n return this._isLocked;\n }\n\n lock () {\n if (!this._isLocked) {\n this._isLocked = true;\n this._scrollY = window.scrollY;\n document.body.style.top = this._scrollY * -1 + 'px';\n document.documentElement.setAttribute(ns.attr('scrolling'), 'false');\n }\n }\n\n unlock () {\n if (this._isLocked) {\n this._isLocked = false;\n document.documentElement.removeAttribute(ns.attr('scrolling'));\n document.body.style.top = '';\n window.scroll(0, this._scrollY);\n }\n }\n}\n\nexport { ScrollLocker };\n","import { Module } from '../module.js';\n\nclass Load extends Module {\n constructor () {\n super('load');\n this.loading = this.load.bind(this);\n }\n\n activate () {\n window.addEventListener('load', this.loading);\n }\n\n load () {\n this.forEach((instance) => instance.load());\n }\n}\n\nexport { Load };\n","import { Register } from './register/register.js';\nimport { Stage } from './stage/stage.js';\nimport { Renderer } from './render/renderer.js';\nimport { Resizer } from './resize/resizer.js';\nimport { ScrollLocker } from './scroll/scroll-locker.js';\nimport { Load } from './load/load.js';\nimport inspector from './inspect/inspector.js';\nimport state from './state.js';\n\nclass Engine {\n constructor () {\n state.create(Register);\n state.create(Stage);\n state.create(Renderer);\n state.create(Resizer);\n state.create(ScrollLocker);\n state.create(Load);\n\n const registerModule = state.getModule('register');\n this.register = registerModule.register.bind(registerModule);\n }\n\n get isActive () {\n return state.isActive;\n }\n\n start () {\n inspector.debug('START');\n state.isActive = true;\n }\n\n stop () {\n inspector.debug('STOP');\n state.isActive = false;\n }\n}\n\nconst engine = new Engine();\nexport default engine;\n","const sanitize = (className) => className.charAt(0) === '.' ? className.substr(1) : className;\n\nconst getClassNames = (element) => element.className ? element.className.split(' ') : [];\n\nconst modifyClass = (element, className, remove) => {\n className = sanitize(className);\n const classNames = getClassNames(element);\n const index = classNames.indexOf(className);\n if (remove === true) {\n if (index > -1) classNames.splice(index, 1);\n } else if (index === -1) classNames.push(className);\n element.className = classNames.join(' ');\n};\n\nconst addClass = (element, className) => modifyClass(element, className);\n\nexport { addClass };\n\nconst removeClass = (element, className) => modifyClass(element, className, true);\n\nexport { removeClass };\n\nconst hasClass = (element, className) => getClassNames(element).indexOf(sanitize(className)) > -1;\n\nexport { hasClass };\n","import { addClass, hasClass, removeClass } from './classes.js';\nimport { queryParentSelector, querySelectorAllArray } from './query-selector.js';\n\nconst dom = {};\n\ndom.addClass = addClass;\ndom.hasClass = hasClass;\ndom.removeClass = removeClass;\ndom.queryParentSelector = queryParentSelector;\ndom.querySelectorAllArray = querySelectorAllArray;\n\nexport default dom;\n","const supportLocalStorage = () => {\n try {\n return 'localStorage' in window && window.localStorage !== null;\n } catch (e) {\n return false;\n }\n};\n\nexport { supportLocalStorage };\n","import { supportLocalStorage } from './browser-support.js';\n\nconst support = {};\n\nsupport.supportLocalStorage = supportLocalStorage;\n\nexport default support;\n","/**\n * Copy properties from multiple sources including accessors.\n * source : https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#copier_des_accesseurs\n *\n * @param {object} [target] - Target object to copy into\n * @param {...objects} [sources] - Multiple objects\n * @return {object} A new object\n *\n * @example\n *\n * const obj1 = {\n * key: 'value'\n * };\n * const obj2 = {\n * get function01 () {\n * return a-value;\n * }\n * set function01 () {\n * return a-value;\n * }\n * };\n * completeAssign(obj1, obj2)\n */\nconst completeAssign = (target, ...sources) => {\n sources.forEach(source => {\n const descriptors = Object.keys(source).reduce((descriptors, key) => {\n descriptors[key] = Object.getOwnPropertyDescriptor(source, key);\n return descriptors;\n }, {});\n\n Object.getOwnPropertySymbols(source).forEach(sym => {\n const descriptor = Object.getOwnPropertyDescriptor(source, sym);\n if (descriptor.enumerable) {\n descriptors[sym] = descriptor;\n }\n });\n Object.defineProperties(target, descriptors);\n });\n return target;\n};\n\nexport { completeAssign };\n","import { completeAssign } from './complete-assign';\n\nconst property = {};\n\nproperty.completeAssign = completeAssign;\n\nexport default property;\n","import state from './state.js';\nimport engine from './engine.js';\nimport options from './options/options.js';\nimport dom from './utilities/dom/index';\nimport ns from './utilities/namespace.js';\nimport support from './utilities/support/index';\nimport property from './utilities/property/index';\n\nconst internals = {};\nconst legacy = {};\n\nObject.defineProperty(legacy, 'isLegacy', {\n get: () => state.isLegacy\n});\n\nlegacy.setLegacy = () => {\n state.isLegacy = true;\n};\n\ninternals.legacy = legacy;\ninternals.dom = dom;\ninternals.support = support;\ninternals.property = property;\ninternals.ns = ns;\ninternals.register = engine.register;\n\nObject.defineProperty(internals, 'preventManipulation', {\n get: () => options.preventManipulation\n});\n\nexport default internals;\n","import state from './state.js';\nimport options, { Modes } from './options/options.js';\nimport config from '../../config.js';\nimport engine from './engine.js';\nimport inspector from './inspect/inspector.js';\nimport internals from './internals.js';\n\ninspector.info(`version ${config.version}`);\n\nconst api = (node) => {\n const stage = state.getModule('stage');\n return stage.getProxy(node);\n};\n\napi.Modes = Modes;\n\nObject.defineProperty(api, 'mode', {\n set: (value) => { options.mode = value; },\n get: () => options.mode\n});\n\napi.internals = internals;\n\napi.start = engine.start;\napi.stop = engine.stop;\n\napi.inspector = inspector;\n\noptions.configure(window[config.namespace], api.start);\n\nwindow[config.namespace] = api;\nexport default api;\n","class Emitter {\n constructor () {\n this.emissions = {};\n }\n\n add (type, closure) {\n if (typeof closure !== 'function') throw new Error('closure must be a function');\n if (!this.emissions[type]) this.emissions[type] = [];\n this.emissions[type].push(closure);\n }\n\n remove (type, closure) {\n if (!this.emissions[type]) return;\n if (!closure) delete this.emissions[type];\n else {\n const index = this.emissions[type].indexOf(closure);\n if (index > -1) this.emissions[type].splice(index);\n }\n }\n\n emit (type, data) {\n if (!this.emissions[type]) return [];\n const response = [];\n for (const closure of this.emissions[type]) if (closure) response.push(closure(data));\n return response;\n }\n\n dispose () {\n this.emissions = null;\n }\n}\n\nexport { Emitter };\n","class Breakpoint {\n constructor (id, minWidth) {\n this.id = id;\n this.minWidth = minWidth;\n }\n\n test () {\n return window.matchMedia(`(min-width: ${this.minWidth}em)`).matches;\n }\n}\n\nexport const Breakpoints = {\n XS: new Breakpoint('xs', 0),\n SM: new Breakpoint('sm', 36),\n MD: new Breakpoint('md', 48),\n LG: new Breakpoint('lg', 62),\n XL: new Breakpoint('xl', 78)\n};\n","import { Emitter } from '../utilities/emitter.js';\nimport state from '../state.js';\nimport inspector from '../inspect/inspector.js';\nimport { Breakpoints } from './breakpoints.js';\nimport { addClass, removeClass, hasClass } from '../utilities/dom/classes.js';\nimport { queryParentSelector, querySelectorAllArray } from '../utilities/dom/query-selector.js';\n\nclass Instance {\n constructor (jsAttribute = true) {\n this.jsAttribute = jsAttribute;\n this._isRendering = false;\n this._isResizing = false;\n this._isScrollLocked = false;\n this._isLoading = false;\n this._listeners = {};\n this._keyListenerTypes = [];\n this._keys = [];\n this.handlingKey = this.handleKey.bind(this);\n this._emitter = new Emitter();\n this._ascent = new Emitter();\n this._descent = new Emitter();\n this._registrations = [];\n this._nexts = [];\n }\n\n static get instanceClassName () {\n return 'Instance';\n }\n\n _config (element, registration) {\n this.element = element;\n this.registration = registration;\n this.node = element.node;\n this.id = element.node.id;\n if (this.jsAttribute) this.setAttribute(registration.attribute, true);\n this.init();\n }\n\n init () {}\n\n get proxy () {\n const scope = this;\n return {\n render: () => scope.render(),\n resize: () => scope.resize()\n };\n }\n\n register (selector, InstanceClass) {\n const registration = state.getModule('register').register(selector, InstanceClass, this);\n this._registrations.push(registration);\n }\n\n getRegisteredInstances (instanceClassName) {\n for (const registration of this._registrations) if (registration.hasInstanceClassName(instanceClassName)) return registration.instances.collection;\n return [];\n }\n\n dispatch (type, detail, bubbles, cancelable) {\n const event = new CustomEvent(type, { detail: detail, bubble: bubbles === true, cancelable: cancelable === true });\n this.node.dispatchEvent(event);\n }\n\n listen (type, closure, options) {\n if (!this._listeners[type]) this._listeners[type] = [];\n if (this._listeners[type].indexOf(closure) > -1) return;\n this._listeners[type].push(closure);\n this.node.addEventListener(type, closure, options);\n }\n\n unlisten (type, closure) {\n if (!type) {\n for (const type in this._listeners) this.unlisten(type);\n } else if (!closure) {\n if (!this._listeners[type]) return;\n for (const closure of this._listeners[type]) this.node.removeEventListener(type, closure);\n this._listeners[type].length = 0;\n } else {\n if (!this._listeners[type]) return;\n const index = this._listeners[type].indexOf(closure);\n if (index > -1) this._listeners[type].splice(index, 1);\n this.node.removeEventListener(type, closure);\n }\n }\n\n listenKey (code, closure, preventDefault = false, stopPropagation = false, type = 'down') {\n if (this._keyListenerTypes.indexOf(type) === -1) {\n this.listen(`key${type}`, this.handlingKey);\n this._keyListenerTypes.push(type);\n }\n\n this._keys.push(new KeyAction(type, code, closure, preventDefault, stopPropagation));\n }\n\n unlistenKey (code, closure) {\n this._keys = this._keys.filter((key) => key.code !== code || key.closure !== closure);\n\n this._keyListenerTypes.forEach(type => {\n if (!this._keys.some(key => key.type === type)) this.unlisten(`key${type}`, this.handlingKey);\n });\n }\n\n handleKey (e) {\n for (const key of this._keys) key.handle(e);\n }\n\n get isRendering () { return this._isRendering; }\n\n set isRendering (value) {\n if (this._isRendering === value) return;\n if (value) state.add('render', this);\n else state.remove('render', this);\n this._isRendering = value;\n }\n\n render () {}\n\n request (closure) {\n this._nexts.push(closure);\n state.getModule('render').request(this);\n }\n\n next () {\n const nexts = this._nexts.slice();\n this._nexts.length = 0;\n for (const closure of nexts) if (closure) closure();\n }\n\n get isResizing () { return this._isResizing; }\n\n set isResizing (value) {\n if (this._isResizing === value) return;\n if (value) {\n state.add('resize', this);\n this.resize();\n } else state.remove('resize', this);\n this._isResizing = value;\n }\n\n resize () {}\n\n isBreakpoint (breakpoint) {\n switch (true) {\n case typeof breakpoint === 'string':\n return Breakpoints[breakpoint.toUpperCase()].test();\n\n default:\n return breakpoint.test();\n }\n }\n\n get isScrollLocked () {\n return this._isScrollLocked;\n }\n\n set isScrollLocked (value) {\n if (this._isScrollLocked === value) return;\n if (value) state.add('lock', this);\n else state.remove('lock', this);\n this._isScrollLocked = value;\n }\n\n get isLoading () {\n return this._isLoading;\n }\n\n set isLoading (value) {\n if (this._isLoading === value) return;\n if (value) state.add('load', this);\n else state.remove('load', this);\n this._isLoading = value;\n }\n\n load () {}\n\n examine (attributeNames) {\n if (!this.node.matches(this.registration.selector)) {\n this._dispose();\n return;\n }\n\n this.mutate(attributeNames);\n }\n\n mutate (attributeNames) {}\n\n _dispose () {\n inspector.debug(`dispose instance of ${this.registration.instanceClassName} on element [${this.element.id}]`);\n this.removeAttribute(this.registration.attribute);\n this.unlisten();\n this._keys = null;\n this.isRendering = false;\n this.isResizing = false;\n this._nexts = null;\n state.getModule('render').nexts.remove(this);\n this.isScrollLocked = false;\n this.isLoading = false;\n this._emitter.dispose();\n this._emitter = null;\n this._ascent.dispose();\n this._ascent = null;\n this._descent.dispose();\n this._descent = null;\n this.element.remove(this);\n for (const registration of this._registrations) state.remove('register', registration);\n this._registrations = null;\n this.registration.remove(this);\n this.dispose();\n }\n\n dispose () {}\n\n emit (type, data) {\n return this.element.emit(type, data);\n }\n\n addEmission (type, closure) {\n this._emitter.add(type, closure);\n }\n\n removeEmission (type, closure) {\n this._emitter.remove(type, closure);\n }\n\n ascend (type, data) {\n return this.element.ascend(type, data);\n }\n\n addAscent (type, closure) {\n this._ascent.add(type, closure);\n }\n\n removeAscent (type, closure) {\n this._ascent.remove(type, closure);\n }\n\n descend (type, data) {\n return this.element.descend(type, data);\n }\n\n addDescent (type, closure) {\n this._descent.add(type, closure);\n }\n\n removeDescent (type, closure) {\n this._descent.remove(type, closure);\n }\n\n get style () {\n return this.node.style;\n }\n\n addClass (className) {\n addClass(this.node, className);\n }\n\n removeClass (className) {\n removeClass(this.node, className);\n }\n\n hasClass (className) {\n return hasClass(this.node, className);\n }\n\n setAttribute (attributeName, value) {\n this.node.setAttribute(attributeName, value);\n }\n\n getAttribute (attributeName) {\n return this.node.getAttribute(attributeName);\n }\n\n hasAttribute (attributeName) {\n return this.node.hasAttribute(attributeName);\n }\n\n removeAttribute (attributeName) {\n this.node.removeAttribute(attributeName);\n }\n\n setProperty (propertyName, value) {\n this.node.style.setProperty(propertyName, value);\n }\n\n removeProperty (propertyName) {\n this.node.style.removeProperty(propertyName);\n }\n\n focus () {\n this.node.focus();\n }\n\n get hasFocus () {\n return this.node === document.activeElement;\n }\n\n matches (selectors) {\n return this.node.matches(selectors);\n }\n\n querySelector (selectors) {\n return this.node.querySelector(selectors);\n }\n\n querySelectorAll (selectors) {\n return querySelectorAllArray(this.node, selectors);\n }\n\n queryParentSelector (selectors) {\n return queryParentSelector(this.node, selectors);\n }\n\n getRect () {\n return this.node.getBoundingClientRect();\n }\n\n get isLegacy () {\n return state.isLegacy;\n }\n}\n\nclass KeyAction {\n constructor (type, code, closure, preventDefault, stopPropagation) {\n this.type = type;\n this.eventType = `key${type}`;\n this.code = code;\n this.closure = closure;\n this.preventDefault = preventDefault === true;\n this.stopPropagation = stopPropagation === true;\n }\n\n handle (e) {\n if (e.type !== this.eventType) return;\n if (e.keyCode === this.code) {\n this.closure(e);\n if (this.preventDefault) {\n e.preventDefault();\n }\n if (this.stopPropagation) {\n e.stopPropagation();\n }\n }\n }\n}\n\nexport { Instance };\n","export const KeyCodes = {\n TAB: 9,\n ESCAPE: 27,\n END: 35,\n HOME: 36,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n};\n","import ns from '../api/utilities/namespace.js';\n\nconst DisclosureEvent = {\n DISCLOSE: ns.event('disclose'),\n CONCEAL: ns.event('conceal')\n};\n\nexport { DisclosureEvent };\n","import ns from '../api/utilities/namespace.js';\n\nconst DisclosureEmission = {\n RESET: ns.emission('disclosure', 'reset'),\n ADDED: ns.emission('disclosure', 'added'),\n REMOVED: ns.emission('disclosure', 'removed'),\n GROUP: ns.emission('disclosure', 'group'),\n UNGROUP: ns.emission('disclosure', 'ungroup')\n};\n\nexport { DisclosureEmission };\n","import { Instance } from '../api/register/instance.js';\nimport { DisclosureEvent } from './disclosure-event.js';\nimport { DisclosureEmission } from './disclosure-emission.js';\nimport { completeAssign } from '../api/utilities/property/complete-assign.js';\n\nclass Disclosure extends Instance {\n constructor (type, selector, DisclosureButtonInstanceClass, disclosuresGroupInstanceClassName) {\n super();\n this.type = type;\n this._selector = selector;\n this.DisclosureButtonInstanceClass = DisclosureButtonInstanceClass;\n this.disclosuresGroupInstanceClassName = disclosuresGroupInstanceClassName;\n this.modifier = this._selector + '--' + this.type.id;\n this.pristine = true;\n }\n\n static get instanceClassName () {\n return 'Disclosure';\n }\n\n init () {\n this.addDescent(DisclosureEmission.RESET, this.reset.bind(this));\n this.addDescent(DisclosureEmission.GROUP, this.update.bind(this));\n this.addDescent(DisclosureEmission.UNGROUP, this.update.bind(this));\n this.register(`[aria-controls=\"${this.id}\"]`, this.DisclosureButtonInstanceClass);\n this.ascend(DisclosureEmission.ADDED);\n this.update();\n }\n\n get proxy () {\n const scope = this;\n const proxy = Object.assign(super.proxy, {\n disclose: scope.disclose.bind(scope),\n focus: scope.focus.bind(scope)\n });\n\n if (this.type.canConceal) proxy.conceal = scope.conceal.bind(scope);\n\n const proxyAccessors = {\n get buttons () {\n return scope.buttons.map((button) => button.proxy);\n },\n get group () {\n const group = scope.group;\n return group ? group.proxy : null;\n }\n };\n\n return completeAssign(proxy, proxyAccessors);\n }\n\n get buttons () {\n return this.getRegisteredInstances(this.DisclosureButtonInstanceClass.instanceClassName);\n }\n\n update () {\n this.getGroup();\n }\n\n getGroup () {\n if (!this.disclosuresGroupInstanceClassName) {\n this._group = null;\n return;\n }\n\n const group = this.element.getAscendantInstance(this.disclosuresGroupInstanceClassName, this.constructor.instanceClassName);\n if (!group || !group.validate(this)) {\n this._group = null;\n return;\n }\n\n this._group = group;\n }\n\n get group () {\n return this._group;\n }\n\n disclose (withhold) {\n if (this.disclosed) return false;\n this.pristine = false;\n this.disclosed = true;\n if (!withhold && this.group) this.group.current = this;\n return true;\n }\n\n conceal (withhold, preventFocus) {\n if (!this.disclosed) return false;\n if (!this.type.canConceal && this.group && this.group.current === this) return false;\n this.pristine = false;\n this.disclosed = false;\n if (!withhold && this.group && this.group.current === this) this.group.current = null;\n if (!preventFocus) this.focus();\n this.descend(DisclosureEmission.RESET);\n return true;\n }\n\n get disclosed () {\n return this._disclosed;\n }\n\n set disclosed (value) {\n if (this._disclosed === value) return;\n this.dispatch(value ? DisclosureEvent.DISCLOSE : DisclosureEvent.CONCEAL, this.type);\n this._disclosed = value;\n if (value) this.addClass(this.modifier);\n else this.removeClass(this.modifier);\n for (let i = 0; i < this.buttons.length; i++) this.buttons[i].apply(value);\n }\n\n reset () {}\n\n toggle (isPrimary) {\n if (!this.type.canConceal) this.disclose();\n else {\n switch (true) {\n case !isPrimary:\n case this.disclosed:\n this.conceal();\n break;\n\n default:\n this.disclose();\n }\n }\n }\n\n get buttonHasFocus () {\n if (this.buttons.some((button) => { return button.hasFocus; })) return true;\n return false;\n }\n\n get hasFocus () {\n if (super.hasFocus) return true;\n if (this.buttonHasFocus) return true;\n return this.querySelectorAll(':focus').length > 0;\n }\n\n focus () {\n for (let i = 0; i < this.buttons.length; i++) {\n const button = this.buttons[i];\n if (button.isPrimary) {\n button.focus();\n return;\n }\n }\n }\n\n dispose () {\n this._group = null;\n super.dispose();\n this.ascend(DisclosureEmission.REMOVED);\n }\n}\n\nexport { Disclosure };\n","import { Instance } from '../api/register/instance';\nimport ns from '../api/utilities/namespace.js';\n\nclass DisclosureButton extends Instance {\n constructor (type) {\n super();\n this.type = type;\n this.attributeName = type.ariaState ? 'aria-' + type.id : ns.attr(type.id);\n }\n\n static get instanceClassName () {\n return 'DisclosureButton';\n }\n\n init () {\n this.controlsId = this.getAttribute('aria-controls');\n this.isPrimary = this.hasAttribute(this.attributeName);\n if (this.isPrimary && this.disclosed && this.registration.creator.pristine) this.registration.creator.disclose();\n this.listen('click', this.click.bind(this));\n }\n\n get proxy () {\n const scope = this;\n return Object.assign(super.proxy, {\n focus: scope.focus.bind(scope)\n });\n }\n\n click (e) {\n if (this.registration.creator) this.registration.creator.toggle(this.isPrimary);\n }\n\n mutate (attributeNames) {\n if (this.isPrimary && attributeNames.indexOf(this.attributeName) > -1 && this.registration.creator) {\n if (this.disclosed) this.registration.creator.disclose();\n else if (this.type.canConceal) this.registration.creator.conceal();\n }\n }\n\n apply (value) {\n if (!this.isPrimary) return;\n this.setAttribute(this.attributeName, value);\n }\n\n get disclosed () {\n return this.getAttribute(this.attributeName) === 'true';\n }\n}\n\nexport { DisclosureButton };\n","import { Instance } from '../api/register/instance.js';\nimport { DisclosureEmission } from './disclosure-emission.js';\nimport { completeAssign } from '../api/utilities/property/complete-assign.js';\n\nclass DisclosuresGroup extends Instance {\n constructor (disclosureInstanceClassName, jsAttribute) {\n super(jsAttribute);\n this.disclosureInstanceClassName = disclosureInstanceClassName;\n this._index = -1;\n }\n\n static get instanceClassName () {\n return 'DisclosuresGroup';\n }\n\n init () {\n this.addAscent(DisclosureEmission.ADDED, this.update.bind(this));\n this.addAscent(DisclosureEmission.REMOVED, this.update.bind(this));\n this.descend(DisclosureEmission.GROUP);\n this.update();\n }\n\n get proxy () {\n const scope = this;\n\n const proxyAccessors = {\n set index (value) {\n scope.index = value;\n },\n get index () {\n return scope.index;\n },\n get length () {\n return scope.length;\n },\n get current () {\n const current = scope.current;\n return current ? current.proxy : null;\n },\n get members () {\n return scope.members.map((member) => member.proxy);\n },\n get hasFocus () {\n return scope.hasFocus;\n }\n };\n\n return completeAssign(super.proxy, proxyAccessors);\n }\n\n validate (member) {\n return true;\n }\n\n getMembers () {\n const members = this.element.getDescendantInstances(this.disclosureInstanceClassName, this.constructor.instanceClassName, true);\n this._members = members.filter(this.validate.bind(this));\n }\n\n update () {\n this.getMembers();\n this.getIndex();\n }\n\n get members () {\n return this._members;\n }\n\n get length () { return this.members.length; }\n\n getIndex () {\n this._index = -1;\n for (let i = 0; i < this.length; i++) {\n if (this.index > -1) this.members[i].conceal(true, true);\n else if (this.members[i].disclosed) {\n this.index = i;\n }\n }\n }\n\n get index () {\n return this._index;\n }\n\n set index (value) {\n if (value < -1 || value >= this.length || value === this._index) return;\n this._index = value;\n for (let i = 0; i < this.length; i++) {\n const member = this.members[i];\n if (value === i) {\n member.disclose(true);\n } else {\n member.conceal(true, true);\n }\n }\n this.apply();\n }\n\n get current () {\n return this._index === -1 ? null : this.members[this._index];\n }\n\n set current (member) {\n this.index = this.members.indexOf(member);\n }\n\n get hasFocus () {\n const current = this.current;\n if (current) return current.hasFocus;\n return false;\n }\n\n apply () {}\n\n dispose () {\n super.dispose();\n this.descend(DisclosureEmission.UNGROUP);\n this._members = null;\n }\n}\n\nexport { DisclosuresGroup };\n","export const DisclosureType = {\n EXPAND: {\n id: 'expanded',\n ariaState: true,\n ariaControls: true,\n canConceal: true\n },\n SELECT: {\n id: 'selected',\n ariaState: true,\n ariaControls: true,\n canConceal: false\n },\n OPENED: {\n id: 'opened',\n ariaState: false,\n ariaControls: true,\n canConceal: true\n }\n};\n","import { DisclosureType } from '../disclosure/disclosure-type.js';\nimport { DisclosureButton } from '../disclosure/disclosure-button.js';\n\nclass CollapseButton extends DisclosureButton {\n constructor () {\n super(DisclosureType.EXPAND);\n }\n\n static get instanceClassName () {\n return 'CollapseButton';\n }\n}\n\nexport { CollapseButton };\n","import ns from '../api/utilities/namespace.js';\n\nexport const CollapseSelector = {\n COLLAPSE: ns.selector('collapse')\n};\n","import { Disclosure } from '../disclosure/disclosure.js';\nimport { CollapseSelector } from './collapse-selector.js';\nimport { DisclosureType } from '../disclosure/disclosure-type.js';\nimport { CollapseButton } from './collapse-button.js';\n\n/**\n * Tab coorespond au panel d'un élement Tabs (tab panel)\n * Tab étend disclosure qui ajoute/enleve le modifier --selected,\n * et ajoute/eleve l'attribut hidden, sur le panel\n */\nclass Collapse extends Disclosure {\n constructor () {\n super(DisclosureType.EXPAND, CollapseSelector.COLLAPSE, CollapseButton, 'CollapsesGroup');\n }\n\n static get instanceClassName () {\n return 'Collapse';\n }\n\n init () {\n super.init();\n this.listen('transitionend', this.transitionend.bind(this));\n }\n\n transitionend (e) {\n if (!this.disclosed) this.style.maxHeight = '';\n }\n\n unbound () {\n this.style.maxHeight = 'none';\n }\n\n disclose (withhold) {\n if (this.disclosed) return;\n this.unbound();\n this.adjust();\n this.request(() => { super.disclose(withhold); });\n }\n\n conceal (withhold, preventFocus) {\n if (!this.disclosed) return;\n this.adjust();\n this.request(() => { super.conceal(withhold, preventFocus); });\n }\n\n adjust () {\n this.setProperty('--collapser', 'none');\n const height = this.node.offsetHeight;\n this.setProperty('--collapse', -height + 'px');\n this.setProperty('--collapser', '');\n }\n\n reset () {\n if (!this.pristine) this.disclosed = false;\n }\n}\n\nexport { Collapse };\n","import { DisclosuresGroup } from '../disclosure/disclosures-group.js';\n\nclass CollapsesGroup extends DisclosuresGroup {\n constructor () {\n super('Collapse');\n }\n\n static get instanceClassName () {\n return 'CollapsesGroup';\n }\n}\n\nexport { CollapsesGroup };\n","import ns from '../api/utilities/namespace.js';\n\nexport const EquisizedEmission = {\n CHANGE: ns('equisized', 'change')\n};\n","import { Instance } from '../api/register/instance.js';\nimport { EquisizedEmission } from './equisized-emission.js';\n\nclass Equisized extends Instance {\n static get instanceClassName () {\n return 'Equisized';\n }\n\n init () {\n this.ascend(EquisizedEmission.CHANGE);\n }\n\n measure () {\n this.style.width = 'auto';\n return this.getRect().width;\n }\n\n adjust (width) {\n this.style.width = `${width}px`;\n }\n\n dispose () {\n this.ascend(EquisizedEmission.CHANGE);\n }\n}\n\nexport { Equisized };\n","import { Instance } from '../api/register/instance.js';\nimport { EquisizedEmission } from './equisized-emission.js';\n\nclass EquisizedsGroup extends Instance {\n static get instanceClassName () {\n return 'EquisizedsGroup';\n }\n\n init () {\n this.isResizing = true;\n this.isLoading = true;\n this.addAscent(EquisizedEmission.CHANGE, this.resize.bind(this));\n }\n\n load () {\n this.resize();\n }\n\n resize () {\n const equisizeds = this.element.getDescendantInstances('Equisized');\n\n const width = Math.max(...equisizeds.map(equisized => equisized.measure()));\n equisizeds.forEach(equisized => equisized.adjust(width));\n }\n}\n\nexport { EquisizedsGroup };\n","import ns from '../../api/utilities/namespace.js';\n\nconst ToggleEvent = {\n TOGGLE: ns.event('toggle')\n};\n\nexport { ToggleEvent };\n","import { Instance } from '../../api/register/instance.js';\nimport { completeAssign } from '../../api/utilities/property/complete-assign.js';\nimport { ToggleEvent } from './toggle-event.js';\n\nclass Toggle extends Instance {\n static get instanceClassName () {\n return 'Toggle';\n }\n\n init () {\n this.pressed = this.pressed === 'true';\n this.listen('click', this.toggle.bind(this));\n }\n\n toggle () {\n this.pressed = this.pressed !== 'true';\n }\n\n get pressed () {\n return this.getAttribute('aria-pressed');\n }\n\n set pressed (value) {\n this.setAttribute('aria-pressed', value ? 'true' : 'false');\n this.dispatch(ToggleEvent.TOGGLE, value);\n }\n\n get proxy () {\n const scope = this;\n const proxy = Object.assign(super.proxy, {\n toggle: scope.toggle.bind(scope)\n });\n\n const proxyAccessors = {\n get pressed () {\n return scope.pressed;\n },\n set pressed (value) {\n scope.pressed = value;\n }\n };\n\n return completeAssign(proxy, proxyAccessors);\n }\n}\n\nexport { Toggle };\n","import { Instance } from '../api/register/instance.js';\nimport { setAttributes } from '../api/utilities/attribute';\n\nclass InjectSvg extends Instance {\n static get instanceClassName () {\n return 'InjectSvg';\n }\n\n init () {\n if (this.node) {\n this.img = this.node.querySelector('img');\n }\n\n if (!this.isLegacy) {\n this.replace();\n }\n }\n\n get proxy () {\n const scope = this;\n return Object.assign(super.proxy, {\n replace: scope.replace.bind(scope),\n restore: scope.restore.bind(scope)\n });\n }\n\n fetch () {\n if (this.img) {\n this.imgID = this.img.getAttribute('id');\n this.imgClass = this.img.getAttribute('class');\n this.imgURL = this.img.getAttribute('src');\n\n fetch(this.imgURL)\n .then(data => data.text())\n .then(response => {\n const parser = new DOMParser();\n const xmlDoc = parser.parseFromString(response, 'text/html');\n this.svg = xmlDoc.querySelector('svg');\n\n if (this.svg) {\n this.replace();\n }\n });\n }\n }\n\n replace () {\n if (!this.svg) {\n this.fetch();\n return;\n }\n\n if (this.imgID && typeof this.imgID !== 'undefined') {\n this.svg.setAttribute('id', this.imgID);\n }\n\n if (this.imgClass && typeof this.imgClass !== 'undefined') {\n this.svg.setAttribute('class', this.imgClass);\n }\n\n if (this.svg.hasAttribute('xmlns:a')) {\n this.svg.removeAttribute('xmlns:a');\n }\n\n this.node.setAttribute('data-fr-inject-svg', true);\n const svgAttributes = {\n 'aria-hidden': true,\n focusable: false\n };\n setAttributes(this.svg, svgAttributes);\n this.node.replaceChild(this.svg, this.img);\n }\n\n restore () {\n if (this.img && this.svg) {\n this.node.setAttribute('data-fr-inject-svg', false);\n this.node.replaceChild(this.img, this.svg);\n }\n }\n}\n\nexport { InjectSvg };\n","const setAttributes = (el, attrs) => {\n Object.keys(attrs).forEach(key => el.setAttribute(key, attrs[key]));\n};\n\nexport { setAttributes };\n","import ns from '../api/utilities/namespace.js';\n\nexport const InjectSvgSelector = {\n INJECT_SVG: `[${ns.attr('inject-svg')}]`\n};\n","import api from './script/api/api';\n\nimport { Instance } from './script/api/register/instance.js';\nimport { KeyCodes } from './script/api/register/key-codes.js';\nimport { Breakpoints } from './script/api/register/breakpoints';\nimport { Disclosure } from './script/disclosure/disclosure.js';\nimport { DisclosureButton } from './script/disclosure/disclosure-button.js';\nimport { DisclosuresGroup } from './script/disclosure/disclosures-group.js';\nimport { DisclosureType } from './script/disclosure/disclosure-type.js';\nimport { DisclosureEvent } from './script/disclosure/disclosure-event.js';\nimport { DisclosureEmission } from './script/disclosure/disclosure-emission.js';\nimport { CollapseButton } from './script/collapse/collapse-button.js';\nimport { Collapse } from './script/collapse/collapse.js';\nimport { CollapsesGroup } from './script/collapse/collapses-group.js';\nimport { CollapseSelector } from './script/collapse/collapse-selector.js';\nimport { Equisized } from './script/equisized/equisized.js';\nimport { EquisizedsGroup } from './script/equisized/equisizeds-group.js';\nimport { EquisizedEmission } from './script/equisized/equisized-emission.js';\nimport { Toggle } from './script/action/toggle/toggle';\nimport { RootSelector } from './script/api/stage/root.js';\nimport { InjectSvg } from './script/inject/inject-svg';\nimport { InjectSvgSelector } from './script/inject/inject-svg-selector';\n\napi.core = {\n Instance: Instance,\n Breakpoints: Breakpoints,\n KeyCodes: KeyCodes,\n Disclosure: Disclosure,\n DisclosureButton: DisclosureButton,\n DisclosuresGroup: DisclosuresGroup,\n DisclosureType: DisclosureType,\n DisclosureEvent: DisclosureEvent,\n DisclosureEmission: DisclosureEmission,\n Collapse: Collapse,\n CollapseButton: CollapseButton,\n CollapsesGroup: CollapsesGroup,\n CollapseSelector: CollapseSelector,\n RootSelector: RootSelector,\n Equisized: Equisized,\n EquisizedEmission: EquisizedEmission,\n Toggle: Toggle,\n EquisizedsGroup: EquisizedsGroup,\n InjectSvg: InjectSvg,\n InjectSvgSelector: InjectSvgSelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.core.CollapseSelector.COLLAPSE, api.core.Collapse);\napi.internals.register(api.core.InjectSvgSelector.INJECT_SVG, api.core.InjectSvg);\n\nexport default api;\n","import config from './config.js';\nconst api = window[config.namespace];\nexport default api;\n","export const SchemeValue = {\n SYSTEM: 'system',\n LIGHT: 'light',\n DARK: 'dark'\n};\n","import api from '../../api';\n\nexport const SchemeAttribute = {\n THEME: api.internals.ns.attr('theme'),\n SCHEME: api.internals.ns.attr('scheme'),\n TRANSITION: api.internals.ns.attr('transition')\n};\n","export const SchemeTheme = {\n LIGHT: 'light',\n DARK: 'dark'\n};\n","import api from '../../api';\n\nexport const SchemeEmission = {\n SCHEME: api.internals.ns.emission('scheme', 'scheme'),\n THEME: api.internals.ns.emission('scheme', 'theme'),\n ASK: api.internals.ns.emission('scheme', 'ask')\n};\n","import api from '../../api.js';\nimport { SchemeValue } from './scheme-value.js';\nimport { SchemeAttribute } from './scheme-attribute.js';\nimport { SchemeTheme } from './scheme-theme.js';\nimport { SchemeEmission } from './scheme-emission.js';\n\nclass Scheme extends api.core.Instance {\n constructor () {\n super(false);\n }\n\n static get instanceClassName () {\n return 'Scheme';\n }\n\n init () {\n this.changing = this.change.bind(this);\n\n if (this.hasAttribute(SchemeAttribute.TRANSITION)) {\n this.removeAttribute(SchemeAttribute.TRANSITION);\n this.request(this.restoreTransition.bind(this));\n }\n\n const scheme = api.internals.support.supportLocalStorage() ? localStorage.getItem('scheme') : '';\n const schemeAttr = this.getAttribute(SchemeAttribute.SCHEME);\n\n switch (scheme) {\n case SchemeValue.DARK:\n case SchemeValue.LIGHT:\n case SchemeValue.SYSTEM:\n this.scheme = scheme;\n break;\n\n default:\n switch (schemeAttr) {\n case SchemeValue.DARK:\n this.scheme = SchemeValue.DARK;\n break;\n\n case SchemeValue.LIGHT:\n this.scheme = SchemeValue.LIGHT;\n break;\n\n default:\n this.scheme = SchemeValue.SYSTEM;\n }\n }\n\n this.addAscent(SchemeEmission.ASK, this.ask.bind(this));\n this.addAscent(SchemeEmission.SCHEME, this.apply.bind(this));\n }\n\n get proxy () {\n const scope = this;\n\n const proxyAccessors = {\n get scheme () {\n return scope.scheme;\n },\n set scheme (value) {\n scope.scheme = value;\n }\n };\n\n return api.internals.property.completeAssign(super.proxy, proxyAccessors);\n }\n\n restoreTransition () {\n this.setAttribute(SchemeAttribute.TRANSITION, '');\n }\n\n ask () {\n this.descend(SchemeEmission.SCHEME, this.scheme);\n }\n\n apply (value) {\n this.scheme = value;\n }\n\n get scheme () {\n return this._scheme;\n }\n\n set scheme (value) {\n if (this._scheme === value) return;\n this._scheme = value;\n switch (value) {\n case SchemeValue.SYSTEM:\n this.listenPreferences();\n break;\n\n case SchemeValue.DARK:\n this.unlistenPreferences();\n this.theme = SchemeTheme.DARK;\n break;\n\n case SchemeValue.LIGHT:\n this.unlistenPreferences();\n this.theme = SchemeTheme.LIGHT;\n break;\n\n default:\n this.scheme = SchemeValue.SYSTEM;\n return;\n }\n\n this.descend(SchemeEmission.SCHEME, value);\n if (api.internals.support.supportLocalStorage()) {\n localStorage.setItem('scheme', value);\n }\n this.setAttribute(SchemeAttribute.SCHEME, value);\n }\n\n get theme () {\n return this._theme;\n }\n\n set theme (value) {\n if (this._theme === value) return;\n switch (value) {\n case SchemeTheme.LIGHT:\n case SchemeTheme.DARK:\n this._theme = value;\n this.setAttribute(SchemeAttribute.THEME, value);\n this.descend(SchemeEmission.THEME, value);\n break;\n }\n }\n\n listenPreferences () {\n if (this.isListening) return;\n this.isListening = true;\n this.mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n this.mediaQuery.addEventListener('change', this.changing);\n this.change();\n }\n\n unlistenPreferences () {\n if (!this.isListening) return;\n this.isListening = false;\n this.mediaQuery.removeEventListener('change', this.changing);\n this.mediaQuery = null;\n }\n\n change () {\n if (!this.isListening) return;\n this.theme = this.mediaQuery.matches ? SchemeTheme.DARK : SchemeTheme.LIGHT;\n }\n\n mutate (attributeNames) {\n if (attributeNames.indexOf(SchemeAttribute.SCHEME) > -1) this.scheme = this.getAttribute(SchemeAttribute.SCHEME);\n if (attributeNames.indexOf(SchemeAttribute.THEME) > -1) this.theme = this.getAttribute(SchemeAttribute.THEME);\n }\n\n dispose () {\n this.unlistenPreferences();\n }\n}\n\nexport { Scheme };\n","import api from '../../api.js';\n\nexport const SchemeSelector = {\n SCHEME: `:root${api.internals.ns.attr.selector('theme')}, :root${api.internals.ns.attr.selector('scheme')}`,\n SWITCH_THEME: api.internals.ns.selector('switch-theme'),\n RADIO_BUTTONS: `input[name=\"${api.internals.ns('radios-theme')}\"]`\n};\n","import api from './api.js';\nimport { Scheme } from './script/scheme/scheme.js';\nimport { SchemeValue } from './script/scheme/scheme-value.js';\nimport { SchemeSelector } from './script/scheme/scheme-selector.js';\nimport { SchemeEmission } from './script/scheme/scheme-emission.js';\nimport { SchemeTheme } from './script/scheme/scheme-theme.js';\n\napi.scheme = {\n Scheme: Scheme,\n SchemeValue: SchemeValue,\n SchemeSelector: SchemeSelector,\n SchemeEmission: SchemeEmission,\n SchemeTheme: SchemeTheme\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.scheme.SchemeSelector.SCHEME, api.scheme.Scheme);\n\nexport default api;\n","import api from '../../api.js';\n\nexport const AccordionSelector = {\n GROUP: api.internals.ns.selector('accordions-group'),\n COLLAPSE: `${api.internals.ns.selector('accordion')} > ${api.internals.ns.selector('collapse')}`\n};\n","import api from '../../api.js';\nimport { AccordionSelector } from './accordion-selector.js';\n\nclass AccordionsGroup extends api.core.CollapsesGroup {\n static get instanceClassName () {\n return 'AccordionsGroup';\n }\n\n validate (member) {\n return member.node.matches(AccordionSelector.COLLAPSE);\n }\n}\n\nexport { AccordionsGroup };\n","import api from './api.js';\nimport { AccordionsGroup } from './script/accordion/accordions-group.js';\nimport { AccordionSelector } from './script/accordion/accordion-selector.js';\n\napi.accordion = {\n AccordionSelector: AccordionSelector,\n AccordionsGroup: AccordionsGroup\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.accordion.AccordionSelector.GROUP, api.accordion.AccordionsGroup);\n\nexport default api;\n","import api from '../../api.js';\n\nexport const ButtonSelector = {\n EQUISIZED_BUTTON: `${api.internals.ns.selector('btns-group--equisized')} ${api.internals.ns.selector('btn')}`,\n EQUISIZED_GROUP: api.internals.ns.selector('btns-group--equisized')\n};\n","import api from './api.js';\nimport { ButtonSelector } from './script/button/button-selector';\n\napi.button = {\n ButtonSelector: ButtonSelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.button.ButtonSelector.EQUISIZED_BUTTON, api.core.Equisized);\napi.internals.register(api.button.ButtonSelector.EQUISIZED_GROUP, api.core.EquisizedsGroup);\n\nexport default api;\n","import api from '../../api.js';\n\nclass Breadcrumb extends api.core.Instance {\n constructor () {\n super();\n this.count = 0;\n this.focusing = this.focus.bind(this);\n }\n\n static get instanceClassName () {\n return 'Breadcrumb';\n }\n\n init () {\n this.getCollapse();\n this.isResizing = true;\n }\n\n get proxy () {\n const scope = this;\n return Object.assign(super.proxy, {\n focus: scope.focus.bind(scope),\n disclose: scope.collapse.disclose.bind(scope.collapse)\n });\n }\n\n getCollapse () {\n const collapse = this.collapse;\n if (collapse) {\n collapse.listen(api.core.DisclosureEvent.DISCLOSE, this.focusing);\n } else {\n this.addAscent(api.core.DisclosureEmission.ADDED, this.getCollapse.bind(this));\n }\n }\n\n resize () {\n const collapse = this.collapse;\n const links = this.links;\n if (!collapse || !links.length) return;\n\n if (this.isBreakpoint(api.core.Breakpoints.MD)) {\n if (collapse.buttonHasFocus) links[0].focus();\n } else {\n if (links.indexOf(document.activeElement) > -1) collapse.focus();\n }\n }\n\n get links () {\n return [...this.querySelectorAll('a[href]')];\n }\n\n get collapse () {\n return this.element.getDescendantInstances(api.core.Collapse.instanceClassName, null, true)[0];\n }\n\n focus () {\n this.count = 0;\n this._focus();\n }\n\n _focus () {\n const link = this.links[0];\n if (!link) return;\n link.focus();\n this.request(this.verify.bind(this));\n }\n\n verify () {\n this.count++;\n if (this.count > 100) return;\n const link = this.links[0];\n if (!link) return;\n if (document.activeElement !== link) this._focus();\n }\n}\n\nexport { Breadcrumb };\n","import api from '../../api.js';\n\nexport const BreadcrumbSelector = {\n BREADCRUMB: api.internals.ns.selector('breadcrumb')\n};\n","import api from './api.js';\nimport { Breadcrumb } from './script/breadcrumb/breadcrumb.js';\nimport { BreadcrumbSelector } from './script/breadcrumb/breadcrumb-selector.js';\n\napi.breadcrumb = {\n BreadcrumbSelector: BreadcrumbSelector,\n Breadcrumb: Breadcrumb\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.breadcrumb.BreadcrumbSelector.BREADCRUMB, api.breadcrumb.Breadcrumb);\n\nexport default api;\n","import api from '../../api.js';\n\nclass ToggleInput extends api.core.Instance {\n static get instanceClassName () {\n return 'ToggleInput';\n }\n\n get isChecked () {\n return this.getAttribute('checked');\n }\n}\n\nexport { ToggleInput };\n","import api from '../../api.js';\nimport { ToggleInput } from './toggle-input.js';\n\nclass ToggleStatusLabel extends api.core.Instance {\n static get instanceClassName () {\n return 'ToggleStatusLabel';\n }\n\n init () {\n this.register(`input[id=\"${this.getAttribute('for')}\"]`, ToggleInput);\n this.update();\n }\n\n get proxy () {\n const scope = this;\n return Object.assign(super.proxy, {\n update: scope.update.bind(scope)\n });\n }\n\n get input () {\n return this.getRegisteredInstances('ToggleInput')[0];\n }\n\n update () {\n const checked = this.input.isChecked;\n const style = getComputedStyle(this.node, 'before');\n let maxWidth = parseInt(style.width);\n this.input.node.checked = !checked;\n\n const style2 = getComputedStyle(this.node, 'before');\n const width = parseInt(style2.width);\n if (width > maxWidth) maxWidth = width;\n this.input.node.checked = checked;\n\n this.node.style = '--toggle-status-width:' + (maxWidth / 16) + 'rem';\n }\n}\n\nexport { ToggleStatusLabel };\n","import api from '../../api.js';\n\nexport const ToggleSelector = {\n STATUS_LABEL: `${api.internals.ns.selector('toggle__label')}${api.internals.ns.attr.selector('checked-label')}${api.internals.ns.attr.selector('unchecked-label')}`\n};\n","import api from './api.js';\nimport { ToggleStatusLabel } from './script/toggle/toggle-status-label.js';\nimport { ToggleSelector } from './script/toggle/toggle-selector.js';\n// import { ToggleInput } from './script/toggle/toggle-input.js';\n\napi.toggle = {\n ToggleStatusLabel: ToggleStatusLabel,\n ToggleSelector: ToggleSelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.toggle.ToggleSelector.STATUS_LABEL, api.toggle.ToggleStatusLabel);\n\nexport default api;\n","import api from '../../api.js';\n\nexport const SidemenuSelector = {\n LIST: api.internals.ns.selector('sidemenu__list'),\n COLLAPSE: `${api.internals.ns.selector('sidemenu__item')} > ${api.internals.ns.selector('collapse')}`\n};\n","import api from '../../api.js';\nimport { SidemenuSelector } from './sidemenu-selector.js';\n\nclass SidemenuList extends api.core.CollapsesGroup {\n static get instanceClassName () {\n return 'SidemenuList';\n }\n\n validate (member) {\n return member.node.matches(SidemenuSelector.COLLAPSE);\n }\n}\n\nexport { SidemenuList };\n","import api from './api.js';\nimport { SidemenuList } from './script/sidemenu/sidemenu-list.js';\nimport { SidemenuSelector } from './script/sidemenu/sidemenu-selector.js';\n\napi.sidemenu = {\n SidemenuList: SidemenuList,\n SidemenuSelector: SidemenuSelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.sidemenu.SidemenuSelector.LIST, api.sidemenu.SidemenuList);\n\nexport default api;\n","import api from '../../api.js';\n\nexport const ModalSelector = {\n MODAL: api.internals.ns.selector('modal'),\n SCROLL_SHADOW: api.internals.ns.selector('scroll-shadow'),\n BODY: api.internals.ns.selector('modal__body')\n};\n","import api from '../../api.js';\n\nclass ModalButton extends api.core.DisclosureButton {\n constructor () {\n super(api.core.DisclosureType.OPENED);\n }\n\n static get instanceClassName () {\n return 'ModalButton';\n }\n}\n\nexport { ModalButton };\n","import api from '../../api';\n\nexport const ModalAttribute = {\n CONCEALING_BACKDROP: api.internals.ns.attr('concealing-backdrop')\n};\n","import api from '../../api.js';\nimport { ModalSelector } from './modal-selector.js';\nimport { ModalButton } from './modal-button.js';\nimport { ModalAttribute } from './modal-attribute';\n\nclass Modal extends api.core.Disclosure {\n constructor () {\n super(api.core.DisclosureType.OPENED, ModalSelector.MODAL, ModalButton, 'ModalsGroup');\n this.scrolling = this.resize.bind(this, false);\n this.resizing = this.resize.bind(this, true);\n }\n\n static get instanceClassName () {\n return 'Modal';\n }\n\n init () {\n super.init();\n this.listen('click', this.click.bind(this));\n this.listenKey(api.core.KeyCodes.ESCAPE, this.conceal.bind(this, false, false), true, true);\n }\n\n get body () {\n return this.element.getDescendantInstances('ModalBody', 'Modal')[0];\n }\n\n click (e) {\n if (e.target === this.node && this.getAttribute(ModalAttribute.CONCEALING_BACKDROP) !== 'false') this.conceal();\n }\n\n disclose (withhold) {\n if (!super.disclose(withhold)) return false;\n if (this.body) this.body.activate();\n this.isScrollLocked = true;\n this.setAttribute('aria-modal', 'true');\n return true;\n }\n\n conceal (withhold, preventFocus) {\n if (!super.conceal(withhold, preventFocus)) return false;\n this.isScrollLocked = false;\n this.removeAttribute('aria-modal');\n if (this.body) this.body.deactivate();\n return true;\n }\n}\n\nexport { Modal };\n","import api from '../../api.js';\n\nconst unordereds = [\n '[tabindex=\"0\"]',\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'details>summary:first-of-type',\n 'details',\n 'iframe'\n];\n\nconst UNORDEREDS = unordereds.join();\n\nconst ordereds = [\n '[tabindex]:not([tabindex=\"-1\"]):not([tabindex=\"0\"])'\n];\n\nconst ORDEREDS = ordereds.join();\n\nconst IS_STUNNING = false;\n\nconst isFocusable = (element, container) => {\n if (!(element instanceof Element)) return false;\n const style = window.getComputedStyle(element);\n if (!style) return false;\n if (style.visibility === 'hidden') return false;\n if (container === undefined) container = element;\n\n while (container.contains(element)) {\n if (style.display === 'none') return false;\n element = element.parentElement;\n }\n\n return true;\n};\n\nclass FocusTrap {\n constructor (onTrap, onUntrap) {\n this.element = null;\n this.activeElement = null;\n this.onTrap = onTrap;\n this.onUntrap = onUntrap;\n this.waiting = this.wait.bind(this);\n this.handling = this.handle.bind(this);\n this.focusing = this.maintainFocus.bind(this);\n this.current = null;\n }\n\n get trapped () { return this.element !== null; }\n\n trap (element) {\n if (this.trapped) this.untrap();\n\n this.element = element;\n this.isTrapping = true;\n this.wait();\n\n if (this.onTrap) this.onTrap();\n }\n\n wait () {\n if (!isFocusable(this.element)) {\n window.requestAnimationFrame(this.waiting);\n return;\n }\n\n this.trapping();\n }\n\n trapping () {\n if (!this.isTrapping) return;\n this.isTrapping = false;\n const focusables = this.focusables;\n if (focusables.length) focusables[0].focus();\n this.element.setAttribute('aria-modal', true);\n window.addEventListener('keydown', this.handling);\n document.body.addEventListener('focus', this.focusing, true);\n\n if (IS_STUNNING) {\n this.stunneds = [];\n this.stun(document.body);\n }\n }\n\n stun (node) {\n for (const child of node.children) {\n if (child === this.element) continue;\n if (child.contains(this.element)) {\n this.stun(child);\n continue;\n }\n this.stunneds.push(new Stunned(child));\n }\n }\n\n maintainFocus (event) {\n if (!this.element.contains(event.target)) {\n const focusables = this.focusables;\n if (focusables.length === 0) return;\n const first = focusables[0];\n event.preventDefault();\n first.focus();\n }\n }\n\n handle (e) {\n if (e.keyCode !== 9) return;\n\n const focusables = this.focusables;\n if (focusables.length === 0) return;\n\n const first = focusables[0];\n const last = focusables[focusables.length - 1];\n\n const index = focusables.indexOf(document.activeElement);\n\n if (e.shiftKey) {\n if (!this.element.contains(document.activeElement) || index < 1) {\n e.preventDefault();\n last.focus();\n } else if (document.activeElement.tabIndex > 0 || focusables[index - 1].tabIndex > 0) {\n e.preventDefault();\n focusables[index - 1].focus();\n }\n } else {\n if (!this.element.contains(document.activeElement) || index === focusables.length - 1 || index === -1) {\n e.preventDefault();\n first.focus();\n } else if (document.activeElement.tabIndex > 0) {\n e.preventDefault();\n focusables[index + 1].focus();\n }\n }\n }\n\n get focusables () {\n let unordereds = api.internals.dom.querySelectorAllArray(this.element, UNORDEREDS);\n\n /**\n * filtrage des radiobutttons de même name (la navigations d'un groupe de radio se fait à la flèche et non pas au tab\n **/\n const radios = api.internals.dom.querySelectorAllArray(document.documentElement, 'input[type=\"radio\"]');\n\n if (radios.length) {\n const groups = {};\n\n for (const radio of radios) {\n const name = radio.getAttribute('name');\n if (groups[name] === undefined) groups[name] = new RadioButtonGroup(name);\n groups[name].push(radio);\n }\n\n unordereds = unordereds.filter((unordered) => {\n if (unordered.tagName.toLowerCase() !== 'input' || unordered.getAttribute('type').toLowerCase() !== 'radio') return true;\n const name = unordered.getAttribute('name');\n return groups[name].keep(unordered);\n });\n }\n\n const ordereds = api.internals.dom.querySelectorAllArray(this.element, ORDEREDS);\n\n ordereds.sort((a, b) => a.tabIndex - b.tabIndex);\n\n const noDuplicates = unordereds.filter((element) => ordereds.indexOf(element) === -1);\n const concateneds = ordereds.concat(noDuplicates);\n return concateneds.filter((element) => element.tabIndex !== '-1' && isFocusable(element, this.element));\n }\n\n untrap () {\n if (!this.trapped) return;\n this.isTrapping = false;\n\n this.element.removeAttribute('aria-modal');\n window.removeEventListener('keydown', this.handling);\n document.body.removeEventListener('focus', this.focusing, true);\n\n this.element = null;\n\n if (IS_STUNNING) {\n for (const stunned of this.stunneds) stunned.unstun();\n this.stunneds = [];\n }\n\n if (this.onUntrap) this.onUntrap();\n }\n\n dispose () {\n this.untrap();\n }\n}\n\nclass Stunned {\n constructor (element) {\n this.element = element;\n // this.hidden = element.getAttribute('aria-hidden');\n this.inert = element.getAttribute('inert');\n\n // this.element.setAttribute('aria-hidden', true);\n this.element.setAttribute('inert', '');\n }\n\n unstun () {\n /*\n if (this.hidden === null) this.element.removeAttribute('aria-hidden');\n else this.element.setAttribute('aria-hidden', this.hidden);\n */\n\n if (this.inert === null) this.element.removeAttribute('inert');\n else this.element.setAttribute('inert', this.inert);\n }\n}\n\nclass RadioButtonGroup {\n constructor (name) {\n this.name = name;\n this.buttons = [];\n }\n\n push (button) {\n this.buttons.push(button);\n if (button === document.activeElement || button.checked || this.selected === undefined) this.selected = button;\n }\n\n keep (button) {\n return this.selected === button;\n }\n}\n\nexport { FocusTrap };\n","import api from '../../api.js';\nimport { FocusTrap } from './focus-trap.js';\n\nclass ModalsGroup extends api.core.DisclosuresGroup {\n constructor () {\n super('Modal', false);\n this.focusTrap = new FocusTrap();\n }\n\n static get instanceClassName () {\n return 'ModalsGroup';\n }\n\n apply (value, initial) {\n super.apply(value, initial);\n if (this.current === null) this.focusTrap.untrap();\n else this.focusTrap.trap(this.current.node);\n }\n}\n\nexport { ModalsGroup };\n","import api from '../../api.js';\nimport { ModalSelector } from './modal-selector.js';\n\nconst OFFSET = 32; // 32px => 8v => 2rem\n\nclass ModalBody extends api.core.Instance {\n static get instanceClassName () {\n return 'ModalBody';\n }\n\n init () {\n this.listen('scroll', this.shade.bind(this));\n }\n\n activate () {\n this.isResizing = true;\n this.resize();\n }\n\n deactivate () {\n this.isResizing = false;\n }\n\n shade () {\n if (this.node.scrollHeight > this.node.clientHeight) {\n if (this.node.offsetHeight + this.node.scrollTop >= this.node.scrollHeight) {\n this.removeClass(ModalSelector.SCROLL_SHADOW);\n } else {\n this.addClass(ModalSelector.SCROLL_SHADOW);\n }\n } else {\n this.removeClass(ModalSelector.SCROLL_SHADOW);\n }\n }\n\n resize () {\n this.adjust();\n this.request(this.adjust.bind(this));\n }\n\n adjust () {\n const offset = OFFSET * (this.isBreakpoint(api.core.Breakpoints.MD) ? 2 : 1);\n this.style.maxHeight = `${window.innerHeight - offset}px`;\n this.shade();\n }\n}\n\nexport { ModalBody };\n","import api from './api.js';\n\nimport { Modal } from './script/modal/modal.js';\nimport { ModalButton } from './script/modal/modal-button.js';\nimport { ModalsGroup } from './script/modal/modals-group.js';\nimport { ModalBody } from './script/modal/modal-body.js';\nimport { ModalSelector } from './script/modal/modal-selector.js';\n\napi.modal = {\n Modal: Modal,\n ModalButton: ModalButton,\n ModalBody: ModalBody,\n ModalsGroup: ModalsGroup,\n ModalSelector: ModalSelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.modal.ModalSelector.MODAL, api.modal.Modal);\napi.internals.register(api.modal.ModalSelector.BODY, api.modal.ModalBody);\napi.internals.register(api.core.RootSelector.ROOT, api.modal.ModalsGroup);\n\nexport default api;\n","import api from '../../api.js';\n\nexport const NavigationSelector = {\n NAVIGATION: api.internals.ns.selector('nav'),\n COLLAPSE: `${api.internals.ns.selector('nav__item')} > ${api.internals.ns.selector('collapse')}`,\n ITEM: api.internals.ns.selector('nav__item'),\n ITEM_RIGHT: api.internals.ns('nav__item--align-right'),\n MENU: api.internals.ns.selector('menu')\n};\n","import api from '../../api.js';\nimport { NavigationSelector } from './navigation-selector.js';\n\nclass NavigationItem extends api.core.Instance {\n constructor () {\n super();\n this._isRightAligned = false;\n }\n\n static get instanceClassName () {\n return 'NavigationItem';\n }\n\n init () {\n this.addAscent(api.core.DisclosureEmission.ADDED, this.calculate.bind(this));\n this.addAscent(api.core.DisclosureEmission.REMOVED, this.calculate.bind(this));\n this.isResizing = true;\n this.calculate();\n }\n\n resize () {\n this.calculate();\n }\n\n calculate () {\n const collapse = this.element.getDescendantInstances(api.core.Collapse.instanceClassName, null, true)[0];\n if (collapse && this.isBreakpoint(api.core.Breakpoints.LG) && collapse.element.node.matches(NavigationSelector.MENU)) {\n const right = this.element.node.parentElement.getBoundingClientRect().right;\n const width = collapse.element.node.getBoundingClientRect().width;\n const left = this.element.node.getBoundingClientRect().left;\n this.isRightAligned = left + width > right;\n } else this.isRightAligned = false;\n }\n\n get isRightAligned () {\n return this._isRightAligned;\n }\n\n set isRightAligned (value) {\n if (this._isRightAligned === value) return;\n this._isRightAligned = value;\n if (value) api.internals.dom.addClass(this.element.node, NavigationSelector.ITEM_RIGHT);\n else api.internals.dom.removeClass(this.element.node, NavigationSelector.ITEM_RIGHT);\n }\n}\n\nexport { NavigationItem };\n","export const NavigationMousePosition = {\n NONE: -1,\n INSIDE: 0,\n OUTSIDE: 1\n};\n","import api from '../../api.js';\nimport { NavigationSelector } from './navigation-selector.js';\nimport { NavigationMousePosition } from './navigation-mouse-position.js';\n\nclass Navigation extends api.core.CollapsesGroup {\n static get instanceClassName () {\n return 'Navigation';\n }\n\n init () {\n super.init();\n this.clicked = false;\n this.out = false;\n this.listen('focusout', this.focusOut.bind(this));\n this.listen('mousedown', this.down.bind(this));\n }\n\n validate (member) {\n return member.element.node.matches(NavigationSelector.COLLAPSE);\n }\n\n down (e) {\n if (!this.isBreakpoint(api.core.Breakpoints.LG) || this.index === -1 || !this.current) return;\n this.position = this.current.element.node.contains(e.target) ? NavigationMousePosition.INSIDE : NavigationMousePosition.OUTSIDE;\n this.request(this.getPosition.bind(this));\n }\n\n focusOut (e) {\n if (!this.isBreakpoint(api.core.Breakpoints.LG)) return;\n this.out = true;\n this.request(this.getPosition.bind(this));\n }\n\n getPosition () {\n if (this.out) {\n switch (this.position) {\n case NavigationMousePosition.OUTSIDE:\n this.index = -1;\n break;\n\n case NavigationMousePosition.INSIDE:\n if (this.current) this.current.focus();\n break;\n\n default:\n if (this.index > -1 && !this.current.hasFocus) this.index = -1;\n }\n }\n this.position = NavigationMousePosition.NONE;\n this.out = false;\n }\n\n get index () { return super.index; }\n\n set index (value) {\n if (value === -1 && this.current !== null && this.current.hasFocus) this.current.focus();\n super.index = value;\n }\n}\n\nexport { Navigation };\n","import api from './api.js';\nimport { NavigationItem } from './script/navigation/navigation-item.js';\nimport { Navigation } from './script/navigation/navigation.js';\nimport { NavigationSelector } from './script/navigation/navigation-selector.js';\nimport { NavigationMousePosition } from './script/navigation/navigation-mouse-position.js';\n\napi.navigation = {\n Navigation: Navigation,\n NavigationItem: NavigationItem,\n NavigationMousePosition: NavigationMousePosition,\n NavigationSelector: NavigationSelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.navigation.NavigationSelector.NAVIGATION, api.navigation.Navigation);\napi.internals.register(api.navigation.NavigationSelector.ITEM, api.navigation.NavigationItem);\n\nexport default api;\n","import api from '../../api.js';\n\n/**\n * TabButton correspond au bouton cliquable qui change le panel\n * TabButton étend de DisclosureButton qui ajoute/enelve l'attribut aria-selected,\n * Et change l'attributte tabindex a 0 si le boutton est actif (value=true), -1 s'il n'est pas actif (value=false)\n */\nclass TabButton extends api.core.DisclosureButton {\n constructor () {\n super(api.core.DisclosureType.SELECT);\n }\n\n static get instanceClassName () {\n return 'TabButton';\n }\n\n apply (value) {\n super.apply(value);\n if (this.isPrimary) {\n this.setAttribute('tabindex', value ? '0' : '-1');\n if (value) {\n if (this.list) this.list.focalize(this);\n }\n }\n }\n\n get list () {\n return this.element.getAscendantInstance('TabsList', 'TabsGroup');\n }\n}\n\nexport { TabButton };\n","import api from '../../api.js';\n\nexport const TabSelector = {\n TAB: api.internals.ns.selector('tabs__tab'),\n GROUP: api.internals.ns.selector('tabs'),\n PANEL: api.internals.ns.selector('tabs__panel'),\n LIST: api.internals.ns.selector('tabs__list'),\n SHADOW: api.internals.ns.selector('tabs__shadow'),\n SHADOW_LEFT: api.internals.ns.selector('tabs__shadow--left'),\n SHADOW_RIGHT: api.internals.ns.selector('tabs__shadow--right')\n};\n","import api from '../../api.js';\nimport { TabButton } from './tab-button.js';\nimport { TabSelector } from './tab-selector.js';\n\n/**\n * Tab coorespond au panel d'un élement Tabs (tab panel)\n * Tab étend disclosure qui ajoute/enleve le modifier --selected,\n * et ajoute/eleve l'attribut hidden, sur le panel\n */\nclass TabPanel extends api.core.Disclosure {\n constructor () {\n super(api.core.DisclosureType.SELECT, TabSelector.PANEL, TabButton, 'TabsGroup');\n }\n\n static get instanceClassName () {\n return 'TabPanel';\n }\n\n translate (direction, initial) {\n this.style.transition = initial ? 'none' : '';\n this.style.transform = `translate(${direction * 100}%)`;\n }\n\n reset () {\n this.group.index = 0;\n }\n}\n\nexport { TabPanel };\n","import api from '../../api.js';\n\n/**\n* TabGroup est la classe étendue de DiscosuresGroup\n* Correspond à un objet Tabs avec plusieurs tab-button & Tab (panel)\n*/\nclass TabsGroup extends api.core.DisclosuresGroup {\n constructor () {\n super('TabPanel');\n }\n\n static get instanceClassName () {\n return 'TabsGroup';\n }\n\n init () {\n super.init();\n this.listen('transitionend', this.transitionend.bind(this));\n this.listenKey(api.core.KeyCodes.RIGHT, this.pressRight.bind(this), true, true);\n this.listenKey(api.core.KeyCodes.LEFT, this.pressLeft.bind(this), true, true);\n this.listenKey(api.core.KeyCodes.HOME, this.pressHome.bind(this), true, true);\n this.listenKey(api.core.KeyCodes.END, this.pressEnd.bind(this), true, true);\n this.isRendering = true;\n\n if (this.list) this.list.apply();\n }\n\n get list () {\n return this.element.getDescendantInstances('TabsList', 'TabsGroup', true)[0];\n }\n\n transitionend (e) {\n this.style.transition = 'none';\n }\n\n get buttonHasFocus () {\n return this.members.some(member => member.buttonHasFocus);\n }\n\n /**\n * Selectionne l'element suivant de la liste si on est sur un bouton\n * Si on est à la fin on retourne au début\n */\n pressRight () {\n if (this.buttonHasFocus) {\n if (this.index < this.length - 1) {\n this.index++;\n } else {\n this.index = 0;\n }\n\n this.focus();\n }\n };\n\n /**\n * Selectionne l'element précédent de la liste si on est sur un bouton\n * Si on est au debut retourne a la fin\n */\n pressLeft () {\n if (this.buttonHasFocus) {\n if (this.index > 0) {\n this.index--;\n } else {\n this.index = this.length - 1;\n }\n\n this.focus();\n }\n };\n\n /**\n * Selectionne le permier element de la liste si on est sur un bouton\n */\n pressHome () {\n if (this.buttonHasFocus) {\n this.index = 0;\n this.focus();\n }\n };\n\n /**\n * Selectionne le dernier element de la liste si on est sur un bouton\n */\n pressEnd () {\n if (this.buttonHasFocus) {\n this.index = this.length - 1;\n this.focus();\n }\n };\n\n focus () {\n if (this.current) {\n this.current.focus();\n }\n }\n\n apply () {\n for (let i = 0; i < this._index; i++) this.members[i].translate(-1);\n this.current.style.transition = '';\n this.current.style.transform = '';\n for (let i = this._index + 1; i < this.length; i++) this.members[i].translate(1);\n this.style.transition = '';\n }\n\n render () {\n if (this.current === null) return;\n const paneHeight = Math.round(this.current.node.offsetHeight);\n if (this.panelHeight === paneHeight) return;\n this.panelHeight = paneHeight;\n let listHeight = 0;\n if (this.list) listHeight = this.list.node.offsetHeight;\n this.style.height = (this.panelHeight + listHeight) + 'px';\n }\n}\n\nexport { TabsGroup };\n","import api from '../../api.js';\nimport { TabSelector } from './tab-selector';\n\nconst FOCALIZE_OFFSET = 16;\nconst SCROLL_OFFSET = 16; // valeur en px du scroll avant laquelle le shadow s'active ou se desactive\n\nclass TabsList extends api.core.Instance {\n static get instanceClassName () {\n return 'TabsList';\n }\n\n init () {\n this.listen('scroll', this.scroll.bind(this));\n this.isResizing = true;\n }\n\n get group () {\n return this.element.getAscendantInstance('TabsGroup', 'TabsList');\n }\n\n focalize (btn) {\n const btnRect = btn.getRect();\n const listRect = this.getRect();\n const actualScroll = this.node.scrollLeft;\n if (btnRect.left < listRect.left) this.node.scrollTo(actualScroll - listRect.left + btnRect.left - FOCALIZE_OFFSET, 0);\n else if (btnRect.right > listRect.right) this.node.scrollTo(actualScroll - listRect.right + btnRect.right + FOCALIZE_OFFSET, 0);\n }\n\n get isScrolling () {\n return this._isScrolling;\n }\n\n set isScrolling (value) {\n if (this._isScrolling === value) return;\n this._isScrolling = value;\n this.apply();\n }\n\n apply () {\n if (!this.group) return;\n if (this._isScrolling) {\n this.group.addClass(TabSelector.SHADOW);\n this.scroll();\n } else {\n this.group.removeClass(TabSelector.SHADOW_RIGHT);\n this.group.removeClass(TabSelector.SHADOW_LEFT);\n this.group.removeClass(TabSelector.SHADOW);\n }\n }\n\n /* ajoute la classe fr-table__shadow-left ou fr-table__shadow-right sur fr-table en fonction d'une valeur de scroll et du sens (right, left) */\n scroll () {\n if (!this.group) return;\n const scrollLeft = this.node.scrollLeft;\n const isMin = scrollLeft <= SCROLL_OFFSET;\n const max = this.node.scrollWidth - this.node.clientWidth - SCROLL_OFFSET;\n\n const isMax = Math.abs(scrollLeft) >= max;\n const isRtl = document.documentElement.getAttribute('dir') === 'rtl';\n const minSelector = isRtl ? TabSelector.SHADOW_RIGHT : TabSelector.SHADOW_LEFT;\n const maxSelector = isRtl ? TabSelector.SHADOW_LEFT : TabSelector.SHADOW_RIGHT;\n\n if (isMin) {\n this.group.removeClass(minSelector);\n } else {\n this.group.addClass(minSelector);\n }\n\n if (isMax) {\n this.group.removeClass(maxSelector);\n } else {\n this.group.addClass(maxSelector);\n }\n }\n\n resize () {\n this.isScrolling = this.node.scrollWidth > this.node.clientWidth + SCROLL_OFFSET;\n }\n\n dispose () {\n this.isScrolling = false;\n }\n}\n\nexport { TabsList };\n","import api from './api.js';\nimport { TabPanel } from './script/tab/tab-panel.js';\nimport { TabButton } from './script/tab/tab-button.js';\nimport { TabsGroup } from './script/tab/tabs-group.js';\nimport { TabsList } from './script/tab/tabs-list.js';\nimport { TabSelector } from './script/tab/tab-selector.js';\n\napi.tab = {\n TabPanel: TabPanel,\n TabButton: TabButton,\n TabsGroup: TabsGroup,\n TabsList: TabsList,\n TabSelector: TabSelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.tab.TabSelector.PANEL, api.tab.TabPanel);\napi.internals.register(api.tab.TabSelector.GROUP, api.tab.TabsGroup);\napi.internals.register(api.tab.TabSelector.LIST, api.tab.TabsList);\n\nexport default api;\n","import api from '../../api.js';\n\nexport const TableEmission = {\n SCROLLABLE: api.internals.ns.emission('table', 'scrollable'),\n CHANGE: api.internals.ns.emission('table', 'change'),\n CAPTION_HEIGHT: api.internals.ns.emission('table', 'captionheight')\n};\n","import api from '../../api.js';\nimport { TableEmission } from './table-emission.js';\n\nconst PADDING = '1rem'; // padding de 4v sur le caption\n\nclass Table extends api.core.Instance {\n static get instanceClassName () {\n return 'Table';\n }\n\n init () {\n this.addAscent(TableEmission.CAPTION_HEIGHT, this.setCaptionHeight.bind(this));\n }\n\n setCaptionHeight (value) {\n this.setProperty('--table-offset', `calc(${value}px + ${PADDING})`);\n }\n}\n\nexport { Table };\n","import api from '../../api.js';\n\nexport const TableSelector = {\n TABLE: api.internals.ns.selector('table'),\n SHADOW: api.internals.ns.selector('table__shadow'),\n SHADOW_LEFT: api.internals.ns.selector('table__shadow--left'),\n SHADOW_RIGHT: api.internals.ns.selector('table__shadow--right'),\n ELEMENT: `${api.internals.ns.selector('table')}:not(${api.internals.ns.selector('table--no-scroll')}) table`,\n CAPTION: `${api.internals.ns.selector('table')} table caption`\n};\n","import api from '../../api.js';\nimport { TableSelector } from './table-selector.js';\n\nconst SCROLL_OFFSET = 8; // valeur en px du scroll avant laquelle le shadow s'active ou se desactive\n\nclass TableElement extends api.core.Instance {\n static get instanceClassName () {\n return 'TableElement';\n }\n\n init () {\n this.listen('scroll', this.scroll.bind(this));\n this.content = this.querySelector('tbody');\n this.isResizing = true;\n }\n\n get isScrolling () {\n return this._isScrolling;\n }\n\n set isScrolling (value) {\n if (this._isScrolling === value) return;\n this._isScrolling = value;\n\n if (value) {\n this.addClass(TableSelector.SHADOW);\n this.scroll();\n } else {\n this.removeClass(TableSelector.SHADOW);\n this.removeClass(TableSelector.SHADOW_LEFT);\n this.removeClass(TableSelector.SHADOW_RIGHT);\n }\n }\n\n /* ajoute la classe fr-table__shadow-left ou fr-table__shadow-right sur fr-table en fonction d'une valeur de scroll et du sens (right, left) */\n scroll () {\n const isMin = this.node.scrollLeft <= SCROLL_OFFSET;\n const max = this.content.offsetWidth - this.node.offsetWidth - SCROLL_OFFSET;\n const isMax = Math.abs(this.node.scrollLeft) >= max;\n const isRtl = document.documentElement.getAttribute('dir') === 'rtl';\n const minSelector = isRtl ? TableSelector.SHADOW_RIGHT : TableSelector.SHADOW_LEFT;\n const maxSelector = isRtl ? TableSelector.SHADOW_LEFT : TableSelector.SHADOW_RIGHT;\n\n if (isMin) {\n this.removeClass(minSelector);\n } else {\n this.addClass(minSelector);\n }\n\n if (isMax) {\n this.removeClass(maxSelector);\n } else {\n this.addClass(maxSelector);\n }\n }\n\n resize () {\n this.isScrolling = this.content.offsetWidth > this.node.offsetWidth;\n }\n\n dispose () {\n this.isScrolling = false;\n }\n}\n\nexport { TableElement };\n","import api from '../../api.js';\nimport { TableEmission } from './table-emission.js';\n\nclass TableCaption extends api.core.Instance {\n static get instanceClassName () {\n return 'TableCaption';\n }\n\n init () {\n this.height = 0;\n this.isResizing = true;\n }\n\n resize () {\n const height = this.getRect().height;\n if (this.height === height) return;\n this.height = height;\n this.ascend(TableEmission.CAPTION_HEIGHT, height);\n }\n}\n\nexport { TableCaption };\n","import api from './api.js';\nimport { Table } from './script/table/table.js';\nimport { TableElement } from './script/table/table-element.js';\nimport { TableSelector } from './script/table/table-selector.js';\nimport { TableCaption } from './script/table/table-caption.js';\n\napi.table = {\n Table: Table,\n TableElement: TableElement,\n TableCaption: TableCaption,\n TableSelector: TableSelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.table.TableSelector.TABLE, api.table.Table);\napi.internals.register(api.table.TableSelector.ELEMENT, api.table.TableElement);\napi.internals.register(api.table.TableSelector.CAPTION, api.table.TableCaption);\n\nexport default api;\n","import api from '../../api.js';\n\nexport const TagSelector = {\n TAG_PRESSABLE: `${api.internals.ns.selector('tag')}[aria-pressed]`\n};\n","import api from './api.js';\nimport { TagSelector } from './script/tag/tag-selector';\n\napi.tag = {\n TagSelector: TagSelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.tag.TagSelector.TAG_PRESSABLE, api.core.Toggle);\n\nexport default api;\n","import api from '../../api.js';\n\nexport const HeaderSelector = {\n HEADER: api.internals.ns.selector('header'),\n TOOLS_LINKS: api.internals.ns.selector('header__tools-links'),\n MENU_LINKS: api.internals.ns.selector('header__menu-links'),\n LINKS: `${api.internals.ns.selector('header__tools-links')} ${api.internals.ns.selector('links-group')}`,\n MODALS: `${api.internals.ns.selector('header__search')}${api.internals.ns.selector('modal')}, ${api.internals.ns.selector('header__menu')}${api.internals.ns.selector('modal')}`\n};\n","import api from '../../api.js';\nimport { HeaderSelector } from './header-selector.js';\n\nclass HeaderLinks extends api.core.Instance {\n static get instanceClassName () {\n return 'HeaderLinks';\n }\n\n init () {\n const header = this.queryParentSelector(HeaderSelector.HEADER);\n this.toolsLinks = header.querySelector(HeaderSelector.TOOLS_LINKS);\n this.menuLinks = header.querySelector(HeaderSelector.MENU_LINKS);\n\n const toolsHtml = this.toolsLinks.innerHTML.replace(/ +/g, ' ');\n const menuHtml = this.menuLinks.innerHTML.replace(/ +/g, ' ');\n\n if (toolsHtml === menuHtml) return;\n\n switch (api.mode) {\n case api.Modes.ANGULAR:\n case api.Modes.REACT:\n case api.Modes.VUE:\n api.inspector.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${api.header.doc}`);\n break;\n\n default:\n this.menuLinks.innerHTML = this.toolsLinks.innerHTML;\n }\n }\n}\n\nexport { HeaderLinks };\n","import api from '../../api.js';\n\nclass HeaderModal extends api.core.Instance {\n static get instanceClassName () {\n return 'HeaderModal';\n }\n\n init () {\n this.isResizing = true;\n }\n\n resize () {\n if (this.isBreakpoint(api.core.Breakpoints.LG)) this.unqualify();\n else this.qualify();\n }\n\n qualify () {\n this.setAttribute('role', 'dialog');\n const modal = this.element.getInstance('Modal');\n if (!modal) return;\n const buttons = modal.buttons;\n let id = '';\n for (const button of buttons) {\n id = button.id || id;\n if (button.isPrimary && id) break;\n }\n this.setAttribute('aria-labelledby', id);\n }\n\n unqualify () {\n const modal = this.element.getInstance('Modal');\n if (modal) modal.conceal();\n this.removeAttribute('role');\n this.removeAttribute('aria-labelledby');\n }\n}\n\nexport { HeaderModal };\n","import api from './api.js';\nimport { HeaderLinks } from './script/header/header-links.js';\nimport { HeaderModal } from './script/header/header-modal.js';\nimport { HeaderSelector } from './script/header/header-selector.js';\n\napi.header = {\n HeaderLinks: HeaderLinks,\n HeaderModal: HeaderModal,\n HeaderSelector: HeaderSelector,\n doc: 'https://gouvfr.atlassian.net/wiki/spaces/DB/pages/222789846/En-t+te+-+Header'\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.header.HeaderSelector.LINKS, api.header.HeaderLinks);\napi.internals.register(api.header.HeaderSelector.MODALS, api.header.HeaderModal);\n\nexport default api;\n","import api from '../../api.js';\n\nexport const DisplaySelector = {\n DISPLAY: api.internals.ns.selector('display'),\n RADIO_BUTTONS: `input[name=\"${api.internals.ns('radios-theme')}\"]`,\n FIELDSET: api.internals.ns.selector('fieldset')\n};\n","import api from '../../api.js';\nimport { DisplaySelector } from './display-selector.js';\n\nclass Display extends api.core.Instance {\n static get instanceClassName () {\n return 'Display';\n }\n\n init () {\n this.radios = this.querySelectorAll(DisplaySelector.RADIO_BUTTONS);\n\n if (api.scheme) {\n this.changing = this.change.bind(this);\n for (const radio of this.radios) radio.addEventListener('change', this.changing);\n this.addDescent(api.scheme.SchemeEmission.SCHEME, this.apply.bind(this));\n this.ascend(api.scheme.SchemeEmission.ASK);\n } else {\n this.querySelector(DisplaySelector.FIELDSET).setAttribute('disabled', '');\n }\n }\n\n get scheme () {\n return this._scheme;\n }\n\n set scheme (value) {\n if (this._scheme === value || !api.scheme) return;\n switch (value) {\n case api.scheme.SchemeValue.SYSTEM:\n case api.scheme.SchemeValue.LIGHT:\n case api.scheme.SchemeValue.DARK:\n this._scheme = value;\n for (const radio of this.radios) {\n radio.checked = radio.value === value;\n }\n this.ascend(api.scheme.SchemeEmission.SCHEME, value);\n break;\n }\n }\n\n change () {\n for (const radio of this.radios) {\n if (radio.checked) {\n this.scheme = radio.value;\n return;\n }\n }\n }\n\n apply (value) {\n this.scheme = value;\n }\n\n dispose () {\n for (const radio of this.radios) radio.removeEventListener('change', this.changing);\n }\n}\n\nexport { Display };\n","import api from './api.js';\nimport { Display } from './script/display/display.js';\nimport { DisplaySelector } from './script/display/display-selector.js';\n\napi.display = {\n Display: Display,\n DisplaySelector: DisplaySelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.display.DisplaySelector.DISPLAY, api.display.Display);\n\nexport default api;\n","/* Polyfill service v3.108.0\n * Disable minification (remove `.min` from URL path) for more info */\n\n(function(self, undefined) {function Call(t,l){var n=arguments.length>2?arguments[2]:[];if(!1===IsCallable(t))throw new TypeError(Object.prototype.toString.call(t)+\"is not a function.\");return t.apply(l,n)}function CreateMethodProperty(e,r,t){var a={value:t,writable:!0,enumerable:!1,configurable:!0};Object.defineProperty(e,r,a)}function Get(n,t){return n[t]}function IsCallable(n){return\"function\"==typeof n}function SameValueNonNumber(e,n){return e===n}function ToObject(e){if(null===e||e===undefined)throw TypeError();return Object(e)}function GetV(t,e){return ToObject(t)[e]}function GetMethod(e,n){var r=GetV(e,n);if(null===r||r===undefined)return undefined;if(!1===IsCallable(r))throw new TypeError(\"Method not callable: \"+n);return r}function Type(e){switch(typeof e){case\"undefined\":return\"undefined\";case\"boolean\":return\"boolean\";case\"number\":return\"number\";case\"string\":return\"string\";case\"symbol\":return\"symbol\";default:return null===e?\"null\":\"Symbol\"in self&&(e instanceof self.Symbol||e.constructor===self.Symbol)?\"symbol\":\"object\"}}function OrdinaryToPrimitive(r,t){if(\"string\"===t)var e=[\"toString\",\"valueOf\"];else e=[\"valueOf\",\"toString\"];for(var i=0;i1?arguments[1]:undefined;if(\"object\"===Type(e)){if(arguments.length<2)var i=\"default\";else t===String?i=\"string\":t===Number&&(i=\"number\");var r=\"function\"==typeof self.Symbol&&\"symbol\"==typeof self.Symbol.toPrimitive?GetMethod(e,self.Symbol.toPrimitive):undefined;if(r!==undefined){var n=Call(r,e,[i]);if(\"object\"!==Type(n))return n;throw new TypeError(\"Cannot convert exotic object to primitive.\")}return\"default\"===i&&(i=\"number\"),OrdinaryToPrimitive(e,i)}return e}function ToString(t){switch(Type(t)){case\"symbol\":throw new TypeError(\"Cannot convert a Symbol value to a string\");case\"object\":return ToString(ToPrimitive(t,String));default:return String(t)}}CreateMethodProperty(Array.prototype,\"includes\",function e(r){\"use strict\";var t=ToObject(this),o=ToLength(Get(t,\"length\"));if(0===o)return!1;var n=ToInteger(arguments[1]);if(n>=0)var a=n;else(a=o+n)<0&&(a=0);for(;a=c)for(;c>>0,\"object\"==typeof n[e]?n[e].baseVal=o.join(\" \"):n[e]=o.join(\" \"),l())},r.remove=function(){u.apply(r,t=arguments);for(var t,c={},f=0,p=[];f>>0,\"object\"==typeof n[e]?n[e].baseVal=o.join(\" \"):n[e]=o.join(\" \"),l()},r.toggle=function(n,t){return u.apply(r,[n]),undefined!==t?t?(r.add(n),!0):(r.remove(n),!1):i[n]?(r.remove(n),!1):(r.add(n),!0)},r.forEach=Array.prototype.forEach,r}}();!function(t){\"DOMTokenList\"in t&&t.DOMTokenList&&(!document.createElementNS||!document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\")||document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\").classList instanceof DOMTokenList)||(t.DOMTokenList=_DOMTokenList),function(){var t=document.createElement(\"span\");\"classList\"in t&&(t.classList.toggle(\"x\",!1),t.classList.contains(\"x\")&&(t.classList.constructor.prototype.toggle=function s(t){var s=arguments[1];if(s===undefined){var e=!this.contains(t);return this[e?\"add\":\"remove\"](t),e}return s=!!s,this[s?\"add\":\"remove\"](t),s}))}(),function(){var t=document.createElement(\"span\");if(\"classList\"in t&&(t.classList.add(\"a\",\"b\"),!t.classList.contains(\"b\"))){var s=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,e=arguments.length,n=0;n