CVE-2024-28190 (JavaScript, published 2024-04-09T14:15Z)
Description: value: Contao is an open source content management system. Starting in version 4.0.0 and prior to version 4.13.40 and 5.3.4, users can inject malicious code in filenames when uploading files (back end and front end), which is then executed in tooltips and popups in the back end. Contao versions 4.13.40 and 5.3.4 have a patch for this issue. As a workaround, remove upload fields from frontend forms and disable uploads for untrusted back end users.
Severity: nan (CVSS v3 base score: )
Weakness: NVD-CWE-noinfo \u2014 Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Repository: https://github.com/contao/contao
Files changed:
core-bundle/assets/scripts/core.js
core-bundle/assets/scripts/tips.js
core-bundle/contao/drivers/DC_Folder.php
core-bundle/public/backend.7d12ce36.js
core-bundle/public/backend.7d12ce36.js.map
core-bundle/public/entrypoints.json
core-bundle/public/manifest.json
Commit message: Merge pull request from GHSA-v24p-7p4j-qvvf

* Encode file names in tooltips and titles

* Allow HTML in help texts

* Remove ampersands in sanitizeFileName()

* Revert "Remove ampersands in sanitizeFileName()"

This reverts commit df7a6d9e7a6122d78380e38e4bb06ff7b823cc71.

* Fix all modals

* Rebuild the assets

---------

Co-authored-by: Leo Feyer <1192057+leofeyer@users.noreply.github.com>

Vulnerable code:
			'title': opt.title,
			'title': opt.title,
			'title': opt.title,
                el.removeAttribute('title')
			$strFolderNameEncoded = StringUtil::convertEncoding(StringUtil::specialchars(basename($currentFolder)), System::getContainer()->getParameter('kernel.charset'));
			$strFileNameEncoded = StringUtil::convertEncoding(StringUtil::specialchars(basename($currentFile)), System::getContainer()->getParameter('kernel.charset'));
{"version":3,"file":"backend.1d61970f.js","mappings":"8GAIA,MAAMA,EACF,WAAAC,CAAYC,EAAaC,EAAWC,GAChCC,KAAKH,YAAcA,EACnBG,KAAKF,UAAYA,EACjBE,KAAKD,aAAeA,EACpBC,KAAKC,kBAAoB,IAAIC,GACjC,CACA,OAAAC,GACIH,KAAKH,YAAYO,iBAAiBJ,KAAKF,UAAWE,KAAMA,KAAKD,aACjE,CACA,UAAAM,G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GAG/C/0B,EAAOi1B,OACf,CCrBAF,EAAoBO,EAAI,SAASL,EAAS/3B,GACzC,IAAI,IAAInR,KAAOmR,EACX63B,EAAoBC,EAAE93B,EAAYnR,KAASgpC,EAAoBC,EAAEC,EAASlpC,IAC5EhD,OAAOwsC,eAAeN,EAASlpC,EAAK,CAAEypC,YAAY,EAAM9pC,IAAKwR,EAAWnR,IAG3E,ECPAgpC,EAAoBC,EAAI,SAASS,EAAKC,GAAQ,OAAO3sC,OAAO+E,UAAUC,eAAe7E,KAAKusC,EAAKC,EAAO,ECCtGX,EAAoBY,EAAI,SAASV,GACX,oBAAXW,QAA0BA,OAAOC,aAC1C9sC,OAAOwsC,eAAeN,EAASW,OAAOC,YAAa,CAAE1pC,MAAO,WAE7DpD,OAAOwsC,eAAeN,EAAS,aAAc,CAAE9oC,OAAO,GACvD,E,qCCSA,SAAS2pC,EAAiC91B,EAAQzR,GAC9C,MAAM0R,EAAwBD,EAAOqK,QACrC,GAAoC,mBAAzBpK,EACP,MAAO,CAAE1R,aAAY0R,wBAE7B,CACA,SAAS81B,EAAwBhqC,GAC7B,MAAMiqC,GAAejqC,EAAIgD,MAAM,2CAA6C,IAAI,GAChF,GAAIinC,EACA,OAAOA,EAAYhpC,QAAQ,KAAM,KAAKA,QAAQ,MAAO,KAE7D,C,0CCfA,MAAMhD,EAAcye,EAAAA,GAAYre,QAChCJ,EAAY0e,OAAQutB,EAEpB,MAAMrkC,EAAUskC,EAAAA,KAChBlsC,EAAYgf,KAAKpX,EAAQ9F,OAAOlB,KAAKmB,IACjC,MAAMwC,EAAawnC,EAAwBhqC,GAC3C,GAAIwC,EACA,OAAOunC,EAAiClkC,EAAQ7F,GAAO,WAAWwC,IACtE,IACDqB,QAAQzD,GAAUA,I","sources":["webpack:///../../../../../../.yarn/berry/cache/@hotwired-stimulus-npm-3.2.2-e1e064f1fe-10c0.zip/node_modules/@hotwired/stimulus/dist/stimulus.js","webpack:///./core-bundle/assets/controllers/clipboard-controller.js","webpack:///./core-bundle/assets/controllers/color-scheme-controller.js","webpack:///./core-bundle/assets/controllers/image-size-controller.js","webpack:///./core-bundle/assets/controllers/jump-targets-controller.js","webpack:///./core-bundle/assets/controllers/limit-height-controller.js","webpack:///./core-bundle/assets/controllers/metawizard-controller.js","webpack:///./core-bundle/assets/controllers/scroll-offset-controller.js","webpack:///./core-bundle/assets/controllers/toggle-fieldset-controller.js","webpack:///./core-bundle/assets/controllers/toggle-navigation-controller.js","webpack:///./core-bundle/assets/controllers/toggle-nodes-controller.js","webpack:///./core-bundle/assets/scripts/core.js","webpack:///./core-bundle/assets/scripts/limit-height.js","webpack:///./core-bundle/assets/scripts/modulewizard.js","webpack:///./core-bundle/assets/scripts/mootao.js","webpack:///./core-bundle/assets/scripts/sectionwizard.js","webpack:///./core-bundle/assets/scripts/tips.js","webpack:///./core-bundle/assets/controllers/ sync \\.js$","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./.yarn/__virtual__/@hotwired-stimulus-webpack-helpers-virtual-5fc151b2eb/7/.yarn/berry/cache/@hotwired-stimulus-webpack-helpers-npm-1.0.1-91fa2baa17-10c0.zip/node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js","webpack:///./core-bundle/assets/backend.js"],"sourcesContent":["/*\nStimulus 3.2.1\nCopyright © 2023 Basecamp, LLC\n */\nclass EventListener {\n    constructor(eventTarget, eventName, eventOptions) {\n        this.eventTarget = eventTarget;\n        this.eventName = eventName;\n        this.eventOptions = eventOptions;\n        this.unorderedBindings = new Set();\n    }\n    connect() {\n        this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n    }\n    disconnect() {\n        this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n    }\n    bindingConnected(binding) {\n        this.unorderedBindings.add(binding);\n    }\n    bindingDisconnected(binding) {\n        this.unorderedBindings.delete(binding);\n    }\n    handleEvent(event) {\n        const extendedEvent = extendEvent(event);\n        for (const binding of this.bindings) {\n            if (extendedEvent.immediatePropagationStopped) {\n                break;\n            }\n            else {\n                binding.handleEvent(extendedEvent);\n            }\n        }\n    }\n    hasBindings() {\n        return this.unorderedBindings.size > 0;\n    }\n    get bindings() {\n        return Array.from(this.unorderedBindings).sort((left, right) => {\n            const leftIndex = left.index, rightIndex = right.index;\n            return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n        });\n    }\n}\nfunction extendEvent(event) {\n    if (\"immediatePropagationStopped\" in event) {\n        return event;\n    }\n    else {\n        const { stopImmediatePropagation } = event;\n        return Object.assign(event, {\n            immediatePropagationStopped: false,\n            stopImmediatePropagation() {\n                this.immediatePropagationStopped = true;\n                stopImmediatePropagation.call(this);\n            },\n        });\n    }\n}\n\nclass Dispatcher {\n    constructor(application) {\n        this.application = application;\n        this.eventListenerMaps = new Map();\n        this.started = false;\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.eventListeners.forEach((eventListener) => eventListener.connect());\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            this.eventListeners.forEach((eventListener) => eventListener.disconnect());\n        }\n    }\n    get eventListeners() {\n        return Array.from(this.eventListenerMaps.values()).reduce((listeners, map) => listeners.concat(Array.from(map.values())), []);\n    }\n    bindingConnected(binding) {\n        this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n    }\n    bindingDisconnected(binding, clearEventListeners = false) {\n        this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n        if (clearEventListeners)\n            this.clearEventListenersForBinding(binding);\n    }\n    handleError(error, message, detail = {}) {\n        this.application.handleError(error, `Error ${message}`, detail);\n    }\n    clearEventListenersForBinding(binding) {\n        const eventListener = this.fetchEventListenerForBinding(binding);\n        if (!eventListener.hasBindings()) {\n            eventListener.disconnect();\n            this.removeMappedEventListenerFor(binding);\n        }\n    }\n    removeMappedEventListenerFor(binding) {\n        const { eventTarget, eventName, eventOptions } = binding;\n        const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n        const cacheKey = this.cacheKey(eventName, eventOptions);\n        eventListenerMap.delete(cacheKey);\n        if (eventListenerMap.size == 0)\n            this.eventListenerMaps.delete(eventTarget);\n    }\n    fetchEventListenerForBinding(binding) {\n        const { eventTarget, eventName, eventOptions } = binding;\n        return this.fetchEventListener(eventTarget, eventName, eventOptions);\n    }\n    fetchEventListener(eventTarget, eventName, eventOptions) {\n        const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n        const cacheKey = this.cacheKey(eventName, eventOptions);\n        let eventListener = eventListenerMap.get(cacheKey);\n        if (!eventListener) {\n            eventListener = this.createEventListener(eventTarget, eventName, eventOptions);\n            eventListenerMap.set(cacheKey, eventListener);\n        }\n        return eventListener;\n    }\n    createEventListener(eventTarget, eventName, eventOptions) {\n        const eventListener = new EventListener(eventTarget, eventName, eventOptions);\n        if (this.started) {\n            eventListener.connect();\n        }\n        return eventListener;\n    }\n    fetchEventListenerMapForEventTarget(eventTarget) {\n        let eventListenerMap = this.eventListenerMaps.get(eventTarget);\n        if (!eventListenerMap) {\n            eventListenerMap = new Map();\n            this.eventListenerMaps.set(eventTarget, eventListenerMap);\n        }\n        return eventListenerMap;\n    }\n    cacheKey(eventName, eventOptions) {\n        const parts = [eventName];\n        Object.keys(eventOptions)\n            .sort()\n            .forEach((key) => {\n            parts.push(`${eventOptions[key] ? \"\" : \"!\"}${key}`);\n        });\n        return parts.join(\":\");\n    }\n}\n\nconst defaultActionDescriptorFilters = {\n    stop({ event, value }) {\n        if (value)\n            event.stopPropagation();\n        return true;\n    },\n    prevent({ event, value }) {\n        if (value)\n            event.preventDefault();\n        return true;\n    },\n    self({ event, value, element }) {\n        if (value) {\n            return element === event.target;\n        }\n        else {\n            return true;\n        }\n    },\n};\nconst descriptorPattern = /^(?:(?:([^.]+?)\\+)?(.+?)(?:\\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n    const source = descriptorString.trim();\n    const matches = source.match(descriptorPattern) || [];\n    let eventName = matches[2];\n    let keyFilter = matches[3];\n    if (keyFilter && ![\"keydown\", \"keyup\", \"keypress\"].includes(eventName)) {\n        eventName += `.${keyFilter}`;\n        keyFilter = \"\";\n    }\n    return {\n        eventTarget: parseEventTarget(matches[4]),\n        eventName,\n        eventOptions: matches[7] ? parseEventOptions(matches[7]) : {},\n        identifier: matches[5],\n        methodName: matches[6],\n        keyFilter: matches[1] || keyFilter,\n    };\n}\nfunction parseEventTarget(eventTargetName) {\n    if (eventTargetName == \"window\") {\n        return window;\n    }\n    else if (eventTargetName == \"document\") {\n        return document;\n    }\n}\nfunction parseEventOptions(eventOptions) {\n    return eventOptions\n        .split(\":\")\n        .reduce((options, token) => Object.assign(options, { [token.replace(/^!/, \"\")]: !/^!/.test(token) }), {});\n}\nfunction stringifyEventTarget(eventTarget) {\n    if (eventTarget == window) {\n        return \"window\";\n    }\n    else if (eventTarget == document) {\n        return \"document\";\n    }\n}\n\nfunction camelize(value) {\n    return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());\n}\nfunction namespaceCamelize(value) {\n    return camelize(value.replace(/--/g, \"-\").replace(/__/g, \"_\"));\n}\nfunction capitalize(value) {\n    return value.charAt(0).toUpperCase() + value.slice(1);\n}\nfunction dasherize(value) {\n    return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`);\n}\nfunction tokenize(value) {\n    return value.match(/[^\\s]+/g) || [];\n}\n\nfunction isSomething(object) {\n    return object !== null && object !== undefined;\n}\nfunction hasProperty(object, property) {\n    return Object.prototype.hasOwnProperty.call(object, property);\n}\n\nconst allModifiers = [\"meta\", \"ctrl\", \"alt\", \"shift\"];\nclass Action {\n    constructor(element, index, descriptor, schema) {\n        this.element = element;\n        this.index = index;\n        this.eventTarget = descriptor.eventTarget || element;\n        this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error(\"missing event name\");\n        this.eventOptions = descriptor.eventOptions || {};\n        this.identifier = descriptor.identifier || error(\"missing identifier\");\n        this.methodName = descriptor.methodName || error(\"missing method name\");\n        this.keyFilter = descriptor.keyFilter || \"\";\n        this.schema = schema;\n    }\n    static forToken(token, schema) {\n        return new this(token.element, token.index, parseActionDescriptorString(token.content), schema);\n    }\n    toString() {\n        const eventFilter = this.keyFilter ? `.${this.keyFilter}` : \"\";\n        const eventTarget = this.eventTargetName ? `@${this.eventTargetName}` : \"\";\n        return `${this.eventName}${eventFilter}${eventTarget}->${this.identifier}#${this.methodName}`;\n    }\n    shouldIgnoreKeyboardEvent(event) {\n        if (!this.keyFilter) {\n            return false;\n        }\n        const filters = this.keyFilter.split(\"+\");\n        if (this.keyFilterDissatisfied(event, filters)) {\n            return true;\n        }\n        const standardFilter = filters.filter((key) => !allModifiers.includes(key))[0];\n        if (!standardFilter) {\n            return false;\n        }\n        if (!hasProperty(this.keyMappings, standardFilter)) {\n            error(`contains unknown key filter: ${this.keyFilter}`);\n        }\n        return this.keyMappings[standardFilter].toLowerCase() !== event.key.toLowerCase();\n    }\n    shouldIgnoreMouseEvent(event) {\n        if (!this.keyFilter) {\n            return false;\n        }\n        const filters = [this.keyFilter];\n        if (this.keyFilterDissatisfied(event, filters)) {\n            return true;\n        }\n        return false;\n    }\n    get params() {\n        const params = {};\n        const pattern = new RegExp(`^data-${this.identifier}-(.+)-param$`, \"i\");\n        for (const { name, value } of Array.from(this.element.attributes)) {\n            const match = name.match(pattern);\n            const key = match && match[1];\n            if (key) {\n                params[camelize(key)] = typecast(value);\n            }\n        }\n        return params;\n    }\n    get eventTargetName() {\n        return stringifyEventTarget(this.eventTarget);\n    }\n    get keyMappings() {\n        return this.schema.keyMappings;\n    }\n    keyFilterDissatisfied(event, filters) {\n        const [meta, ctrl, alt, shift] = allModifiers.map((modifier) => filters.includes(modifier));\n        return event.metaKey !== meta || event.ctrlKey !== ctrl || event.altKey !== alt || event.shiftKey !== shift;\n    }\n}\nconst defaultEventNames = {\n    a: () => \"click\",\n    button: () => \"click\",\n    form: () => \"submit\",\n    details: () => \"toggle\",\n    input: (e) => (e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\"),\n    select: () => \"change\",\n    textarea: () => \"input\",\n};\nfunction getDefaultEventNameForElement(element) {\n    const tagName = element.tagName.toLowerCase();\n    if (tagName in defaultEventNames) {\n        return defaultEventNames[tagName](element);\n    }\n}\nfunction error(message) {\n    throw new Error(message);\n}\nfunction typecast(value) {\n    try {\n        return JSON.parse(value);\n    }\n    catch (o_O) {\n        return value;\n    }\n}\n\nclass Binding {\n    constructor(context, action) {\n        this.context = context;\n        this.action = action;\n    }\n    get index() {\n        return this.action.index;\n    }\n    get eventTarget() {\n        return this.action.eventTarget;\n    }\n    get eventOptions() {\n        return this.action.eventOptions;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    handleEvent(event) {\n        const actionEvent = this.prepareActionEvent(event);\n        if (this.willBeInvokedByEvent(event) && this.applyEventModifiers(actionEvent)) {\n            this.invokeWithEvent(actionEvent);\n        }\n    }\n    get eventName() {\n        return this.action.eventName;\n    }\n    get method() {\n        const method = this.controller[this.methodName];\n        if (typeof method == \"function\") {\n            return method;\n        }\n        throw new Error(`Action \"${this.action}\" references undefined method \"${this.methodName}\"`);\n    }\n    applyEventModifiers(event) {\n        const { element } = this.action;\n        const { actionDescriptorFilters } = this.context.application;\n        const { controller } = this.context;\n        let passes = true;\n        for (const [name, value] of Object.entries(this.eventOptions)) {\n            if (name in actionDescriptorFilters) {\n                const filter = actionDescriptorFilters[name];\n                passes = passes && filter({ name, value, event, element, controller });\n            }\n            else {\n                continue;\n            }\n        }\n        return passes;\n    }\n    prepareActionEvent(event) {\n        return Object.assign(event, { params: this.action.params });\n    }\n    invokeWithEvent(event) {\n        const { target, currentTarget } = event;\n        try {\n            this.method.call(this.controller, event);\n            this.context.logDebugActivity(this.methodName, { event, target, currentTarget, action: this.methodName });\n        }\n        catch (error) {\n            const { identifier, controller, element, index } = this;\n            const detail = { identifier, controller, element, index, event };\n            this.context.handleError(error, `invoking action \"${this.action}\"`, detail);\n        }\n    }\n    willBeInvokedByEvent(event) {\n        const eventTarget = event.target;\n        if (event instanceof KeyboardEvent && this.action.shouldIgnoreKeyboardEvent(event)) {\n            return false;\n        }\n        if (event instanceof MouseEvent && this.action.shouldIgnoreMouseEvent(event)) {\n            return false;\n        }\n        if (this.element === eventTarget) {\n            return true;\n        }\n        else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n            return this.scope.containsElement(eventTarget);\n        }\n        else {\n            return this.scope.containsElement(this.action.element);\n        }\n    }\n    get controller() {\n        return this.context.controller;\n    }\n    get methodName() {\n        return this.action.methodName;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n}\n\nclass ElementObserver {\n    constructor(element, delegate) {\n        this.mutationObserverInit = { attributes: true, childList: true, subtree: true };\n        this.element = element;\n        this.started = false;\n        this.delegate = delegate;\n        this.elements = new Set();\n        this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.mutationObserver.observe(this.element, this.mutationObserverInit);\n            this.refresh();\n        }\n    }\n    pause(callback) {\n        if (this.started) {\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n        callback();\n        if (!this.started) {\n            this.mutationObserver.observe(this.element, this.mutationObserverInit);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.mutationObserver.takeRecords();\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n    }\n    refresh() {\n        if (this.started) {\n            const matches = new Set(this.matchElementsInTree());\n            for (const element of Array.from(this.elements)) {\n                if (!matches.has(element)) {\n                    this.removeElement(element);\n                }\n            }\n            for (const element of Array.from(matches)) {\n                this.addElement(element);\n            }\n        }\n    }\n    processMutations(mutations) {\n        if (this.started) {\n            for (const mutation of mutations) {\n                this.processMutation(mutation);\n            }\n        }\n    }\n    processMutation(mutation) {\n        if (mutation.type == \"attributes\") {\n            this.processAttributeChange(mutation.target, mutation.attributeName);\n        }\n        else if (mutation.type == \"childList\") {\n            this.processRemovedNodes(mutation.removedNodes);\n            this.processAddedNodes(mutation.addedNodes);\n        }\n    }\n    processAttributeChange(element, attributeName) {\n        if (this.elements.has(element)) {\n            if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n                this.delegate.elementAttributeChanged(element, attributeName);\n            }\n            else {\n                this.removeElement(element);\n            }\n        }\n        else if (this.matchElement(element)) {\n            this.addElement(element);\n        }\n    }\n    processRemovedNodes(nodes) {\n        for (const node of Array.from(nodes)) {\n            const element = this.elementFromNode(node);\n            if (element) {\n                this.processTree(element, this.removeElement);\n            }\n        }\n    }\n    processAddedNodes(nodes) {\n        for (const node of Array.from(nodes)) {\n            const element = this.elementFromNode(node);\n            if (element && this.elementIsActive(element)) {\n                this.processTree(element, this.addElement);\n            }\n        }\n    }\n    matchElement(element) {\n        return this.delegate.matchElement(element);\n    }\n    matchElementsInTree(tree = this.element) {\n        return this.delegate.matchElementsInTree(tree);\n    }\n    processTree(tree, processor) {\n        for (const element of this.matchElementsInTree(tree)) {\n            processor.call(this, element);\n        }\n    }\n    elementFromNode(node) {\n        if (node.nodeType == Node.ELEMENT_NODE) {\n            return node;\n        }\n    }\n    elementIsActive(element) {\n        if (element.isConnected != this.element.isConnected) {\n            return false;\n        }\n        else {\n            return this.element.contains(element);\n        }\n    }\n    addElement(element) {\n        if (!this.elements.has(element)) {\n            if (this.elementIsActive(element)) {\n                this.elements.add(element);\n                if (this.delegate.elementMatched) {\n                    this.delegate.elementMatched(element);\n                }\n            }\n        }\n    }\n    removeElement(element) {\n        if (this.elements.has(element)) {\n            this.elements.delete(element);\n            if (this.delegate.elementUnmatched) {\n                this.delegate.elementUnmatched(element);\n            }\n        }\n    }\n}\n\nclass AttributeObserver {\n    constructor(element, attributeName, delegate) {\n        this.attributeName = attributeName;\n        this.delegate = delegate;\n        this.elementObserver = new ElementObserver(element, this);\n    }\n    get element() {\n        return this.elementObserver.element;\n    }\n    get selector() {\n        return `[${this.attributeName}]`;\n    }\n    start() {\n        this.elementObserver.start();\n    }\n    pause(callback) {\n        this.elementObserver.pause(callback);\n    }\n    stop() {\n        this.elementObserver.stop();\n    }\n    refresh() {\n        this.elementObserver.refresh();\n    }\n    get started() {\n        return this.elementObserver.started;\n    }\n    matchElement(element) {\n        return element.hasAttribute(this.attributeName);\n    }\n    matchElementsInTree(tree) {\n        const match = this.matchElement(tree) ? [tree] : [];\n        const matches = Array.from(tree.querySelectorAll(this.selector));\n        return match.concat(matches);\n    }\n    elementMatched(element) {\n        if (this.delegate.elementMatchedAttribute) {\n            this.delegate.elementMatchedAttribute(element, this.attributeName);\n        }\n    }\n    elementUnmatched(element) {\n        if (this.delegate.elementUnmatchedAttribute) {\n            this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n        }\n    }\n    elementAttributeChanged(element, attributeName) {\n        if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n            this.delegate.elementAttributeValueChanged(element, attributeName);\n        }\n    }\n}\n\nfunction add(map, key, value) {\n    fetch(map, key).add(value);\n}\nfunction del(map, key, value) {\n    fetch(map, key).delete(value);\n    prune(map, key);\n}\nfunction fetch(map, key) {\n    let values = map.get(key);\n    if (!values) {\n        values = new Set();\n        map.set(key, values);\n    }\n    return values;\n}\nfunction prune(map, key) {\n    const values = map.get(key);\n    if (values != null && values.size == 0) {\n        map.delete(key);\n    }\n}\n\nclass Multimap {\n    constructor() {\n        this.valuesByKey = new Map();\n    }\n    get keys() {\n        return Array.from(this.valuesByKey.keys());\n    }\n    get values() {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.reduce((values, set) => values.concat(Array.from(set)), []);\n    }\n    get size() {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.reduce((size, set) => size + set.size, 0);\n    }\n    add(key, value) {\n        add(this.valuesByKey, key, value);\n    }\n    delete(key, value) {\n        del(this.valuesByKey, key, value);\n    }\n    has(key, value) {\n        const values = this.valuesByKey.get(key);\n        return values != null && values.has(value);\n    }\n    hasKey(key) {\n        return this.valuesByKey.has(key);\n    }\n    hasValue(value) {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.some((set) => set.has(value));\n    }\n    getValuesForKey(key) {\n        const values = this.valuesByKey.get(key);\n        return values ? Array.from(values) : [];\n    }\n    getKeysForValue(value) {\n        return Array.from(this.valuesByKey)\n            .filter(([_key, values]) => values.has(value))\n            .map(([key, _values]) => key);\n    }\n}\n\nclass IndexedMultimap extends Multimap {\n    constructor() {\n        super();\n        this.keysByValue = new Map();\n    }\n    get values() {\n        return Array.from(this.keysByValue.keys());\n    }\n    add(key, value) {\n        super.add(key, value);\n        add(this.keysByValue, value, key);\n    }\n    delete(key, value) {\n        super.delete(key, value);\n        del(this.keysByValue, value, key);\n    }\n    hasValue(value) {\n        return this.keysByValue.has(value);\n    }\n    getKeysForValue(value) {\n        const set = this.keysByValue.get(value);\n        return set ? Array.from(set) : [];\n    }\n}\n\nclass SelectorObserver {\n    constructor(element, selector, delegate, details) {\n        this._selector = selector;\n        this.details = details;\n        this.elementObserver = new ElementObserver(element, this);\n        this.delegate = delegate;\n        this.matchesByElement = new Multimap();\n    }\n    get started() {\n        return this.elementObserver.started;\n    }\n    get selector() {\n        return this._selector;\n    }\n    set selector(selector) {\n        this._selector = selector;\n        this.refresh();\n    }\n    start() {\n        this.elementObserver.start();\n    }\n    pause(callback) {\n        this.elementObserver.pause(callback);\n    }\n    stop() {\n        this.elementObserver.stop();\n    }\n    refresh() {\n        this.elementObserver.refresh();\n    }\n    get element() {\n        return this.elementObserver.element;\n    }\n    matchElement(element) {\n        const { selector } = this;\n        if (selector) {\n            const matches = element.matches(selector);\n            if (this.delegate.selectorMatchElement) {\n                return matches && this.delegate.selectorMatchElement(element, this.details);\n            }\n            return matches;\n        }\n        else {\n            return false;\n        }\n    }\n    matchElementsInTree(tree) {\n        const { selector } = this;\n        if (selector) {\n            const match = this.matchElement(tree) ? [tree] : [];\n            const matches = Array.from(tree.querySelectorAll(selector)).filter((match) => this.matchElement(match));\n            return match.concat(matches);\n        }\n        else {\n            return [];\n        }\n    }\n    elementMatched(element) {\n        const { selector } = this;\n        if (selector) {\n            this.selectorMatched(element, selector);\n        }\n    }\n    elementUnmatched(element) {\n        const selectors = this.matchesByElement.getKeysForValue(element);\n        for (const selector of selectors) {\n            this.selectorUnmatched(element, selector);\n        }\n    }\n    elementAttributeChanged(element, _attributeName) {\n        const { selector } = this;\n        if (selector) {\n            const matches = this.matchElement(element);\n            const matchedBefore = this.matchesByElement.has(selector, element);\n            if (matches && !matchedBefore) {\n                this.selectorMatched(element, selector);\n            }\n            else if (!matches && matchedBefore) {\n                this.selectorUnmatched(element, selector);\n            }\n        }\n    }\n    selectorMatched(element, selector) {\n        this.delegate.selectorMatched(element, selector, this.details);\n        this.matchesByElement.add(selector, element);\n    }\n    selectorUnmatched(element, selector) {\n        this.delegate.selectorUnmatched(element, selector, this.details);\n        this.matchesByElement.delete(selector, element);\n    }\n}\n\nclass StringMapObserver {\n    constructor(element, delegate) {\n        this.element = element;\n        this.delegate = delegate;\n        this.started = false;\n        this.stringMap = new Map();\n        this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.mutationObserver.observe(this.element, { attributes: true, attributeOldValue: true });\n            this.refresh();\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.mutationObserver.takeRecords();\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n    }\n    refresh() {\n        if (this.started) {\n            for (const attributeName of this.knownAttributeNames) {\n                this.refreshAttribute(attributeName, null);\n            }\n        }\n    }\n    processMutations(mutations) {\n        if (this.started) {\n            for (const mutation of mutations) {\n                this.processMutation(mutation);\n            }\n        }\n    }\n    processMutation(mutation) {\n        const attributeName = mutation.attributeName;\n        if (attributeName) {\n            this.refreshAttribute(attributeName, mutation.oldValue);\n        }\n    }\n    refreshAttribute(attributeName, oldValue) {\n        const key = this.delegate.getStringMapKeyForAttribute(attributeName);\n        if (key != null) {\n            if (!this.stringMap.has(attributeName)) {\n                this.stringMapKeyAdded(key, attributeName);\n            }\n            const value = this.element.getAttribute(attributeName);\n            if (this.stringMap.get(attributeName) != value) {\n                this.stringMapValueChanged(value, key, oldValue);\n            }\n            if (value == null) {\n                const oldValue = this.stringMap.get(attributeName);\n                this.stringMap.delete(attributeName);\n                if (oldValue)\n                    this.stringMapKeyRemoved(key, attributeName, oldValue);\n            }\n            else {\n                this.stringMap.set(attributeName, value);\n            }\n        }\n    }\n    stringMapKeyAdded(key, attributeName) {\n        if (this.delegate.stringMapKeyAdded) {\n            this.delegate.stringMapKeyAdded(key, attributeName);\n        }\n    }\n    stringMapValueChanged(value, key, oldValue) {\n        if (this.delegate.stringMapValueChanged) {\n            this.delegate.stringMapValueChanged(value, key, oldValue);\n        }\n    }\n    stringMapKeyRemoved(key, attributeName, oldValue) {\n        if (this.delegate.stringMapKeyRemoved) {\n            this.delegate.stringMapKeyRemoved(key, attributeName, oldValue);\n        }\n    }\n    get knownAttributeNames() {\n        return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n    }\n    get currentAttributeNames() {\n        return Array.from(this.element.attributes).map((attribute) => attribute.name);\n    }\n    get recordedAttributeNames() {\n        return Array.from(this.stringMap.keys());\n    }\n}\n\nclass TokenListObserver {\n    constructor(element, attributeName, delegate) {\n        this.attributeObserver = new AttributeObserver(element, attributeName, this);\n        this.delegate = delegate;\n        this.tokensByElement = new Multimap();\n    }\n    get started() {\n        return this.attributeObserver.started;\n    }\n    start() {\n        this.attributeObserver.start();\n    }\n    pause(callback) {\n        this.attributeObserver.pause(callback);\n    }\n    stop() {\n        this.attributeObserver.stop();\n    }\n    refresh() {\n        this.attributeObserver.refresh();\n    }\n    get element() {\n        return this.attributeObserver.element;\n    }\n    get attributeName() {\n        return this.attributeObserver.attributeName;\n    }\n    elementMatchedAttribute(element) {\n        this.tokensMatched(this.readTokensForElement(element));\n    }\n    elementAttributeValueChanged(element) {\n        const [unmatchedTokens, matchedTokens] = this.refreshTokensForElement(element);\n        this.tokensUnmatched(unmatchedTokens);\n        this.tokensMatched(matchedTokens);\n    }\n    elementUnmatchedAttribute(element) {\n        this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n    }\n    tokensMatched(tokens) {\n        tokens.forEach((token) => this.tokenMatched(token));\n    }\n    tokensUnmatched(tokens) {\n        tokens.forEach((token) => this.tokenUnmatched(token));\n    }\n    tokenMatched(token) {\n        this.delegate.tokenMatched(token);\n        this.tokensByElement.add(token.element, token);\n    }\n    tokenUnmatched(token) {\n        this.delegate.tokenUnmatched(token);\n        this.tokensByElement.delete(token.element, token);\n    }\n    refreshTokensForElement(element) {\n        const previousTokens = this.tokensByElement.getValuesForKey(element);\n        const currentTokens = this.readTokensForElement(element);\n        const firstDifferingIndex = zip(previousTokens, currentTokens).findIndex(([previousToken, currentToken]) => !tokensAreEqual(previousToken, currentToken));\n        if (firstDifferingIndex == -1) {\n            return [[], []];\n        }\n        else {\n            return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n        }\n    }\n    readTokensForElement(element) {\n        const attributeName = this.attributeName;\n        const tokenString = element.getAttribute(attributeName) || \"\";\n        return parseTokenString(tokenString, element, attributeName);\n    }\n}\nfunction parseTokenString(tokenString, element, attributeName) {\n    return tokenString\n        .trim()\n        .split(/\\s+/)\n        .filter((content) => content.length)\n        .map((content, index) => ({ element, attributeName, content, index }));\n}\nfunction zip(left, right) {\n    const length = Math.max(left.length, right.length);\n    return Array.from({ length }, (_, index) => [left[index], right[index]]);\n}\nfunction tokensAreEqual(left, right) {\n    return left && right && left.index == right.index && left.content == right.content;\n}\n\nclass ValueListObserver {\n    constructor(element, attributeName, delegate) {\n        this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n        this.delegate = delegate;\n        this.parseResultsByToken = new WeakMap();\n        this.valuesByTokenByElement = new WeakMap();\n    }\n    get started() {\n        return this.tokenListObserver.started;\n    }\n    start() {\n        this.tokenListObserver.start();\n    }\n    stop() {\n        this.tokenListObserver.stop();\n    }\n    refresh() {\n        this.tokenListObserver.refresh();\n    }\n    get element() {\n        return this.tokenListObserver.element;\n    }\n    get attributeName() {\n        return this.tokenListObserver.attributeName;\n    }\n    tokenMatched(token) {\n        const { element } = token;\n        const { value } = this.fetchParseResultForToken(token);\n        if (value) {\n            this.fetchValuesByTokenForElement(element).set(token, value);\n            this.delegate.elementMatchedValue(element, value);\n        }\n    }\n    tokenUnmatched(token) {\n        const { element } = token;\n        const { value } = this.fetchParseResultForToken(token);\n        if (value) {\n            this.fetchValuesByTokenForElement(element).delete(token);\n            this.delegate.elementUnmatchedValue(element, value);\n        }\n    }\n    fetchParseResultForToken(token) {\n        let parseResult = this.parseResultsByToken.get(token);\n        if (!parseResult) {\n            parseResult = this.parseToken(token);\n            this.parseResultsByToken.set(token, parseResult);\n        }\n        return parseResult;\n    }\n    fetchValuesByTokenForElement(element) {\n        let valuesByToken = this.valuesByTokenByElement.get(element);\n        if (!valuesByToken) {\n            valuesByToken = new Map();\n            this.valuesByTokenByElement.set(element, valuesByToken);\n        }\n        return valuesByToken;\n    }\n    parseToken(token) {\n        try {\n            const value = this.delegate.parseValueForToken(token);\n            return { value };\n        }\n        catch (error) {\n            return { error };\n        }\n    }\n}\n\nclass BindingObserver {\n    constructor(context, delegate) {\n        this.context = context;\n        this.delegate = delegate;\n        this.bindingsByAction = new Map();\n    }\n    start() {\n        if (!this.valueListObserver) {\n            this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n            this.valueListObserver.start();\n        }\n    }\n    stop() {\n        if (this.valueListObserver) {\n            this.valueListObserver.stop();\n            delete this.valueListObserver;\n            this.disconnectAllActions();\n        }\n    }\n    get element() {\n        return this.context.element;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    get actionAttribute() {\n        return this.schema.actionAttribute;\n    }\n    get schema() {\n        return this.context.schema;\n    }\n    get bindings() {\n        return Array.from(this.bindingsByAction.values());\n    }\n    connectAction(action) {\n        const binding = new Binding(this.context, action);\n        this.bindingsByAction.set(action, binding);\n        this.delegate.bindingConnected(binding);\n    }\n    disconnectAction(action) {\n        const binding = this.bindingsByAction.get(action);\n        if (binding) {\n            this.bindingsByAction.delete(action);\n            this.delegate.bindingDisconnected(binding);\n        }\n    }\n    disconnectAllActions() {\n        this.bindings.forEach((binding) => this.delegate.bindingDisconnected(binding, true));\n        this.bindingsByAction.clear();\n    }\n    parseValueForToken(token) {\n        const action = Action.forToken(token, this.schema);\n        if (action.identifier == this.identifier) {\n            return action;\n        }\n    }\n    elementMatchedValue(element, action) {\n        this.connectAction(action);\n    }\n    elementUnmatchedValue(element, action) {\n        this.disconnectAction(action);\n    }\n}\n\nclass ValueObserver {\n    constructor(context, receiver) {\n        this.context = context;\n        this.receiver = receiver;\n        this.stringMapObserver = new StringMapObserver(this.element, this);\n        this.valueDescriptorMap = this.controller.valueDescriptorMap;\n    }\n    start() {\n        this.stringMapObserver.start();\n        this.invokeChangedCallbacksForDefaultValues();\n    }\n    stop() {\n        this.stringMapObserver.stop();\n    }\n    get element() {\n        return this.context.element;\n    }\n    get controller() {\n        return this.context.controller;\n    }\n    getStringMapKeyForAttribute(attributeName) {\n        if (attributeName in this.valueDescriptorMap) {\n            return this.valueDescriptorMap[attributeName].name;\n        }\n    }\n    stringMapKeyAdded(key, attributeName) {\n        const descriptor = this.valueDescriptorMap[attributeName];\n        if (!this.hasValue(key)) {\n            this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), descriptor.writer(descriptor.defaultValue));\n        }\n    }\n    stringMapValueChanged(value, name, oldValue) {\n        const descriptor = this.valueDescriptorNameMap[name];\n        if (value === null)\n            return;\n        if (oldValue === null) {\n            oldValue = descriptor.writer(descriptor.defaultValue);\n        }\n        this.invokeChangedCallback(name, value, oldValue);\n    }\n    stringMapKeyRemoved(key, attributeName, oldValue) {\n        const descriptor = this.valueDescriptorNameMap[key];\n        if (this.hasValue(key)) {\n            this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), oldValue);\n        }\n        else {\n            this.invokeChangedCallback(key, descriptor.writer(descriptor.defaultValue), oldValue);\n        }\n    }\n    invokeChangedCallbacksForDefaultValues() {\n        for (const { key, name, defaultValue, writer } of this.valueDescriptors) {\n            if (defaultValue != undefined && !this.controller.data.has(key)) {\n                this.invokeChangedCallback(name, writer(defaultValue), undefined);\n            }\n        }\n    }\n    invokeChangedCallback(name, rawValue, rawOldValue) {\n        const changedMethodName = `${name}Changed`;\n        const changedMethod = this.receiver[changedMethodName];\n        if (typeof changedMethod == \"function\") {\n            const descriptor = this.valueDescriptorNameMap[name];\n            try {\n                const value = descriptor.reader(rawValue);\n                let oldValue = rawOldValue;\n                if (rawOldValue) {\n                    oldValue = descriptor.reader(rawOldValue);\n                }\n                changedMethod.call(this.receiver, value, oldValue);\n            }\n            catch (error) {\n                if (error instanceof TypeError) {\n                    error.message = `Stimulus Value \"${this.context.identifier}.${descriptor.name}\" - ${error.message}`;\n                }\n                throw error;\n            }\n        }\n    }\n    get valueDescriptors() {\n        const { valueDescriptorMap } = this;\n        return Object.keys(valueDescriptorMap).map((key) => valueDescriptorMap[key]);\n    }\n    get valueDescriptorNameMap() {\n        const descriptors = {};\n        Object.keys(this.valueDescriptorMap).forEach((key) => {\n            const descriptor = this.valueDescriptorMap[key];\n            descriptors[descriptor.name] = descriptor;\n        });\n        return descriptors;\n    }\n    hasValue(attributeName) {\n        const descriptor = this.valueDescriptorNameMap[attributeName];\n        const hasMethodName = `has${capitalize(descriptor.name)}`;\n        return this.receiver[hasMethodName];\n    }\n}\n\nclass TargetObserver {\n    constructor(context, delegate) {\n        this.context = context;\n        this.delegate = delegate;\n        this.targetsByName = new Multimap();\n    }\n    start() {\n        if (!this.tokenListObserver) {\n            this.tokenListObserver = new TokenListObserver(this.element, this.attributeName, this);\n            this.tokenListObserver.start();\n        }\n    }\n    stop() {\n        if (this.tokenListObserver) {\n            this.disconnectAllTargets();\n            this.tokenListObserver.stop();\n            delete this.tokenListObserver;\n        }\n    }\n    tokenMatched({ element, content: name }) {\n        if (this.scope.containsElement(element)) {\n            this.connectTarget(element, name);\n        }\n    }\n    tokenUnmatched({ element, content: name }) {\n        this.disconnectTarget(element, name);\n    }\n    connectTarget(element, name) {\n        var _a;\n        if (!this.targetsByName.has(name, element)) {\n            this.targetsByName.add(name, element);\n            (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetConnected(element, name));\n        }\n    }\n    disconnectTarget(element, name) {\n        var _a;\n        if (this.targetsByName.has(name, element)) {\n            this.targetsByName.delete(name, element);\n            (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetDisconnected(element, name));\n        }\n    }\n    disconnectAllTargets() {\n        for (const name of this.targetsByName.keys) {\n            for (const element of this.targetsByName.getValuesForKey(name)) {\n                this.disconnectTarget(element, name);\n            }\n        }\n    }\n    get attributeName() {\n        return `data-${this.context.identifier}-target`;\n    }\n    get element() {\n        return this.context.element;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n}\n\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n    const ancestors = getAncestorsForConstructor(constructor);\n    return Array.from(ancestors.reduce((values, constructor) => {\n        getOwnStaticArrayValues(constructor, propertyName).forEach((name) => values.add(name));\n        return values;\n    }, new Set()));\n}\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n    const ancestors = getAncestorsForConstructor(constructor);\n    return ancestors.reduce((pairs, constructor) => {\n        pairs.push(...getOwnStaticObjectPairs(constructor, propertyName));\n        return pairs;\n    }, []);\n}\nfunction getAncestorsForConstructor(constructor) {\n    const ancestors = [];\n    while (constructor) {\n        ancestors.push(constructor);\n        constructor = Object.getPrototypeOf(constructor);\n    }\n    return ancestors.reverse();\n}\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n    const definition = constructor[propertyName];\n    return Array.isArray(definition) ? definition : [];\n}\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n    const definition = constructor[propertyName];\n    return definition ? Object.keys(definition).map((key) => [key, definition[key]]) : [];\n}\n\nclass OutletObserver {\n    constructor(context, delegate) {\n        this.started = false;\n        this.context = context;\n        this.delegate = delegate;\n        this.outletsByName = new Multimap();\n        this.outletElementsByName = new Multimap();\n        this.selectorObserverMap = new Map();\n        this.attributeObserverMap = new Map();\n    }\n    start() {\n        if (!this.started) {\n            this.outletDefinitions.forEach((outletName) => {\n                this.setupSelectorObserverForOutlet(outletName);\n                this.setupAttributeObserverForOutlet(outletName);\n            });\n            this.started = true;\n            this.dependentContexts.forEach((context) => context.refresh());\n        }\n    }\n    refresh() {\n        this.selectorObserverMap.forEach((observer) => observer.refresh());\n        this.attributeObserverMap.forEach((observer) => observer.refresh());\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            this.disconnectAllOutlets();\n            this.stopSelectorObservers();\n            this.stopAttributeObservers();\n        }\n    }\n    stopSelectorObservers() {\n        if (this.selectorObserverMap.size > 0) {\n            this.selectorObserverMap.forEach((observer) => observer.stop());\n            this.selectorObserverMap.clear();\n        }\n    }\n    stopAttributeObservers() {\n        if (this.attributeObserverMap.size > 0) {\n            this.attributeObserverMap.forEach((observer) => observer.stop());\n            this.attributeObserverMap.clear();\n        }\n    }\n    selectorMatched(element, _selector, { outletName }) {\n        const outlet = this.getOutlet(element, outletName);\n        if (outlet) {\n            this.connectOutlet(outlet, element, outletName);\n        }\n    }\n    selectorUnmatched(element, _selector, { outletName }) {\n        const outlet = this.getOutletFromMap(element, outletName);\n        if (outlet) {\n            this.disconnectOutlet(outlet, element, outletName);\n        }\n    }\n    selectorMatchElement(element, { outletName }) {\n        const selector = this.selector(outletName);\n        const hasOutlet = this.hasOutlet(element, outletName);\n        const hasOutletController = element.matches(`[${this.schema.controllerAttribute}~=${outletName}]`);\n        if (selector) {\n            return hasOutlet && hasOutletController && element.matches(selector);\n        }\n        else {\n            return false;\n        }\n    }\n    elementMatchedAttribute(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    elementAttributeValueChanged(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    elementUnmatchedAttribute(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    connectOutlet(outlet, element, outletName) {\n        var _a;\n        if (!this.outletElementsByName.has(outletName, element)) {\n            this.outletsByName.add(outletName, outlet);\n            this.outletElementsByName.add(outletName, element);\n            (_a = this.selectorObserverMap.get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletConnected(outlet, element, outletName));\n        }\n    }\n    disconnectOutlet(outlet, element, outletName) {\n        var _a;\n        if (this.outletElementsByName.has(outletName, element)) {\n            this.outletsByName.delete(outletName, outlet);\n            this.outletElementsByName.delete(outletName, element);\n            (_a = this.selectorObserverMap\n                .get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletDisconnected(outlet, element, outletName));\n        }\n    }\n    disconnectAllOutlets() {\n        for (const outletName of this.outletElementsByName.keys) {\n            for (const element of this.outletElementsByName.getValuesForKey(outletName)) {\n                for (const outlet of this.outletsByName.getValuesForKey(outletName)) {\n                    this.disconnectOutlet(outlet, element, outletName);\n                }\n            }\n        }\n    }\n    updateSelectorObserverForOutlet(outletName) {\n        const observer = this.selectorObserverMap.get(outletName);\n        if (observer) {\n            observer.selector = this.selector(outletName);\n        }\n    }\n    setupSelectorObserverForOutlet(outletName) {\n        const selector = this.selector(outletName);\n        const selectorObserver = new SelectorObserver(document.body, selector, this, { outletName });\n        this.selectorObserverMap.set(outletName, selectorObserver);\n        selectorObserver.start();\n    }\n    setupAttributeObserverForOutlet(outletName) {\n        const attributeName = this.attributeNameForOutletName(outletName);\n        const attributeObserver = new AttributeObserver(this.scope.element, attributeName, this);\n        this.attributeObserverMap.set(outletName, attributeObserver);\n        attributeObserver.start();\n    }\n    selector(outletName) {\n        return this.scope.outlets.getSelectorForOutletName(outletName);\n    }\n    attributeNameForOutletName(outletName) {\n        return this.scope.schema.outletAttributeForScope(this.identifier, outletName);\n    }\n    getOutletNameFromOutletAttributeName(attributeName) {\n        return this.outletDefinitions.find((outletName) => this.attributeNameForOutletName(outletName) === attributeName);\n    }\n    get outletDependencies() {\n        const dependencies = new Multimap();\n        this.router.modules.forEach((module) => {\n            const constructor = module.definition.controllerConstructor;\n            const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n            outlets.forEach((outlet) => dependencies.add(outlet, module.identifier));\n        });\n        return dependencies;\n    }\n    get outletDefinitions() {\n        return this.outletDependencies.getKeysForValue(this.identifier);\n    }\n    get dependentControllerIdentifiers() {\n        return this.outletDependencies.getValuesForKey(this.identifier);\n    }\n    get dependentContexts() {\n        const identifiers = this.dependentControllerIdentifiers;\n        return this.router.contexts.filter((context) => identifiers.includes(context.identifier));\n    }\n    hasOutlet(element, outletName) {\n        return !!this.getOutlet(element, outletName) || !!this.getOutletFromMap(element, outletName);\n    }\n    getOutlet(element, outletName) {\n        return this.application.getControllerForElementAndIdentifier(element, outletName);\n    }\n    getOutletFromMap(element, outletName) {\n        return this.outletsByName.getValuesForKey(outletName).find((outlet) => outlet.element === element);\n    }\n    get scope() {\n        return this.context.scope;\n    }\n    get schema() {\n        return this.context.schema;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    get application() {\n        return this.context.application;\n    }\n    get router() {\n        return this.application.router;\n    }\n}\n\nclass Context {\n    constructor(module, scope) {\n        this.logDebugActivity = (functionName, detail = {}) => {\n            const { identifier, controller, element } = this;\n            detail = Object.assign({ identifier, controller, element }, detail);\n            this.application.logDebugActivity(this.identifier, functionName, detail);\n        };\n        this.module = module;\n        this.scope = scope;\n        this.controller = new module.controllerConstructor(this);\n        this.bindingObserver = new BindingObserver(this, this.dispatcher);\n        this.valueObserver = new ValueObserver(this, this.controller);\n        this.targetObserver = new TargetObserver(this, this);\n        this.outletObserver = new OutletObserver(this, this);\n        try {\n            this.controller.initialize();\n            this.logDebugActivity(\"initialize\");\n        }\n        catch (error) {\n            this.handleError(error, \"initializing controller\");\n        }\n    }\n    connect() {\n        this.bindingObserver.start();\n        this.valueObserver.start();\n        this.targetObserver.start();\n        this.outletObserver.start();\n        try {\n            this.controller.connect();\n            this.logDebugActivity(\"connect\");\n        }\n        catch (error) {\n            this.handleError(error, \"connecting controller\");\n        }\n    }\n    refresh() {\n        this.outletObserver.refresh();\n    }\n    disconnect() {\n        try {\n            this.controller.disconnect();\n            this.logDebugActivity(\"disconnect\");\n        }\n        catch (error) {\n            this.handleError(error, \"disconnecting controller\");\n        }\n        this.outletObserver.stop();\n        this.targetObserver.stop();\n        this.valueObserver.stop();\n        this.bindingObserver.stop();\n    }\n    get application() {\n        return this.module.application;\n    }\n    get identifier() {\n        return this.module.identifier;\n    }\n    get schema() {\n        return this.application.schema;\n    }\n    get dispatcher() {\n        return this.application.dispatcher;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get parentElement() {\n        return this.element.parentElement;\n    }\n    handleError(error, message, detail = {}) {\n        const { identifier, controller, element } = this;\n        detail = Object.assign({ identifier, controller, element }, detail);\n        this.application.handleError(error, `Error ${message}`, detail);\n    }\n    targetConnected(element, name) {\n        this.invokeControllerMethod(`${name}TargetConnected`, element);\n    }\n    targetDisconnected(element, name) {\n        this.invokeControllerMethod(`${name}TargetDisconnected`, element);\n    }\n    outletConnected(outlet, element, name) {\n        this.invokeControllerMethod(`${namespaceCamelize(name)}OutletConnected`, outlet, element);\n    }\n    outletDisconnected(outlet, element, name) {\n        this.invokeControllerMethod(`${namespaceCamelize(name)}OutletDisconnected`, outlet, element);\n    }\n    invokeControllerMethod(methodName, ...args) {\n        const controller = this.controller;\n        if (typeof controller[methodName] == \"function\") {\n            controller[methodName](...args);\n        }\n    }\n}\n\nfunction bless(constructor) {\n    return shadow(constructor, getBlessedProperties(constructor));\n}\nfunction shadow(constructor, properties) {\n    const shadowConstructor = extend(constructor);\n    const shadowProperties = getShadowProperties(constructor.prototype, properties);\n    Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n    return shadowConstructor;\n}\nfunction getBlessedProperties(constructor) {\n    const blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n    return blessings.reduce((blessedProperties, blessing) => {\n        const properties = blessing(constructor);\n        for (const key in properties) {\n            const descriptor = blessedProperties[key] || {};\n            blessedProperties[key] = Object.assign(descriptor, properties[key]);\n        }\n        return blessedProperties;\n    }, {});\n}\nfunction getShadowProperties(prototype, properties) {\n    return getOwnKeys(properties).reduce((shadowProperties, key) => {\n        const descriptor = getShadowedDescriptor(prototype, properties, key);\n        if (descriptor) {\n            Object.assign(shadowProperties, { [key]: descriptor });\n        }\n        return shadowProperties;\n    }, {});\n}\nfunction getShadowedDescriptor(prototype, properties, key) {\n    const shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n    const shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n    if (!shadowedByValue) {\n        const descriptor = Object.getOwnPropertyDescriptor(properties, key).value;\n        if (shadowingDescriptor) {\n            descriptor.get = shadowingDescriptor.get || descriptor.get;\n            descriptor.set = shadowingDescriptor.set || descriptor.set;\n        }\n        return descriptor;\n    }\n}\nconst getOwnKeys = (() => {\n    if (typeof Object.getOwnPropertySymbols == \"function\") {\n        return (object) => [...Object.getOwnPropertyNames(object), ...Object.getOwnPropertySymbols(object)];\n    }\n    else {\n        return Object.getOwnPropertyNames;\n    }\n})();\nconst extend = (() => {\n    function extendWithReflect(constructor) {\n        function extended() {\n            return Reflect.construct(constructor, arguments, new.target);\n        }\n        extended.prototype = Object.create(constructor.prototype, {\n            constructor: { value: extended },\n        });\n        Reflect.setPrototypeOf(extended, constructor);\n        return extended;\n    }\n    function testReflectExtension() {\n        const a = function () {\n            this.a.call(this);\n        };\n        const b = extendWithReflect(a);\n        b.prototype.a = function () { };\n        return new b();\n    }\n    try {\n        testReflectExtension();\n        return extendWithReflect;\n    }\n    catch (error) {\n        return (constructor) => class extended extends constructor {\n        };\n    }\n})();\n\nfunction blessDefinition(definition) {\n    return {\n        identifier: definition.identifier,\n        controllerConstructor: bless(definition.controllerConstructor),\n    };\n}\n\nclass Module {\n    constructor(application, definition) {\n        this.application = application;\n        this.definition = blessDefinition(definition);\n        this.contextsByScope = new WeakMap();\n        this.connectedContexts = new Set();\n    }\n    get identifier() {\n        return this.definition.identifier;\n    }\n    get controllerConstructor() {\n        return this.definition.controllerConstructor;\n    }\n    get contexts() {\n        return Array.from(this.connectedContexts);\n    }\n    connectContextForScope(scope) {\n        const context = this.fetchContextForScope(scope);\n        this.connectedContexts.add(context);\n        context.connect();\n    }\n    disconnectContextForScope(scope) {\n        const context = this.contextsByScope.get(scope);\n        if (context) {\n            this.connectedContexts.delete(context);\n            context.disconnect();\n        }\n    }\n    fetchContextForScope(scope) {\n        let context = this.contextsByScope.get(scope);\n        if (!context) {\n            context = new Context(this, scope);\n            this.contextsByScope.set(scope, context);\n        }\n        return context;\n    }\n}\n\nclass ClassMap {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    has(name) {\n        return this.data.has(this.getDataKey(name));\n    }\n    get(name) {\n        return this.getAll(name)[0];\n    }\n    getAll(name) {\n        const tokenString = this.data.get(this.getDataKey(name)) || \"\";\n        return tokenize(tokenString);\n    }\n    getAttributeName(name) {\n        return this.data.getAttributeNameForKey(this.getDataKey(name));\n    }\n    getDataKey(name) {\n        return `${name}-class`;\n    }\n    get data() {\n        return this.scope.data;\n    }\n}\n\nclass DataMap {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get(key) {\n        const name = this.getAttributeNameForKey(key);\n        return this.element.getAttribute(name);\n    }\n    set(key, value) {\n        const name = this.getAttributeNameForKey(key);\n        this.element.setAttribute(name, value);\n        return this.get(key);\n    }\n    has(key) {\n        const name = this.getAttributeNameForKey(key);\n        return this.element.hasAttribute(name);\n    }\n    delete(key) {\n        if (this.has(key)) {\n            const name = this.getAttributeNameForKey(key);\n            this.element.removeAttribute(name);\n            return true;\n        }\n        else {\n            return false;\n        }\n    }\n    getAttributeNameForKey(key) {\n        return `data-${this.identifier}-${dasherize(key)}`;\n    }\n}\n\nclass Guide {\n    constructor(logger) {\n        this.warnedKeysByObject = new WeakMap();\n        this.logger = logger;\n    }\n    warn(object, key, message) {\n        let warnedKeys = this.warnedKeysByObject.get(object);\n        if (!warnedKeys) {\n            warnedKeys = new Set();\n            this.warnedKeysByObject.set(object, warnedKeys);\n        }\n        if (!warnedKeys.has(key)) {\n            warnedKeys.add(key);\n            this.logger.warn(message, object);\n        }\n    }\n}\n\nfunction attributeValueContainsToken(attributeName, token) {\n    return `[${attributeName}~=\"${token}\"]`;\n}\n\nclass TargetSet {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get schema() {\n        return this.scope.schema;\n    }\n    has(targetName) {\n        return this.find(targetName) != null;\n    }\n    find(...targetNames) {\n        return targetNames.reduce((target, targetName) => target || this.findTarget(targetName) || this.findLegacyTarget(targetName), undefined);\n    }\n    findAll(...targetNames) {\n        return targetNames.reduce((targets, targetName) => [\n            ...targets,\n            ...this.findAllTargets(targetName),\n            ...this.findAllLegacyTargets(targetName),\n        ], []);\n    }\n    findTarget(targetName) {\n        const selector = this.getSelectorForTargetName(targetName);\n        return this.scope.findElement(selector);\n    }\n    findAllTargets(targetName) {\n        const selector = this.getSelectorForTargetName(targetName);\n        return this.scope.findAllElements(selector);\n    }\n    getSelectorForTargetName(targetName) {\n        const attributeName = this.schema.targetAttributeForScope(this.identifier);\n        return attributeValueContainsToken(attributeName, targetName);\n    }\n    findLegacyTarget(targetName) {\n        const selector = this.getLegacySelectorForTargetName(targetName);\n        return this.deprecate(this.scope.findElement(selector), targetName);\n    }\n    findAllLegacyTargets(targetName) {\n        const selector = this.getLegacySelectorForTargetName(targetName);\n        return this.scope.findAllElements(selector).map((element) => this.deprecate(element, targetName));\n    }\n    getLegacySelectorForTargetName(targetName) {\n        const targetDescriptor = `${this.identifier}.${targetName}`;\n        return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n    }\n    deprecate(element, targetName) {\n        if (element) {\n            const { identifier } = this;\n            const attributeName = this.schema.targetAttribute;\n            const revisedAttributeName = this.schema.targetAttributeForScope(identifier);\n            this.guide.warn(element, `target:${targetName}`, `Please replace ${attributeName}=\"${identifier}.${targetName}\" with ${revisedAttributeName}=\"${targetName}\". ` +\n                `The ${attributeName} attribute is deprecated and will be removed in a future version of Stimulus.`);\n        }\n        return element;\n    }\n    get guide() {\n        return this.scope.guide;\n    }\n}\n\nclass OutletSet {\n    constructor(scope, controllerElement) {\n        this.scope = scope;\n        this.controllerElement = controllerElement;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get schema() {\n        return this.scope.schema;\n    }\n    has(outletName) {\n        return this.find(outletName) != null;\n    }\n    find(...outletNames) {\n        return outletNames.reduce((outlet, outletName) => outlet || this.findOutlet(outletName), undefined);\n    }\n    findAll(...outletNames) {\n        return outletNames.reduce((outlets, outletName) => [...outlets, ...this.findAllOutlets(outletName)], []);\n    }\n    getSelectorForOutletName(outletName) {\n        const attributeName = this.schema.outletAttributeForScope(this.identifier, outletName);\n        return this.controllerElement.getAttribute(attributeName);\n    }\n    findOutlet(outletName) {\n        const selector = this.getSelectorForOutletName(outletName);\n        if (selector)\n            return this.findElement(selector, outletName);\n    }\n    findAllOutlets(outletName) {\n        const selector = this.getSelectorForOutletName(outletName);\n        return selector ? this.findAllElements(selector, outletName) : [];\n    }\n    findElement(selector, outletName) {\n        const elements = this.scope.queryElements(selector);\n        return elements.filter((element) => this.matchesElement(element, selector, outletName))[0];\n    }\n    findAllElements(selector, outletName) {\n        const elements = this.scope.queryElements(selector);\n        return elements.filter((element) => this.matchesElement(element, selector, outletName));\n    }\n    matchesElement(element, selector, outletName) {\n        const controllerAttribute = element.getAttribute(this.scope.schema.controllerAttribute) || \"\";\n        return element.matches(selector) && controllerAttribute.split(\" \").includes(outletName);\n    }\n}\n\nclass Scope {\n    constructor(schema, element, identifier, logger) {\n        this.targets = new TargetSet(this);\n        this.classes = new ClassMap(this);\n        this.data = new DataMap(this);\n        this.containsElement = (element) => {\n            return element.closest(this.controllerSelector) === this.element;\n        };\n        this.schema = schema;\n        this.element = element;\n        this.identifier = identifier;\n        this.guide = new Guide(logger);\n        this.outlets = new OutletSet(this.documentScope, element);\n    }\n    findElement(selector) {\n        return this.element.matches(selector) ? this.element : this.queryElements(selector).find(this.containsElement);\n    }\n    findAllElements(selector) {\n        return [\n            ...(this.element.matches(selector) ? [this.element] : []),\n            ...this.queryElements(selector).filter(this.containsElement),\n        ];\n    }\n    queryElements(selector) {\n        return Array.from(this.element.querySelectorAll(selector));\n    }\n    get controllerSelector() {\n        return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n    }\n    get isDocumentScope() {\n        return this.element === document.documentElement;\n    }\n    get documentScope() {\n        return this.isDocumentScope\n            ? this\n            : new Scope(this.schema, document.documentElement, this.identifier, this.guide.logger);\n    }\n}\n\nclass ScopeObserver {\n    constructor(element, schema, delegate) {\n        this.element = element;\n        this.schema = schema;\n        this.delegate = delegate;\n        this.valueListObserver = new ValueListObserver(this.element, this.controllerAttribute, this);\n        this.scopesByIdentifierByElement = new WeakMap();\n        this.scopeReferenceCounts = new WeakMap();\n    }\n    start() {\n        this.valueListObserver.start();\n    }\n    stop() {\n        this.valueListObserver.stop();\n    }\n    get controllerAttribute() {\n        return this.schema.controllerAttribute;\n    }\n    parseValueForToken(token) {\n        const { element, content: identifier } = token;\n        return this.parseValueForElementAndIdentifier(element, identifier);\n    }\n    parseValueForElementAndIdentifier(element, identifier) {\n        const scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n        let scope = scopesByIdentifier.get(identifier);\n        if (!scope) {\n            scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);\n            scopesByIdentifier.set(identifier, scope);\n        }\n        return scope;\n    }\n    elementMatchedValue(element, value) {\n        const referenceCount = (this.scopeReferenceCounts.get(value) || 0) + 1;\n        this.scopeReferenceCounts.set(value, referenceCount);\n        if (referenceCount == 1) {\n            this.delegate.scopeConnected(value);\n        }\n    }\n    elementUnmatchedValue(element, value) {\n        const referenceCount = this.scopeReferenceCounts.get(value);\n        if (referenceCount) {\n            this.scopeReferenceCounts.set(value, referenceCount - 1);\n            if (referenceCount == 1) {\n                this.delegate.scopeDisconnected(value);\n            }\n        }\n    }\n    fetchScopesByIdentifierForElement(element) {\n        let scopesByIdentifier = this.scopesByIdentifierByElement.get(element);\n        if (!scopesByIdentifier) {\n            scopesByIdentifier = new Map();\n            this.scopesByIdentifierByElement.set(element, scopesByIdentifier);\n        }\n        return scopesByIdentifier;\n    }\n}\n\nclass Router {\n    constructor(application) {\n        this.application = application;\n        this.scopeObserver = new ScopeObserver(this.element, this.schema, this);\n        this.scopesByIdentifier = new Multimap();\n        this.modulesByIdentifier = new Map();\n    }\n    get element() {\n        return this.application.element;\n    }\n    get schema() {\n        return this.application.schema;\n    }\n    get logger() {\n        return this.application.logger;\n    }\n    get controllerAttribute() {\n        return this.schema.controllerAttribute;\n    }\n    get modules() {\n        return Array.from(this.modulesByIdentifier.values());\n    }\n    get contexts() {\n        return this.modules.reduce((contexts, module) => contexts.concat(module.contexts), []);\n    }\n    start() {\n        this.scopeObserver.start();\n    }\n    stop() {\n        this.scopeObserver.stop();\n    }\n    loadDefinition(definition) {\n        this.unloadIdentifier(definition.identifier);\n        const module = new Module(this.application, definition);\n        this.connectModule(module);\n        const afterLoad = definition.controllerConstructor.afterLoad;\n        if (afterLoad) {\n            afterLoad.call(definition.controllerConstructor, definition.identifier, this.application);\n        }\n    }\n    unloadIdentifier(identifier) {\n        const module = this.modulesByIdentifier.get(identifier);\n        if (module) {\n            this.disconnectModule(module);\n        }\n    }\n    getContextForElementAndIdentifier(element, identifier) {\n        const module = this.modulesByIdentifier.get(identifier);\n        if (module) {\n            return module.contexts.find((context) => context.element == element);\n        }\n    }\n    proposeToConnectScopeForElementAndIdentifier(element, identifier) {\n        const scope = this.scopeObserver.parseValueForElementAndIdentifier(element, identifier);\n        if (scope) {\n            this.scopeObserver.elementMatchedValue(scope.element, scope);\n        }\n        else {\n            console.error(`Couldn't find or create scope for identifier: \"${identifier}\" and element:`, element);\n        }\n    }\n    handleError(error, message, detail) {\n        this.application.handleError(error, message, detail);\n    }\n    createScopeForElementAndIdentifier(element, identifier) {\n        return new Scope(this.schema, element, identifier, this.logger);\n    }\n    scopeConnected(scope) {\n        this.scopesByIdentifier.add(scope.identifier, scope);\n        const module = this.modulesByIdentifier.get(scope.identifier);\n        if (module) {\n            module.connectContextForScope(scope);\n        }\n    }\n    scopeDisconnected(scope) {\n        this.scopesByIdentifier.delete(scope.identifier, scope);\n        const module = this.modulesByIdentifier.get(scope.identifier);\n        if (module) {\n            module.disconnectContextForScope(scope);\n        }\n    }\n    connectModule(module) {\n        this.modulesByIdentifier.set(module.identifier, module);\n        const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n        scopes.forEach((scope) => module.connectContextForScope(scope));\n    }\n    disconnectModule(module) {\n        this.modulesByIdentifier.delete(module.identifier);\n        const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n        scopes.forEach((scope) => module.disconnectContextForScope(scope));\n    }\n}\n\nconst defaultSchema = {\n    controllerAttribute: \"data-controller\",\n    actionAttribute: \"data-action\",\n    targetAttribute: \"data-target\",\n    targetAttributeForScope: (identifier) => `data-${identifier}-target`,\n    outletAttributeForScope: (identifier, outlet) => `data-${identifier}-${outlet}-outlet`,\n    keyMappings: Object.assign(Object.assign({ enter: \"Enter\", tab: \"Tab\", esc: \"Escape\", space: \" \", up: \"ArrowUp\", down: \"ArrowDown\", left: \"ArrowLeft\", right: \"ArrowRight\", home: \"Home\", end: \"End\", page_up: \"PageUp\", page_down: \"PageDown\" }, objectFromEntries(\"abcdefghijklmnopqrstuvwxyz\".split(\"\").map((c) => [c, c]))), objectFromEntries(\"0123456789\".split(\"\").map((n) => [n, n]))),\n};\nfunction objectFromEntries(array) {\n    return array.reduce((memo, [k, v]) => (Object.assign(Object.assign({}, memo), { [k]: v })), {});\n}\n\nclass Application {\n    constructor(element = document.documentElement, schema = defaultSchema) {\n        this.logger = console;\n        this.debug = false;\n        this.logDebugActivity = (identifier, functionName, detail = {}) => {\n            if (this.debug) {\n                this.logFormattedMessage(identifier, functionName, detail);\n            }\n        };\n        this.element = element;\n        this.schema = schema;\n        this.dispatcher = new Dispatcher(this);\n        this.router = new Router(this);\n        this.actionDescriptorFilters = Object.assign({}, defaultActionDescriptorFilters);\n    }\n    static start(element, schema) {\n        const application = new this(element, schema);\n        application.start();\n        return application;\n    }\n    async start() {\n        await domReady();\n        this.logDebugActivity(\"application\", \"starting\");\n        this.dispatcher.start();\n        this.router.start();\n        this.logDebugActivity(\"application\", \"start\");\n    }\n    stop() {\n        this.logDebugActivity(\"application\", \"stopping\");\n        this.dispatcher.stop();\n        this.router.stop();\n        this.logDebugActivity(\"application\", \"stop\");\n    }\n    register(identifier, controllerConstructor) {\n        this.load({ identifier, controllerConstructor });\n    }\n    registerActionOption(name, filter) {\n        this.actionDescriptorFilters[name] = filter;\n    }\n    load(head, ...rest) {\n        const definitions = Array.isArray(head) ? head : [head, ...rest];\n        definitions.forEach((definition) => {\n            if (definition.controllerConstructor.shouldLoad) {\n                this.router.loadDefinition(definition);\n            }\n        });\n    }\n    unload(head, ...rest) {\n        const identifiers = Array.isArray(head) ? head : [head, ...rest];\n        identifiers.forEach((identifier) => this.router.unloadIdentifier(identifier));\n    }\n    get controllers() {\n        return this.router.contexts.map((context) => context.controller);\n    }\n    getControllerForElementAndIdentifier(element, identifier) {\n        const context = this.router.getContextForElementAndIdentifier(element, identifier);\n        return context ? context.controller : null;\n    }\n    handleError(error, message, detail) {\n        var _a;\n        this.logger.error(`%s\\n\\n%o\\n\\n%o`, message, error, detail);\n        (_a = window.onerror) === null || _a === void 0 ? void 0 : _a.call(window, message, \"\", 0, 0, error);\n    }\n    logFormattedMessage(identifier, functionName, detail = {}) {\n        detail = Object.assign({ application: this }, detail);\n        this.logger.groupCollapsed(`${identifier} #${functionName}`);\n        this.logger.log(\"details:\", Object.assign({}, detail));\n        this.logger.groupEnd();\n    }\n}\nfunction domReady() {\n    return new Promise((resolve) => {\n        if (document.readyState == \"loading\") {\n            document.addEventListener(\"DOMContentLoaded\", () => resolve());\n        }\n        else {\n            resolve();\n        }\n    });\n}\n\nfunction ClassPropertiesBlessing(constructor) {\n    const classes = readInheritableStaticArrayValues(constructor, \"classes\");\n    return classes.reduce((properties, classDefinition) => {\n        return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n    }, {});\n}\nfunction propertiesForClassDefinition(key) {\n    return {\n        [`${key}Class`]: {\n            get() {\n                const { classes } = this;\n                if (classes.has(key)) {\n                    return classes.get(key);\n                }\n                else {\n                    const attribute = classes.getAttributeName(key);\n                    throw new Error(`Missing attribute \"${attribute}\"`);\n                }\n            },\n        },\n        [`${key}Classes`]: {\n            get() {\n                return this.classes.getAll(key);\n            },\n        },\n        [`has${capitalize(key)}Class`]: {\n            get() {\n                return this.classes.has(key);\n            },\n        },\n    };\n}\n\nfunction OutletPropertiesBlessing(constructor) {\n    const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n    return outlets.reduce((properties, outletDefinition) => {\n        return Object.assign(properties, propertiesForOutletDefinition(outletDefinition));\n    }, {});\n}\nfunction getOutletController(controller, element, identifier) {\n    return controller.application.getControllerForElementAndIdentifier(element, identifier);\n}\nfunction getControllerAndEnsureConnectedScope(controller, element, outletName) {\n    let outletController = getOutletController(controller, element, outletName);\n    if (outletController)\n        return outletController;\n    controller.application.router.proposeToConnectScopeForElementAndIdentifier(element, outletName);\n    outletController = getOutletController(controller, element, outletName);\n    if (outletController)\n        return outletController;\n}\nfunction propertiesForOutletDefinition(name) {\n    const camelizedName = namespaceCamelize(name);\n    return {\n        [`${camelizedName}Outlet`]: {\n            get() {\n                const outletElement = this.outlets.find(name);\n                const selector = this.outlets.getSelectorForOutletName(name);\n                if (outletElement) {\n                    const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n                    if (outletController)\n                        return outletController;\n                    throw new Error(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`);\n                }\n                throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n            },\n        },\n        [`${camelizedName}Outlets`]: {\n            get() {\n                const outlets = this.outlets.findAll(name);\n                if (outlets.length > 0) {\n                    return outlets\n                        .map((outletElement) => {\n                        const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n                        if (outletController)\n                            return outletController;\n                        console.warn(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`, outletElement);\n                    })\n                        .filter((controller) => controller);\n                }\n                return [];\n            },\n        },\n        [`${camelizedName}OutletElement`]: {\n            get() {\n                const outletElement = this.outlets.find(name);\n                const selector = this.outlets.getSelectorForOutletName(name);\n                if (outletElement) {\n                    return outletElement;\n                }\n                else {\n                    throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n                }\n            },\n        },\n        [`${camelizedName}OutletElements`]: {\n            get() {\n                return this.outlets.findAll(name);\n            },\n        },\n        [`has${capitalize(camelizedName)}Outlet`]: {\n            get() {\n                return this.outlets.has(name);\n            },\n        },\n    };\n}\n\nfunction TargetPropertiesBlessing(constructor) {\n    const targets = readInheritableStaticArrayValues(constructor, \"targets\");\n    return targets.reduce((properties, targetDefinition) => {\n        return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n    }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n    return {\n        [`${name}Target`]: {\n            get() {\n                const target = this.targets.find(name);\n                if (target) {\n                    return target;\n                }\n                else {\n                    throw new Error(`Missing target element \"${name}\" for \"${this.identifier}\" controller`);\n                }\n            },\n        },\n        [`${name}Targets`]: {\n            get() {\n                return this.targets.findAll(name);\n            },\n        },\n        [`has${capitalize(name)}Target`]: {\n            get() {\n                return this.targets.has(name);\n            },\n        },\n    };\n}\n\nfunction ValuePropertiesBlessing(constructor) {\n    const valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n    const propertyDescriptorMap = {\n        valueDescriptorMap: {\n            get() {\n                return valueDefinitionPairs.reduce((result, valueDefinitionPair) => {\n                    const valueDescriptor = parseValueDefinitionPair(valueDefinitionPair, this.identifier);\n                    const attributeName = this.data.getAttributeNameForKey(valueDescriptor.key);\n                    return Object.assign(result, { [attributeName]: valueDescriptor });\n                }, {});\n            },\n        },\n    };\n    return valueDefinitionPairs.reduce((properties, valueDefinitionPair) => {\n        return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n    }, propertyDescriptorMap);\n}\nfunction propertiesForValueDefinitionPair(valueDefinitionPair, controller) {\n    const definition = parseValueDefinitionPair(valueDefinitionPair, controller);\n    const { key, name, reader: read, writer: write } = definition;\n    return {\n        [name]: {\n            get() {\n                const value = this.data.get(key);\n                if (value !== null) {\n                    return read(value);\n                }\n                else {\n                    return definition.defaultValue;\n                }\n            },\n            set(value) {\n                if (value === undefined) {\n                    this.data.delete(key);\n                }\n                else {\n                    this.data.set(key, write(value));\n                }\n            },\n        },\n        [`has${capitalize(name)}`]: {\n            get() {\n                return this.data.has(key) || definition.hasCustomDefaultValue;\n            },\n        },\n    };\n}\nfunction parseValueDefinitionPair([token, typeDefinition], controller) {\n    return valueDescriptorForTokenAndTypeDefinition({\n        controller,\n        token,\n        typeDefinition,\n    });\n}\nfunction parseValueTypeConstant(constant) {\n    switch (constant) {\n        case Array:\n            return \"array\";\n        case Boolean:\n            return \"boolean\";\n        case Number:\n            return \"number\";\n        case Object:\n            return \"object\";\n        case String:\n            return \"string\";\n    }\n}\nfunction parseValueTypeDefault(defaultValue) {\n    switch (typeof defaultValue) {\n        case \"boolean\":\n            return \"boolean\";\n        case \"number\":\n            return \"number\";\n        case \"string\":\n            return \"string\";\n    }\n    if (Array.isArray(defaultValue))\n        return \"array\";\n    if (Object.prototype.toString.call(defaultValue) === \"[object Object]\")\n        return \"object\";\n}\nfunction parseValueTypeObject(payload) {\n    const { controller, token, typeObject } = payload;\n    const hasType = isSomething(typeObject.type);\n    const hasDefault = isSomething(typeObject.default);\n    const fullObject = hasType && hasDefault;\n    const onlyType = hasType && !hasDefault;\n    const onlyDefault = !hasType && hasDefault;\n    const typeFromObject = parseValueTypeConstant(typeObject.type);\n    const typeFromDefaultValue = parseValueTypeDefault(payload.typeObject.default);\n    if (onlyType)\n        return typeFromObject;\n    if (onlyDefault)\n        return typeFromDefaultValue;\n    if (typeFromObject !== typeFromDefaultValue) {\n        const propertyPath = controller ? `${controller}.${token}` : token;\n        throw new Error(`The specified default value for the Stimulus Value \"${propertyPath}\" must match the defined type \"${typeFromObject}\". The provided default value of \"${typeObject.default}\" is of type \"${typeFromDefaultValue}\".`);\n    }\n    if (fullObject)\n        return typeFromObject;\n}\nfunction parseValueTypeDefinition(payload) {\n    const { controller, token, typeDefinition } = payload;\n    const typeObject = { controller, token, typeObject: typeDefinition };\n    const typeFromObject = parseValueTypeObject(typeObject);\n    const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n    const typeFromConstant = parseValueTypeConstant(typeDefinition);\n    const type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n    if (type)\n        return type;\n    const propertyPath = controller ? `${controller}.${typeDefinition}` : token;\n    throw new Error(`Unknown value type \"${propertyPath}\" for \"${token}\" value`);\n}\nfunction defaultValueForDefinition(typeDefinition) {\n    const constant = parseValueTypeConstant(typeDefinition);\n    if (constant)\n        return defaultValuesByType[constant];\n    const hasDefault = hasProperty(typeDefinition, \"default\");\n    const hasType = hasProperty(typeDefinition, \"type\");\n    const typeObject = typeDefinition;\n    if (hasDefault)\n        return typeObject.default;\n    if (hasType) {\n        const { type } = typeObject;\n        const constantFromType = parseValueTypeConstant(type);\n        if (constantFromType)\n            return defaultValuesByType[constantFromType];\n    }\n    return typeDefinition;\n}\nfunction valueDescriptorForTokenAndTypeDefinition(payload) {\n    const { token, typeDefinition } = payload;\n    const key = `${dasherize(token)}-value`;\n    const type = parseValueTypeDefinition(payload);\n    return {\n        type,\n        key,\n        name: camelize(key),\n        get defaultValue() {\n            return defaultValueForDefinition(typeDefinition);\n        },\n        get hasCustomDefaultValue() {\n            return parseValueTypeDefault(typeDefinition) !== undefined;\n        },\n        reader: readers[type],\n        writer: writers[type] || writers.default,\n    };\n}\nconst defaultValuesByType = {\n    get array() {\n        return [];\n    },\n    boolean: false,\n    number: 0,\n    get object() {\n        return {};\n    },\n    string: \"\",\n};\nconst readers = {\n    array(value) {\n        const array = JSON.parse(value);\n        if (!Array.isArray(array)) {\n            throw new TypeError(`expected value of type \"array\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(array)}\"`);\n        }\n        return array;\n    },\n    boolean(value) {\n        return !(value == \"0\" || String(value).toLowerCase() == \"false\");\n    },\n    number(value) {\n        return Number(value.replace(/_/g, \"\"));\n    },\n    object(value) {\n        const object = JSON.parse(value);\n        if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n            throw new TypeError(`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(object)}\"`);\n        }\n        return object;\n    },\n    string(value) {\n        return value;\n    },\n};\nconst writers = {\n    default: writeString,\n    array: writeJSON,\n    object: writeJSON,\n};\nfunction writeJSON(value) {\n    return JSON.stringify(value);\n}\nfunction writeString(value) {\n    return `${value}`;\n}\n\nclass Controller {\n    constructor(context) {\n        this.context = context;\n    }\n    static get shouldLoad() {\n        return true;\n    }\n    static afterLoad(_identifier, _application) {\n        return;\n    }\n    get application() {\n        return this.context.application;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get targets() {\n        return this.scope.targets;\n    }\n    get outlets() {\n        return this.scope.outlets;\n    }\n    get classes() {\n        return this.scope.classes;\n    }\n    get data() {\n        return this.scope.data;\n    }\n    initialize() {\n    }\n    connect() {\n    }\n    disconnect() {\n    }\n    dispatch(eventName, { target = this.element, detail = {}, prefix = this.identifier, bubbles = true, cancelable = true, } = {}) {\n        const type = prefix ? `${prefix}:${eventName}` : eventName;\n        const event = new CustomEvent(type, { detail, bubbles, cancelable });\n        target.dispatchEvent(event);\n        return event;\n    }\n}\nController.blessings = [\n    ClassPropertiesBlessing,\n    TargetPropertiesBlessing,\n    ValuePropertiesBlessing,\n    OutletPropertiesBlessing,\n];\nController.targets = [];\nController.outlets = [];\nController.values = {};\n\nexport { Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, SelectorObserver, StringMapObserver, TokenListObserver, ValueListObserver, add, defaultSchema, del, fetch, prune };\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static values = {\n        content: String\n    }\n\n    write () {\n        if (navigator.clipboard && navigator.clipboard.writeText) {\n            navigator.clipboard.writeText(this.contentValue).catch(this.clipboardFallback.bind(this));\n        } else {\n            this.clipboardFallback();\n        }\n    }\n\n    clipboardFallback  () {\n        const input = document.createElement('input');\n        input.value = this.contentValue;\n        document.body.appendChild(input);\n        input.select();\n        input.setSelectionRange(0, 99999);\n        document.execCommand('copy');\n        document.body.removeChild(input);\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nconst prefersDark = () => {\n    const prefersDark = localStorage.getItem('contao--prefers-dark');\n\n    if (null === prefersDark) {\n        return !!window.matchMedia('(prefers-color-scheme: dark)').matches;\n    }\n\n    return prefersDark === 'true';\n}\n\nconst setColorScheme = () => {\n    document.documentElement.dataset.colorScheme = prefersDark() ? 'dark' : 'light';\n};\n\nwindow.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', setColorScheme);\nsetColorScheme();\n\nexport default class extends Controller {\n    static targets = ['label'];\n\n    static values = {\n        i18n: {\n            type: Object,\n            default: { light: 'Disable dark mode', dark: 'Enable dark mode' }\n        }\n    };\n\n    initialize () {\n        this.toggle = this.toggle.bind(this);\n        this.setLabel = this.setLabel.bind(this);\n    }\n\n    connect () {\n        this.element.addEventListener('click', this.toggle);\n\n        window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', this.setLabel);\n        this.setLabel();\n    }\n\n    disconnect () {\n        this.element.removeEventListener('click', this.toggle);\n    }\n\n    toggle (e) {\n        e.preventDefault();\n\n        const isDark = !prefersDark();\n\n        if (isDark === window.matchMedia('(prefers-color-scheme: dark)').matches) {\n            localStorage.removeItem('contao--prefers-dark');\n        } else {\n            localStorage.setItem('contao--prefers-dark', String(isDark));\n        }\n\n        setColorScheme();\n\n        // Change the label after the dropdown is hidden\n        setTimeout(this.setLabel, 300);\n    }\n\n    setLabel () {\n        if (!this.hasLabelTarget) {\n            return;\n        }\n\n        const label = this.i18nValue[prefersDark() ? 'light' : 'dark'];\n\n        this.labelTarget.title = label;\n        this.labelTarget.innerText = label;\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static values = {\n        config: Object,\n    }\n\n    initialize () {\n        this.updateWizard = this.updateWizard.bind(this);\n        this.openModal = this.openModal.bind(this);\n    }\n\n    connect () {\n        this.select = this.element.querySelector('select');\n        this.button = document.createElement('button');\n        this.button.type = 'button';\n        this.button.title = '';\n        this.buttonImage = document.createElement('img');\n        this.button.append(this.buttonImage);\n        this.element.parentNode.classList.add('wizard');\n        this.element.after(this.button);\n\n        this.select.addEventListener('change', this.updateWizard);\n        this.button.addEventListener('click', this.openModal);\n\n        this.updateWizard();\n    }\n\n    disconnect () {\n        this.element.parentNode.classList.remove('wizard');\n        this.select.removeEventListener('change', this.updateWizard);\n        this.buttonImage.remove();\n        this.button.remove();\n    }\n\n    updateWizard () {\n        if (this.canEdit()) {\n            this.button.title = this.configValue.title;\n            this.button.disabled = false;\n            this.buttonImage.src = this.configValue.icon;\n        } else {\n            this.button.title = '';\n            this.button.disabled = true;\n            this.buttonImage.src = this.configValue.iconDisabled;\n        }\n    }\n\n    openModal () {\n        Backend.openModalIframe({\n            title: this.configValue.title,\n            url: `${ this.configValue.href }&id=${ this.select.value }`\n        });\n    }\n\n    canEdit () {\n        return this.configValue.ids.includes(Number(this.select.value));\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static targets = ['navigation', 'section'];\n\n    connect () {\n        this.rebuildNavigation();\n        this.connected = true;\n    }\n\n    sectionTargetConnected () {\n        if (!this.connected) {\n            return;\n        }\n\n        this.rebuildNavigation();\n    }\n\n    rebuildNavigation () {\n        if (!this.hasNavigationTarget) {\n            return;\n        }\n\n        const links = document.createElement('ul');\n\n        this.sectionTargets.forEach((el) => {\n            const action = document.createElement('button');\n            action.innerText = el.getAttribute(`data-${this.identifier}-label-value`);\n\n            action.addEventListener('click', (event) => {\n                event.preventDefault();\n                this.dispatch('scrollto', { target: el });\n                el.scrollIntoView();\n            });\n\n            const li = document.createElement('li');\n            li.append(action);\n\n            links.append(li);\n        });\n\n        this.navigationTarget.replaceChildren(links);\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static values = {\n        max: Number,\n        expand: String,\n        collapse: String,\n        expandAll: String,\n        expandAllTitle: String,\n        collapseAll: String,\n        collapseAllTitle: String,\n    }\n\n    static targets = ['operation', 'node'];\n\n    initialize () {\n        super.initialize();\n        this.togglerMap = new WeakMap();\n        this.nextId = 1;\n    }\n\n    operationTargetConnected () {\n        this.updateOperation();\n    }\n\n    nodeTargetConnected (node) {\n        const style = window.getComputedStyle(node, null);\n        const padding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);\n        const height = node.clientHeight - padding;\n\n        // Resize the element if it is higher than the maximum height\n        if (this.maxValue > height) {\n            return;\n        }\n\n        if (!node.id) {\n            node.id = `limit-height-${this.nextId++}`;\n        }\n\n        node.style.overflow = 'hidden';\n        node.style.maxHeight = `${this.maxValue}px`;\n\n        const button = document.createElement('button');\n        button.setAttribute('type', 'button');\n        button.title = this.expandValue;\n        button.innerHTML = '<span>...</span>';\n        button.classList.add('unselectable');\n        button.setAttribute('aria-expanded', 'false');\n        button.setAttribute('aria-controls', node.id);\n\n        button.addEventListener('click', (event) => {\n            event.preventDefault();\n            this.toggle(node);\n            this.updateOperation(event);\n        });\n\n        const toggler = document.createElement('div');\n        toggler.classList.add('limit_toggler');\n        toggler.append(button);\n\n        this.togglerMap.set(node, toggler);\n\n        node.append(toggler);\n        this.updateOperation();\n    }\n\n    nodeTargetDisconnected (node) {\n        if (!this.togglerMap.has(node)) {\n            return;\n        }\n\n        this.togglerMap.get(node).remove();\n        this.togglerMap.delete(node);\n        node.style.overflow = '';\n        node.style.maxHeight = '';\n    }\n\n    toggle (node) {\n        if (node.style.maxHeight === '') {\n            this.collapse(node);\n        } else {\n            this.expand(node);\n        }\n    }\n\n    expand (node) {\n        if (!this.togglerMap.has(node)) {\n            return;\n        }\n\n        node.style.maxHeight = '';\n        const button = this.togglerMap.get(node).querySelector('button');\n        button.title = this.collapseValue;\n        button.setAttribute('aria-expanded', 'true');\n    }\n\n    collapse (node) {\n        if (!this.togglerMap.has(node)) {\n            return;\n        }\n\n        node.style.maxHeight = `${this.maxValue}px`;\n        const button = this.togglerMap.get(node).querySelector('button');\n        button.title = this.expandValue;\n        button.setAttribute('aria-expanded', 'false');\n    }\n\n    toggleAll (event) {\n        event.preventDefault();\n        const isExpanded = this.hasExpanded() ^ event.altKey;\n\n        this.nodeTargets.forEach((node) => {\n            if (isExpanded) {\n                this.collapse(node);\n            } else {\n                this.expand(node);\n            }\n        });\n\n        this.updateOperation(event);\n    }\n\n    keypress (event) {\n        this.updateOperation(event);\n    }\n\n    updateOperation (event) {\n        if (!this.hasOperationTarget) {\n            return;\n        }\n\n        const hasTogglers = !!this.nodeTargets.find((el) => this.togglerMap.has(el));\n        const expanded = this.hasExpanded();\n\n        this.operationTarget.style.display = hasTogglers ? '' : 'none';\n        this.operationTarget.setAttribute('aria-controls', this.nodeTargets.map((el) => el.id).join(' '));\n        this.operationTarget.setAttribute('aria-expanded', expanded ? 'true' : 'false');\n\n        if (expanded ^ (event ? event.altKey : false)) {\n            this.operationTarget.innerText = this.collapseAllValue;\n            this.operationTarget.title = this.collapseAllTitleValue;\n        } else {\n            this.operationTarget.innerText = this.expandAllValue;\n            this.operationTarget.title = this.expandAllTitleValue;\n        }\n    }\n\n    hasExpanded () {\n        return !!this.nodeTargets.find((el) => this.togglerMap.has(el) && el.style.maxHeight === '');\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static targets = ['input']\n\n    delete () {\n        this.inputTargets.forEach((input) => {\n            input.value = '';\n        })\n    }\n}\n","import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n    static targets = ['scrollTo', 'autoFocus'];\n\n    static values = {\n        sessionKey: {\n            type: String,\n            default: 'contao_backend_offset'\n        },\n        behavior: {\n            type: String,\n            default: 'instant'\n        },\n        block: {\n            type: String,\n            default: 'center'\n        }\n    };\n\n    // Backwards compatibility: automatically register the Stimulus controller if the legacy methods are used\n    static afterLoad(identifier, application) {\n        const loadFallback = () => {\n            return new Promise((resolve, reject) => {\n                const controller = application.getControllerForElementAndIdentifier(document.documentElement, identifier);\n\n                if (controller) {\n                    resolve(controller);\n                    return;\n                }\n\n                const { controllerAttribute } = application.schema;\n                document.documentElement.setAttribute(controllerAttribute, `${document.documentElement.getAttribute(controllerAttribute) || ''} ${ identifier }`);\n\n                setTimeout(() => {\n                    const controller = application.getControllerForElementAndIdentifier(document.documentElement, identifier);\n                    controller && resolve(controller) || reject(controller);\n                }, 100);\n            });\n        }\n\n        if (window.Backend && !window.Backend.initScrollOffset) {\n            window.Backend.initScrollOffset = () => {\n                console.warn('Backend.initScrollOffset() is deprecated. Please use the Stimulus controller instead.');\n                loadFallback();\n            }\n        }\n\n        if (window.Backend && !window.Backend.getScrollOffset) {\n            window.Backend.getScrollOffset = () => {\n                console.warn('Backend.getScrollOffset() is deprecated. Please use the Stimulus controller instead.');\n                loadFallback().then((controller) => controller.discard());\n            }\n        }\n    }\n\n    initialize () {\n        this.store = this.store.bind(this);\n    }\n\n    connect () {\n        if (!this.offset) return;\n\n        window.scrollTo({\n            top: this.offset,\n            behavior: this.behaviorValue,\n            block: this.blockValue\n        });\n\n        this.offset = null;\n    }\n\n    scrollToTargetConnected() {\n        this.scrollToTarget.scrollIntoView({\n            behavior: this.behaviorValue,\n            block: this.blockValue\n        });\n    }\n\n    autoFocusTargetConnected() {\n        if (this.offset || this.autoFocus) return;\n\n        const input = this.autoFocusTarget;\n\n        if (\n            input.disabled || input.readonly\n            || !input.offsetWidth || !input.offsetHeight\n            || input.closest('.chzn-search')\n            || input.autocomplete && input.autocomplete !== 'off'\n        ) {\n            return;\n        }\n\n        this.autoFocus = true;\n        input.focus();\n    }\n\n    store () {\n        this.offset = this.element.scrollTop;\n    }\n\n    discard () {\n        this.offset = null;\n    }\n\n    get offset () {\n        const value = window.sessionStorage.getItem(this.sessionKeyValue);\n\n        return value ? parseInt(value) : null;\n    }\n\n    set offset (value) {\n        if (value === null || value === undefined) {\n            window.sessionStorage.removeItem(this.sessionKeyValue);\n        } else {\n            window.sessionStorage.setItem(this.sessionKeyValue, String(value));\n        }\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static values = {\n        id: String,\n        table: String,\n    }\n\n    static classes = ['collapsed'];\n\n    static afterLoad (identifier, application) {\n        const addController = (el, id, table) => {\n            const fs = el.parentNode;\n\n            fs.dataset.controller = `${fs.dataset.controller || ''} ${identifier}`;\n            fs.setAttribute(`data-${identifier}-id-value`, id);\n            fs.setAttribute(`data-${identifier}-table-value`, table);\n            fs.setAttribute(`data-${identifier}-collapsed-class`, 'collapsed');\n            el.setAttribute('data-action', `click->${identifier}#toggle`);\n        }\n\n        const migrateLegacy = () => {\n            document.querySelectorAll('legend[data-toggle-fieldset]').forEach(function(el) {\n                if (window.console) {\n                    console.warn(`Using the \"data-toggle-fieldset\" attribute on fieldset legends is deprecated and will be removed in Contao 6. Apply the \"${identifier}\" Stimulus controller instead.`);\n                }\n\n                const { id, table } = JSON.parse(el.getAttribute('data-toggle-fieldset'));\n                addController(el, id, table);\n            });\n\n            AjaxRequest.toggleFieldset = (el, id, table) => {\n                const fs = el.parentNode;\n\n                // Already clicked, Stimulus controller was added dynamically\n                if (application.getControllerForElementAndIdentifier(fs, identifier)) {\n                    return;\n                }\n\n                if (window.console) {\n                    console.warn('Using AjaxRequest.toggleFieldset() is deprecated and will be removed in Contao 6. Apply the Stimulus actions instead.');\n                }\n\n                addController(el, id, table);\n\n                // Optimistically wait until Stimulus has registered the new controller\n                setTimeout(() => { application.getControllerForElementAndIdentifier(fs, identifier).toggle(); }, 100);\n            };\n        }\n\n        // Called as soon as registered, so DOM may not have been loaded yet\n        if (document.readyState === \"loading\") {\n            document.addEventListener(\"DOMContentLoaded\", migrateLegacy)\n        } else {\n            migrateLegacy();\n        }\n    }\n\n    connect () {\n        if (this.element.querySelectorAll('label.error, label.mandatory').length) {\n            this.element.classList.remove(this.collapsedClass);\n        } else if (this.element.classList.contains('hide')) {\n            if (window.console) {\n                console.warn(`Using class \"hide\" on a fieldset is deprecated and will be removed in Contao 6. Use class \"${this.collapsedClass}\" instead.`);\n            }\n\n            this.element.classList.add(this.collapsedClass);\n        }\n    }\n\n    toggle () {\n        if (this.element.classList.contains(this.collapsedClass)) {\n            this.open();\n        } else {\n            this.close();\n        }\n    }\n\n    open () {\n        if (!this.element.classList.contains(this.collapsedClass)) {\n            return;\n        }\n\n        this.element.classList.remove(this.collapsedClass);\n        this.storeState(1);\n    }\n\n    close () {\n        if (this.element.classList.contains(this.collapsedClass)) {\n            return;\n        }\n\n        const form = this.element.closest('form');\n        const input = this.element.querySelectorAll('[required]');\n\n        let collapse = true;\n        for (let i = 0; i < input.length; i++) {\n            if (!input[i].value) {\n                collapse = false;\n                break;\n            }\n        }\n\n        if (!collapse) {\n            if (typeof(form.checkValidity) == 'function') {\n                form.querySelector('button[type=\"submit\"]').click();\n            }\n        } else {\n            this.element.classList.add(this.collapsedClass);\n            this.storeState(0);\n        }\n    }\n\n    storeState (state) {\n        if (!this.hasIdValue || !this.hasTableValue) {\n            return;\n        }\n\n        fetch(window.location.href, {\n            method: 'POST',\n            headers: {\n                'X-Requested-With': 'XMLHttpRequest'\n            },\n            body: new URLSearchParams({\n                action: 'toggleFieldset',\n                id: this.idValue,\n                table: this.tableValue,\n                state: state,\n            })\n        });\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static classes = ['collapsed']\n\n    static values = {\n        url: String,\n        requestToken: String,\n        expandTitle: String,\n        collapseTitle: String,\n    }\n\n    toggle ({ currentTarget, params: { category }}) {\n        const el = currentTarget.parentNode;\n        const collapsed = el.classList.toggle(this.collapsedClass);\n\n        currentTarget.setAttribute('aria-expanded', collapsed ? 'false' : 'true');\n        currentTarget.setAttribute('title', collapsed ? this.expandTitleValue : this.collapseTitleValue);\n\n        this.sendRequest(category, collapsed)\n    }\n\n    sendRequest (category, collapsed) {\n        fetch(this.urlValue, {\n            method: 'POST',\n            headers: {\n                'X-Requested-With': 'XMLHttpRequest'\n            },\n            body: new URLSearchParams({\n                action: 'toggleNavigation',\n                id: category,\n                state: collapsed ? 0 : 1,\n                REQUEST_TOKEN: this.requestTokenValue\n            })\n        });\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static values = {\n        mode: {\n            type: Number,\n            default: 5\n        },\n        toggleAction: String,\n        loadAction: String,\n        requestToken: String,\n        refererId: String,\n        expand: String,\n        collapse: String,\n        expandAll: String,\n        expandAllTitle: String,\n        collapseAll: String,\n        collapseAllTitle: String,\n    }\n\n    static targets = ['operation', 'node', 'toggle', 'child', 'rootChild'];\n\n    operationTargetConnected () {\n        this.updateOperation();\n    }\n\n    childTargetConnected () {\n        this.updateOperation();\n    }\n\n    toggle (event) {\n        event.preventDefault();\n\n        const el = event.currentTarget;\n        el.blur();\n\n        this.toggleToggler(el, event.params.id, event.params.level, event.params.folder);\n    }\n\n    toggleToggler (el, id, level, folder) {\n        const item = document.id(id);\n\n        if (item && item.style.display === 'none') {\n            this.showChild(item);\n            this.expandToggler(el);\n            this.updateState(el, id, 1);\n        } else if (item) {\n            this.hideChild(item);\n            this.collapseToggler(el);\n            this.updateState(el, id, 0);\n        } else {\n            this.fetchChild(el, id, level, folder)\n        }\n\n        this.updateOperation();\n    }\n\n    expandToggler (el) {\n        el.classList.add('foldable--open');\n        el.title = this.collapseValue;\n    }\n\n    collapseToggler (el) {\n        el.classList.remove('foldable--open');\n        el.title = this.expandValue;\n    }\n\n    loadToggler (el, enabled) {\n        el.classList[enabled ? 'add' : 'remove']('foldable--loading');\n    }\n\n    showChild (item) {\n        item.style.display = '';\n    }\n\n    hideChild (item) {\n        item.style.display = 'none';\n    }\n\n    async fetchChild (el, id, level, folder) {\n        this.loadToggler(el, true);\n\n        const url = new URL(location.href);\n        const search = url.searchParams;\n        search.set('ref', this.refererIdValue);\n        url.search = search.toString();\n\n        const response = await fetch(url, {\n            method: 'POST',\n            headers: {\n                'Content-Type': 'application/x-www-form-urlencoded',\n                'X-Requested-With': 'XMLHttpRequest'\n            },\n            body: new URLSearchParams({\n                'action': this.loadActionValue,\n                'id': id,\n                'level': level,\n                'folder': folder,\n                'state': 1,\n                'REQUEST_TOKEN': this.requestTokenValue\n            })\n        });\n\n        if (response.ok) {\n            const txt = await response.text();\n\n            const li = document.createElement('li');\n            li.id = id;\n            li.classList.add('parent');\n            li.style.display = 'inline';\n            li.setAttribute(`data-${this.identifier}-target`, level === 0 ? 'child rootChild' : 'child')\n\n            const ul = document.createElement('ul');\n            ul.classList.add('level_' + level);\n            ul.innerHTML = txt;\n            li.append(ul);\n\n            if (this.modeValue === 5) {\n                el.closest('li').after(li);\n            } else {\n                let isFolder = false,\n                    parent = el.closest('li'),\n                    next;\n\n                while (typeOf(parent) === 'element' && parent.tagName === 'LI' && (next = parent.nextElementSibling)) {\n                    parent = next;\n                    if (parent.classList.contains('tl_folder')) {\n                        isFolder = true;\n                        break;\n                    }\n                }\n\n                if (isFolder) {\n                    parent.before(li);\n                } else {\n                    parent.after(li);\n                }\n            }\n\n            window.dispatchEvent(new CustomEvent('structure'));\n            this.expandToggler(el);\n\n            // HOOK (see #6752)\n            window.fireEvent('ajax_change')\n        }\n\n        this.loadToggler(el, false);\n    }\n\n    async toggleAll (event) {\n        event.preventDefault();\n\n        const href = event.currentTarget.href;\n\n        if (this.hasExpandedRoot() ^ (event ? event.altKey : false)) {\n            this.updateAllState(href, 0);\n            this.toggleTargets.forEach((el) => this.collapseToggler(el));\n            this.childTargets.forEach((item) => item.style.display = 'none');\n        } else {\n            this.childTargets.forEach((el) => el.remove());\n            this.toggleTargets.forEach((el) => this.loadToggler(el, true));\n\n            await this.updateAllState(href, 1);\n            const promises = [];\n\n            this.toggleTargets.forEach((el) => {\n                promises.push(this.fetchChild(\n                    el,\n                    el.getAttribute(`data-${this.identifier}-id-param`),\n                    0,\n                    el.getAttribute(`data-${this.identifier}-folder-param`)\n                ));\n            });\n\n            await Promise.all(promises);\n        }\n\n        this.updateOperation();\n    }\n\n    keypress (event) {\n        this.updateOperation(event)\n    }\n\n    async updateState (el, id, state) {\n        await fetch(location.href, {\n            method: 'POST',\n            headers: {\n                'Content-Type': 'application/x-www-form-urlencoded',\n                'X-Requested-With': 'XMLHttpRequest'\n            },\n            body: new URLSearchParams({\n                'action': this.toggleActionValue,\n                'id': id,\n                'state': state,\n                'REQUEST_TOKEN': this.requestTokenValue\n            })\n        });\n    }\n\n    async updateAllState (href, state) {\n        await fetch(`${href}&state=${state}`);\n    }\n\n    updateOperation (event) {\n        if (!this.hasOperationTarget) {\n            return;\n        }\n\n        if (this.hasExpandedRoot() ^ (event ? event.altKey : false)) {\n            this.operationTarget.innerText = this.collapseAllValue;\n            this.operationTarget.title = this.collapseAllTitleValue;\n        } else {\n            this.operationTarget.innerText = this.expandAllValue;\n            this.operationTarget.title = this.expandAllTitleValue;\n        }\n    }\n\n    hasExpandedRoot () {\n        return !!this.rootChildTargets.find((el) => el.style.display !== 'none')\n    }\n}\n","/**\n * Provide methods to handle Ajax requests.\n *\n * @author Leo Feyer <https://github.com/leofeyer>\n */\nwindow.AjaxRequest =\n{\n\t/**\n\t * Toggle the navigation menu\n\t *\n\t * @param {object} el  The DOM element\n\t * @param {string} id  The ID of the menu item\n\t * @param {string} url The Ajax URL\n\t *\n\t * @returns {boolean}\n\t */\n\ttoggleNavigation: function(el, id, url) {\n\t\tif (window.console) {\n\t\t\tconsole.warn('AjaxRequest.toggleNavigation() is deprecated. Please use the stimulus controller instead.');\n\t\t}\n\n\t\tvar item = $(id),\n\t\t\tparent = $(el).getParent('li');\n\n\t\tif (item) {\n\t\t\tif (parent.hasClass('collapsed')) {\n\t\t\t\tparent.removeClass('collapsed');\n\t\t\t\t$(el).setAttribute('aria-expanded', 'true');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.collapse);\n\t\t\t\tnew Request.Contao({ url: url }).post({'action':'toggleNavigation', 'id':id, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t} else {\n\t\t\t\tparent.addClass('collapsed');\n\t\t\t\t$(el).setAttribute('aria-expanded', 'false');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.expand);\n\t\t\t\tnew Request.Contao({ url: url }).post({'action':'toggleNavigation', 'id':id, 'state':0, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * Toggle the page tree\n\t *\n\t * @param {object} el    The DOM element\n\t * @param {string} id    The ID of the target element\n\t * @param {int}    level The indentation level\n\t * @param {int}    mode  The insert mode\n\t *\n\t * @returns {boolean}\n\t */\n\ttoggleStructure: function(el, id, level, mode) {\n\t\tif (window.console) {\n\t\t\tconsole.warn('AjaxRequest.toggleStructure() is deprecated. Please use the stimulus controller instead.');\n\t\t}\n\n\t\tel.blur();\n\n\t\tvar item = $(id);\n\n\t\tif (item) {\n\t\t\tif (item.getStyle('display') == 'none') {\n\t\t\t\titem.setStyle('display', null);\n\n\t\t\t\t$(el).addClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.collapse);\n\n\t\t\t\tnew Request.Contao({field:el}).post({'action':'toggleStructure', 'id':id, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t} else {\n\t\t\t\titem.setStyle('display', 'none');\n\n\t\t\t\t$(el).removeClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.expand);\n\n\t\t\t\tnew Request.Contao({field:el}).post({'action':'toggleStructure', 'id':id, 'state':0, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tnew Request.Contao({\n\t\t\tfield: el,\n\t\t\tevalScripts: true,\n\t\t\tonRequest: function() {\n\t\t\t\tAjaxRequest.displayBox(Contao.lang.loading + ' …');\n\t\t\t},\n\t\t\tonSuccess: function(txt) {\n\t\t\t\tvar li = new Element('li', {\n\t\t\t\t\t'id': id,\n\t\t\t\t\t'class': 'parent',\n\t\t\t\t\t'styles': {\n\t\t\t\t\t\t'display': 'inline'\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tnew Element('ul', {\n\t\t\t\t\t'class': 'level_' + level,\n\t\t\t\t\t'html': txt\n\t\t\t\t}).inject(li, 'bottom');\n\n\t\t\t\tif (mode == 5) {\n\t\t\t\t\tli.inject($(el).getParent('li'), 'after');\n\t\t\t\t} else {\n\t\t\t\t\tvar folder = false,\n\t\t\t\t\t\tparent = $(el).getParent('li'),\n\t\t\t\t\t\tnext;\n\n\t\t\t\t\twhile (typeOf(parent) == 'element' && (next = parent.getNext('li'))) {\n\t\t\t\t\t\tparent = next;\n\t\t\t\t\t\tif (parent.hasClass('tl_folder')) {\n\t\t\t\t\t\t\tfolder = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (folder) {\n\t\t\t\t\t\tli.inject(parent, 'before');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tli.inject(parent, 'after');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Update the referer ID\n\t\t\t\tli.getElements('a').each(function(el) {\n\t\t\t\t\tel.href = el.href.replace(/&ref=[a-f0-9]+/, '&ref=' + Contao.referer_id);\n\t\t\t\t});\n\n\t\t\t\t$(el).addClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.collapse);\n\n\t\t\t\twindow.fireEvent('structure');\n\t\t\t\tAjaxRequest.hideBox();\n\n\t\t\t\t// HOOK\n\t\t\t\twindow.fireEvent('ajax_change');\n   \t\t\t}\n\t\t}).post({'action':'loadStructure', 'id':id, 'level':level, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * Toggle the file tree\n\t *\n\t * @param {object} el     The DOM element\n\t * @param {string} id     The ID of the target element\n\t * @param {string} folder The folder's path\n\t * @param {int}    level  The indentation level\n\t *\n\t * @returns {boolean}\n\t */\n\ttoggleFileManager: function(el, id, folder, level) {\n\t\tif (window.console) {\n\t\t\tconsole.warn('AjaxRequest.toggleFileManager() is deprecated. Please use the stimulus controller instead.');\n\t\t}\n\n\t\tel.blur();\n\n\t\tvar item = $(id);\n\n\t\tif (item) {\n\t\t\tif (item.getStyle('display') == 'none') {\n\t\t\t\titem.setStyle('display', null);\n\n\t\t\t\t$(el).addClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.collapse);\n\n\t\t\t\tnew Request.Contao({field:el}).post({'action':'toggleFileManager', 'id':id, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t} else {\n\t\t\t\titem.setStyle('display', 'none');\n\n\t\t\t\t$(el).removeClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.expand);\n\n\t\t\t\tnew Request.Contao({field:el}).post({'action':'toggleFileManager', 'id':id, 'state':0, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tnew Request.Contao({\n\t\t\tfield: el,\n\t\t\tevalScripts: true,\n\t\t\tonRequest: function() {\n\t\t\t\tAjaxRequest.displayBox(Contao.lang.loading + ' …');\n\t\t\t},\n\t\t\tonSuccess: function(txt) {\n\t\t\t\tvar li = new Element('li', {\n\t\t\t\t\t'id': id,\n\t\t\t\t\t'class': 'parent',\n\t\t\t\t\t'styles': {\n\t\t\t\t\t\t'display': 'inline'\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tnew Element('ul', {\n\t\t\t\t\t'class': 'level_' + level,\n\t\t\t\t\t'html': txt\n\t\t\t\t}).inject(li, 'bottom');\n\n\t\t\t\tli.inject($(el).getParent('li'), 'after');\n\n\t\t\t\t// Update the referer ID\n\t\t\t\tli.getElements('a').each(function(el) {\n\t\t\t\t\tel.href = el.href.replace(/&ref=[a-f0-9]+/, '&ref=' + Contao.referer_id);\n\t\t\t\t});\n\n\t\t\t\t$(el).addClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.collapse);\n\n\t\t\t\tAjaxRequest.hideBox();\n\n\t\t\t\t// HOOK\n\t\t\t\twindow.fireEvent('ajax_change');\n   \t\t\t}\n\t\t}).post({'action':'loadFileManager', 'id':id, 'level':level, 'folder':folder, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * Toggle sub-palettes in edit mode\n\t *\n\t * @param {object} el    The DOM element\n\t * @param {string} id    The ID of the target element\n\t * @param {string} field The field name\n\t */\n\ttoggleSubpalette: function(el, id, field) {\n\t\tel.blur();\n\t\tvar item = $(id);\n\n\t\tif (item) {\n\t\t\tif (!el.value) {\n\t\t\t\tel.value = 1;\n\t\t\t\tel.checked = 'checked';\n\t\t\t\titem.setStyle('display', null);\n\t\t\t\titem.getElements('[data-required]').each(function(el) {\n\t\t\t\t\tel.set('required', '').set('data-required', null);\n\t\t\t\t});\n\t\t\t\tnew Request.Contao({field: el, onSuccess:updateVersionNumber}).post({'action':'toggleSubpalette', 'id':id, 'field':field, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t} else {\n\t\t\t\tel.value = '';\n\t\t\t\tel.checked = '';\n\t\t\t\titem.setStyle('display', 'none');\n\t\t\t\titem.getElements('[required]').each(function(el) {\n\t\t\t\t\tel.set('required', null).set('data-required', '');\n\t\t\t\t});\n\t\t\t\tnew Request.Contao({field: el, onSuccess:updateVersionNumber}).post({'action':'toggleSubpalette', 'id':id, 'field':field, 'state':0, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tnew Request.Contao({\n\t\t\tfield: el,\n\t\t\tevalScripts: false,\n\t\t\tonRequest: function() {\n\t\t\t\tAjaxRequest.displayBox(Contao.lang.loading + ' …');\n\t\t\t},\n\t\t\tonSuccess: function(txt, json) {\n\t\t\t\tvar div = new Element('div', {\n\t\t\t\t\t'id': id,\n\t\t\t\t\t'class': 'subpal cf',\n\t\t\t\t\t'html': txt,\n\t\t\t\t\t'styles': {\n\t\t\t\t\t\t'display': 'block'\n\t\t\t\t\t}\n\t\t\t\t}).inject($(el).getParent('div').getParent('div'), 'after');\n\n\t\t\t\t// Execute scripts after the DOM has been updated\n\t\t\t\tif (json.javascript) {\n\n\t\t\t\t\t// Use Asset.javascript() instead of document.write() to load a\n\t\t\t\t\t// JavaScript file and re-execute the code after it has been loaded\n\t\t\t\t\tdocument.write = function(str) {\n\t\t\t\t\t\tvar src = '';\n\t\t\t\t\t\tstr.replace(/<script src=\"([^\"]+)\"/i, function(all, match){\n\t\t\t\t\t\t\tsrc = match;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsrc && Asset.javascript(src, {\n\t\t\t\t\t\t\tonLoad: function() {\n\t\t\t\t\t\t\t\tBrowser.exec(json.javascript);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\n\t\t\t\t\tBrowser.exec(json.javascript);\n\t\t\t\t}\n\n\t\t\t\tel.value = 1;\n\t\t\t\tel.checked = 'checked';\n\n\t\t\t\t// Update the referer ID\n\t\t\t\tdiv.getElements('a').each(function(el) {\n\t\t\t\t\tel.href = el.href.replace(/&ref=[a-f0-9]+/, '&ref=' + Contao.referer_id);\n\t\t\t\t});\n\n\t\t\t\tupdateVersionNumber(txt);\n\n\t\t\t\tAjaxRequest.hideBox();\n\t\t\t\twindow.fireEvent('ajax_change');\n\t\t\t}\n\t\t}).post({'action':'toggleSubpalette', 'id':id, 'field':field, 'load':1, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\n\t\tfunction updateVersionNumber(html) {\n\t\t\tvar fields = el.form.elements.VERSION_NUMBER || [];\n\t\t\tif (!fields.forEach) {\n\t\t\t\tfields = [fields];\n\t\t\t}\n\t\t\tfields.forEach(function(field) {\n\t\t\t\tfield.value = /<input\\s+[^>]*?name=\"VERSION_NUMBER\"\\s+[^>]*?value=\"([^\"]*)\"/i.exec(html)[1];\n\t\t\t});\n\t\t}\n\t},\n\n\t/**\n\t * Toggle the state of a checkbox field\n\t *\n\t * @param {object}  el      The DOM element\n\t * @param {boolean} rowIcon Whether the row icon should be toggled as well\n\t *\n\t * @returns {boolean}\n\t */\n\ttoggleField: function(el, rowIcon) {\n\t\tel.blur();\n\n\t\tvar img = null,\n\t\t\timages = $(el).getElements('img'),\n\t\t\tpublished = (images[0].get('data-state') == 1),\n\t\t\tdiv = el.getParent('div'),\n\t\t\tnext, pa;\n\n\t\tif (rowIcon) {\n\t\t\t// Find the icon depending on the view (tree view, list view, parent view)\n\t\t\tif (div.hasClass('tl_right')) {\n\t\t\t\timg = div.getPrevious('div').getElements('img');\n\t\t\t} else if (div.hasClass('tl_listing_container')) {\n\t\t\t\timg = el.getParent('td').getPrevious('td').getFirst('div.list_icon');\n\t\t\t\tif (img === null) { // comments\n\t\t\t\t\timg = el.getParent('td').getPrevious('td').getElement('div.cte_type');\n\t\t\t\t}\n\t\t\t\tif (img === null) { // showColumns\n\t\t\t\t\timg = el.getParent('tr').getFirst('td').getElement('div.list_icon_new');\n\t\t\t\t}\n\t\t\t} else if (next = div.getNext('div')) {\n\t\t\t\tif (next.hasClass('cte_type')) {\n\t\t\t\t\timg = next;\n\t\t\t\t}\n\t\t\t\tif (img === null) { // newsletter recipients\n\t\t\t\t\timg = next.getFirst('div.list_icon');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Change the row icon\n\t\t\tif (img !== null) {\n\t\t\t\t// Tree view\n\t\t\t\tif (!(img instanceof HTMLElement) && img.forEach) {\n\t\t\t\t\timg.forEach((img) => {\n\t\t\t\t\t\tif (img.nodeName.toLowerCase() == 'img') {\n\t\t\t\t\t\t\tif (!img.getParent('ul.tl_listing').hasClass('tl_tree_xtnd')) {\n\t\t\t\t\t\t\t\tpa = img.getParent('a');\n\n\t\t\t\t\t\t\t\tif (pa && pa.href.indexOf('contao/preview') == -1) {\n\t\t\t\t\t\t\t\t\tif (next = pa.getNext('a')) {\n\t\t\t\t\t\t\t\t\t\timg = next.getElement('img');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\timg = new Element('img'); // no icons used (see #2286)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst newSrc = !published ? img.get('data-icon') : img.get('data-icon-disabled');\n\t\t\t\t\t\t\timg.src = (img.src.includes('/') && !newSrc.includes('/')) ? img.src.slice(0, img.src.lastIndexOf('/') + 1) + newSrc : newSrc;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\t// Parent view\n\t\t\t\telse if (img.hasClass('cte_type')) {\n\t\t\t\t\tif (!published) {\n\t\t\t\t\t\timg.addClass('published');\n\t\t\t\t\t\timg.removeClass('unpublished');\n\t\t\t\t\t} else {\n\t\t\t\t\t\timg.addClass('unpublished');\n\t\t\t\t\t\timg.removeClass('published');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// List view\n\t\t\t\telse {\n\t\t\t\t\timg.setStyle('background-image', 'url(' + (!published ? img.get('data-icon') : img.get('data-icon-disabled')) + ')');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Send request\n\t\timages.forEach(function(image) {\n\t\t\tconst newSrc = !published ? image.get('data-icon') : image.get('data-icon-disabled');\n\t\t\timage.src = (image.src.includes('/') && !newSrc.includes('/')) ? image.src.slice(0, image.src.lastIndexOf('/') + 1) + newSrc : newSrc;\n\t\t\timage.set('data-state', !published ? 1 : 0);\n\t\t});\n\n\t\tif (!published && $(el).get('data-title')) {\n\t\t\tel.title = $(el).get('data-title');\n\t\t} else if (published && $(el).get('data-title-disabled')) {\n\t\t\tel.title = $(el).get('data-title-disabled');\n\t\t}\n\n\t\tnew Request.Contao({'url':el.href, 'followRedirects':false}).get();\n\n\t\t// Return false to stop the click event on link\n\t\treturn false;\n\t},\n\n\t/**\n\t * Toggle a group of a multi-checkbox field\n\t *\n\t * @param {object} el The DOM element\n\t * @param {string} id The ID of the target element\n\t *\n\t * @returns {boolean}\n\t */\n\ttoggleCheckboxGroup: function(el, id) {\n\t\tel.blur();\n\n\t\tvar item = $(id);\n\n\t\tif (item) {\n\t\t\tif (item.getStyle('display') == 'none') {\n\t\t\t\titem.setStyle('display', null);\n\t\t\t\t$(el).addClass('foldable--open');\n\n\t\t\t\tnew Request.Contao().post({'action':'toggleCheckboxGroup', 'id':id, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t} else {\n\t\t\t\titem.setStyle('display', 'none');\n\t\t\t\t$(el).removeClass('foldable--open');\n\n\t\t\t\tnew Request.Contao().post({'action':'toggleCheckboxGroup', 'id':id, 'state':0, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * Display the \"loading data\" message\n\t *\n\t * @param {string} message The message text\n\t */\n\tdisplayBox: function(message) {\n\t\tvar box = $('tl_ajaxBox'),\n\t\t\toverlay = $('tl_ajaxOverlay'),\n\t\t\tscroll = window.getScroll();\n\n\t\tif (overlay === null) {\n\t\t\toverlay = new Element('div', {\n\t\t\t\t'id': 'tl_ajaxOverlay'\n\t\t\t}).inject($(document.body), 'bottom');\n\t\t}\n\n\t\toverlay.set({\n\t\t\t'styles': {\n\t\t\t\t'display': 'block',\n\t\t\t\t'top': scroll.y + 'px'\n\t\t\t}\n\t\t});\n\n\t\tif (box === null) {\n\t\t\tbox = new Element('div', {\n\t\t\t\t'id': 'tl_ajaxBox'\n\t\t\t}).inject($(document.body), 'bottom');\n\t\t}\n\n\t\tbox.set({\n\t\t\t'html': message,\n\t\t\t'styles': {\n\t\t\t\t'display': 'block',\n\t\t\t\t'top': (scroll.y + 100) + 'px'\n\t\t\t}\n\t\t})\n\t},\n\n\t/**\n\t * Hide the \"loading data\" message\n\t */\n\thideBox: function() {\n\t\tvar box = $('tl_ajaxBox'),\n\t\t\toverlay = $('tl_ajaxOverlay');\n\n\t\tif (overlay) {\n\t\t\toverlay.setStyle('display', 'none');\n\t\t}\n\n\t\tif (box) {\n\t\t\tbox.setStyle('display', 'none');\n\t\t}\n\t}\n};\n\n/**\n * Provide methods to handle back end tasks.\n *\n * @author Leo Feyer <https://github.com/leofeyer>\n */\nwindow.Backend =\n{\n\t/**\n\t * The current ID\n\t * @member {(string|null)}\n\t */\n\tcurrentId: null,\n\n\t/**\n\t * The popup window\n\t * @member {object}\n\t */\n\tpopupWindow: null,\n\n\t/**\n\t * The theme path\n\t * @member {string}\n\t */\n\tthemePath: Contao.script_url + 'system/themes/' + Contao.theme + '/',\n\n\t/**\n\t * Open a modal window\n\t *\n\t * @param {int}    width   The width in pixels\n\t * @param {string} title   The window's title\n\t * @param {string} content The window's content\n\t */\n\topenModalWindow: function(width, title, content) {\n\t\tnew SimpleModal({\n\t\t\t'width': width,\n\t\t\t'hideFooter': true,\n\t\t\t'draggable': false,\n\t\t\t'overlayOpacity': .7,\n\t\t\t'onShow': function() { document.body.setStyle('overflow', 'hidden'); },\n\t\t\t'onHide': function() { document.body.setStyle('overflow', 'auto'); }\n\t\t}).show({\n\t\t\t'title': title,\n\t\t\t'contents': content\n\t\t});\n\t},\n\n\t/**\n\t * Open an image in a modal window\n\t *\n\t * @param {object} options An optional options object\n\t */\n\topenModalImage: function(options) {\n\t\tvar opt = options || {},\n\t\t\tmaxWidth = (window.getSize().x - 20).toInt();\n\t\tif (!opt.width || opt.width > maxWidth) opt.width = Math.min(maxWidth, 900);\n\t\tvar M = new SimpleModal({\n\t\t\t'width': opt.width,\n\t\t\t'hideFooter': true,\n\t\t\t'draggable': false,\n\t\t\t'overlayOpacity': .7,\n\t\t\t'onShow': function() { document.body.setStyle('overflow', 'hidden'); },\n\t\t\t'onHide': function() { document.body.setStyle('overflow', 'auto'); }\n\t\t});\n\t\tM.show({\n\t\t\t'title': opt.title,\n\t\t\t'contents': '<img src=\"' + opt.url + '\" alt=\"\">'\n\t\t});\n\t},\n\n\t/**\n\t * Open an iframe in a modal window\n\t *\n\t * @param {object} options An optional options object\n\t */\n\topenModalIframe: function(options) {\n\t\tvar opt = options || {},\n\t\t\tmaxWidth = (window.getSize().x - 20).toInt(),\n\t\t\tmaxHeight = (window.getSize().y - 137).toInt();\n\t\tif (!opt.width || opt.width > maxWidth) opt.width = Math.min(maxWidth, 900);\n\t\tif (!opt.height || opt.height > maxHeight) opt.height = maxHeight;\n\t\tvar M = new SimpleModal({\n\t\t\t'width': opt.width,\n\t\t\t'hideFooter': true,\n\t\t\t'draggable': false,\n\t\t\t'overlayOpacity': .7,\n\t\t\t'onShow': function() { document.body.setStyle('overflow', 'hidden'); },\n\t\t\t'onHide': function() { document.body.setStyle('overflow', 'auto'); }\n\t\t});\n\t\tM.show({\n\t\t\t'title': opt.title,\n\t\t\t'contents': '<iframe src=\"' + opt.url + '\" width=\"100%\" height=\"' + opt.height + '\" frameborder=\"0\"></iframe>',\n\t\t\t'model': 'modal'\n\t\t});\n\t},\n\n\t/**\n\t * Open a selector page in a modal window\n\t *\n\t * @param {object} options An optional options object\n\t */\n\topenModalSelector: function(options) {\n\t\tvar opt = options || {},\n\t\t\tmaxWidth = (window.getSize().x - 20).toInt(),\n\t\t\tmaxHeight = (window.getSize().y - 192).toInt();\n\t\tif (!opt.id) opt.id = 'tl_select';\n\t\tif (!opt.width || opt.width > maxWidth) opt.width = Math.min(maxWidth, 900);\n\t\tif (!opt.height || opt.height > maxHeight) opt.height = maxHeight;\n\t\tvar M = new SimpleModal({\n\t\t\t'width': opt.width,\n\t\t\t'draggable': false,\n\t\t\t'overlayOpacity': .7,\n\t\t\t'onShow': function() { document.body.setStyle('overflow', 'hidden'); },\n\t\t\t'onHide': function() { document.body.setStyle('overflow', 'auto'); }\n\t\t});\n\t\tM.addButton(Contao.lang.cancel, 'btn', function() {\n\t\t\tif (this.buttons[0].hasClass('btn-disabled')) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.hide();\n\t\t});\n\t\tM.addButton(Contao.lang.apply, 'btn primary', function() {\n\t\t\tif (this.buttons[1].hasClass('btn-disabled')) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar frm = window.frames['simple-modal-iframe'],\n\t\t\t\tval = [], ul, inp, i, pickerValue, sIndex;\n\t\t\tif (frm === undefined) {\n\t\t\t\talert('Could not find the SimpleModal frame');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tul = frm.document.getElementById(opt.id);\n\t\t\t// Load the previous values (#1816)\n\t\t\tif (pickerValue = ul.get('data-picker-value')) {\n\t\t\t\tval = JSON.parse(pickerValue);\n\t\t\t}\n\t\t\tinp = ul.getElementsByTagName('input');\n\t\t\tfor (i=0; i<inp.length; i++) {\n\t\t\t\tif (inp[i].id.match(/^(check_all_|reset_)/)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Add currently selected value, otherwise remove (#1816)\n\t\t\t\tsIndex = val.indexOf(inp[i].get('value'));\n\t\t\t\tif (inp[i].checked) {\n\t\t\t\t\tif (sIndex == -1) {\n\t\t\t\t\t\tval.push(inp[i].get('value'));\n\t\t\t\t\t}\n\t\t\t\t} else if (sIndex != -1) {\n\t\t\t\t\tval.splice(sIndex, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\topt.callback(ul.get('data-table'), val);\n\t\t\tthis.hide();\n\t\t});\n\t\tM.show({\n\t\t\t'title': opt.title,\n\t\t\t'contents': '<iframe src=\"' + opt.url + '\" name=\"simple-modal-iframe\" width=\"100%\" height=\"' + opt.height + '\" frameborder=\"0\"></iframe>',\n\t\t\t'model': 'modal'\n\t\t});\n\t},\n\n\t/**\n\t * Open a TinyMCE file browser in a modal window\n\t *\n\t * @param {string} field_name The field name\n\t * @param {string} url        The URL\n\t * @param {string} type       The picker type\n\t * @param {object} win        The window object\n\t * @param {string} source     The source record\n\t */\n\topenModalBrowser: function(field_name, url, type, win, source) {\n\t\tBackend.openModalSelector({\n\t\t\t'id': 'tl_listing',\n\t\t\t'title': win.document.getElement('div.mce-title').get('text'),\n\t\t\t'url': Contao.routes.backend_picker + '?context=' + (type == 'file' ? 'link' : 'file') + '&amp;extras[fieldType]=radio&amp;extras[filesOnly]=true&amp;extras[source]=' + source + '&amp;value=' + url + '&amp;popup=1',\n\t\t\t'callback': function(table, value) {\n\t\t\t\twin.document.getElementById(field_name).value = value.join(',');\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Automatically submit a form\n\t *\n\t * @param {object} el The DOM element\n\t */\n\tautoSubmit: function(el) {\n\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\n\t\tvar hidden = new Element('input', {\n\t\t\t'type': 'hidden',\n\t\t\t'name': 'SUBMIT_TYPE',\n\t\t\t'value': 'auto'\n\t\t});\n\n\t\tvar form = $(el) || el;\n\t\thidden.inject(form, 'bottom');\n\t\tform.submit();\n\t},\n\n\t/**\n\t * Scroll the window to a certain vertical position\n\t *\n\t * @param {int} offset The offset to scroll to\n\t */\n\tvScrollTo: function(offset) {\n\t\twindow.addEvent('load', function() {\n\t\t\twindow.scrollTo(null, parseInt(offset));\n\t\t});\n\t},\n\n\t/**\n\t * Toggle checkboxes\n\t *\n\t * @param {object} el   The DOM element\n\t * @param {string} [id] The ID of the target element\n\t */\n\ttoggleCheckboxes: function(el, id) {\n\t\tvar items = $$('input'),\n\t\t\tstatus = $(el).checked ? 'checked' : '';\n\n\t\tfor (var i=0; i<items.length; i++) {\n\t\t\tif (items[i].type.toLowerCase() != 'checkbox') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (id !== undefined && id != items[i].id.substr(0, id.length)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\titems[i].checked = status;\n\t\t}\n\t},\n\n\t/**\n\t * Toggle a checkbox group\n\t *\n\t * @param {object} el The DOM element\n\t * @param {string} id The ID of the target element\n\t */\n\ttoggleCheckboxGroup: function(el, id) {\n\t\tvar cls = $(el).className,\n\t\t\tstatus = $(el).checked ? 'checked' : '';\n\n\t\tif (cls == 'tl_checkbox') {\n\t\t\tvar cbx = $(id) ? $$('#' + id + ' .tl_checkbox') : $(el).getParent('fieldset').getElements('.tl_checkbox');\n\t\t\tcbx.each(function(checkbox) {\n\t\t\t\tcheckbox.checked = status;\n\t\t\t});\n\t\t} else if (cls == 'tl_tree_checkbox') {\n\t\t\t$$('#' + id + ' .parent .tl_tree_checkbox').each(function(checkbox) {\n\t\t\t\tcheckbox.checked = status;\n\t\t\t});\n\t\t}\n\n\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t},\n\n\t/**\n\t * Toggle checkbox elements\n\t *\n\t * @param {string} el  The DOM element\n\t * @param {string} cls The CSS class name\n\t */\n\ttoggleCheckboxElements: function(el, cls) {\n\t\tvar status = $(el).checked ? 'checked' : '';\n\n\t\t$$('.' + cls).each(function(checkbox) {\n\t\t\tif (checkbox.hasClass('tl_checkbox')) {\n\t\t\t\tcheckbox.checked = status;\n\t\t\t}\n\t\t});\n\n\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t},\n\n\t/**\n\t * Make parent view items sortable\n\t *\n\t * @param {object} ul The DOM element\n\t *\n\t * @author Joe Ray Gregory\n\t * @author Martin Auswöger\n\t */\n\tmakeParentViewSortable: function(ul) {\n\t\tvar ds = new Scroller(document.getElement('body'), {\n\t\t\tonChange: function(x, y) {\n\t\t\t\tthis.element.scrollTo(this.element.getScroll().x, y);\n\t\t\t}\n\t\t});\n\n\t\tvar list = new Sortables(ul, {\n\t\t\tconstrain: true,\n\t\t\topacity: 0.6,\n\t\t\tonStart: function() {\n\t\t\t\tds.start();\n\t\t\t},\n\t\t\tonComplete: function() {\n\t\t\t\tds.stop();\n\t\t\t},\n\t\t\tonSort: function(el) {\n\t\t\t\tvar ul = el.getParent('ul'),\n\t\t\t\t\twrapLevel = 0, divs, i;\n\n\t\t\t\tif (!ul) return;\n\n\t\t\t\tdivs = ul.getChildren('li > div:first-child');\n\n\t\t\t\tif (!divs) return;\n\n\t\t\t\tfor (i=0; i<divs.length; i++) {\n\t\t\t\t\tif (divs[i].hasClass('wrapper_stop') && wrapLevel > 0) {\n\t\t\t\t\t\twrapLevel--;\n\t\t\t\t\t}\n\n\t\t\t\t\tdivs[i].className = divs[i].className.replace(/(^|\\s)indent[^\\s]*/g, '');\n\n\t\t\t\t\tif (wrapLevel > 0) {\n\t\t\t\t\t\tdivs[i].addClass('indent').addClass('indent_' + wrapLevel);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (divs[i].hasClass('wrapper_start')) {\n\t\t\t\t\t\twrapLevel++;\n\t\t\t\t\t}\n\n\t\t\t\t\tdivs[i].removeClass('indent_first');\n\t\t\t\t\tdivs[i].removeClass('indent_last');\n\n\t\t\t\t\tif (divs[i-1] && divs[i-1].hasClass('wrapper_start')) {\n\t\t\t\t\t\tdivs[i].addClass('indent_first');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (divs[i+1] && divs[i+1].hasClass('wrapper_stop')) {\n\t\t\t\t\t\tdivs[i].addClass('indent_last');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\thandle: '.drag-handle'\n\t\t});\n\n\t\tlist.active = false;\n\n\t\tlist.addEvent('start', function() {\n\t\t\tlist.active = true;\n\t\t});\n\n\t\tlist.addEvent('complete', function(el) {\n\t\t\tif (!list.active) return;\n\t\t\tvar id, pid, req, href;\n\n\t\t\tif (el.getPrevious('li')) {\n\t\t\t\tid = el.get('id').replace(/li_/, '');\n\t\t\t\tpid = el.getPrevious('li').get('id').replace(/li_/, '');\n\t\t\t\treq = window.location.search.replace(/id=[0-9]*/, 'id=' + id) + '&act=cut&mode=1&pid=' + pid;\n\t\t\t\thref = window.location.href.replace(/\\?.*$/, '');\n\t\t\t\tnew Request.Contao({'url':href + req, 'followRedirects':false}).get();\n\t\t\t} else if (el.getParent('ul')) {\n\t\t\t\tid = el.get('id').replace(/li_/, '');\n\t\t\t\tpid = el.getParent('ul').get('id').replace(/ul_/, '');\n\t\t\t\treq = window.location.search.replace(/id=[0-9]*/, 'id=' + id) + '&act=cut&mode=2&pid=' + pid;\n\t\t\t\thref = window.location.href.replace(/\\?.*$/, '');\n\t\t\t\tnew Request.Contao({'url':href + req, 'followRedirects':false}).get();\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Make multiSRC items sortable\n\t *\n\t * @param {string} id  The ID of the target element\n\t * @param {string} oid The order field\n\t * @param {string} val The value field\n\t */\n\tmakeMultiSrcSortable: function(id, oid, val) {\n\t\tvar list = new Sortables($(id), {\n\t\t\tconstrain: true,\n\t\t\topacity: 0.6\n\t\t}).addEvent('complete', function() {\n\t\t\tvar els = [],\n\t\t\t\tlis = $(id).getChildren('[data-id]'),\n\t\t\t\ti;\n\t\t\tfor (i=0; i<lis.length; i++) {\n\t\t\t\tels.push(lis[i].get('data-id'));\n\t\t\t}\n\t\t\tif (oid === val) {\n\t\t\t\t$(val).value.split(',').forEach(function(j) {\n\t\t\t\t\tif (els.indexOf(j) === -1) {\n\t\t\t\t\t\tels.push(j);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t$(oid).value = els.join(',');\n\t\t});\n\t\t$(id).getElements('.gimage').each(function(el) {\n\t\t\tif (el.hasClass('removable')) {\n\t\t\t\tnew Element('button', {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\thtml: '&times;',\n\t\t\t\t\t'class': 'tl_red'\n\t\t\t\t}).addEvent('click', function() {\n\t\t\t\t\tvar li = el.getParent('li'),\n\t\t\t\t\t\tdid = li.get('data-id');\n\t\t\t\t\t$(val).value = $(val).value.split(',').filter(function(j) { return j != did; }).join(',');\n\t\t\t\t\t$(oid).value = $(oid).value.split(',').filter(function(j) { return j != did; }).join(',');\n\t\t\t\t\tli.dispose();\n\t\t\t\t}).inject(el, 'after');\n\t\t\t} else {\n\t\t\t\tnew Element('button', {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\thtml: '&times',\n\t\t\t\t\tdisabled: true\n\t\t\t\t}).inject(el, 'after');\n\t\t\t}\n\t\t});\n\t\tlist.fireEvent(\"complete\"); // Initial sorting\n\t},\n\n\t/**\n\t * Enable drag and drop for the file tree\n\t *\n\t * @param {object} ul      The DOM element\n\t * @param {object} options An optional options object\n\t */\n\tenableFileTreeDragAndDrop: function(ul, options) {\n\t\tvar ds = new Scroller(document.getElement('body'), {\n\t\t\tonChange: function(x, y) {\n\t\t\t\tthis.element.scrollTo(this.element.getScroll().x, y);\n\t\t\t}\n\t\t});\n\n\t\tul.addEvent('mousedown', function(event) {\n\t\t\tvar dragHandle = event.target.hasClass('drag-handle') ? event.target : event.target.getParent('.drag-handle');\n\t\t\tvar dragElement = event.target.getParent('.tl_file,.tl_folder');\n\n\t\t\tif (!dragHandle || !dragElement || event.rightClick) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tds.start();\n\t\t\tul.addClass('tl_listing_dragging');\n\n\t\t\tvar cloneBase = (dragElement.getElements('.tl_left')[0] || dragElement),\n\t\t\t\tclone = cloneBase.clone(true)\n\t\t\t\t\t.inject(ul)\n\t\t\t\t\t.addClass('tl_left_dragging'),\n\t\t\t\tcurrentHover, currentHoverTime, expandLink;\n\n\t\t\tclone.setPosition({\n\t\t\t\tx: event.page.x - cloneBase.getOffsetParent().getPosition().x - clone.getSize().x,\n\t\t\t\ty: cloneBase.getPosition(cloneBase.getOffsetParent()).y\n\t\t\t}).setStyle('display', 'none');\n\n\t\t\tvar move = new Drag.Move(clone, {\n\t\t\t\tdroppables: $$([ul]).append(ul.getElements('.tl_folder,li.parent,.tl_folder_top')),\n\t\t\t\tunDraggableTags: [],\n\t\t\t\tmodifiers: {\n\t\t\t\t\tx: 'left',\n\t\t\t\t\ty: 'top'\n\t\t\t\t},\n\t\t\t\tonStart: function() {\n\t\t\t\t\tclone.setStyle('display', '');\n\t\t\t\t},\n\t\t\t\tonEnter: function(element, droppable) {\n\t\t\t\t\tdroppable = fixDroppable(droppable);\n\t\t\t\t\tdroppable.addClass('tl_folder_dropping');\n\n\t\t\t\t\tif (droppable.hasClass('tl_folder') && currentHover !== droppable) {\n\t\t\t\t\t\tcurrentHover = droppable;\n\t\t\t\t\t\tcurrentHoverTime = new Date().getTime();\n\t\t\t\t\t\texpandLink = droppable.getElement('a.foldable');\n\n\t\t\t\t\t\tif (expandLink && !expandLink.hasClass('foldable--open')) {\n\t\t\t\t\t\t\t// Expand the folder after one second hover time\n\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tif (currentHover === droppable && currentHoverTime + 900 < new Date().getTime()) {\n\t\t\t\t\t\t\t\t\tvar event = document.createEvent('HTMLEvents');\n\t\t\t\t\t\t\t\t\tevent.initEvent('click', true, true);\n\t\t\t\t\t\t\t\t\texpandLink.dispatchEvent(event);\n\n\t\t\t\t\t\t\t\t\tcurrentHover = undefined;\n\t\t\t\t\t\t\t\t\tcurrentHoverTime = undefined;\n\n\t\t\t\t\t\t\t\t\twindow.addEvent('ajax_change', function onAjax() {\n\t\t\t\t\t\t\t\t\t\tif (move && move.droppables && ul && ul.getElements) {\n\t\t\t\t\t\t\t\t\t\t\tmove.droppables = $$([ul]).append(ul.getElements('.tl_folder,li.parent'));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\twindow.removeEvent('ajax_change', onAjax);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonCancel: function() {\n\t\t\t\t\tcurrentHover = undefined;\n\t\t\t\t\tcurrentHoverTime = undefined;\n\n\t\t\t\t\tds.stop();\n\t\t\t\t\tclone.destroy();\n\t\t\t\t\twindow.removeEvent('keyup', onKeyup);\n\t\t\t\t\tul.getElements('.tl_folder_dropping').removeClass('tl_folder_dropping');\n\t\t\t\t\tul.removeClass('tl_listing_dragging');\n\t\t\t\t},\n\t\t\t\tonDrop: function(element, droppable) {\n\t\t\t\t\tcurrentHover = undefined;\n\t\t\t\t\tcurrentHoverTime = undefined;\n\n\t\t\t\t\tds.stop();\n\t\t\t\t\tclone.destroy();\n\t\t\t\t\twindow.removeEvent('keyup', onKeyup);\n\t\t\t\t\tul.getElements('.tl_folder_dropping').removeClass('tl_folder_dropping');\n\t\t\t\t\tul.removeClass('tl_listing_dragging');\n\n\t\t\t\t\tdroppable = fixDroppable(droppable);\n\n\t\t\t\t\tif (!droppable) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar id = dragElement.get('data-id'),\n\t\t\t\t\t\tpid = droppable.get('data-id') || decodeURIComponent(options.url.split(/[?&]pid=/)[1].split('&')[0]);\n\n\t\t\t\t\t// Ignore invalid move operations\n\t\t\t\t\tif (id && pid && ((pid+'/').indexOf(id+'/') === 0 || pid+'/' === id.replace(/[^/]+$/, ''))) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\tdocument.location.href = options.url + '&id=' + encodeURIComponent(id) + '&pid=' + encodeURIComponent(pid);\n\t\t\t\t},\n\t\t\t\tonLeave: function(element, droppable) {\n\t\t\t\t\tdroppable = fixDroppable(droppable);\n\t\t\t\t\tdroppable.removeClass('tl_folder_dropping');\n\t\t\t\t\tcurrentHover = undefined;\n\t\t\t\t\tcurrentHoverTime = undefined;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tmove.start(event);\n\t\t\twindow.addEvent('keyup', onKeyup);\n\n\t\t\tfunction onKeyup(event) {\n\t\t\t\tif (event.key === 'esc' && move && move.stop) {\n\t\t\t\t\tmove.droppables = $$([]);\n\t\t\t\t\tmove.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfunction fixDroppable(droppable) {\n\t\t\tif (droppable && droppable.hasClass('parent') && droppable.getPrevious('.tl_folder')) {\n\t\t\t\treturn droppable.getPrevious('.tl_folder');\n\t\t\t}\n\n\t\t\treturn droppable;\n\t\t}\n\t},\n\n\t/**\n\t * List wizard\n\t *\n\t * @param {string} id The ID of the target element\n\t */\n\tlistWizard: function(id) {\n\t\tvar ul = $(id),\n\t\t\tmakeSortable = function(ul) {\n\t\t\t\tnew Sortables(ul, {\n\t\t\t\t\tconstrain: true,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t\thandle: '.drag-handle'\n\t\t\t\t});\n\t\t\t},\n\t\t\taddEventsTo = function(li) {\n\t\t\t\tvar command, clone, input, previous, next;\n\n\t\t\t\tli.getElements('button').each(function(bt) {\n\t\t\t\t\tif (bt.hasEvent('click')) return;\n\t\t\t\t\tcommand = bt.getProperty('data-command');\n\n\t\t\t\t\tswitch (command) {\n\t\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tclone = li.clone(true).inject(li, 'before');\n\t\t\t\t\t\t\t\tif (input = li.getFirst('input')) {\n\t\t\t\t\t\t\t\t\tclone.getFirst('input').value = input.value;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taddEventsTo(clone);\n\t\t\t\t\t\t\t\tinput.select();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tif (ul.getChildren().length > 1) {\n\t\t\t\t\t\t\t\t\tli.destroy();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase null:\n\t\t\t\t\t\t\tbt.addEvent('keydown', function(e) {\n\t\t\t\t\t\t\t\tif (e.event.keyCode == 38) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (previous = li.getPrevious('li')) {\n\t\t\t\t\t\t\t\t\t\tli.inject(previous, 'before');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tli.inject(ul, 'bottom');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t} else if (e.event.keyCode == 40) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (next = li.getNext('li')) {\n\t\t\t\t\t\t\t\t\t\tli.inject(next, 'after');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tli.inject(ul.getFirst('li'), 'before');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\n\t\tmakeSortable(ul);\n\n\t\tul.getChildren().each(function(li) {\n\t\t\taddEventsTo(li);\n\t\t});\n\t},\n\n\t/**\n\t * Table wizard\n\t *\n\t * @param {string} id The ID of the target element\n\t */\n\ttableWizard: function(id) {\n\t\tvar table = $(id),\n\t\t\tthead = table.getElement('thead'),\n\t\t\ttbody = table.getElement('tbody'),\n\t\t\tmakeSortable = function(tbody) {\n\t\t\t\tvar rows = tbody.getChildren(),\n\t\t\t\t\ttextarea, children, i, j;\n\n\t\t\t\tfor (i=0; i<rows.length; i++) {\n\t\t\t\t\tchildren = rows[i].getChildren();\n\t\t\t\t\tfor (j=0; j<children.length; j++) {\n\t\t\t\t\t\tif (textarea = children[j].getFirst('textarea')) {\n\t\t\t\t\t\t\ttextarea.name = textarea.name.replace(/\\[[0-9]+][[0-9]+]/g, '[' + i + '][' + j + ']')\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnew Sortables(tbody, {\n\t\t\t\t\tconstrain: true,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t\thandle: '.drag-handle',\n\t\t\t\t\tonComplete: function() {\n\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\taddEventsTo = function(tr) {\n\t\t\t\tvar head = thead.getFirst('tr'),\n\t\t\t\t\tcommand, textarea, current, next, ntr, children, index, i;\n\n\t\t\t\ttr.getElements('button').each(function(bt) {\n\t\t\t\t\tif (bt.hasEvent('click')) return;\n\t\t\t\t\tcommand = bt.getProperty('data-command');\n\n\t\t\t\t\tswitch (command) {\n\t\t\t\t\t\tcase 'rcopy':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tntr = new Element('tr');\n\t\t\t\t\t\t\t\tchildren = tr.getChildren();\n\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\tnext = children[i].clone(true).inject(ntr, 'bottom');\n\t\t\t\t\t\t\t\t\tif (textarea = children[i].getFirst('textarea')) {\n\t\t\t\t\t\t\t\t\t\tnext.getFirst('textarea').value = textarea.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tntr.inject(tr, 'after');\n\t\t\t\t\t\t\t\taddEventsTo(ntr);\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\tntr.getFirst('td').getFirst('textarea').select();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'rdelete':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tif (tbody.getChildren().length > 1) {\n\t\t\t\t\t\t\t\t\ttr.destroy();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'ccopy':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tindex = getIndex(bt);\n\t\t\t\t\t\t\t\tchildren = tbody.getChildren();\n\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\tcurrent = children[i].getChildren()[index];\n\t\t\t\t\t\t\t\t\tnext = current.clone(true).inject(current, 'after');\n\t\t\t\t\t\t\t\t\tif (textarea = current.getFirst('textarea')) {\n\t\t\t\t\t\t\t\t\t\tnext.getFirst('textarea').value = textarea.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taddEventsTo(next);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar headFirst = head.getFirst('td');\n\t\t\t\t\t\t\t\tnext = headFirst.clone(true).inject(head.getLast('td'), 'before');\n\t\t\t\t\t\t\t\taddEventsTo(next);\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\tchildren[0].getChildren()[index + 1].getFirst('textarea').select();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'cmovel':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tindex = getIndex(bt);\n\t\t\t\t\t\t\t\tchildren = tbody.getChildren();\n\t\t\t\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\t\tcurrent = children[i].getChildren()[index];\n\t\t\t\t\t\t\t\t\t\tcurrent.inject(current.getPrevious(), 'before');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\t\tcurrent = children[i].getChildren()[index];\n\t\t\t\t\t\t\t\t\t\tcurrent.inject(children[i].getLast(), 'before');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'cmover':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tindex = getIndex(bt);\n\t\t\t\t\t\t\t\tchildren = tbody.getChildren();\n\t\t\t\t\t\t\t\tif (index < (tr.getChildren().length - 2)) {\n\t\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\t\tcurrent = children[i].getChildren()[index];\n\t\t\t\t\t\t\t\t\t\tcurrent.inject(current.getNext(), 'after');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\t\tcurrent = children[i].getChildren()[index];\n\t\t\t\t\t\t\t\t\t\tcurrent.inject(children[i].getFirst(), 'before');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'cdelete':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tindex = getIndex(bt);\n\t\t\t\t\t\t\t\tchildren = tbody.getChildren();\n\t\t\t\t\t\t\t\tif (tr.getChildren().length > 2) {\n\t\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\t\tchildren[i].getChildren()[index].destroy();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\thead.getFirst('td').destroy();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase null:\n\t\t\t\t\t\t\tbt.addEvent('keydown', function(e) {\n\t\t\t\t\t\t\t\tif (e.event.keyCode == 38) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getPrevious('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'before');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'bottom');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t} else if (e.event.keyCode == 40) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getNext('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'after');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'top');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\tgetIndex = function(bt) {\n\t\t\t\tvar td = $(bt).getParent('td'),\n\t\t\t\t\ttr = td.getParent('tr'),\n\t\t\t\t\tcols = tr.getChildren(),\n\t\t\t\t\tindex = 0, i;\n\n\t\t\t\tfor (i=0; i<cols.length; i++) {\n\t\t\t\t\tif (cols[i] == td) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\n\t\t\t\treturn index;\n\t\t\t};\n\n\t\tmakeSortable(tbody);\n\n\t\tthead.getChildren().each(function(tr) {\n\t\t\taddEventsTo(tr);\n\t\t});\n\n\t\ttbody.getChildren().each(function(tr) {\n\t\t\taddEventsTo(tr);\n\t\t});\n\n\t\tBackend.tableWizardResize();\n\t},\n\n\t/**\n\t * Resize the table wizard fields on focus\n\t *\n\t * @param {float} [factor] The resize factor\n\t */\n\ttableWizardResize: function(factor) {\n\t\tvar size = window.localStorage.getItem('contao_table_wizard_cell_size');\n\n\t\tif (factor !== undefined) {\n\t\t\tsize = '';\n\t\t\t$$('.tl_tablewizard textarea').each(function(el) {\n\t\t\t\tel.setStyle('width', (el.getStyle('width').toInt() * factor).round().limit(142, 284));\n\t\t\t\tel.setStyle('height', (el.getStyle('height').toInt() * factor).round().limit(66, 132));\n\t\t\t\tif (size == '') {\n\t\t\t\t\tsize = el.getStyle('width') + '|' + el.getStyle('height');\n\t\t\t\t}\n\t\t\t});\n\t\t\twindow.localStorage.setItem('contao_table_wizard_cell_size', size);\n\t\t} else if (size !== null) {\n\t\t\tvar chunks = size.split('|');\n\t\t\t$$('.tl_tablewizard textarea').each(function(el) {\n\t\t\t\tel.setStyle('width', chunks[0]);\n\t\t\t\tel.setStyle('height', chunks[1]);\n\t\t\t});\n\t\t}\n\t},\n\n\t/**\n\t * Set the width of the table wizard\n\t */\n\ttableWizardSetWidth: function() {\n\t\tvar wrap = $('tl_tablewizard');\n\t\tif (!wrap) return;\n\t\twrap.setStyle('width', Math.round(wrap.getParent('.tl_formbody_edit').getComputedSize().width * 0.96));\n\t},\n\n\t/**\n\t * Options wizard\n\t *\n\t * @param {string} id The ID of the target element\n\t */\n\toptionsWizard: function(id) {\n\t\tvar table = $(id),\n\t\t\ttbody = table.getElement('tbody'),\n\t\t\tmakeSortable = function(tbody) {\n\t\t\t\tvar rows = tbody.getChildren(),\n\t\t\t\t\tchildren, i, j, input;\n\n\t\t\t\tfor (i=0; i<rows.length; i++) {\n\t\t\t\t\tchildren = rows[i].getChildren();\n\t\t\t\t\tfor (j=0; j<children.length; j++) {\n\t\t\t\t\t\tif (input = children[j].getFirst('input')) {\n\t\t\t\t\t\t\tinput.name = input.name.replace(/\\[[0-9]+]/g, '[' + i + ']');\n\t\t\t\t\t\t\tif (input.type == 'checkbox') {\n\t\t\t\t\t\t\t\tinput.id = input.name.replace(/\\[[0-9]+]/g, '').replace(/\\[/g, '_').replace(/]/g, '') + '_' + i;\n\t\t\t\t\t\t\t\tinput.getNext('label').set('for', input.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnew Sortables(tbody, {\n\t\t\t\t\tconstrain: true,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t\thandle: '.drag-handle',\n\t\t\t\t\tonComplete: function() {\n\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\taddEventsTo = function(tr) {\n\t\t\t\tvar command, input, next, ntr, children, i;\n\t\t\t\ttr.getElements('button').each(function(bt) {\n\t\t\t\t\tif (bt.hasEvent('click')) return;\n\t\t\t\t\tcommand = bt.getProperty('data-command');\n\n\t\t\t\t\tswitch (command) {\n\t\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tntr = new Element('tr');\n\t\t\t\t\t\t\t\tchildren = tr.getChildren();\n\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\tnext = children[i].clone(true).inject(ntr, 'bottom');\n\t\t\t\t\t\t\t\t\tif (input = children[i].getFirst('input')) {\n\t\t\t\t\t\t\t\t\t\tnext.getFirst('input').value = input.value;\n\t\t\t\t\t\t\t\t\t\tif (input.type == 'checkbox') {\n\t\t\t\t\t\t\t\t\t\t\tnext.getFirst('input').checked = input.checked ? 'checked' : '';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tntr.inject(tr, 'after');\n\t\t\t\t\t\t\t\taddEventsTo(ntr);\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\tntr.getFirst('td').getFirst('input').select();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tif (tbody.getChildren().length > 1) {\n\t\t\t\t\t\t\t\t\ttr.destroy();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase null:\n\t\t\t\t\t\t\tbt.addEvent('keydown', function(e) {\n\t\t\t\t\t\t\t\tif (e.event.keyCode == 38) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getPrevious('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'before');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'bottom');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t} else if (e.event.keyCode == 40) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getNext('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'after');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'top');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\n\t\tmakeSortable(tbody);\n\n\t\ttbody.getChildren().each(function(tr) {\n\t\t\taddEventsTo(tr);\n\t\t});\n\t},\n\n\t/**\n\t * Key/value wizard\n\t *\n\t * @param {string} id The ID of the target element\n\t */\n\tkeyValueWizard: function(id) {\n\t\tvar table = $(id),\n\t\t\ttbody = table.getElement('tbody'),\n\t\t\tmakeSortable = function(tbody) {\n\t\t\t\tvar rows = tbody.getChildren(),\n\t\t\t\t\tchildren, i, j, input;\n\n\t\t\t\tfor (i=0; i<rows.length; i++) {\n\t\t\t\t\tchildren = rows[i].getChildren();\n\t\t\t\t\tfor (j=0; j<children.length; j++) {\n\t\t\t\t\t\tif (input = children[j].getFirst('input')) {\n\t\t\t\t\t\t\tinput.name = input.name.replace(/\\[[0-9]+]/g, '[' + i + ']')\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnew Sortables(tbody, {\n\t\t\t\t\tconstrain: true,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t\thandle: '.drag-handle',\n\t\t\t\t\tonComplete: function() {\n\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\taddEventsTo = function(tr) {\n\t\t\t\tvar command, input, next, ntr, children, i;\n\t\t\t\ttr.getElements('button').each(function(bt) {\n\t\t\t\t\tif (bt.hasEvent('click')) return;\n\t\t\t\t\tcommand = bt.getProperty('data-command');\n\n\t\t\t\t\tswitch (command) {\n\t\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tntr = new Element('tr');\n\t\t\t\t\t\t\t\tchildren = tr.getChildren();\n\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\tnext = children[i].clone(true).inject(ntr, 'bottom');\n\t\t\t\t\t\t\t\t\tif (input = children[i].getFirst('input')) {\n\t\t\t\t\t\t\t\t\t\tnext.getFirst().value = input.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tntr.inject(tr, 'after');\n\t\t\t\t\t\t\t\taddEventsTo(ntr);\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\tntr.getFirst('td').getFirst('input').select();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tif (tbody.getChildren().length > 1) {\n\t\t\t\t\t\t\t\t\ttr.destroy();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase null:\n\t\t\t\t\t\t\tbt.addEvent('keydown', function(e) {\n\t\t\t\t\t\t\t\tif (e.event.keyCode == 38) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getPrevious('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'before');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'bottom');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t} else if (e.event.keyCode == 40) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getNext('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'after');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'top');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\n\t\tmakeSortable(tbody);\n\n\t\ttbody.getChildren().each(function(tr) {\n\t\t\taddEventsTo(tr);\n\t\t});\n\t},\n\n\t/**\n\t * Checkbox wizard\n\t *\n\t * @param {string} id The ID of the target element\n\t */\n\tcheckboxWizard: function(id) {\n\t\tvar container = $(id).getElement('.sortable'),\n\t\t\tmakeSortable = function(container) {\n\t\t\t\tnew Sortables(container, {\n\t\t\t\t\tconstrain: true,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t\thandle: '.drag-handle'\n\t\t\t\t});\n\t\t\t},\n\t\t\taddEventsTo = function(span) {\n\t\t\t\tvar nspan;\n\t\t\t\tspan.getElements('button').each(function(bt) {\n\t\t\t\t\tif (bt.hasEvent('click')) return;\n\t\t\t\t\tbt.addEvent('keydown', function(e) {\n\t\t\t\t\t\tif (e.event.keyCode == 38) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tif ((nspan = span.getPrevious('span'))) {\n\t\t\t\t\t\t\t\tspan.inject(nspan, 'before');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tspan.inject(container, 'bottom');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t} else if (e.event.keyCode == 40) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tif (nspan = span.getNext('span')) {\n\t\t\t\t\t\t\t\tspan.inject(nspan, 'after');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tspan.inject(container, 'top');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t};\n\n\t\tmakeSortable(container);\n\n\t\tcontainer.getChildren().each(function(span) {\n\t\t\taddEventsTo(span);\n\t\t});\n\t},\n\n\t/**\n\t * Update the fields of the imageSize widget upon change\n\t */\n\tenableImageSizeWidgets: function() {\n\t\t$$('.tl_image_size').each(function(el) {\n\t\t\tvar select = el.getElement('select'),\n\t\t\t\twidthInput = el.getChildren('input')[0],\n\t\t\t\theightInput = el.getChildren('input')[1],\n\t\t\t\tupdate = function() {\n\t\t\t\t\tif (select.get('value') === '' || select.get('value').indexOf('_') === 0 || select.get('value').toInt().toString() === select.get('value')) {\n\t\t\t\t\t\twidthInput.readOnly = true;\n\t\t\t\t\t\theightInput.readOnly = true;\n\t\t\t\t\t\tvar dimensions = $(select.getSelected()[0]).get('text');\n\t\t\t\t\t\tdimensions = dimensions.split('(').length > 1\n\t\t\t\t\t\t\t? dimensions.split('(').getLast().split(')')[0].split('x')\n\t\t\t\t\t\t\t: ['', ''];\n\t\t\t\t\t\twidthInput.set('value', '').set('placeholder', dimensions[0] * 1 || '');\n\t\t\t\t\t\theightInput.set('value', '').set('placeholder', dimensions[1] * 1 || '');\n\t\t\t\t\t} else {\n\t\t\t\t\t\twidthInput.set('placeholder', '');\n\t\t\t\t\t\theightInput.set('placeholder', '');\n\t\t\t\t\t\twidthInput.readOnly = false;\n\t\t\t\t\t\theightInput.readOnly = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t;\n\n\t\t\tupdate();\n\t\t\tselect.addEvent('change', update);\n\t\t\tselect.addEvent('keyup', update);\n\t\t});\n\t},\n\n\t/**\n\t * Allow toggling checkboxes or radio buttons by clicking a row\n\t *\n\t * @author Kamil Kuzminski\n\t */\n\tenableToggleSelect: function() {\n\t\tvar container = $('tl_listing'),\n\t\t\tshiftToggle = function(el) {\n\t\t\t\tthisIndex = checkboxes.indexOf(el);\n\t\t\t\tstartIndex = checkboxes.indexOf(start);\n\t\t\t\tfrom = Math.min(thisIndex, startIndex);\n\t\t\t\tto = Math.max(thisIndex, startIndex);\n\t\t\t\tstatus = !!checkboxes[startIndex].checked;\n\n\t\t\t\tfor (from; from<=to; from++) {\n\t\t\t\t\tcheckboxes[from].checked = status;\n\t\t\t\t}\n\t\t\t},\n\t\t\tclickEvent = function(e) {\n\t\t\t\tvar input = this.getElement('input[type=\"checkbox\"],input[type=\"radio\"]'),\n\t\t\t\t\tlimitToggler = $(e.target).getParent('.limit_toggler');\n\n\t\t\t\tif (!input || input.get('disabled') || limitToggler !== null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Radio buttons\n\t\t\t\tif (input.type == 'radio') {\n\t\t\t\t\tif (!input.checked) {\n\t\t\t\t\t\tinput.checked = 'checked';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Checkboxes\n\t\t\t\tif (e.shift && start) {\n\t\t\t\t\tshiftToggle(input);\n\t\t\t\t} else {\n\t\t\t\t\tinput.checked = input.checked ? '' : 'checked';\n\n\t\t\t\t\tif (input.get('onclick') == 'Backend.toggleCheckboxes(this)') {\n\t\t\t\t\t\tBackend.toggleCheckboxes(input); // see #6399\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstart = input;\n\t\t\t},\n\t\t\tcheckboxes = [], start, thisIndex, startIndex, status, from, to;\n\n\t\tif (container) {\n\t\t\tcheckboxes = container.getElements('input[type=\"checkbox\"]');\n\t\t}\n\n\t\t// Row click\n\t\t$$('.toggle_select').each(function(el) {\n\t\t\tvar boundEvent = el.retrieve('boundEvent');\n\n\t\t\tif (boundEvent) {\n\t\t\t\tel.removeEvent('click', boundEvent);\n\t\t\t}\n\n\t\t\t// Do not propagate the form field click events\n\t\t\tel.getElements('label,input[type=\"checkbox\"],input[type=\"radio\"]').each(function(i) {\n\t\t\t\ti.addEvent('click', function(e) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tboundEvent = clickEvent.bind(el);\n\n\t\t\tel.addEvent('click', boundEvent);\n\t\t\tel.store('boundEvent', boundEvent);\n\t\t});\n\n\t\t// Checkbox click\n\t\tcheckboxes.each(function(el) {\n\t\t\tel.addEvent('click', function(e) {\n\t\t\t\tif (e.shift && start) {\n\t\t\t\t\tshiftToggle(this);\n\t\t\t\t}\n\n\t\t\t\tstart = this;\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n\t * Allow to mark the important part of an image\n\t *\n\t * @param {object} el The DOM element\n\t */\n\teditPreviewWizard: function(el) {\n\t\tel = $(el);\n\t\tvar imageElement = el.getElement('img'),\n\t\t\tinputElements = {},\n\t\t\tisDrawing = false,\n\t\t\tpartElement, startPos,\n\t\t\tgetScale = function() {\n\t\t\t\treturn {\n\t\t\t\t\tx: imageElement.getComputedSize().width,\n\t\t\t\t\ty: imageElement.getComputedSize().height\n\t\t\t\t};\n\t\t\t},\n\t\t\tupdateImage = function() {\n\t\t\t\tvar scale = getScale(),\n\t\t\t\t\timageSize = imageElement.getComputedSize();\n\t\t\t\tpartElement.setStyles({\n\t\t\t\t\ttop: imageSize.computedTop + (inputElements.y.get('value') * scale.y).round() + 'px',\n\t\t\t\t\tleft: imageSize.computedLeft + (inputElements.x.get('value') * scale.x).round() + 'px',\n\t\t\t\t\twidth: (inputElements.width.get('value') * scale.x).round() + 'px',\n\t\t\t\t\theight: (inputElements.height.get('value') * scale.y).round() + 'px'\n\t\t\t\t});\n\t\t\t\tif (!inputElements.width.get('value').toFloat() || !inputElements.height.get('value').toFloat()) {\n\t\t\t\t\tpartElement.setStyle('display', 'none');\n\t\t\t\t} else {\n\t\t\t\t\tpartElement.setStyle('display', null);\n\t\t\t\t}\n\t\t\t},\n\t\t\tupdateValues = function() {\n\t\t\t\tvar scale = getScale(),\n\t\t\t\t\tstyles = partElement.getStyles('top', 'left', 'width', 'height'),\n\t\t\t\t\timageSize = imageElement.getComputedSize(),\n\t\t\t\t\tvalues = {\n\t\t\t\t\t\tx: Math.max(0, Math.min(1, (styles.left.toFloat() - imageSize.computedLeft) / scale.x)),\n\t\t\t\t\t\ty: Math.max(0, Math.min(1, (styles.top.toFloat() - imageSize.computedTop) / scale.y))\n\t\t\t\t\t};\n\t\t\t\tvalues.width = Math.min(1 - values.x, styles.width.toFloat() / scale.x);\n\t\t\t\tvalues.height = Math.min(1 - values.y, styles.height.toFloat() / scale.y);\n\t\t\t\tif (!values.width || !values.height) {\n\t\t\t\t\tvalues.x = values.y = values.width = values.height = '';\n\t\t\t\t\tpartElement.setStyle('display', 'none');\n\t\t\t\t} else {\n\t\t\t\t\tpartElement.setStyle('display', null);\n\t\t\t\t}\n\t\t\t\tObject.each(values, function(value, key) {\n\t\t\t\t\tinputElements[key].set('value', value === '' ? '' : Number(value).toFixed(15));\n\t\t\t\t});\n\t\t\t},\n\t\t\tstart = function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (isDrawing) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tisDrawing = true;\n\t\t\t\tstartPos = {\n\t\t\t\t\tx: event.page.x - el.getPosition().x - imageElement.getComputedSize().computedLeft,\n\t\t\t\t\ty: event.page.y - el.getPosition().y - imageElement.getComputedSize().computedTop\n\t\t\t\t};\n\t\t\t\tmove(event);\n\t\t\t},\n\t\t\tmove = function(event) {\n\t\t\t\tif (!isDrawing) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar imageSize = imageElement.getComputedSize();\n\t\t\t\tvar rect = {\n\t\t\t\t\tx: [\n\t\t\t\t\t\tMath.max(0, Math.min(imageSize.width, startPos.x)),\n\t\t\t\t\t\tMath.max(0, Math.min(imageSize.width, event.page.x - el.getPosition().x - imageSize.computedLeft))\n\t\t\t\t\t],\n\t\t\t\t\ty: [\n\t\t\t\t\t\tMath.max(0, Math.min(imageSize.height, startPos.y)),\n\t\t\t\t\t\tMath.max(0, Math.min(imageSize.height, event.page.y - el.getPosition().y - imageSize.computedTop))\n\t\t\t\t\t]\n\t\t\t\t};\n\t\t\t\tpartElement.setStyles({\n\t\t\t\t\ttop: Math.min(rect.y[0], rect.y[1]) + imageSize.computedTop + 'px',\n\t\t\t\t\tleft: Math.min(rect.x[0], rect.x[1]) + imageSize.computedLeft + 'px',\n\t\t\t\t\twidth: Math.abs(rect.x[0] - rect.x[1]) + 'px',\n\t\t\t\t\theight: Math.abs(rect.y[0] - rect.y[1]) + 'px'\n\t\t\t\t});\n\t\t\t\tupdateValues();\n\t\t\t},\n\t\t\tstop = function(event) {\n\t\t\t\tmove(event);\n\t\t\t\tisDrawing = false;\n\t\t\t},\n\t\t\tinit = function() {\n\t\t\t\tel.getParent('.tl_tbox,.tl_box').getElements('input[name^=\"importantPart\"]').each(function(input) {\n\t\t\t\t\t['x', 'y', 'width', 'height'].each(function(key) {\n\t\t\t\t\t\tif (input.get('name').substr(13, key.length) === key.capitalize()) {\n\t\t\t\t\t\t\tinputElements[key] = input = $(input);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tif (Object.getLength(inputElements) !== 4) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tObject.each(inputElements, function(input) {\n\t\t\t\t\tinput.getParent().setStyle('display', 'none');\n\t\t\t\t});\n\t\t\t\tel.addClass('tl_edit_preview_enabled');\n\t\t\t\tpartElement = new Element('div', {\n\t\t\t\t\t'class': 'tl_edit_preview_important_part'\n\t\t\t\t}).inject(el);\n\t\t\t\tupdateImage();\n\t\t\t\timageElement.addEvent('load', updateImage);\n\t\t\t\tel.addEvents({\n\t\t\t\t\tmousedown: start,\n\t\t\t\t\ttouchstart: start\n\t\t\t\t});\n\t\t\t\t$(document.documentElement).addEvents({\n\t\t\t\t\tmousemove: move,\n\t\t\t\t\ttouchmove: move,\n\t\t\t\t\tmouseup: stop,\n\t\t\t\t\ttouchend: stop,\n\t\t\t\t\ttouchcancel: stop,\n\t\t\t\t\tresize: updateImage\n\t\t\t\t});\n\t\t\t}\n\t\t;\n\n\t\twindow.addEvent('domready', init);\n\t},\n\n\t/**\n\t * Enable drag and drop file upload for the file tree\n\t *\n\t * @param {object} wrap    The DOM element\n\t * @param {object} options An optional options object\n\t */\n\tenableFileTreeUpload: function(wrap, options) {\n\t\twrap = $(wrap);\n\n\t\tvar fallbackUrl = options.url,\n\t\t\tdzElement = new Element('div', {\n\t\t\t\t'class': 'dropzone dropzone-filetree',\n\t\t\t\thtml: '<span class=\"dropzone-previews\"></span>'\n\t\t\t}).inject(wrap, 'top'),\n\t\t\tcurrentHover, currentHoverTime, expandLink;\n\n\t\toptions.previewsContainer = dzElement.getElement('.dropzone-previews');\n\t\toptions.clickable = false;\n\n\t\tvar dz = new Dropzone(wrap, options);\n\n\t\tdz.on('queuecomplete', function() {\n\t\t\twindow.location.reload();\n\t\t});\n\n\t\tdz.on('dragover', function(event) {\n\t\t\tif (!event.dataTransfer || !event.dataTransfer.types || event.dataTransfer.types.indexOf('Files') === -1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twrap.getElements('.tl_folder_dropping').removeClass('tl_folder_dropping');\n\t\t\tvar target = event.target && $(event.target);\n\n\t\t\tif (target) {\n\t\t\t\tvar folder = target.match('.tl_folder') ? target : target.getParent('.tl_folder');\n\n\t\t\t\tif (!folder) {\n\t\t\t\t\tfolder = target.getParent('.parent');\n\t\t\t\t\tfolder = folder && folder.getPrevious('.tl_folder');\n\t\t\t\t}\n\n\t\t\t\tif (folder) {\n\t\t\t\t\tvar link = folder.getElement('img[src$=\"/icons/new.svg\"]');\n\t\t\t\t\tlink = link && link.getParent('a');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (link && link.href) {\n\t\t\t\tdz.options.url = ''+link.href;\n\t\t\t\tfolder.addClass('tl_folder_dropping');\n\n\t\t\t\tif (currentHover !== folder) {\n\t\t\t\t\tcurrentHover = folder;\n\t\t\t\t\tcurrentHoverTime = new Date().getTime();\n\t\t\t\t\texpandLink = folder.getElement('a.foldable');\n\n\t\t\t\t\tif (expandLink && !expandLink.hasClass('foldable--open')) {\n\t\t\t\t\t\t// Expand the folder after one second hover time\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\tif (currentHover === folder && currentHoverTime + 900 < new Date().getTime()) {\n\t\t\t\t\t\t\t\tvar event = document.createEvent('HTMLEvents');\n\t\t\t\t\t\t\t\tevent.initEvent('click', true, true);\n\t\t\t\t\t\t\t\texpandLink.dispatchEvent(event);\n\t\t\t\t\t\t\t\tcurrentHover = undefined;\n\t\t\t\t\t\t\t\tcurrentHoverTime = undefined;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdz.options.url = fallbackUrl;\n\t\t\t\tcurrentHover = undefined;\n\t\t\t\tcurrentHoverTime = undefined;\n\t\t\t}\n\t\t});\n\n\t\tdz.on('drop', function(event) {\n\t\t\tif (!event.dataTransfer || !event.dataTransfer.types || event.dataTransfer.types.indexOf('Files') === -1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdzElement.addClass('dropzone-filetree-enabled');\n\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t});\n\n\t\tdz.on('dragleave', function() {\n\t\t\twrap.getElements('.tl_folder_dropping').removeClass('tl_folder_dropping');\n\t\t\tcurrentHover = undefined;\n\t\t\tcurrentHoverTime = undefined;\n\t\t});\n\t},\n\n\t/**\n\t * Crawl the website\n\t */\n\tcrawl: function() {\n\t\tvar timeout = 2000,\n\t\t\tcrawl = $('tl_crawl'),\n\t\t\tprogressBar = crawl.getElement('div.progress-bar'),\n\t\t\tprogressCount = crawl.getElement('p.progress-count'),\n\t\t\tresults = crawl.getElement('div.results'),\n\t\t\tdebugLog = crawl.getElement('p.debug-log');\n\n\t\tfunction updateData(response) {\n\t\t\tvar total = response.total,\n\t\t\t\tdone = total - response.pending,\n\t\t\t\tpercentage = total > 0 ? parseInt(done / total * 100, 10) : 100,\n\t\t\t\tresult;\n\n\t\t\t// Initialize the status bar at 10%\n\t\t\tif (done < 1 && percentage < 1) {\n\t\t\t\tdone = 1;\n\t\t\t\tpercentage = 10;\n\t\t\t\ttotal = 10;\n\t\t\t}\n\n\t\t\tprogressBar.setStyle('width', percentage + '%');\n\t\t\tprogressBar.set('html', percentage + '%');\n\t\t\tprogressBar.setAttribute('aria-valuenow', percentage);\n\t\t\tprogressCount.set('html', done + ' / ' + total);\n\n\t\t\tif (response.hasDebugLog) {\n\t\t\t\tdebugLog.setStyle('display', 'block');\n\t\t\t}\n\n\t\t\tif (response.hasDebugLog) {\n\t\t\t\tdebugLog.setStyle('display', 'block');\n\t\t\t}\n\n\t\t\tif (!response.finished) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tprogressBar.removeClass('running').addClass('finished');\n\t\t\tresults.removeClass('running').addClass('finished');\n\n\t\t\tfor (result in response.results) {\n\t\t\t\tif (response.results.hasOwnProperty(result)) {\n\t\t\t\t\tvar summary = results.getElement('.result[data-subscriber=\"' + result + '\"] p.summary'),\n\t\t\t\t\t\twarning = results.getElement('.result[data-subscriber=\"' + result + '\"] p.warning'),\n\t\t\t\t\t\tlog = results.getElement('.result[data-subscriber=\"' + result + '\"] p.subscriber-log'),\n\t\t\t\t\t\tsubscriberResults = response.results[result],\n\t\t\t\t\t\tsubscriberSummary = subscriberResults.summary;\n\n\t\t\t\t\tif (subscriberResults.warning) {\n\t\t\t\t\t\twarning.set('html', subscriberResults.warning);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (subscriberResults.hasLog) {\n\t\t\t\t\t\tlog.setStyle('display', 'block');\n\t\t\t\t\t}\n\n\t\t\t\t\tsummary.addClass(subscriberResults.wasSuccessful ? 'success' : 'failure');\n\t\t\t\t\tsummary.set('html', subscriberSummary);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction execRequest(onlyStatusUpdate = false) {\n\t\t\tnew Request({\n\t\t\t\turl: window.location.href,\n\t\t\t\theaders: {\n\t\t\t\t\t'Only-Status-Update': onlyStatusUpdate\n\t\t\t\t},\n\t\t\t\tonSuccess: function(responseText) {\n\t\t\t\t\tvar response = JSON.decode(responseText);\n\n\t\t\t\t\tupdateData(response);\n\n\t\t\t\t\tif (!response.finished) {\n\t\t\t\t\t\tsetTimeout(execRequest, timeout);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}).send();\n\t\t}\n\n\t\texecRequest(true);\n\t}\n};\n\nwindow.Theme =\n{\n\t/**\n\t * Check for WebKit\n\t * @member {boolean}\n \t */\n\tisWebkit: (Browser.chrome || Browser.safari || navigator.userAgent.match(/(?:webkit|khtml)/i)),\n\n\t/**\n\t * Stop the propagation of click events of certain elements\n\t */\n\tstopClickPropagation: function() {\n\t\t// Do not propagate the click events of the icons\n\t\t$$('.picker_selector').each(function(ul) {\n\t\t\tul.getElements('a').each(function(el) {\n\t\t\t\tel.addEvent('click', function(e) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// Do not propagate the click events of the checkboxes\n\t\t$$('.picker_selector,.click2edit').each(function(ul) {\n\t\t\tul.getElements('input[type=\"checkbox\"]').each(function(el) {\n\t\t\t\tel.addEvent('click', function(e) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n\t * Set up the [Ctrl] + click to edit functionality\n\t */\n\tsetupCtrlClick: function() {\n\t\t$$('.click2edit').each(function(el) {\n\n\t\t\t// Do not propagate the click events of the default buttons (see #5731)\n\t\t\tel.getElements('a').each(function(a) {\n\t\t\t\ta.addEvent('click', function(e) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Set up regular click events on touch devices\n\t\t\tif (Browser.Features.Touch) {\n\t\t\t\tel.addEvent('click', function() {\n\t\t\t\t\tif (!el.getAttribute('data-visited')) {\n\t\t\t\t\t\tel.setAttribute('data-visited', '1');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tel.getElements('a').each(function(a) {\n\t\t\t\t\t\t\tif (a.hasClass('edit')) {\n\t\t\t\t\t\t\t\tdocument.location.href = a.href;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tel.removeAttribute('data-visited');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tel.addEvent('click', function(e) {\n\t\t\t\t\tvar key = Browser.Platform.mac ? e.event.metaKey : e.event.ctrlKey;\n\t\t\t\t\tif (!key) return;\n\n\t\t\t\t\tif (e.event.shiftKey) {\n\t\t\t\t\t\tel.getElements('a').each(function(a) {\n\t\t\t\t\t\t\tif (a.hasClass('children')) {\n\t\t\t\t\t\t\t\tdocument.location.href = a.href;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tel.getElements('a').each(function(a) {\n\t\t\t\t\t\t\tif (a.hasClass('edit')) {\n\t\t\t\t\t\t\t\tdocument.location.href = a.href;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Set up the textarea resizing\n\t */\n\tsetupTextareaResizing: function() {\n\t\t$$('.tl_textarea').each(function(el) {\n\t\t\tif (Browser.ie6 || Browser.ie7 || Browser.ie8) return;\n\t\t\tif (el.hasClass('noresize') || el.retrieve('autogrow')) return;\n\n\t\t\t// Set up the dummy element\n\t\t\tvar dummy = new Element('div', {\n\t\t\t\thtml: 'X',\n\t\t\t\tstyles: {\n\t\t\t\t\t'position':'absolute',\n\t\t\t\t\t'top':0,\n\t\t\t\t\t'left':'-999em',\n\t\t\t\t\t'overflow-x':'hidden'\n\t\t\t\t}\n\t\t\t}).setStyles(\n\t\t\t\tel.getStyles('font-size', 'font-family', 'width', 'line-height')\n\t\t\t).inject(document.body);\n\n\t\t\t// Also consider the box-sizing\n\t\t\tif (el.getStyle('-moz-box-sizing') == 'border-box' || el.getStyle('-webkit-box-sizing') == 'border-box' || el.getStyle('box-sizing') == 'border-box') {\n\t\t\t\tdummy.setStyles({\n\t\t\t\t\t'padding': el.getStyle('padding'),\n\t\t\t\t\t'border': el.getStyle('border-left')\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Single line height\n\t\t\tvar line = Math.max(dummy.clientHeight, 30);\n\n\t\t\t// Respond to the \"input\" event\n\t\t\tel.addEvent('input', function() {\n\t\t\t\tdummy.set('html', this.get('value')\n\t\t\t\t\t.replace(/</g, '&lt;')\n\t\t\t\t\t.replace(/>/g, '&gt;')\n\t\t\t\t\t.replace(/\\n|\\r\\n/g, '<br>X'));\n\t\t\t\tvar height = Math.max(line, dummy.getSize().y);\n\t\t\t\tif (this.clientHeight != height) this.tween('height', height);\n\t\t\t}).set('tween', { 'duration':100 }).setStyle('height', line + 'px');\n\n\t\t\t// Fire the event\n\t\t\tel.fireEvent('input');\n\t\t\tel.store('autogrow', true);\n\t\t});\n\t},\n\n\t/**\n\t * Set up the menu toggle\n\t */\n\tsetupMenuToggle: function() {\n\t\tvar burger = $('burger');\n\t\tif (!burger) return;\n\n\t\tburger\n\t\t\t.addEvent('click', function() {\n\t\t\t\tdocument.body.toggleClass('show-navigation');\n\t\t\t\tburger.setAttribute('aria-expanded', document.body.hasClass('show-navigation') ? 'true' : 'false')\n\t\t\t})\n\t\t\t.addEvent('keydown', function(e) {\n\t\t\t\tif (e.event.keyCode == 27) {\n\t\t\t\t\tdocument.body.removeClass('show-navigation');\n\t\t\t\t}\n\t\t\t})\n\t\t;\n\n\t\tif (window.matchMedia) {\n\t\t\tvar matchMedia = window.matchMedia('(max-width:991px)');\n\t\t\tvar setAriaControls = function() {\n\t\t\t\tif (matchMedia.matches) {\n\t\t\t\t\tburger.setAttribute('aria-controls', 'left')\n\t\t\t\t\tburger.setAttribute('aria-expanded', document.body.hasClass('show-navigation') ? 'true' : 'false')\n\t\t\t\t} else {\n\t\t\t\t\tburger.removeAttribute('aria-controls');\n\t\t\t\t\tburger.removeAttribute('aria-expanded');\n\t\t\t\t}\n\t\t\t};\n\t\t\tmatchMedia.addEventListener('change', setAriaControls);\n\t\t\tsetAriaControls();\n\t\t}\n\t},\n\n\t/**\n\t * Set up the profile toggle\n\t */\n\tsetupProfileToggle: function() {\n\t\tvar tmenu = $('tmenu');\n\t\tif (!tmenu) return;\n\n\t\tvar li = tmenu.getElement('.submenu'),\n\t\t\tbutton = li.getFirst('span').getFirst('button'),\n\t\t\tmenu = li.getFirst('ul');\n\t\tif (!li || !button || !menu) return;\n\n\t\tbutton.setAttribute('aria-controls', 'tmenu__profile');\n\t\tbutton.setAttribute('aria-expanded', 'false');\n\n\t\tmenu.id = 'tmenu__profile';\n\n\t\tbutton.addEvent('click', function(e) {\n\t\t\tif (li.hasClass('active')) {\n\t\t\t\tli.removeClass('active');\n\t\t\t\tbutton.setAttribute('aria-expanded', 'false');\n\t\t\t} else {\n\t\t\t\tli.addClass('active');\n\t\t\t\tbutton.setAttribute('aria-expanded', 'true');\n\t\t\t}\n\t\t\te.stopPropagation();\n\t\t});\n\n\t\t$(document.body).addEvent('click', function() {\n\t\t\tif (li.hasClass('active')) {\n\t\t\t\tli.removeClass('active');\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Set up the split button toggle\n\t */\n\tsetupSplitButtonToggle: function() {\n\t\tvar toggle = $('sbtog');\n\t\tif (!toggle) return;\n\n\t\tvar ul = toggle.getParent('.split-button').getElement('ul'),\n\t\t\ttab, timer;\n\n\t\ttoggle.addEvent('click', function(e) {\n\t\t\ttab = false;\n\t\t\tul.toggleClass('invisible');\n\t\t\ttoggle.toggleClass('active');\n\t\t\te.stopPropagation();\n\t\t});\n\n\t\t$(document.body).addEvent('click', function() {\n\t\t\ttab = false;\n\t\t\tul.addClass('invisible');\n\t\t\ttoggle.removeClass('active');\n\t\t});\n\n\t\t$(document.body).addEvent('keydown', function(e) {\n\t\t\ttab = (e.event.keyCode == 9);\n\t\t});\n\n\t\t[toggle].append(ul.getElements('button')).each(function(el) {\n\t\t\tel.addEvent('focus', function() {\n\t\t\t\tif (!tab) return;\n\t\t\t\tul.removeClass('invisible');\n\t\t\t\ttoggle.addClass('active');\n\t\t\t\tclearTimeout(timer);\n\t\t\t});\n\n\t\t\tel.addEvent('blur', function() {\n\t\t\t\tif (!tab) return;\n\t\t\t\ttimer = setTimeout(function() {\n\t\t\t\t\tul.addClass('invisible');\n\t\t\t\t\ttoggle.removeClass('active');\n\t\t\t\t}, 100);\n\t\t\t});\n\t\t});\n\n\t\ttoggle.set('tabindex', '-1');\n\t}\n};\n\n// Initialize the back end script\nwindow.addEvent('domready', function() {\n\t$(document.body).addClass('js');\n\n\t// Mark touch devices (see #5563)\n\tif (Browser.Features.Touch) {\n\t\t$(document.body).addClass('touch');\n\t}\n\n\tBackend.tableWizardSetWidth();\n\tBackend.enableImageSizeWidgets();\n\tBackend.enableToggleSelect();\n\n\t// Chosen\n\tif (Elements.chosen != undefined) {\n\t\t$$('select.tl_chosen').chosen();\n\t}\n\n\tTheme.stopClickPropagation();\n\tTheme.setupCtrlClick();\n\tTheme.setupTextareaResizing();\n\tTheme.setupMenuToggle();\n\tTheme.setupProfileToggle();\n\tTheme.setupSplitButtonToggle();\n});\n\n// Resize the table wizard\nwindow.addEvent('resize', function() {\n\tBackend.tableWizardSetWidth();\n});\n\n// Re-apply certain changes upon ajax_change\nwindow.addEvent('ajax_change', function() {\n\tBackend.enableImageSizeWidgets();\n\tBackend.enableToggleSelect();\n\n\t// Chosen\n\tif (Elements.chosen != undefined) {\n\t\t$$('select.tl_chosen').filter(function(el) {\n\t\t\treturn el.getStyle('display') != 'none';\n\t\t}).chosen();\n\t}\n\n\tTheme.stopClickPropagation();\n\tTheme.setupCtrlClick();\n\tTheme.setupTextareaResizing();\n});\n","window.addEventListener('DOMContentLoaded', function() {\n    document.querySelectorAll('div.limit_height').forEach(function(div) {\n        if (window.console) {\n            console.warn('Using \"limit_height\" class on child_record_callback is deprecated. Set a list.sorting.limitHeight in your DCA instead.');\n        }\n\n        const parent = div.parentNode.closest('.tl_content');\n\n        // Return if the element is a wrapper\n        if (parent && (parent.classList.contains('wrapper_start') || parent.classList.contains('wrapper_stop'))) return;\n\n        const hgt = Number(div.className.replace(/[^0-9]*/, ''))\n\n        // Return if there is no height value\n        if (!hgt) return;\n\n        const style = window.getComputedStyle(div, null);\n        const padding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);\n        const height = div.clientHeight - padding;\n\n        // Do not add the toggle if the preview height is below the max-height\n        if (height <= hgt) return;\n\n        // Resize the element if it is higher than the maximum height\n        div.style.height = hgt+'px';\n\n        const button = document.createElement('button');\n        button.setAttribute('type', 'button');\n        button.title = Contao.lang.expand;\n        button.innerHTML = '<span>...</span>';\n        button.classList.add('unselectable');\n\n        button.addEventListener('click', function() {\n            if (div.style.height == 'auto') {\n                div.style.height = hgt+'px';\n                button.title = Contao.lang.expand;\n            } else {\n                div.style.height = 'auto';\n                button.title = Contao.lang.collapse;\n            }\n        });\n\n        const toggler = document.createElement('div');\n        toggler.classList.add('limit_toggler');\n        toggler.append(button);\n\n        div.append(toggler);\n    });\n});\n","(function(){\n    'use strict';\n\n    const initializedRows = new WeakMap();\n    const saveScrollOffsetEvent = new Event('store-scroll-offset');\n\n    const init = (row) => {\n        // Check if this row has already been initialized\n        if (initializedRows.has(row)) {\n            return;\n        }\n\n        // Check if this row has all necessary elements\n        if (9 !== row.querySelectorAll('select, button, a.module_link, img.module_image').length) {\n            return;\n        }\n\n        initializedRows.set(row, true);\n\n        const tbody = row.closest('tbody');\n\n        const makeSortable = (tbody) => {\n            Array.from(tbody.children).forEach((tr, i) => {\n                tr.querySelectorAll('input, select').forEach((el) => {\n                    el.name = el.name.replace(/\\[[0-9]+]/g, '[' + i + ']');\n                });\n            });\n\n            // TODO: replace this with a vanilla JS solution\n            new Sortables(tbody, {\n                constrain: true,\n                opacity: 0.6,\n                handle: '.drag-handle',\n                onComplete: function() {\n                    makeSortable(tbody);\n                }\n            });\n        };\n\n        const addEventsTo = (tr) => {\n            tr.querySelectorAll('button').forEach((bt) => {\n                const command = bt.dataset.command;\n\n                switch (command) {\n                    case 'copy':\n                        bt.addEventListener('click', () => {\n                            window.dispatchEvent(saveScrollOffsetEvent)\n\n                            const ntr = tr.cloneNode(true);\n                            const selects = tr.querySelectorAll('select');\n                            const nselects = ntr.querySelectorAll('select');\n\n                            for (let j=0; j<selects.length; j++) {\n                                nselects[j].value = selects[j].value;\n                            }\n\n                            ntr.querySelectorAll('[data-original-title]').forEach((el) => {\n                                el.setAttribute('title', el.getAttribute('data-original-title'));\n                                el.removeAttribute('data-original-title');\n                            });\n\n                            initializedRows.set(ntr, true);\n                            tr.parentNode.insertBefore(ntr, tr.nextSibling);\n\n                            // Remove the ID of the select before initializing Chosen\n                            const select = ntr.querySelector('select.tl_select')\n                            select.removeAttribute('id');\n\n                            ntr.querySelector('.chzn-container').remove();\n                            new Chosen(select);\n\n                            addEventsTo(ntr);\n                            makeSortable(tbody);\n                        });\n                        break;\n\n                    case 'delete':\n                        bt.addEventListener('click', () => {\n                            window.dispatchEvent(saveScrollOffsetEvent);\n\n                            if (tbody.children.length > 1) {\n                                tr.remove();\n                            } else {\n                                // Reset values for last element (#689)\n                                tr.querySelectorAll('select').forEach((select) => {\n                                    select.value = select.children[0].value;\n                                });\n                            }\n\n                            makeSortable(tbody);\n                        });\n                        break;\n\n                    case 'enable':\n                        bt.addEventListener('click', function() {\n                            window.dispatchEvent(saveScrollOffsetEvent);\n\n                            const cbx = bt.previousElementSibling;\n\n                            if (cbx.checked) {\n                                cbx.checked = '';\n                            } else {\n                                cbx.checked = 'checked';\n                            }\n                        });\n                        break;\n\n                    default:\n                        if (bt.classList.contains('drag-handle')) {\n                            bt.addEventListener('keydown', (event) => {\n                                if (event.code === 'ArrowUp' || event.keyCode === 38) {\n                                    event.preventDefault();\n\n                                    if (tr.previousElementSibling) {\n                                        tr.previousElementSibling.insertAdjacentElement('beforebegin', tr);\n                                    } else {\n                                        tbody.insertAdjacentElement('beforeend', tr);\n                                    }\n\n                                    bt.focus();\n                                    makeSortable(tbody);\n                                } else if (event.code === 'ArrowDown' || event.keyCode === 40) {\n                                    event.preventDefault();\n\n                                    if (tr.nextElementSibling) {\n                                        tr.nextElementSibling.insertAdjacentElement('afterend', tr);\n                                    } else {\n                                        tbody.insertAdjacentElement('afterbegin', tr);\n                                    }\n\n                                    bt.focus();\n                                    makeSortable(tbody);\n                                }\n                            });\n                        }\n                        break;\n                }\n            });\n\n            const select = tr.querySelector('td:first-child select');\n\n            if (!select) {\n                return;\n            }\n\n            const link = tr.querySelector('a.module_link');\n            const images = tr.querySelectorAll('img.module_image');\n\n            const updateLink = () => {\n                link.href = link.href.replace(/id=[0-9]+/, 'id=' + select.value);\n\n                if (select.value > 0) {\n                    link.classList.remove('hidden');\n\n                    images.forEach((image) => {\n                        image.classList.add('hidden');\n                    });\n                } else {\n                    link.classList.add('hidden');\n\n                    images.forEach((image) => {\n                        image.classList.remove('hidden');\n                    });\n                }\n            };\n\n            select.addEventListener('change', updateLink);\n\n            // Backwards compatibility with MooTools \"Chosen\" script that fires non-native change event\n            select.addEvent('change', updateLink);\n        };\n\n        makeSortable(tbody);\n        addEventsTo(row);\n    };\n\n    document.querySelectorAll('.tl_modulewizard tr').forEach(init);\n\n    new MutationObserver(function(mutationsList) {\n        for (const mutation of mutationsList) {\n            if (mutation.type === 'childList') {\n                mutation.addedNodes.forEach(function(element) {\n                    if (element.matches && element.matches('.tl_modulewizard tr, .tl_modulewizard tr *')) {\n                        init(element.closest('tr'));\n                    }\n                })\n            }\n        }\n    }).observe(document, {\n        attributes: false,\n        childList: true,\n        subtree: true\n    });\n})();\n","/*\n---\n\nname: Request.Contao\n\ndescription: Extends the MooTools Request.JSON class with Contao-specific routines.\n\nlicense: LGPLv3\n\nauthors:\n - Leo Feyer\n\nrequires: [Request, JSON]\n\nprovides: Request.Contao\n\n...\n*/\n\nRequest.Contao = new Class(\n{\n\tExtends: Request.JSON,\n\n\toptions: {\n\t\tfollowRedirects: true,\n\t\turl: window.location.href\n\t},\n\n\tinitialize: function(options) {\n\t\tif (options && !options.url && options.field && options.field.form && options.field.form.action) {\n\t\t\tthis.options.url = options.field.form.action;\n\t\t}\n\t\tthis.parent(options);\n\t},\n\n\tsuccess: function(text) {\n\t\tvar url = this.getHeader('X-Ajax-Location'),\n\t\t\tjson;\n\n\t\tif (url && this.options.followRedirects) {\n\t\t\tlocation.replace(url);\n\t\t\treturn;\n\t\t}\n\n\t\t// Support both plain text and JSON responses\n\t\ttry {\n\t\t\tjson = this.response.json = JSON.decode(text, this.options.secure);\n\t\t} catch(e) {\n\t\t\tjson = {'content':text};\n\t\t}\n\n\t\t// Empty response\n\t\tif (json === null) {\n\t\t\tjson = {'content':''};\n\t\t} else if (typeof(json) != 'object') {\n\t\t\tjson = {'content':text};\n\t\t}\n\n\t\t// Isolate scripts and execute them\n\t\tif (json.content != '') {\n\t\t\tjson.content = json.content.stripScripts(function(script) {\n\t\t\t\tjson.javascript = script.replace(/<!--|\\/\\/-->|<!\\[CDATA\\[\\/\\/>|<!]]>/g, '');\n\t\t\t});\n\t\t\tif (json.javascript && this.options.evalScripts) {\n\t\t\t\tBrowser.exec(json.javascript);\n\t\t\t}\n\t\t}\n\n\t\tthis.onSuccess(json.content, json);\n\t},\n\n\tfailure: function() {\n\t\tvar url = this.getHeader('X-Ajax-Location');\n\n\t\tif (url && 401 === this.status) {\n\t\t\tlocation.replace(url);\n\t\t\treturn;\n\t\t}\n\n\t\tif (url && this.options.followRedirects && this.status >= 300 && this.status < 400) {\n\t\t\tlocation.replace(url);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.onFailure();\n\t}\n});\n\n\n/*\n---\n\nname: Drag\n\ndescription: Extends the base Drag class with touch support.\n\nlicense: LGPLv3\n\nauthors:\n - Andreas Schempp\n\nrequires: [Drag]\n\nprovides: Drag\n\n...\n*/\n\nClass.refactor(Drag,\n{\n\tattach: function() {\n\t\tthis.handles.addEvent('touchstart', this.bound.start);\n\t\treturn this.previous.apply(this, arguments);\n\t},\n\n\tdetach: function() {\n\t\tthis.handles.removeEvent('touchstart', this.bound.start);\n\t\treturn this.previous.apply(this, arguments);\n\t},\n\n\tstart: function() {\n\t\tdocument.addEvents({\n\t\t\ttouchmove: this.bound.check,\n\t\t\ttouchend: this.bound.cancel\n\t\t});\n\t\tthis.previous.apply(this, arguments);\n\t},\n\n\tcheck: function(event) {\n\t\tif (this.options.preventDefault) event.preventDefault();\n\t\tvar distance = Math.round(Math.sqrt(Math.pow(event.page.x - this.mouse.start.x, 2) + Math.pow(event.page.y - this.mouse.start.y, 2)));\n\t\tif (distance > this.options.snap) {\n\t\t\tthis.cancel();\n\t\t\tthis.document.addEvents({\n\t\t\t\tmousemove: this.bound.drag,\n\t\t\t\tmouseup: this.bound.stop\n\t\t\t});\n\t\t\tdocument.addEvents({\n\t\t\t\ttouchmove: this.bound.drag,\n\t\t\t\ttouchend: this.bound.stop\n\t\t\t});\n\t\t\tthis.fireEvent('start', [this.element, event]).fireEvent('snap', this.element);\n\t\t}\n\t},\n\n\tcancel: function() {\n\t\tdocument.removeEvents({\n\t\t\ttouchmove: this.bound.check,\n\t\t\ttouchend: this.bound.cancel\n\t\t});\n\t\treturn this.previous.apply(this, arguments);\n\t},\n\n\tstop: function() {\n\t\tdocument.removeEvents({\n\t\t\ttouchmove: this.bound.drag,\n\t\t\ttouchend: this.bound.stop\n\t\t});\n\t\treturn this.previous.apply(this, arguments);\n\t}\n});\n\n/*\n---\n\nname: Sortables\n\ndescription: Extends the base Sortables class with touch support.\n\nlicense: LGPLv3\n\nauthors:\n - Andreas Schempp\n\nrequires: [Sortables]\n\nprovides: Sortables\n\n...\n*/\n\nClass.refactor(Sortables,\n{\n\tinitialize: function(lists, options) {\n\t\toptions.dragOptions = Object.merge(options.dragOptions || {}, { preventDefault: (options.dragOptions && options.dragOptions.preventDefault) || Browser.Features.Touch });\n\t\tif (options.dragOptions.unDraggableTags === undefined) {\n\t\t\toptions.dragOptions.unDraggableTags = this.options.unDraggableTags.filter(function(tag) {\n\t\t\t\treturn tag != 'button';\n\t\t\t});\n\t\t}\n\t\treturn this.previous.apply(this, arguments);\n\t},\n\n\taddItems: function() {\n\t\tArray.flatten(arguments).each(function(element) {\n\t\t\tthis.elements.push(element);\n\t\t\tvar start = element.retrieve('sortables:start', function(event) {\n\t\t\t\tthis.start.call(this, event, element);\n\t\t\t}.bind(this));\n\t\t\t(this.options.handle ? element.getElement(this.options.handle) || element : element).addEvents({\n\t\t\t\tmousedown: start,\n\t\t\t\ttouchstart: start\n\t\t\t});\n\t\t}, this);\n\t\treturn this;\n\t},\n\n\tremoveItems: function() {\n\t\treturn $$(Array.flatten(arguments).map(function(element) {\n\t\t\tthis.elements.erase(element);\n\t\t\tvar start = element.retrieve('sortables:start');\n\t\t\t(this.options.handle ? element.getElement(this.options.handle) || element : element).removeEvents({\n\t\t\t\tmousedown: start,\n\t\t\t\ttouchend: start\n\t\t\t});\n\t\t\treturn element;\n\t\t}, this));\n\t},\n\n\tgetClone: function(event, element) {\n\t\tif (!this.options.clone) return new Element(element.tagName).inject(document.body);\n\t\tif (typeOf(this.options.clone) == 'function') return this.options.clone.call(this, event, element, this.list);\n\t\tvar clone = this.previous.apply(this, arguments);\n\t\tclone.addEvent('touchstart', function(event) {\n\t\t\telement.fireEvent('touchstart', event);\n\t\t});\n\t\treturn clone;\n\t}\n});\n\n/*\n---\n\nscript: Request.Queue.js\n\nname: Request.Queue\n\ndescription: Extends the base Request.Queue class and attempts to fix some issues.\n\nlicense: MIT-style license\n\nauthors:\n - Leo Feyer\n\nrequires:\n\t- Core/Element\n\t- Core/Request\n\t- Class.Binds\n\nprovides: [Request.Queue]\n\n...\n*/\n\nClass.refactor(Request.Queue,\n{\n\t// Do not fire the \"end\" event here\n\tonComplete: function(){\n\t\tthis.fireEvent('complete', arguments);\n\t},\n\n\t// Call resume() instead of runNext()\n\tonCancel: function(){\n\t\tif (this.options.autoAdvance && !this.error) this.resume();\n\t\tthis.fireEvent('cancel', arguments);\n\t},\n\n\t// Call resume() instead of runNext() and fire the \"end\" event\n\tonSuccess: function(){\n\t\tif (this.options.autoAdvance && !this.error) this.resume();\n\t\tthis.fireEvent('success', arguments);\n\t\tif (!this.queue.length && !this.isRunning()) this.fireEvent('end');\n\t},\n\n\t// Call resume() instead of runNext() and fire the \"end\" event\n\tonFailure: function(){\n\t\tthis.error = true;\n\t\tif (!this.options.stopOnFailure && this.options.autoAdvance) this.resume();\n\t\tthis.fireEvent('failure', arguments);\n\t\tif (!this.queue.length && !this.isRunning()) this.fireEvent('end');\n\t},\n\n\t// Call resume() instead of runNext()\n\tonException: function(){\n\t\tthis.error = true;\n\t\tif (!this.options.stopOnFailure && this.options.autoAdvance) this.resume();\n\t\tthis.fireEvent('exception', arguments);\n\t}\n});\n\n/*\n---\n\nname: Contao.SerpPreview\n\ndescription: Generates a SERP preview\n\nlicense: LGPLv3\n\nauthors:\n - Leo Feyer\n\nrequires: [Request, JSON]\n\nprovides: Contao.SerpPreview\n\n...\n*/\n\nContao.SerpPreview = new Class(\n{\n\toptions: {\n\t\tid: 0,\n\t\ttrail: null,\n\t\ttitleField: null,\n\t\ttitleFallbackField: null,\n\t\taliasField: null,\n\t\tdescriptionField: null,\n\t\tdescriptionFallbackField: null,\n\t\ttitleTag: null\n\t},\n\n\tshorten: function(str, max) {\n\t\tif (str.length <= max) {\n\t\t\treturn str;\n\t\t}\n\t\treturn str.substr(0, str.lastIndexOf(' ', max)) + ' …';\n\t},\n\n\thtml2string: function(html) {\n\t\treturn new DOMParser().parseFromString(html, 'text/html').body.textContent.replace(/\\[-]/g, '\\xAD').replace(/\\[nbsp]/g, '\\xA0');\n\t},\n\n\tgetTinymce: function() {\n\t\tif (window.tinyMCE && this.options.descriptionFallbackField) {\n\t\t\treturn window.tinyMCE.get(this.options.descriptionFallbackField);\n\t\t}\n\t},\n\n\tinitialize: function() {\n\t\tthis.options = Object.merge.apply(null, [{}, this.options].append(arguments));\n\n\t\tvar serpTitle = $('serp_title_' + this.options.id),\n\t\t\tserpUrl = $('serp_url_' + this.options.id),\n\t\t\tserpDescription = $('serp_description_' + this.options.id),\n\t\t\ttitleField = $(this.options.titleField),\n\t\t\ttitleFallbackField = $(this.options.titleFallbackField),\n\t\t\taliasField = $(this.options.aliasField),\n\t\t\tdescriptionField = $(this.options.descriptionField),\n\t\t\tdescriptionFallbackField = $(this.options.descriptionFallbackField),\n\t\t\tindexEmpty = this.options.trail.indexOf('›') === -1,\n\t\t\ttitleTag = this.options.titleTag || '%s';\n\n\t\ttitleField && titleField.addEvent('input', function() {\n\t\t\tif (titleField.value) {\n\t\t\t\tserpTitle.set('text', this.shorten(this.html2string(titleTag.replace(/%s/, titleField.value)).replace(/%%/g, '%'), 64));\n\t\t\t} else if (titleFallbackField && titleFallbackField.value) {\n\t\t\t\tserpTitle.set('text', this.shorten(this.html2string(titleTag.replace(/%s/, titleFallbackField.value)).replace(/%%/g, '%'), 64));\n\t\t\t} else {\n\t\t\t\tserpTitle.set('text', '');\n\t\t\t}\n\t\t}.bind(this));\n\n\t\ttitleFallbackField && titleFallbackField.addEvent('input', function() {\n\t\t\tif (titleField && titleField.value) return;\n\t\t\tserpTitle.set('text', this.shorten(this.html2string(titleTag.replace(/%s/, titleFallbackField.value)).replace(/%%/g, '%'), 64));\n\t\t}.bind(this));\n\n\t\taliasField && aliasField.addEvent('input', function() {\n\t\t\tif (aliasField.value == 'index' && indexEmpty) {\n\t\t\t\tserpUrl.set('text', this.options.trail);\n\t\t\t} else {\n\t\t\t\tserpUrl.set('text', this.options.trail + ' › ' + (aliasField.value || this.options.id).replace(/\\//g, ' › '));\n\t\t\t}\n\t\t}.bind(this));\n\n\t\tdescriptionField && descriptionField.addEvent('input', function() {\n\t\t\tif (descriptionField.value) {\n\t\t\t\tserpDescription.set('text', this.shorten(descriptionField.value, 160));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar editor = this.getTinymce();\n\t\t\tif (editor) {\n\t\t\t\tserpDescription.set('text', this.shorten(this.html2string(editor.getContent()), 160));\n\t\t\t} else if (descriptionFallbackField && descriptionFallbackField.value) {\n\t\t\t\tserpDescription.set('text', this.shorten(this.html2string(descriptionFallbackField.value), 160));\n\t\t\t} else {\n\t\t\t\tserpDescription.set('text', '');\n\t\t\t}\n\t\t}.bind(this));\n\n\t\tdescriptionFallbackField && descriptionFallbackField.addEvent('input', function() {\n\t\t\tif (descriptionField && descriptionField.value) return;\n\t\t\tserpDescription.set('text', this.shorten(this.html2string(descriptionFallbackField.value), 160));\n\t\t}.bind(this));\n\n\t\tsetTimeout(function() {\n\t\t\tvar editor = this.getTinymce();\n\t\t\teditor && editor.on('keyup', function() {\n\t\t\t\tif (descriptionField && descriptionField.value) return;\n\t\t\t\tserpDescription.set('text', this.shorten(this.html2string(window.tinyMCE.activeEditor.getContent()), 160));\n\t\t\t}.bind(this));\n\t\t}.bind(this), 4);\n\t}\n});\n","(function(){\n    'use strict';\n\n    const initializedRows = new WeakMap();\n    const saveScrollOffsetEvent = new Event('store-scroll-offset');\n\n    const init = (row) => {\n        // Check if this row has already been initialized\n        if (initializedRows.has(row)) {\n            return;\n        }\n\n        // Check if this row has all necessary elements\n        if (7 !== row.querySelectorAll('input, select, button').length) {\n            return;\n        }\n\n        initializedRows.set(row, true);\n\n        const tbody = row.closest('tbody');\n\n        const makeSortable = (tbody) => {\n            Array.from(tbody.children).forEach((tr, i) => {\n                tr.querySelectorAll('input, select').forEach((el) => {\n                    el.name = el.name.replace(/\\[[0-9]+]/g, '[' + i + ']');\n                });\n            });\n\n            // TODO: replace this with a vanilla JS solution\n            new Sortables(tbody, {\n                constrain: true,\n                opacity: 0.6,\n                handle: '.drag-handle',\n                onComplete: function() {\n                    makeSortable(tbody);\n                }\n            });\n        };\n\n        const addEventsTo = (tr) => {\n            tr.querySelectorAll('button').forEach((bt) => {\n                const command = bt.dataset.command;\n\n                switch (command) {\n                    case 'copy':\n                        bt.addEventListener('click', () => {\n                            window.dispatchEvent(saveScrollOffsetEvent);\n                            const ntr = tr.cloneNode(true);\n                            const selects = tr.querySelectorAll('select');\n                            const nselects = ntr.querySelectorAll('select');\n                            for (let j=0; j<selects.length; j++) {\n                                nselects[j].value = selects[j].value;\n                            }\n                            tr.parentNode.insertBefore(ntr, tr.nextSibling);\n                            addEventsTo(ntr);\n                            makeSortable(tbody);\n                        });\n                        break;\n\n                    case 'delete':\n                        bt.addEventListener('click', () => {\n                            window.dispatchEvent(saveScrollOffsetEvent);\n                            if (tbody.children.length > 1) {\n                                tr.remove();\n                            } else {\n                                // Reset values for last element (#689)\n                                tr.querySelectorAll('input').forEach((input) => {\n                                    input.value = '';\n                                });\n\n                                tr.querySelectorAll('select').forEach((select) => {\n                                    select.value = select.children[0].value;\n                                });\n                            }\n                            makeSortable(tbody);\n                        });\n                        break;\n\n                    default:\n                        if (bt.classList.contains('drag-handle')) {\n                            bt.addEventListener('keydown', (event) => {\n                                if (event.code === 'ArrowUp' || event.keyCode === 38) {\n                                    event.preventDefault();\n                                    if (tr.previousElementSibling) {\n                                        tr.previousElementSibling.insertAdjacentElement('beforebegin', tr);\n                                    } else {\n                                        tbody.insertAdjacentElement('beforeend', tr);\n                                    }\n                                    bt.focus();\n                                    makeSortable(tbody);\n                                } else if (event.code === 'ArrowDown' || event.keyCode === 40) {\n                                    event.preventDefault();\n                                    if (tr.nextElementSibling) {\n                                        tr.nextElementSibling.insertAdjacentElement('afterend', tr);\n                                    } else {\n                                        tbody.insertAdjacentElement('afterbegin', tr);\n                                    }\n                                    bt.focus();\n                                    makeSortable(tbody);\n                                }\n                            });\n                        }\n                        break;\n                }\n            });\n        };\n\n        makeSortable(tbody);\n        addEventsTo(row);\n    };\n\n    document.querySelectorAll('.tl_sectionwizard tr').forEach(init);\n\n    new MutationObserver(function(mutationsList) {\n        for (const mutation of mutationsList) {\n            if (mutation.type === 'childList') {\n                mutation.addedNodes.forEach(function(element) {\n                    if (element.matches && element.matches('.tl_sectionwizard tr, .tl_sectionwizard tr *')) {\n                        init(element.closest('tr'));\n                    }\n                })\n            }\n        }\n    }).observe(document, {\n        attributes: false,\n        childList: true,\n        subtree: true\n    });\n})();\n","(function() {\n    const initialized = [];\n\n    const tip = document.createElement('div');\n    tip.setAttribute('role', 'tooltip');\n    tip.classList.add('tip')\n    tip.style.position = 'absolute';\n    tip.style.display = 'none';\n\n    const init = function(el, x, y, useContent) {\n        if (initialized.includes(el)) {\n            return;\n        }\n\n        initialized.push(el);\n\n        let text, timer;\n\n        el.addEventListener('mouseenter', function() {\n            if (useContent) {\n                text = el.innerHTML;\n            } else {\n                text = el.getAttribute('title');\n                el.setAttribute('data-original-title', text);\n                el.removeAttribute('title')\n            }\n\n            if (!text) {\n                return;\n            }\n\n            clearTimeout(timer);\n            tip.style.willChange = 'display,contents';\n\n            timer = setTimeout(function() {\n                const position = el.getBoundingClientRect();\n                const rtl = getComputedStyle(el).direction === 'rtl';\n                const clientWidth = document.html.clientWidth;\n\n                if ((rtl && position.x < 200) || (!rtl && position.x < (clientWidth - 200))) {\n                    tip.style.left = `${(window.scrollX + position.left + x)}px`;\n                    tip.style.right = 'auto';\n                    tip.classList.remove('tip--rtl')\n                } else {\n                    tip.style.left = 'auto';\n                    tip.style.right = `${(clientWidth - window.scrollX - position.right + x)}px`;\n                    tip.classList.add('tip--rtl')\n                }\n\n                tip.innerHTML = `<div>${text}</div>`;\n                tip.style.top = `${(window.scrollY + position.top + y)}px`;\n                tip.style.display = 'block';\n                tip.style.willChange = 'auto';\n\n                if (!tip.parentNode && document.body) {\n                    document.body.append(tip);\n                }\n            }, 1000)\n        })\n\n        el.addEventListener('mouseleave', function() {\n            if (el.hasAttribute('data-original-title')) {\n                if (!el.hasAttribute('title')) {\n                    el.setAttribute('title', el.getAttribute('data-original-title'));\n                }\n\n                el.removeAttribute('data-original-title')\n            }\n\n            clearTimeout(timer)\n            tip.style.willChange = 'auto';\n\n            if (tip.style.display === 'block') {\n                tip.style.willChange = 'display';\n                timer = setTimeout(function() {\n                    tip.style.display = 'none';\n                    tip.style.willChange = 'auto';\n                }, 100)\n            }\n        })\n\n        const action = el.closest('button, a');\n\n        // Hide tooltip when clicking a button (usually an operation icon in a wizard widget)\n        if (action) {\n            action.addEventListener('click', function() {\n                clearTimeout(timer);\n                tip.style.display = 'none';\n                tip.style.willChange = 'auto';\n            })\n        }\n    }\n\n    function select(node, selector) {\n        if (node.matches(selector)) {\n            return [node, ...node.querySelectorAll(selector)];\n        }\n\n        return node.querySelectorAll(selector);\n    }\n\n    function setup(node) {\n        select(node, 'p.tl_tip').forEach(function(el) {\n            init(el, 0, 23, true);\n        });\n\n        select(node, '#home').forEach(function(el) {\n            init(el, 6, 42);\n        });\n\n        select(node, '#tmenu a[title]').forEach(function(el) {\n            init(el, 0, 42);\n        });\n\n        select(node, 'a[title][class^=\"group-\"]').forEach(function(el) {\n            init(el, -6, 27);\n        });\n\n        select(node, 'a[title].navigation').forEach(function(el) {\n            init(el, 25, 32);\n        });\n\n        select(node, 'img[title]').forEach(function(el) {\n            init(el, -9, el.classList.contains('gimage') ? 60 : 30);\n        });\n\n        select(node, 'a[title]').forEach(function(el) {\n            if (el.classList.contains('picker-wizard')) {\n                init(el, -4, 30);\n            } else {\n                init(el, -9, 30);\n            }\n        });\n\n        select(node, 'button[title]').forEach(function(el) {\n            if (el.classList.contains('unselectable')) {\n                init(el, -4, 20);\n            } else {\n                init(el, -9, 30);\n            }\n        });\n\n        ['input[title]', 'time[title]', 'span[title]'].forEach(function(selector) {\n            select(node, selector).forEach(function(el) {\n                init(el, -9, ((selector === 'time[title]' || selector === 'span[title]') ? 26 : 30));\n            });\n        });\n    }\n\n    setup(document.documentElement);\n\n    new MutationObserver(function(mutationsList) {\n        for (const mutation of mutationsList) {\n            if (mutation.type === 'childList') {\n                mutation.addedNodes.forEach(function(element) {\n                    if (element.matches && element.querySelectorAll) {\n                        setup(element);\n                    }\n                })\n            }\n        }\n    }).observe(document, {\n        attributes: false,\n        childList: true,\n        subtree: true\n    });\n})();\n","var map = {\n\t\"./clipboard-controller.js\": 836,\n\t\"./color-scheme-controller.js\": 316,\n\t\"./image-size-controller.js\": 910,\n\t\"./jump-targets-controller.js\": 547,\n\t\"./limit-height-controller.js\": 5,\n\t\"./metawizard-controller.js\": 17,\n\t\"./scroll-offset-controller.js\": 470,\n\t\"./toggle-fieldset-controller.js\": 554,\n\t\"./toggle-navigation-controller.js\": 125,\n\t\"./toggle-nodes-controller.js\": 634\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 483;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/*\nStimulus Webpack Helpers 1.0.0\nCopyright © 2021 Basecamp, LLC\n */\nfunction definitionsFromContext(context) {\n    return context.keys()\n        .map((key) => definitionForModuleWithContextAndKey(context, key))\n        .filter((value) => value);\n}\nfunction definitionForModuleWithContextAndKey(context, key) {\n    const identifier = identifierForContextKey(key);\n    if (identifier) {\n        return definitionForModuleAndIdentifier(context(key), identifier);\n    }\n}\nfunction definitionForModuleAndIdentifier(module, identifier) {\n    const controllerConstructor = module.default;\n    if (typeof controllerConstructor == \"function\") {\n        return { identifier, controllerConstructor };\n    }\n}\nfunction identifierForContextKey(key) {\n    const logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n    if (logicalName) {\n        return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n    }\n}\n\nexport { definitionForModuleAndIdentifier, definitionForModuleWithContextAndKey, definitionsFromContext, identifierForContextKey };\n","import { Application } from '@hotwired/stimulus'\nimport { definitionForModuleAndIdentifier, identifierForContextKey } from '@hotwired/stimulus-webpack-helpers'\n\nimport './scripts/mootao.js'\nimport './scripts/core.js'\nimport './scripts/limit-height.js'\nimport './scripts/modulewizard.js'\nimport './scripts/sectionwizard.js'\nimport './scripts/tips.js'\n\n// Start Stimulus application and register all controllers with `contao--` prefix.\nconst application = Application.start()\napplication.debug = process.env.NODE_ENV === 'development'\n\nconst context = require.context('./controllers', true, /\\.js$/)\napplication.load(context.keys().map((key) => {\n    const identifier = identifierForContextKey(key);\n    if (identifier) {\n        return definitionForModuleAndIdentifier(context(key), `contao--${ identifier }`);\n    }\n}).filter((value) => value));\n"],"names":["EventListener","constructor","eventTarget","eventName","eventOptions","this","unorderedBindings","Set","connect","addEventListener","disconnect","removeEventListener","bindingConnected","binding","add","bindingDisconnected","delete","handleEvent","event","extendedEvent","stopImmediatePropagation","Object","assign","immediatePropagationStopped","call","extendEvent","bindings","hasBindings","size","Array","from","sort","left","right","leftIndex","index","rightIndex","Dispatcher","application","eventListenerMaps","Map","started","start","eventListeners","forEach","eventListener","stop","values","reduce","listeners","map","concat","fetchEventListenerForBinding","clearEventListeners","clearEventListenersForBinding","handleError","error","message","detail","removeMappedEventListenerFor","eventListenerMap","fetchEventListenerMapForEventTarget","cacheKey","fetchEventListener","get","createEventListener","set","parts","keys","key","push","join","defaultActionDescriptorFilters","value","stopPropagation","prevent","preventDefault","self","element","target","descriptorPattern","parseEventTarget","eventTargetName","window","document","camelize","replace","_","char","toUpperCase","namespaceCamelize","capitalize","charAt","slice","dasherize","toLowerCase","isSomething","object","hasProperty","property","prototype","hasOwnProperty","allModifiers","Action","descriptor","schema","tagName","defaultEventNames","getDefaultEventNameForElement","identifier","methodName","keyFilter","forToken","token","descriptorString","matches","trim","match","includes","split","options","test","parseActionDescriptorString","content","toString","eventFilter","shouldIgnoreKeyboardEvent","filters","keyFilterDissatisfied","standardFilter","filter","keyMappings","shouldIgnoreMouseEvent","params","pattern","RegExp","name","attributes","typecast","meta","ctrl","alt","shift","modifier","metaKey","ctrlKey","altKey","shiftKey","a","button","form","details","input","e","getAttribute","select","textarea","Error","JSON","parse","o_O","Binding","context","action","actionEvent","prepareActionEvent","willBeInvokedByEvent","applyEventModifiers","invokeWithEvent","method","controller","actionDescriptorFilters","passes","entries","currentTarget","logDebugActivity","KeyboardEvent","MouseEvent","Element","contains","scope","containsElement","ElementObserver","delegate","mutationObserverInit","childList","subtree","elements","mutationObserver","MutationObserver","mutations","processMutations","observe","refresh","pause","callback","takeRecords","matchElementsInTree","has","removeElement","addElement","mutation","processMutation","type","processAttributeChange","attributeName","processRemovedNodes","removedNodes","processAddedNodes","addedNodes","elementAttributeChanged","matchElement","nodes","node","elementFromNode","processTree","elementIsActive","tree","processor","nodeType","Node","ELEMENT_NODE","isConnected","elementMatched","elementUnmatched","AttributeObserver","elementObserver","selector","hasAttribute","querySelectorAll","elementMatchedAttribute","elementUnmatchedAttribute","elementAttributeValueChanged","fetch","del","prune","Multimap","valuesByKey","hasKey","hasValue","some","getValuesForKey","getKeysForValue","_key","_values","SelectorObserver","_selector","matchesByElement","selectorMatchElement","selectorMatched","selectors","selectorUnmatched","_attributeName","matchedBefore","StringMapObserver","stringMap","attributeOldValue","knownAttributeNames","refreshAttribute","oldValue","getStringMapKeyForAttribute","stringMapKeyAdded","stringMapValueChanged","stringMapKeyRemoved","currentAttributeNames","recordedAttributeNames","attribute","TokenListObserver","attributeObserver","tokensByElement","tokensMatched","readTokensForElement","unmatchedTokens","matchedTokens","refreshTokensForElement","tokensUnmatched","tokens","tokenMatched","tokenUnmatched","previousTokens","currentTokens","firstDifferingIndex","length","Math","max","zip","findIndex","previousToken","currentToken","tokenString","parseTokenString","ValueListObserver","tokenListObserver","parseResultsByToken","WeakMap","valuesByTokenByElement","fetchParseResultForToken","fetchValuesByTokenForElement","elementMatchedValue","elementUnmatchedValue","parseResult","parseToken","valuesByToken","parseValueForToken","BindingObserver","bindingsByAction","valueListObserver","actionAttribute","disconnectAllActions","connectAction","disconnectAction","clear","ValueObserver","receiver","stringMapObserver","valueDescriptorMap","invokeChangedCallbacksForDefaultValues","invokeChangedCallback","writer","defaultValue","valueDescriptorNameMap","valueDescriptors","undefined","data","rawValue","rawOldValue","changedMethodName","changedMethod","reader","TypeError","descriptors","hasMethodName","TargetObserver","targetsByName","disconnectAllTargets","connectTarget","disconnectTarget","_a","targetConnected","targetDisconnected","readInheritableStaticArrayValues","propertyName","ancestors","getAncestorsForConstructor","definition","isArray","getOwnStaticArrayValues","readInheritableStaticObjectPairs","pairs","getOwnStaticObjectPairs","getPrototypeOf","reverse","OutletObserver","outletsByName","outletElementsByName","selectorObserverMap","attributeObserverMap","outletDefinitions","outletName","setupSelectorObserverForOutlet","setupAttributeObserverForOutlet","dependentContexts","observer","disconnectAllOutlets","stopSelectorObservers","stopAttributeObservers","outlet","getOutlet","connectOutlet","getOutletFromMap","disconnectOutlet","hasOutlet","hasOutletController","controllerAttribute","_element","getOutletNameFromOutletAttributeName","updateSelectorObserverForOutlet","outletConnected","outletDisconnected","selectorObserver","body","attributeNameForOutletName","outlets","getSelectorForOutletName","outletAttributeForScope","find","outletDependencies","dependencies","router","modules","module","controllerConstructor","dependentControllerIdentifiers","identifiers","contexts","getControllerForElementAndIdentifier","Context","functionName","bindingObserver","dispatcher","valueObserver","targetObserver","outletObserver","initialize","parentElement","invokeControllerMethod","args","bless","properties","shadowConstructor","extend","shadowProperties","getOwnKeys","shadowingDescriptor","getOwnPropertyDescriptor","getShadowedDescriptor","getShadowProperties","defineProperties","shadow","blessings","blessedProperties","blessing","getBlessedProperties","getOwnPropertySymbols","getOwnPropertyNames","extendWithReflect","extended","Reflect","construct","arguments","create","setPrototypeOf","b","testReflectExtension","Module","blessDefinition","contextsByScope","connectedContexts","connectContextForScope","fetchContextForScope","disconnectContextForScope","ClassMap","getDataKey","getAll","getAttributeName","getAttributeNameForKey","DataMap","setAttribute","removeAttribute","Guide","logger","warnedKeysByObject","warn","warnedKeys","attributeValueContainsToken","TargetSet","targetName","targetNames","findTarget","findLegacyTarget","findAll","targets","findAllTargets","findAllLegacyTargets","getSelectorForTargetName","findElement","findAllElements","targetAttributeForScope","getLegacySelectorForTargetName","deprecate","targetDescriptor","targetAttribute","revisedAttributeName","guide","OutletSet","controllerElement","outletNames","findOutlet","findAllOutlets","queryElements","matchesElement","Scope","classes","closest","controllerSelector","documentScope","isDocumentScope","documentElement","ScopeObserver","scopesByIdentifierByElement","scopeReferenceCounts","parseValueForElementAndIdentifier","scopesByIdentifier","fetchScopesByIdentifierForElement","createScopeForElementAndIdentifier","referenceCount","scopeConnected","scopeDisconnected","Router","scopeObserver","modulesByIdentifier","loadDefinition","unloadIdentifier","connectModule","afterLoad","disconnectModule","getContextForElementAndIdentifier","proposeToConnectScopeForElementAndIdentifier","console","defaultSchema","enter","tab","esc","space","up","down","home","end","page_up","page_down","objectFromEntries","c","n","array","memo","k","v","Application","debug","logFormattedMessage","Promise","resolve","readyState","register","load","registerActionOption","head","rest","shouldLoad","unload","controllers","onerror","groupCollapsed","log","groupEnd","getOutletController","getControllerAndEnsureConnectedScope","outletController","parseValueDefinitionPair","typeDefinition","payload","typeObject","typeFromObject","hasType","hasDefault","default","fullObject","onlyType","onlyDefault","parseValueTypeConstant","typeFromDefaultValue","parseValueTypeDefault","parseValueTypeObject","typeFromConstant","propertyPath","parseValueTypeDefinition","constant","defaultValuesByType","constantFromType","defaultValueForDefinition","hasCustomDefaultValue","readers","writers","valueDescriptorForTokenAndTypeDefinition","Boolean","Number","String","boolean","number","string","writeJSON","stringify","Controller","_identifier","_application","dispatch","prefix","bubbles","cancelable","CustomEvent","dispatchEvent","classDefinition","targetDefinition","valueDefinitionPairs","propertyDescriptorMap","result","valueDefinitionPair","valueDescriptor","read","write","propertiesForValueDefinitionPair","outletDefinition","camelizedName","outletElement","propertiesForOutletDefinition","static","navigator","clipboard","writeText","contentValue","catch","clipboardFallback","bind","createElement","appendChild","setSelectionRange","execCommand","removeChild","prefersDark","localStorage","getItem","matchMedia","setColorScheme","dataset","colorScheme","i18n","light","dark","toggle","setLabel","isDark","removeItem","setItem","setTimeout","hasLabelTarget","label","i18nValue","labelTarget","title","innerText","config","updateWizard","openModal","querySelector","buttonImage","append","parentNode","classList","after","remove","canEdit","configValue","disabled","src","icon","iconDisabled","Backend","openModalIframe","url","href","ids","rebuildNavigation","connected","sectionTargetConnected","hasNavigationTarget","links","sectionTargets","el","scrollIntoView","li","navigationTarget","replaceChildren","expand","collapse","expandAll","expandAllTitle","collapseAll","collapseAllTitle","super","togglerMap","nextId","operationTargetConnected","updateOperation","nodeTargetConnected","style","getComputedStyle","padding","parseFloat","paddingTop","paddingBottom","height","clientHeight","maxValue","id","overflow","maxHeight","expandValue","innerHTML","toggler","nodeTargetDisconnected","collapseValue","toggleAll","isExpanded","hasExpanded","nodeTargets","keypress","hasOperationTarget","hasTogglers","expanded","operationTarget","display","collapseAllValue","collapseAllTitleValue","expandAllValue","expandAllTitleValue","inputTargets","sessionKey","behavior","block","loadFallback","reject","initScrollOffset","getScrollOffset","then","discard","store","offset","scrollTo","top","behaviorValue","blockValue","scrollToTargetConnected","scrollToTarget","autoFocusTargetConnected","autoFocus","autoFocusTarget","readonly","offsetWidth","offsetHeight","autocomplete","focus","scrollTop","sessionStorage","sessionKeyValue","parseInt","table","addController","fs","migrateLegacy","AjaxRequest","toggleFieldset","collapsedClass","open","close","storeState","i","checkValidity","click","state","hasIdValue","hasTableValue","location","headers","URLSearchParams","idValue","tableValue","requestToken","expandTitle","collapseTitle","_ref","category","collapsed","expandTitleValue","collapseTitleValue","sendRequest","urlValue","REQUEST_TOKEN","requestTokenValue","mode","toggleAction","loadAction","refererId","childTargetConnected","blur","toggleToggler","level","folder","item","showChild","expandToggler","updateState","hideChild","collapseToggler","fetchChild","loadToggler","enabled","URL","search","searchParams","refererIdValue","response","loadActionValue","ok","txt","text","ul","modeValue","next","isFolder","parent","typeOf","nextElementSibling","before","fireEvent","hasExpandedRoot","updateAllState","toggleTargets","childTargets","promises","all","toggleActionValue","rootChildTargets","toggleNavigation","$","getParent","hasClass","removeClass","Contao","lang","Request","post","request_token","addClass","toggleStructure","getStyle","setStyle","field","evalScripts","onRequest","displayBox","loading","onSuccess","inject","getNext","getElements","each","referer_id","hideBox","toggleFileManager","toggleSubpalette","updateVersionNumber","html","fields","VERSION_NUMBER","exec","checked","json","div","javascript","str","Asset","onLoad","Browser","toggleField","rowIcon","pa","img","images","published","getPrevious","getFirst","getElement","HTMLElement","nodeName","indexOf","newSrc","lastIndexOf","image","toggleCheckboxGroup","box","overlay","scroll","getScroll","y","currentId","popupWindow","themePath","script_url","theme","openModalWindow","width","SimpleModal","show","openModalImage","opt","maxWidth","getSize","x","toInt","min","openModalSelector","M","addButton","cancel","buttons","hide","apply","inp","pickerValue","sIndex","frm","frames","val","getElementById","getElementsByTagName","splice","alert","openModalBrowser","field_name","win","source","routes","backend_picker","autoSubmit","Event","hidden","submit","vScrollTo","addEvent","toggleCheckboxes","items","$$","status","substr","cls","className","checkbox","toggleCheckboxElements","makeParentViewSortable","ds","Scroller","onChange","list","Sortables","constrain","opacity","onStart","onComplete","onSort","divs","wrapLevel","getChildren","handle","active","pid","req","makeMultiSrcSortable","oid","els","lis","j","did","dispose","enableFileTreeDragAndDrop","fixDroppable","droppable","dragHandle","dragElement","rightClick","currentHover","currentHoverTime","expandLink","cloneBase","clone","setPosition","page","getOffsetParent","getPosition","move","Drag","Move","droppables","unDraggableTags","modifiers","onEnter","Date","getTime","createEvent","initEvent","onAjax","removeEvent","onCancel","destroy","onKeyup","onDrop","decodeURIComponent","encodeURIComponent","onLeave","listWizard","addEventsTo","previous","bt","hasEvent","getProperty","keyCode","makeSortable","tableWizard","thead","tbody","children","rows","tr","current","ntr","getIndex","headFirst","getLast","td","cols","tableWizardResize","factor","round","limit","chunks","tableWizardSetWidth","wrap","getComputedSize","optionsWizard","keyValueWizard","checkboxWizard","container","span","nspan","enableImageSizeWidgets","widthInput","heightInput","update","readOnly","dimensions","getSelected","enableToggleSelect","thisIndex","startIndex","to","shiftToggle","checkboxes","clickEvent","limitToggler","boundEvent","retrieve","editPreviewWizard","partElement","startPos","imageElement","inputElements","isDrawing","getScale","updateImage","scale","imageSize","setStyles","computedTop","computedLeft","toFloat","rect","abs","styles","getStyles","toFixed","updateValues","getLength","addEvents","mousedown","touchstart","mousemove","touchmove","mouseup","touchend","touchcancel","resize","enableFileTreeUpload","fallbackUrl","dzElement","previewsContainer","clickable","dz","Dropzone","on","reload","dataTransfer","types","link","crawl","progressBar","progressCount","results","debugLog","execRequest","onlyStatusUpdate","responseText","decode","total","done","pending","percentage","hasDebugLog","finished","summary","warning","subscriberResults","subscriberSummary","hasLog","wasSuccessful","updateData","send","Theme","isWebkit","chrome","safari","userAgent","stopClickPropagation","setupCtrlClick","Features","Touch","Platform","mac","setupTextareaResizing","ie6","ie7","ie8","dummy","line","tween","setupMenuToggle","burger","toggleClass","setAriaControls","setupProfileToggle","tmenu","menu","setupSplitButtonToggle","timer","clearTimeout","Elements","chosen","hgt","initializedRows","saveScrollOffsetEvent","init","row","command","cloneNode","selects","nselects","insertBefore","nextSibling","Chosen","cbx","previousElementSibling","code","insertAdjacentElement","updateLink","mutationsList","Class","Extends","followRedirects","success","getHeader","secure","stripScripts","script","failure","onFailure","refactor","attach","handles","bound","detach","check","sqrt","pow","mouse","snap","drag","removeEvents","lists","dragOptions","merge","tag","addItems","flatten","removeItems","erase","getClone","Queue","autoAdvance","resume","queue","isRunning","stopOnFailure","onException","SerpPreview","trail","titleField","titleFallbackField","aliasField","descriptionField","descriptionFallbackField","titleTag","shorten","html2string","DOMParser","parseFromString","textContent","getTinymce","tinyMCE","serpTitle","serpUrl","serpDescription","indexEmpty","editor","getContent","activeEditor","initialized","tip","position","useContent","willChange","getBoundingClientRect","rtl","direction","clientWidth","scrollX","scrollY","setup","webpackContext","webpackContextResolve","__webpack_require__","o","exports","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","d","defineProperty","enumerable","obj","prop","r","Symbol","toStringTag","definitionForModuleAndIdentifier","identifierForContextKey","logicalName","process","require"],"sourceRoot":""}
!function(){var e={448:function(e,t,n){"use strict";n.d(t,{Mx:function(){return Z},Qr:function(){return ce}});class i{constructor(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=function(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort(((e,t)=>{const n=e.index,i=t.index;return n<i?-1:n>i?1:0}))}}class s{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach((e=>e.connect())))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach((e=>e.disconnect())))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce(((e,t)=>e.concat(Array.from(t.values()))),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,n={}){this.application.handleError(e,`Error ${t}`,n)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:n,eventOptions:i}=e,s=this.fetchEventListenerMapForEventTarget(t),r=this.cacheKey(n,i);s.delete(r),0==s.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:n,eventOptions:i}=e;return this.fetchEventListener(t,n,i)}fetchEventListener(e,t,n){const i=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,n);let r=i.get(s);return r||(r=this.createEventListener(e,t,n),i.set(s,r)),r}createEventListener(e,t,n){const s=new i(e,t,n);return this.started&&s.connect(),s}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){const n=[e];return Object.keys(t).sort().forEach((e=>{n.push(`${t[e]?"":"!"}${e}`)})),n.join(":")}}const r={stop({event:e,value:t}){return t&&e.stopPropagation(),!0},prevent({event:e,value:t}){return t&&e.preventDefault(),!0},self({event:e,value:t,element:n}){return!t||n===e.target}},o=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function a(e){return"window"==e?window:"document"==e?document:void 0}function l(e){return e.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function c(e){return l(e.replace(/--/g,"-").replace(/__/g,"_"))}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}function u(e){return e.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function h(e){return null!=e}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const p=["meta","ctrl","alt","shift"];class f{constructor(e,t,n,i){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(e){const t=e.tagName.toLowerCase();if(t in m)return m[t](e)}(e)||v("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||v("missing identifier"),this.methodName=n.methodName||v("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=i}static forToken(e,t){return new this(e.element,e.index,function(e){const t=e.trim().match(o)||[];let n=t[2],i=t[3];return i&&!["keydown","keyup","keypress"].includes(n)&&(n+=`.${i}`,i=""),{eventTarget:a(t[4]),eventName:n,eventOptions:t[7]?(s=t[7],s.split(":").reduce(((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)})),{})):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||i};var s}(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;const n=t.filter((e=>!p.includes(e)))[0];return!!n&&(g(this.keyMappings,n)||v(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[n].toLowerCase()!==e.key.toLowerCase())}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:n,value:i}of Array.from(this.element.attributes)){const s=n.match(t),r=s&&s[1];r&&(e[l(r)]=b(i))}return e}get eventTargetName(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[n,i,s,r]=p.map((e=>t.includes(e)));return e.metaKey!==n||e.ctrlKey!==i||e.altKey!==s||e.shiftKey!==r}}const m={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function v(e){throw new Error(e)}function b(e){try{return JSON.parse(e)}catch(t){return e}}class y{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action,{actionDescriptorFilters:n}=this.context.application,{controller:i}=this.context;let s=!0;for(const[r,o]of Object.entries(this.eventOptions))if(r in n){const a=n[r];s=s&&a({name:r,value:o,event:e,element:t,controller:i})}return s}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:n}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:n,action:this.methodName})}catch(t){const{identifier:n,controller:i,element:s,index:r}=this,o={identifier:n,controller:i,element:s,index:r,event:e};this.context.handleError(t,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&(!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element))))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class w{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const n of this.matchElementsInTree(e))t.call(this,n)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}}class E{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new w(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function k(e,t,n){S(e,t).add(n)}function C(e,t,n){S(e,t).delete(n),function(e,t){const n=e.get(t);null!=n&&0==n.size&&e.delete(t)}(e,t)}function S(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}class x{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e.concat(Array.from(t))),[])}get size(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e+t.size),0)}add(e,t){k(this.valuesByKey,e,t)}delete(e,t){C(this.valuesByKey,e,t)}has(e,t){const n=this.valuesByKey.get(e);return null!=n&&n.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some((t=>t.has(e)))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter((([t,n])=>n.has(e))).map((([e,t])=>e))}}class A{constructor(e,t,n,i){this._selector=t,this.details=i,this.elementObserver=new w(e,this),this.delegate=n,this.matchesByElement=new x}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const n=e.matches(t);return this.delegate.selectorMatchElement?n&&this.delegate.selectorMatchElement(e,this.details):n}return!1}matchElementsInTree(e){const{selector:t}=this;if(t){const n=this.matchElement(e)?[e]:[],i=Array.from(e.querySelectorAll(t)).filter((e=>this.matchElement(e)));return n.concat(i)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const n of t)this.selectorUnmatched(e,n)}elementAttributeChanged(e,t){const{selector:n}=this;if(n){const t=this.matchElement(e),i=this.matchesByElement.has(n,e);t&&!i?this.selectorMatched(e,n):!t&&i&&this.selectorUnmatched(e,n)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}}class O{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const n=this.delegate.getStringMapKeyForAttribute(e);if(null!=n){this.stringMap.has(e)||this.stringMapKeyAdded(n,e);const i=this.element.getAttribute(e);if(this.stringMap.get(e)!=i&&this.stringMapValueChanged(i,n,t),null==i){const t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(n,e,t)}else this.stringMap.set(e,i)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,n){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,n)}stringMapKeyRemoved(e,t,n){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,n)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map((e=>e.name))}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class T{constructor(e,t,n){this.attributeObserver=new E(e,t,this),this.delegate=n,this.tokensByElement=new x}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,n]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(n)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach((e=>this.tokenMatched(e)))}tokensUnmatched(e){e.forEach((e=>this.tokenUnmatched(e)))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),i=function(e,t){const n=Math.max(e.length,t.length);return Array.from({length:n},((n,i)=>[e[i],t[i]]))}(t,n).findIndex((([e,t])=>{return i=t,!((n=e)&&i&&n.index==i.index&&n.content==i.content);var n,i}));return-1==i?[[],[]]:[t.slice(i),n.slice(i)]}readTokensForElement(e){const t=this.attributeName;return function(e,t,n){return e.trim().split(/\s+/).filter((e=>e.length)).map(((e,i)=>({element:t,attributeName:n,content:e,index:i})))}(e.getAttribute(t)||"",e,t)}}class M{constructor(e,t,n){this.tokenListObserver=new T(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))}tokenUnmatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}}class ${constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new M(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new y(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach((e=>this.delegate.bindingDisconnected(e,!0))),this.bindingsByAction.clear()}parseValueForToken(e){const t=f.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class F{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new O(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const n=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,n.writer(this.receiver[e]),n.writer(n.defaultValue))}stringMapValueChanged(e,t,n){const i=this.valueDescriptorNameMap[t];null!==e&&(null===n&&(n=i.writer(i.defaultValue)),this.invokeChangedCallback(t,e,n))}stringMapKeyRemoved(e,t,n){const i=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,i.writer(this.receiver[e]),n):this.invokeChangedCallback(e,i.writer(i.defaultValue),n)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:n,writer:i}of this.valueDescriptors)null==n||this.controller.data.has(e)||this.invokeChangedCallback(t,i(n),void 0)}invokeChangedCallback(e,t,n){const i=`${e}Changed`,s=this.receiver[i];if("function"==typeof s){const i=this.valueDescriptorNameMap[e];try{const e=i.reader(t);let r=n;n&&(r=i.reader(n)),s.call(this.receiver,e,r)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${i.name}" - ${e.message}`),e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map((t=>e[t]))}get valueDescriptorNameMap(){const e={};return Object.keys(this.valueDescriptorMap).forEach((t=>{const n=this.valueDescriptorMap[t];e[n.name]=n})),e}hasValue(e){const t=`has${d(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class _{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new x}start(){this.tokenListObserver||(this.tokenListObserver=new T(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var n;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetConnected(e,t))))}disconnectTarget(e,t){var n;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetDisconnected(e,t))))}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function N(e,t){const n=j(e);return Array.from(n.reduce(((e,n)=>(function(e,t){const n=e[t];return Array.isArray(n)?n:[]}(n,t).forEach((t=>e.add(t))),e)),new Set))}function L(e,t){return j(e).reduce(((e,n)=>(e.push(...function(e,t){const n=e[t];return n?Object.keys(n).map((e=>[e,n[e]])):[]}(n,t)),e)),[])}function j(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}class B{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new x,this.outletElementsByName=new x,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach((e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)})),this.started=!0,this.dependentContexts.forEach((e=>e.refresh())))}refresh(){this.selectorObserverMap.forEach((e=>e.refresh())),this.attributeObserverMap.forEach((e=>e.refresh()))}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach((e=>e.stop())),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach((e=>e.stop())),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:n}){const i=this.getOutlet(e,n);i&&this.connectOutlet(i,e,n)}selectorUnmatched(e,t,{outletName:n}){const i=this.getOutletFromMap(e,n);i&&this.disconnectOutlet(i,e,n)}selectorMatchElement(e,{outletName:t}){const n=this.selector(t),i=this.hasOutlet(e,t),s=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!n&&(i&&s&&e.matches(n))}elementMatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementAttributeValueChanged(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementUnmatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}connectOutlet(e,t,n){var i;this.outletElementsByName.has(n,t)||(this.outletsByName.add(n,e),this.outletElementsByName.add(n,t),null===(i=this.selectorObserverMap.get(n))||void 0===i||i.pause((()=>this.delegate.outletConnected(e,t,n))))}disconnectOutlet(e,t,n){var i;this.outletElementsByName.has(n,t)&&(this.outletsByName.delete(n,e),this.outletElementsByName.delete(n,t),null===(i=this.selectorObserverMap.get(n))||void 0===i||i.pause((()=>this.delegate.outletDisconnected(e,t,n))))}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const n of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(n,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e),n=new A(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,n),n.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),n=new E(this.scope.element,t,this);this.attributeObserverMap.set(e,n),n.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find((t=>this.attributeNameForOutletName(t)===e))}get outletDependencies(){const e=new x;return this.router.modules.forEach((t=>{N(t.definition.controllerConstructor,"outlets").forEach((n=>e.add(n,t.identifier)))})),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter((t=>e.includes(t.identifier)))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find((t=>t.element===e))}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class D{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:n,controller:i,element:s}=this;t=Object.assign({identifier:n,controller:i,element:s},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new $(this,this.dispatcher),this.valueObserver=new F(this,this.controller),this.targetObserver=new _(this,this),this.outletObserver=new B(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,n={}){const{identifier:i,controller:s,element:r}=this;n=Object.assign({identifier:i,controller:s,element:r},n),this.application.handleError(e,`Error ${t}`,n)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,n){this.invokeControllerMethod(`${c(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${c(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const n=this.controller;"function"==typeof n[e]&&n[e](...t)}}function P(e){return function(e,t){const n=R(e),i=function(e,t){return q(t).reduce(((n,i)=>{const s=function(e,t,n){const i=Object.getOwnPropertyDescriptor(e,n);if(!i||!("value"in i)){const e=Object.getOwnPropertyDescriptor(t,n).value;return i&&(e.get=i.get||e.get,e.set=i.set||e.set),e}}(e,t,i);return s&&Object.assign(n,{[i]:s}),n}),{})}(e.prototype,t);return Object.defineProperties(n.prototype,i),n}(e,function(e){const t=N(e,"blessings");return t.reduce(((t,n)=>{const i=n(e);for(const e in i){const n=t[e]||{};t[e]=Object.assign(n,i[e])}return t}),{})}(e))}const q="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,R=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e((function(){this.a.call(this)}));t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();class I{constructor(e,t){this.application=e,this.definition=function(e){return{identifier:e.identifier,controllerConstructor:P(e.controllerConstructor)}}(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new D(this,e),this.contextsByScope.set(e,t)),t}}class V{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){const t=this.data.get(this.getDataKey(e))||"";return t.match(/[^\s]+/g)||[]}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class z{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${u(e)}`}}class K{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,n){let i=this.warnedKeysByObject.get(e);i||(i=new Set,this.warnedKeysByObject.set(e,i)),i.has(t)||(i.add(t),this.logger.warn(n,e))}}function U(e,t){return`[${e}~="${t}"]`}class W{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)]),[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return U(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map((t=>this.deprecate(t,e)))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return U(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:n}=this,i=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${i}="${n}.${t}" with ${s}="${t}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class H{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findOutlet(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllOutlets(t)]),[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))}matchesElement(e,t,n){const i=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&i.split(" ").includes(n)}}class Q{constructor(e,t,n,i){this.targets=new W(this),this.classes=new V(this),this.data=new z(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new K(i),this.outlets=new H(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return U(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new Q(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class X{constructor(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new M(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:n}=e;return this.parseValueForElementAndIdentifier(t,n)}parseValueForElementAndIdentifier(e,t){const n=this.fetchScopesByIdentifierForElement(e);let i=n.get(t);return i||(i=this.delegate.createScopeForElementAndIdentifier(e,t),n.set(t,i)),i}elementMatchedValue(e,t){const n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}}class J{constructor(e){this.application=e,this.scopeObserver=new X(this.element,this.schema,this),this.scopesByIdentifier=new x,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce(((e,t)=>e.concat(t.contexts)),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new I(this.application,e);this.connectModule(t);const n=e.controllerConstructor.afterLoad;n&&n.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const n=this.modulesByIdentifier.get(t);if(n)return n.contexts.find((t=>t.element==e))}proposeToConnectScopeForElementAndIdentifier(e,t){const n=this.scopeObserver.parseValueForElementAndIdentifier(e,t);n?this.scopeObserver.elementMatchedValue(n.element,n):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,n){this.application.handleError(e,t,n)}createScopeForElementAndIdentifier(e,t){return new Q(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.connectContextForScope(t)))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.disconnectContextForScope(t)))}}const G={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},Y("abcdefghijklmnopqrstuvwxyz".split("").map((e=>[e,e])))),Y("0123456789".split("").map((e=>[e,e]))))};function Y(e){return e.reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{})}class Z{constructor(e=document.documentElement,t=G){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,n={})=>{this.debug&&this.logFormattedMessage(e,t,n)},this.element=e,this.schema=t,this.dispatcher=new s(this),this.router=new J(this),this.actionDescriptorFilters=Object.assign({},r)}static start(e,t){const n=new this(e,t);return n.start(),n}async start(){await new Promise((e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>e())):e()})),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)}))}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>this.router.unloadIdentifier(e)))}get controllers(){return this.router.contexts.map((e=>e.controller))}getControllerForElementAndIdentifier(e,t){const n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null}handleError(e,t,n){var i;this.logger.error("%s\n\n%o\n\n%o",t,e,n),null===(i=window.onerror)||void 0===i||i.call(window,t,"",0,0,e)}logFormattedMessage(e,t,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}}function ee(e,t,n){return e.application.getControllerForElementAndIdentifier(t,n)}function te(e,t,n){let i=ee(e,t,n);return i||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,n),i=ee(e,t,n),i||void 0)}function ne([e,t],n){return function(e){const{token:t,typeDefinition:n}=e,i=`${u(t)}-value`,s=function(e){const{controller:t,token:n,typeDefinition:i}=e,s={controller:t,token:n,typeObject:i},r=function(e){const{controller:t,token:n,typeObject:i}=e,s=h(i.type),r=h(i.default),o=s&&r,a=s&&!r,l=!s&&r,c=ie(i.type),d=se(e.typeObject.default);if(a)return c;if(l)return d;if(c!==d){throw new Error(`The specified default value for the Stimulus Value "${t?`${t}.${n}`:n}" must match the defined type "${c}". The provided default value of "${i.default}" is of type "${d}".`)}if(o)return c}(s),o=se(i),a=ie(i),l=r||o||a;if(l)return l;const c=t?`${t}.${i}`:n;throw new Error(`Unknown value type "${c}" for "${n}" value`)}(e);return{type:s,key:i,name:l(i),get defaultValue(){return function(e){const t=ie(e);if(t)return re[t];const n=g(e,"default"),i=g(e,"type"),s=e;if(n)return s.default;if(i){const{type:e}=s,t=ie(e);if(t)return re[t]}return e}(n)},get hasCustomDefaultValue(){return void 0!==se(n)},reader:oe[s],writer:ae[s]||ae.default}}({controller:n,token:e,typeDefinition:t})}function ie(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function se(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}const re={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},oe={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${se(t)}"`);return t},boolean(e){return!("0"==e||"false"==String(e).toLowerCase())},number(e){return Number(e.replace(/_/g,""))},object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${se(t)}"`);return t},string(e){return e}},ae={default:function(e){return`${e}`},array:le,object:le};function le(e){return JSON.stringify(e)}class ce{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:i=this.identifier,bubbles:s=!0,cancelable:r=!0}={}){const o=new CustomEvent(i?`${i}:${e}`:e,{detail:n,bubbles:s,cancelable:r});return t.dispatchEvent(o),o}}ce.blessings=[function(e){return N(e,"classes").reduce(((e,t)=>{return Object.assign(e,{[`${n=t}Class`]:{get(){const{classes:e}=this;if(e.has(n))return e.get(n);{const t=e.getAttributeName(n);throw new Error(`Missing attribute "${t}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${d(n)}Class`]:{get(){return this.classes.has(n)}}});var n}),{})},function(e){return N(e,"targets").reduce(((e,t)=>{return Object.assign(e,{[`${n=t}Target`]:{get(){const e=this.targets.find(n);if(e)return e;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${d(n)}Target`]:{get(){return this.targets.has(n)}}});var n}),{})},function(e){const t=L(e,"values"),n={valueDescriptorMap:{get(){return t.reduce(((e,t)=>{const n=ne(t,this.identifier),i=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[i]:n})}),{})}}};return t.reduce(((e,t)=>Object.assign(e,function(e,t){const n=ne(e,t),{key:i,name:s,reader:r,writer:o}=n;return{[s]:{get(){const e=this.data.get(i);return null!==e?r(e):n.defaultValue},set(e){void 0===e?this.data.delete(i):this.data.set(i,o(e))}},[`has${d(s)}`]:{get(){return this.data.has(i)||n.hasCustomDefaultValue}}}}(t))),n)},function(e){return N(e,"outlets").reduce(((e,t)=>Object.assign(e,function(e){const t=c(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t){const n=te(this,t,e);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map((t=>{const n=te(this,t,e);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)})).filter((e=>e)):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${d(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}(t))),{})}],ce.targets=[],ce.outlets=[],ce.values={}},836:function(e,t,n){"use strict";n.r(t);var i=n(448);t.default=class extends i.Qr{static values={content:String};write(){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(this.contentValue).catch(this.clipboardFallback.bind(this)):this.clipboardFallback()}clipboardFallback(){const e=document.createElement("input");e.value=this.contentValue,document.body.appendChild(e),e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(e)}}},316:function(e,t,n){"use strict";n.r(t);var i=n(448);const s=()=>{const e=localStorage.getItem("contao--prefers-dark");return null===e?!!window.matchMedia("(prefers-color-scheme: dark)").matches:"true"===e},r=()=>{document.documentElement.dataset.colorScheme=s()?"dark":"light"};window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),r(),t.default=class extends i.Qr{static targets=["label"];static values={i18n:{type:Object,default:{light:"Disable dark mode",dark:"Enable dark mode"}}};initialize(){this.toggle=this.toggle.bind(this),this.setLabel=this.setLabel.bind(this)}connect(){this.element.addEventListener("click",this.toggle),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",this.setLabel),this.setLabel()}disconnect(){this.element.removeEventListener("click",this.toggle)}toggle(e){e.preventDefault();const t=!s();t===window.matchMedia("(prefers-color-scheme: dark)").matches?localStorage.removeItem("contao--prefers-dark"):localStorage.setItem("contao--prefers-dark",String(t)),r(),setTimeout(this.setLabel,300)}setLabel(){if(!this.hasLabelTarget)return;const e=this.i18nValue[s()?"light":"dark"];this.labelTarget.title=e,this.labelTarget.innerText=e}}},910:function(e,t,n){"use strict";n.r(t);var i=n(448);t.default=class extends i.Qr{static values={config:Object};initialize(){this.updateWizard=this.updateWizard.bind(this),this.openModal=this.openModal.bind(this)}connect(){this.select=this.element.querySelector("select"),this.button=document.createElement("button"),this.button.type="button",this.button.title="",this.buttonImage=document.createElement("img"),this.button.append(this.buttonImage),this.element.parentNode.classList.add("wizard"),this.element.after(this.button),this.select.addEventListener("change",this.updateWizard),this.button.addEventListener("click",this.openModal),this.updateWizard()}disconnect(){this.element.parentNode.classList.remove("wizard"),this.select.removeEventListener("change",this.updateWizard),this.buttonImage.remove(),this.button.remove()}updateWizard(){this.canEdit()?(this.button.title=this.configValue.title,this.button.disabled=!1,this.buttonImage.src=this.configValue.icon):(this.button.title="",this.button.disabled=!0,this.buttonImage.src=this.configValue.iconDisabled)}openModal(){Backend.openModalIframe({title:this.configValue.title,url:`${this.configValue.href}&id=${this.select.value}`})}canEdit(){return this.configValue.ids.includes(Number(this.select.value))}}},547:function(e,t,n){"use strict";n.r(t);var i=n(448);t.default=class extends i.Qr{static targets=["navigation","section"];connect(){this.rebuildNavigation(),this.connected=!0}sectionTargetConnected(){this.connected&&this.rebuildNavigation()}rebuildNavigation(){if(!this.hasNavigationTarget)return;const e=document.createElement("ul");this.sectionTargets.forEach((t=>{const n=document.createElement("button");n.innerText=t.getAttribute(`data-${this.identifier}-label-value`),n.addEventListener("click",(e=>{e.preventDefault(),this.dispatch("scrollto",{target:t}),t.scrollIntoView()}));const i=document.createElement("li");i.append(n),e.append(i)})),this.navigationTarget.replaceChildren(e)}}},5:function(e,t,n){"use strict";n.r(t);var i=n(448);t.default=class extends i.Qr{static values={max:Number,expand:String,collapse:String,expandAll:String,expandAllTitle:String,collapseAll:String,collapseAllTitle:String};static targets=["operation","node"];initialize(){super.initialize(),this.togglerMap=new WeakMap,this.nextId=1}operationTargetConnected(){this.updateOperation()}nodeTargetConnected(e){const t=window.getComputedStyle(e,null),n=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),i=e.clientHeight-n;if(this.maxValue>i)return;e.id||(e.id="limit-height-"+this.nextId++),e.style.overflow="hidden",e.style.maxHeight=`${this.maxValue}px`;const s=document.createElement("button");s.setAttribute("type","button"),s.title=this.expandValue,s.innerHTML="<span>...</span>",s.classList.add("unselectable"),s.setAttribute("aria-expanded","false"),s.setAttribute("aria-controls",e.id),s.addEventListener("click",(t=>{t.preventDefault(),this.toggle(e),this.updateOperation(t)}));const r=document.createElement("div");r.classList.add("limit_toggler"),r.append(s),this.togglerMap.set(e,r),e.append(r),this.updateOperation()}nodeTargetDisconnected(e){this.togglerMap.has(e)&&(this.togglerMap.get(e).remove(),this.togglerMap.delete(e),e.style.overflow="",e.style.maxHeight="")}toggle(e){""===e.style.maxHeight?this.collapse(e):this.expand(e)}expand(e){if(!this.togglerMap.has(e))return;e.style.maxHeight="";const t=this.togglerMap.get(e).querySelector("button");t.title=this.collapseValue,t.setAttribute("aria-expanded","true")}collapse(e){if(!this.togglerMap.has(e))return;e.style.maxHeight=`${this.maxValue}px`;const t=this.togglerMap.get(e).querySelector("button");t.title=this.expandValue,t.setAttribute("aria-expanded","false")}toggleAll(e){e.preventDefault();const t=this.hasExpanded()^e.altKey;this.nodeTargets.forEach((e=>{t?this.collapse(e):this.expand(e)})),this.updateOperation(e)}keypress(e){this.updateOperation(e)}updateOperation(e){if(!this.hasOperationTarget)return;const t=!!this.nodeTargets.find((e=>this.togglerMap.has(e))),n=this.hasExpanded();this.operationTarget.style.display=t?"":"none",this.operationTarget.setAttribute("aria-controls",this.nodeTargets.map((e=>e.id)).join(" ")),this.operationTarget.setAttribute("aria-expanded",n?"true":"false"),n^(!!e&&e.altKey)?(this.operationTarget.innerText=this.collapseAllValue,this.operationTarget.title=this.collapseAllTitleValue):(this.operationTarget.innerText=this.expandAllValue,this.operationTarget.title=this.expandAllTitleValue)}hasExpanded(){return!!this.nodeTargets.find((e=>this.togglerMap.has(e)&&""===e.style.maxHeight))}}},17:function(e,t,n){"use strict";n.r(t);var i=n(448);t.default=class extends i.Qr{static targets=["input"];delete(){this.inputTargets.forEach((e=>{e.value=""}))}}},470:function(e,t,n){"use strict";n.r(t);var i=n(448);t.default=class extends i.Qr{static targets=["scrollTo","autoFocus"];static values={sessionKey:{type:String,default:"contao_backend_offset"},behavior:{type:String,default:"instant"},block:{type:String,default:"center"}};static afterLoad(e,t){const n=()=>new Promise(((n,i)=>{const s=t.getControllerForElementAndIdentifier(document.documentElement,e);if(s)return void n(s);const{controllerAttribute:r}=t.schema;document.documentElement.setAttribute(r,`${document.documentElement.getAttribute(r)||""} ${e}`),setTimeout((()=>{const s=t.getControllerForElementAndIdentifier(document.documentElement,e);s&&n(s)||i(s)}),100)}));window.Backend&&!window.Backend.initScrollOffset&&(window.Backend.initScrollOffset=()=>{console.warn("Backend.initScrollOffset() is deprecated. Please use the Stimulus controller instead."),n()}),window.Backend&&!window.Backend.getScrollOffset&&(window.Backend.getScrollOffset=()=>{console.warn("Backend.getScrollOffset() is deprecated. Please use the Stimulus controller instead."),n().then((e=>e.discard()))})}initialize(){this.store=this.store.bind(this)}connect(){this.offset&&(window.scrollTo({top:this.offset,behavior:this.behaviorValue,block:this.blockValue}),this.offset=null)}scrollToTargetConnected(){this.scrollToTarget.scrollIntoView({behavior:this.behaviorValue,block:this.blockValue})}autoFocusTargetConnected(){if(this.offset||this.autoFocus)return;const e=this.autoFocusTarget;e.disabled||e.readonly||!e.offsetWidth||!e.offsetHeight||e.closest(".chzn-search")||e.autocomplete&&"off"!==e.autocomplete||(this.autoFocus=!0,e.focus())}store(){this.offset=this.element.scrollTop}discard(){this.offset=null}get offset(){const e=window.sessionStorage.getItem(this.sessionKeyValue);return e?parseInt(e):null}set offset(e){null==e?window.sessionStorage.removeItem(this.sessionKeyValue):window.sessionStorage.setItem(this.sessionKeyValue,String(e))}}},554:function(e,t,n){"use strict";n.r(t);var i=n(448);t.default=class extends i.Qr{static values={id:String,table:String};static classes=["collapsed"];static afterLoad(e,t){const n=(t,n,i)=>{const s=t.parentNode;s.dataset.controller=`${s.dataset.controller||""} ${e}`,s.setAttribute(`data-${e}-id-value`,n),s.setAttribute(`data-${e}-table-value`,i),s.setAttribute(`data-${e}-collapsed-class`,"collapsed"),t.setAttribute("data-action",`click->${e}#toggle`)},i=()=>{document.querySelectorAll("legend[data-toggle-fieldset]").forEach((function(t){window.console&&console.warn(`Using the "data-toggle-fieldset" attribute on fieldset legends is deprecated and will be removed in Contao 6. Apply the "${e}" Stimulus controller instead.`);const{id:i,table:s}=JSON.parse(t.getAttribute("data-toggle-fieldset"));n(t,i,s)})),AjaxRequest.toggleFieldset=(i,s,r)=>{const o=i.parentNode;t.getControllerForElementAndIdentifier(o,e)||(window.console&&console.warn("Using AjaxRequest.toggleFieldset() is deprecated and will be removed in Contao 6. Apply the Stimulus actions instead."),n(i,s,r),setTimeout((()=>{t.getControllerForElementAndIdentifier(o,e).toggle()}),100))}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):i()}connect(){this.element.querySelectorAll("label.error, label.mandatory").length?this.element.classList.remove(this.collapsedClass):this.element.classList.contains("hide")&&(window.console&&console.warn(`Using class "hide" on a fieldset is deprecated and will be removed in Contao 6. Use class "${this.collapsedClass}" instead.`),this.element.classList.add(this.collapsedClass))}toggle(){this.element.classList.contains(this.collapsedClass)?this.open():this.close()}open(){this.element.classList.contains(this.collapsedClass)&&(this.element.classList.remove(this.collapsedClass),this.storeState(1))}close(){if(this.element.classList.contains(this.collapsedClass))return;const e=this.element.closest("form"),t=this.element.querySelectorAll("[required]");let n=!0;for(let e=0;e<t.length;e++)if(!t[e].value){n=!1;break}n?(this.element.classList.add(this.collapsedClass),this.storeState(0)):"function"==typeof e.checkValidity&&e.querySelector('button[type="submit"]').click()}storeState(e){this.hasIdValue&&this.hasTableValue&&fetch(window.location.href,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({action:"toggleFieldset",id:this.idValue,table:this.tableValue,state:e})})}}},125:function(e,t,n){"use strict";n.r(t);var i=n(448);t.default=class extends i.Qr{static classes=["collapsed"];static values={url:String,requestToken:String,expandTitle:String,collapseTitle:String};toggle(e){let{currentTarget:t,params:{category:n}}=e;const i=t.parentNode.classList.toggle(this.collapsedClass);t.setAttribute("aria-expanded",i?"false":"true"),t.setAttribute("title",i?this.expandTitleValue:this.collapseTitleValue),this.sendRequest(n,i)}sendRequest(e,t){fetch(this.urlValue,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({action:"toggleNavigation",id:e,state:t?0:1,REQUEST_TOKEN:this.requestTokenValue})})}}},634:function(e,t,n){"use strict";n.r(t);var i=n(448);t.default=class extends i.Qr{static values={mode:{type:Number,default:5},toggleAction:String,loadAction:String,requestToken:String,refererId:String,expand:String,collapse:String,expandAll:String,expandAllTitle:String,collapseAll:String,collapseAllTitle:String};static targets=["operation","node","toggle","child","rootChild"];operationTargetConnected(){this.updateOperation()}childTargetConnected(){this.updateOperation()}toggle(e){e.preventDefault();const t=e.currentTarget;t.blur(),this.toggleToggler(t,e.params.id,e.params.level,e.params.folder)}toggleToggler(e,t,n,i){const s=document.id(t);s&&"none"===s.style.display?(this.showChild(s),this.expandToggler(e),this.updateState(e,t,1)):s?(this.hideChild(s),this.collapseToggler(e),this.updateState(e,t,0)):this.fetchChild(e,t,n,i),this.updateOperation()}expandToggler(e){e.classList.add("foldable--open"),e.title=this.collapseValue}collapseToggler(e){e.classList.remove("foldable--open"),e.title=this.expandValue}loadToggler(e,t){e.classList[t?"add":"remove"]("foldable--loading")}showChild(e){e.style.display=""}hideChild(e){e.style.display="none"}async fetchChild(e,t,n,i){this.loadToggler(e,!0);const s=new URL(location.href),r=s.searchParams;r.set("ref",this.refererIdValue),s.search=r.toString();const o=await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({action:this.loadActionValue,id:t,level:n,folder:i,state:1,REQUEST_TOKEN:this.requestTokenValue})});if(o.ok){const i=await o.text(),s=document.createElement("li");s.id=t,s.classList.add("parent"),s.style.display="inline",s.setAttribute(`data-${this.identifier}-target`,0===n?"child rootChild":"child");const r=document.createElement("ul");if(r.classList.add("level_"+n),r.innerHTML=i,s.append(r),5===this.modeValue)e.closest("li").after(s);else{let t,n=!1,i=e.closest("li");for(;"element"===typeOf(i)&&"LI"===i.tagName&&(t=i.nextElementSibling);)if(i=t,i.classList.contains("tl_folder")){n=!0;break}n?i.before(s):i.after(s)}window.dispatchEvent(new CustomEvent("structure")),this.expandToggler(e),window.fireEvent("ajax_change")}this.loadToggler(e,!1)}async toggleAll(e){e.preventDefault();const t=e.currentTarget.href;if(this.hasExpandedRoot()^(!!e&&e.altKey))this.updateAllState(t,0),this.toggleTargets.forEach((e=>this.collapseToggler(e))),this.childTargets.forEach((e=>e.style.display="none"));else{this.childTargets.forEach((e=>e.remove())),this.toggleTargets.forEach((e=>this.loadToggler(e,!0))),await this.updateAllState(t,1);const e=[];this.toggleTargets.forEach((t=>{e.push(this.fetchChild(t,t.getAttribute(`data-${this.identifier}-id-param`),0,t.getAttribute(`data-${this.identifier}-folder-param`)))})),await Promise.all(e)}this.updateOperation()}keypress(e){this.updateOperation(e)}async updateState(e,t,n){await fetch(location.href,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({action:this.toggleActionValue,id:t,state:n,REQUEST_TOKEN:this.requestTokenValue})})}async updateAllState(e,t){await fetch(`${e}&state=${t}`)}updateOperation(e){this.hasOperationTarget&&(this.hasExpandedRoot()^(!!e&&e.altKey)?(this.operationTarget.innerText=this.collapseAllValue,this.operationTarget.title=this.collapseAllTitleValue):(this.operationTarget.innerText=this.expandAllValue,this.operationTarget.title=this.expandAllTitleValue))}hasExpandedRoot(){return!!this.rootChildTargets.find((e=>"none"!==e.style.display))}}},944:function(){window.AjaxRequest={toggleNavigation:function(e,t,n){window.console&&console.warn("AjaxRequest.toggleNavigation() is deprecated. Please use the stimulus controller instead.");var i=$(t),s=$(e).getParent("li");return!!i&&(s.hasClass("collapsed")?(s.removeClass("collapsed"),$(e).setAttribute("aria-expanded","true"),$(e).setAttribute("title",Contao.lang.collapse),new Request.Contao({url:n}).post({action:"toggleNavigation",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(s.addClass("collapsed"),$(e).setAttribute("aria-expanded","false"),$(e).setAttribute("title",Contao.lang.expand),new Request.Contao({url:n}).post({action:"toggleNavigation",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!1)},toggleStructure:function(e,t,n,i){window.console&&console.warn("AjaxRequest.toggleStructure() is deprecated. Please use the stimulus controller instead."),e.blur();var s=$(t);return s?("none"==s.getStyle("display")?(s.setStyle("display",null),$(e).addClass("foldable--open"),$(e).setAttribute("title",Contao.lang.collapse),new Request.Contao({field:e}).post({action:"toggleStructure",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(s.setStyle("display","none"),$(e).removeClass("foldable--open"),$(e).setAttribute("title",Contao.lang.expand),new Request.Contao({field:e}).post({action:"toggleStructure",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!1):(new Request.Contao({field:e,evalScripts:!0,onRequest:function(){AjaxRequest.displayBox(Contao.lang.loading+" …")},onSuccess:function(s){var r=new Element("li",{id:t,class:"parent",styles:{display:"inline"}});if(new Element("ul",{class:"level_"+n,html:s}).inject(r,"bottom"),5==i)r.inject($(e).getParent("li"),"after");else{for(var o,a=!1,l=$(e).getParent("li");"element"==typeOf(l)&&(o=l.getNext("li"));)if((l=o).hasClass("tl_folder")){a=!0;break}a?r.inject(l,"before"):r.inject(l,"after")}r.getElements("a").each((function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)})),$(e).addClass("foldable--open"),$(e).setAttribute("title",Contao.lang.collapse),window.fireEvent("structure"),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"loadStructure",id:t,level:n,state:1,REQUEST_TOKEN:Contao.request_token}),!1)},toggleFileManager:function(e,t,n,i){window.console&&console.warn("AjaxRequest.toggleFileManager() is deprecated. Please use the stimulus controller instead."),e.blur();var s=$(t);return s?("none"==s.getStyle("display")?(s.setStyle("display",null),$(e).addClass("foldable--open"),$(e).setAttribute("title",Contao.lang.collapse),new Request.Contao({field:e}).post({action:"toggleFileManager",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(s.setStyle("display","none"),$(e).removeClass("foldable--open"),$(e).setAttribute("title",Contao.lang.expand),new Request.Contao({field:e}).post({action:"toggleFileManager",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!1):(new Request.Contao({field:e,evalScripts:!0,onRequest:function(){AjaxRequest.displayBox(Contao.lang.loading+" …")},onSuccess:function(n){var s=new Element("li",{id:t,class:"parent",styles:{display:"inline"}});new Element("ul",{class:"level_"+i,html:n}).inject(s,"bottom"),s.inject($(e).getParent("li"),"after"),s.getElements("a").each((function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)})),$(e).addClass("foldable--open"),$(e).setAttribute("title",Contao.lang.collapse),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"loadFileManager",id:t,level:i,folder:n,state:1,REQUEST_TOKEN:Contao.request_token}),!1)},toggleSubpalette:function(e,t,n){e.blur();var i=$(t);function s(t){var n=e.form.elements.VERSION_NUMBER||[];n.forEach||(n=[n]),n.forEach((function(e){e.value=/<input\s+[^>]*?name="VERSION_NUMBER"\s+[^>]*?value="([^"]*)"/i.exec(t)[1]}))}i?e.value?(e.value="",e.checked="",i.setStyle("display","none"),i.getElements("[required]").each((function(e){e.set("required",null).set("data-required","")})),new Request.Contao({field:e,onSuccess:s}).post({action:"toggleSubpalette",id:t,field:n,state:0,REQUEST_TOKEN:Contao.request_token})):(e.value=1,e.checked="checked",i.setStyle("display",null),i.getElements("[data-required]").each((function(e){e.set("required","").set("data-required",null)})),new Request.Contao({field:e,onSuccess:s}).post({action:"toggleSubpalette",id:t,field:n,state:1,REQUEST_TOKEN:Contao.request_token})):new Request.Contao({field:e,evalScripts:!1,onRequest:function(){AjaxRequest.displayBox(Contao.lang.loading+" …")},onSuccess:function(n,i){var r=new Element("div",{id:t,class:"subpal cf",html:n,styles:{display:"block"}}).inject($(e).getParent("div").getParent("div"),"after");i.javascript&&(document.write=function(e){var t="";e.replace(/<script src="([^"]+)"/i,(function(e,n){t=n})),t&&Asset.javascript(t,{onLoad:function(){Browser.exec(i.javascript)}})},Browser.exec(i.javascript)),e.value=1,e.checked="checked",r.getElements("a").each((function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)})),s(n),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"toggleSubpalette",id:t,field:n,load:1,state:1,REQUEST_TOKEN:Contao.request_token})},toggleField:function(e,t){e.blur();var n,i,s=null,r=$(e).getElements("img"),o=1==r[0].get("data-state"),a=e.getParent("div");return t&&(a.hasClass("tl_right")?s=a.getPrevious("div").getElements("img"):a.hasClass("tl_listing_container")?(null===(s=e.getParent("td").getPrevious("td").getFirst("div.list_icon"))&&(s=e.getParent("td").getPrevious("td").getElement("div.cte_type")),null===s&&(s=e.getParent("tr").getFirst("td").getElement("div.list_icon_new"))):(n=a.getNext("div"))&&(n.hasClass("cte_type")&&(s=n),null===s&&(s=n.getFirst("div.list_icon"))),null!==s&&(s instanceof HTMLElement||!s.forEach?s.hasClass("cte_type")?o?(s.addClass("unpublished"),s.removeClass("published")):(s.addClass("published"),s.removeClass("unpublished")):s.setStyle("background-image","url("+(o?s.get("data-icon-disabled"):s.get("data-icon"))+")"):s.forEach((e=>{if("img"==e.nodeName.toLowerCase()){e.getParent("ul.tl_listing").hasClass("tl_tree_xtnd")||(i=e.getParent("a"))&&-1==i.href.indexOf("contao/preview")&&(e=(n=i.getNext("a"))?n.getElement("img"):new Element("img"));const t=o?e.get("data-icon-disabled"):e.get("data-icon");e.src=e.src.includes("/")&&!t.includes("/")?e.src.slice(0,e.src.lastIndexOf("/")+1)+t:t}})))),r.forEach((function(e){const t=o?e.get("data-icon-disabled"):e.get("data-icon");e.src=e.src.includes("/")&&!t.includes("/")?e.src.slice(0,e.src.lastIndexOf("/")+1)+t:t,e.set("data-state",o?0:1)})),!o&&$(e).get("data-title")?e.title=$(e).get("data-title"):o&&$(e).get("data-title-disabled")&&(e.title=$(e).get("data-title-disabled")),new Request.Contao({url:e.href,followRedirects:!1}).get(),!1},toggleCheckboxGroup:function(e,t){e.blur();var n=$(t);return!!n&&("none"==n.getStyle("display")?(n.setStyle("display",null),$(e).addClass("foldable--open"),(new Request.Contao).post({action:"toggleCheckboxGroup",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(n.setStyle("display","none"),$(e).removeClass("foldable--open"),(new Request.Contao).post({action:"toggleCheckboxGroup",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!0)},displayBox:function(e){var t=$("tl_ajaxBox"),n=$("tl_ajaxOverlay"),i=window.getScroll();null===n&&(n=new Element("div",{id:"tl_ajaxOverlay"}).inject($(document.body),"bottom")),n.set({styles:{display:"block",top:i.y+"px"}}),null===t&&(t=new Element("div",{id:"tl_ajaxBox"}).inject($(document.body),"bottom")),t.set({html:e,styles:{display:"block",top:i.y+100+"px"}})},hideBox:function(){var e=$("tl_ajaxBox"),t=$("tl_ajaxOverlay");t&&t.setStyle("display","none"),e&&e.setStyle("display","none")}},window.Backend={currentId:null,popupWindow:null,themePath:Contao.script_url+"system/themes/"+Contao.theme+"/",openModalWindow:function(e,t,n){new SimpleModal({width:e,hideFooter:!0,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.setStyle("overflow","hidden")},onHide:function(){document.body.setStyle("overflow","auto")}}).show({title:t,contents:n})},openModalImage:function(e){var t=e||{},n=(window.getSize().x-20).toInt();(!t.width||t.width>n)&&(t.width=Math.min(n,900)),new SimpleModal({width:t.width,hideFooter:!0,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.setStyle("overflow","hidden")},onHide:function(){document.body.setStyle("overflow","auto")}}).show({title:t.title,contents:'<img src="'+t.url+'" alt="">'})},openModalIframe:function(e){var t=e||{},n=(window.getSize().x-20).toInt(),i=(window.getSize().y-137).toInt();(!t.width||t.width>n)&&(t.width=Math.min(n,900)),(!t.height||t.height>i)&&(t.height=i),new SimpleModal({width:t.width,hideFooter:!0,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.setStyle("overflow","hidden")},onHide:function(){document.body.setStyle("overflow","auto")}}).show({title:t.title,contents:'<iframe src="'+t.url+'" width="100%" height="'+t.height+'" frameborder="0"></iframe>',model:"modal"})},openModalSelector:function(e){var t=e||{},n=(window.getSize().x-20).toInt(),i=(window.getSize().y-192).toInt();t.id||(t.id="tl_select"),(!t.width||t.width>n)&&(t.width=Math.min(n,900)),(!t.height||t.height>i)&&(t.height=i);var s=new SimpleModal({width:t.width,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.setStyle("overflow","hidden")},onHide:function(){document.body.setStyle("overflow","auto")}});s.addButton(Contao.lang.cancel,"btn",(function(){this.buttons[0].hasClass("btn-disabled")||this.hide()})),s.addButton(Contao.lang.apply,"btn primary",(function(){if(!this.buttons[1].hasClass("btn-disabled")){var e,n,i,s,r,o=window.frames["simple-modal-iframe"],a=[];if(void 0!==o){for((s=(e=o.document.getElementById(t.id)).get("data-picker-value"))&&(a=JSON.parse(s)),n=e.getElementsByTagName("input"),i=0;i<n.length;i++)n[i].id.match(/^(check_all_|reset_)/)||(r=a.indexOf(n[i].get("value")),n[i].checked?-1==r&&a.push(n[i].get("value")):-1!=r&&a.splice(r,1));t.callback(e.get("data-table"),a),this.hide()}else alert("Could not find the SimpleModal frame")}})),s.show({title:t.title,contents:'<iframe src="'+t.url+'" name="simple-modal-iframe" width="100%" height="'+t.height+'" frameborder="0"></iframe>',model:"modal"})},openModalBrowser:function(e,t,n,i,s){Backend.openModalSelector({id:"tl_listing",title:i.document.getElement("div.mce-title").get("text"),url:Contao.routes.backend_picker+"?context="+("file"==n?"link":"file")+"&amp;extras[fieldType]=radio&amp;extras[filesOnly]=true&amp;extras[source]="+s+"&amp;value="+t+"&amp;popup=1",callback:function(t,n){i.document.getElementById(e).value=n.join(",")}})},autoSubmit:function(e){window.dispatchEvent(new Event("store-scroll-offset"));var t=new Element("input",{type:"hidden",name:"SUBMIT_TYPE",value:"auto"}),n=$(e)||e;t.inject(n,"bottom"),n.submit()},vScrollTo:function(e){window.addEvent("load",(function(){window.scrollTo(null,parseInt(e))}))},toggleCheckboxes:function(e,t){for(var n=$$("input"),i=$(e).checked?"checked":"",s=0;s<n.length;s++)"checkbox"==n[s].type.toLowerCase()&&(void 0!==t&&t!=n[s].id.substr(0,t.length)||(n[s].checked=i))},toggleCheckboxGroup:function(e,t){var n=$(e).className,i=$(e).checked?"checked":"";"tl_checkbox"==n?($(t)?$$("#"+t+" .tl_checkbox"):$(e).getParent("fieldset").getElements(".tl_checkbox")).each((function(e){e.checked=i})):"tl_tree_checkbox"==n&&$$("#"+t+" .parent .tl_tree_checkbox").each((function(e){e.checked=i}));window.dispatchEvent(new Event("store-scroll-offset"))},toggleCheckboxElements:function(e,t){var n=$(e).checked?"checked":"";$$("."+t).each((function(e){e.hasClass("tl_checkbox")&&(e.checked=n)})),window.dispatchEvent(new Event("store-scroll-offset"))},makeParentViewSortable:function(e){var t=new Scroller(document.getElement("body"),{onChange:function(e,t){this.element.scrollTo(this.element.getScroll().x,t)}}),n=new Sortables(e,{constrain:!0,opacity:.6,onStart:function(){t.start()},onComplete:function(){t.stop()},onSort:function(e){var t,n,i=e.getParent("ul"),s=0;if(i&&(t=i.getChildren("li > div:first-child")))for(n=0;n<t.length;n++)t[n].hasClass("wrapper_stop")&&s>0&&s--,t[n].className=t[n].className.replace(/(^|\s)indent[^\s]*/g,""),s>0&&t[n].addClass("indent").addClass("indent_"+s),t[n].hasClass("wrapper_start")&&s++,t[n].removeClass("indent_first"),t[n].removeClass("indent_last"),t[n-1]&&t[n-1].hasClass("wrapper_start")&&t[n].addClass("indent_first"),t[n+1]&&t[n+1].hasClass("wrapper_stop")&&t[n].addClass("indent_last")},handle:".drag-handle"});n.active=!1,n.addEvent("start",(function(){n.active=!0})),n.addEvent("complete",(function(e){var t,i,s,r;n.active&&(e.getPrevious("li")?(t=e.get("id").replace(/li_/,""),i=e.getPrevious("li").get("id").replace(/li_/,""),s=window.location.search.replace(/id=[0-9]*/,"id="+t)+"&act=cut&mode=1&pid="+i,r=window.location.href.replace(/\?.*$/,""),new Request.Contao({url:r+s,followRedirects:!1}).get()):e.getParent("ul")&&(t=e.get("id").replace(/li_/,""),i=e.getParent("ul").get("id").replace(/ul_/,""),s=window.location.search.replace(/id=[0-9]*/,"id="+t)+"&act=cut&mode=2&pid="+i,r=window.location.href.replace(/\?.*$/,""),new Request.Contao({url:r+s,followRedirects:!1}).get()))}))},makeMultiSrcSortable:function(e,t,n){var i=new Sortables($(e),{constrain:!0,opacity:.6}).addEvent("complete",(function(){var i,s=[],r=$(e).getChildren("[data-id]");for(i=0;i<r.length;i++)s.push(r[i].get("data-id"));t===n&&$(n).value.split(",").forEach((function(e){-1===s.indexOf(e)&&s.push(e)})),$(t).value=s.join(",")}));$(e).getElements(".gimage").each((function(e){e.hasClass("removable")?new Element("button",{type:"button",html:"&times;",class:"tl_red"}).addEvent("click",(function(){var i=e.getParent("li"),s=i.get("data-id");$(n).value=$(n).value.split(",").filter((function(e){return e!=s})).join(","),$(t).value=$(t).value.split(",").filter((function(e){return e!=s})).join(","),i.dispose()})).inject(e,"after"):new Element("button",{type:"button",html:"&times",disabled:!0}).inject(e,"after")})),i.fireEvent("complete")},enableFileTreeDragAndDrop:function(e,t){var n=new Scroller(document.getElement("body"),{onChange:function(e,t){this.element.scrollTo(this.element.getScroll().x,t)}});function i(e){return e&&e.hasClass("parent")&&e.getPrevious(".tl_folder")?e.getPrevious(".tl_folder"):e}e.addEvent("mousedown",(function(s){var r=s.target.hasClass("drag-handle")?s.target:s.target.getParent(".drag-handle"),o=s.target.getParent(".tl_file,.tl_folder");if(r&&o&&!s.rightClick){n.start(),e.addClass("tl_listing_dragging");var a,l,c,d=o.getElements(".tl_left")[0]||o,u=d.clone(!0).inject(e).addClass("tl_left_dragging");u.setPosition({x:s.page.x-d.getOffsetParent().getPosition().x-u.getSize().x,y:d.getPosition(d.getOffsetParent()).y}).setStyle("display","none");var h=new Drag.Move(u,{droppables:$$([e]).append(e.getElements(".tl_folder,li.parent,.tl_folder_top")),unDraggableTags:[],modifiers:{x:"left",y:"top"},onStart:function(){u.setStyle("display","")},onEnter:function(t,n){(n=i(n)).addClass("tl_folder_dropping"),n.hasClass("tl_folder")&&a!==n&&(a=n,l=(new Date).getTime(),(c=n.getElement("a.foldable"))&&!c.hasClass("foldable--open")&&setTimeout((function(){if(a===n&&l+900<(new Date).getTime()){var t=document.createEvent("HTMLEvents");t.initEvent("click",!0,!0),c.dispatchEvent(t),a=void 0,l=void 0,window.addEvent("ajax_change",(function t(){h&&h.droppables&&e&&e.getElements&&(h.droppables=$$([e]).append(e.getElements(".tl_folder,li.parent"))),window.removeEvent("ajax_change",t)}))}}),1e3))},onCancel:function(){a=void 0,l=void 0,n.stop(),u.destroy(),window.removeEvent("keyup",g),e.getElements(".tl_folder_dropping").removeClass("tl_folder_dropping"),e.removeClass("tl_listing_dragging")},onDrop:function(s,r){if(a=void 0,l=void 0,n.stop(),u.destroy(),window.removeEvent("keyup",g),e.getElements(".tl_folder_dropping").removeClass("tl_folder_dropping"),e.removeClass("tl_listing_dragging"),r=i(r)){var c=o.get("data-id"),d=r.get("data-id")||decodeURIComponent(t.url.split(/[?&]pid=/)[1].split("&")[0]);c&&d&&(0===(d+"/").indexOf(c+"/")||d+"/"===c.replace(/[^/]+$/,""))||(window.dispatchEvent(new Event("store-scroll-offset")),document.location.href=t.url+"&id="+encodeURIComponent(c)+"&pid="+encodeURIComponent(d))}},onLeave:function(e,t){(t=i(t)).removeClass("tl_folder_dropping"),a=void 0,l=void 0}});h.start(s),window.addEvent("keyup",g)}function g(e){"esc"===e.key&&h&&h.stop&&(h.droppables=$$([]),h.stop())}}))},listWizard:function(e){var t=$(e),n=function(e){var i,s,r,o;e.getElements("button").each((function(a){if(!a.hasEvent("click"))switch(a.getProperty("data-command")){case"copy":a.addEvent("click",(function(){window.dispatchEvent(new Event("store-scroll-offset")),i=e.clone(!0).inject(e,"before"),(s=e.getFirst("input"))&&(i.getFirst("input").value=s.value),n(i),s.select()}));break;case"delete":a.addEvent("click",(function(){window.dispatchEvent(new Event("store-scroll-offset")),t.getChildren().length>1&&e.destroy()}));break;case null:a.addEvent("keydown",(function(n){38==n.event.keyCode?(n.preventDefault(),(r=e.getPrevious("li"))?e.inject(r,"before"):e.inject(t,"bottom"),a.focus()):40==n.event.keyCode&&(n.preventDefault(),(o=e.getNext("li"))?e.inject(o,"after"):e.inject(t.getFirst("li"),"before"),a.focus())}))}}))};!function(e){new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle"})}(t),t.getChildren().each((function(e){n(e)}))},tableWizard:function(e){var t=$(e),n=t.getElement("thead"),i=t.getElement("tbody"),s=function(e){var t,n,i,r,o=e.getChildren();for(i=0;i<o.length;i++)for(n=o[i].getChildren(),r=0;r<n.length;r++)(t=n[r].getFirst("textarea"))&&(t.name=t.name.replace(/\[[0-9]+][[0-9]+]/g,"["+i+"]["+r+"]"));new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){s(e)}})},r=function(e){var t,a,l,c,d,u,h,g=n.getFirst("tr");e.getElements("button").each((function(n){if(!n.hasEvent("click"))switch(n.getProperty("data-command")){case"rcopy":n.addEvent("click",(function(){for(window.dispatchEvent(new Event("store-scroll-offset")),c=new Element("tr"),d=e.getChildren(),h=0;h<d.length;h++)l=d[h].clone(!0).inject(c,"bottom"),(t=d[h].getFirst("textarea"))&&(l.getFirst("textarea").value=t.value);c.inject(e,"after"),r(c),s(i),c.getFirst("td").getFirst("textarea").select()}));break;case"rdelete":n.addEvent("click",(function(){window.dispatchEvent(new Event("store-scroll-offset")),i.getChildren().length>1&&e.destroy(),s(i)}));break;case"ccopy":n.addEvent("click",(function(){for(window.dispatchEvent(new Event("store-scroll-offset")),u=o(n),d=i.getChildren(),h=0;h<d.length;h++)a=d[h].getChildren()[u],l=a.clone(!0).inject(a,"after"),(t=a.getFirst("textarea"))&&(l.getFirst("textarea").value=t.value),r(l);var e=g.getFirst("td");l=e.clone(!0).inject(g.getLast("td"),"before"),r(l),s(i),d[0].getChildren()[u+1].getFirst("textarea").select()}));break;case"cmovel":n.addEvent("click",(function(){if(window.dispatchEvent(new Event("store-scroll-offset")),u=o(n),d=i.getChildren(),u>0)for(h=0;h<d.length;h++)(a=d[h].getChildren()[u]).inject(a.getPrevious(),"before");else for(h=0;h<d.length;h++)(a=d[h].getChildren()[u]).inject(d[h].getLast(),"before");s(i)}));break;case"cmover":n.addEvent("click",(function(){if(window.dispatchEvent(new Event("store-scroll-offset")),u=o(n),d=i.getChildren(),u<e.getChildren().length-2)for(h=0;h<d.length;h++)(a=d[h].getChildren()[u]).inject(a.getNext(),"after");else for(h=0;h<d.length;h++)(a=d[h].getChildren()[u]).inject(d[h].getFirst(),"before");s(i)}));break;case"cdelete":n.addEvent("click",(function(){if(window.dispatchEvent(new Event("store-scroll-offset")),u=o(n),d=i.getChildren(),e.getChildren().length>2){for(h=0;h<d.length;h++)d[h].getChildren()[u].destroy();g.getFirst("td").destroy()}s(i)}));break;case null:n.addEvent("keydown",(function(t){38==t.event.keyCode?(t.preventDefault(),(c=e.getPrevious("tr"))?e.inject(c,"before"):e.inject(i,"bottom"),n.focus(),s(i)):40==t.event.keyCode&&(t.preventDefault(),(c=e.getNext("tr"))?e.inject(c,"after"):e.inject(i,"top"),n.focus(),s(i))}))}}))},o=function(e){var t,n=$(e).getParent("td"),i=n.getParent("tr").getChildren(),s=0;for(t=0;t<i.length&&i[t]!=n;t++)s++;return s};s(i),n.getChildren().each((function(e){r(e)})),i.getChildren().each((function(e){r(e)})),Backend.tableWizardResize()},tableWizardResize:function(e){var t=window.localStorage.getItem("contao_table_wizard_cell_size");if(void 0!==e)t="",$$(".tl_tablewizard textarea").each((function(n){n.setStyle("width",(n.getStyle("width").toInt()*e).round().limit(142,284)),n.setStyle("height",(n.getStyle("height").toInt()*e).round().limit(66,132)),""==t&&(t=n.getStyle("width")+"|"+n.getStyle("height"))})),window.localStorage.setItem("contao_table_wizard_cell_size",t);else if(null!==t){var n=t.split("|");$$(".tl_tablewizard textarea").each((function(e){e.setStyle("width",n[0]),e.setStyle("height",n[1])}))}},tableWizardSetWidth:function(){var e=$("tl_tablewizard");e&&e.setStyle("width",Math.round(.96*e.getParent(".tl_formbody_edit").getComputedSize().width))},optionsWizard:function(e){var t=$(e).getElement("tbody"),n=function(e){var t,i,s,r,o=e.getChildren();for(i=0;i<o.length;i++)for(t=o[i].getChildren(),s=0;s<t.length;s++)(r=t[s].getFirst("input"))&&(r.name=r.name.replace(/\[[0-9]+]/g,"["+i+"]"),"checkbox"==r.type&&(r.id=r.name.replace(/\[[0-9]+]/g,"").replace(/\[/g,"_").replace(/]/g,"")+"_"+i,r.getNext("label").set("for",r.id)));new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){n(e)}})},i=function(e){var s,r,o,a,l;e.getElements("button").each((function(c){if(!c.hasEvent("click"))switch(c.getProperty("data-command")){case"copy":c.addEvent("click",(function(){for(window.dispatchEvent(new Event("store-scroll-offset")),o=new Element("tr"),a=e.getChildren(),l=0;l<a.length;l++)r=a[l].clone(!0).inject(o,"bottom"),(s=a[l].getFirst("input"))&&(r.getFirst("input").value=s.value,"checkbox"==s.type&&(r.getFirst("input").checked=s.checked?"checked":""));o.inject(e,"after"),i(o),n(t),o.getFirst("td").getFirst("input").select()}));break;case"delete":c.addEvent("click",(function(){window.dispatchEvent(new Event("store-scroll-offset")),t.getChildren().length>1&&e.destroy(),n(t)}));break;case null:c.addEvent("keydown",(function(i){38==i.event.keyCode?(i.preventDefault(),(o=e.getPrevious("tr"))?e.inject(o,"before"):e.inject(t,"bottom"),c.focus(),n(t)):40==i.event.keyCode&&(i.preventDefault(),(o=e.getNext("tr"))?e.inject(o,"after"):e.inject(t,"top"),c.focus(),n(t))}))}}))};n(t),t.getChildren().each((function(e){i(e)}))},keyValueWizard:function(e){var t=$(e).getElement("tbody"),n=function(e){var t,i,s,r,o=e.getChildren();for(i=0;i<o.length;i++)for(t=o[i].getChildren(),s=0;s<t.length;s++)(r=t[s].getFirst("input"))&&(r.name=r.name.replace(/\[[0-9]+]/g,"["+i+"]"));new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){n(e)}})},i=function(e){var s,r,o,a,l;e.getElements("button").each((function(c){if(!c.hasEvent("click"))switch(c.getProperty("data-command")){case"copy":c.addEvent("click",(function(){for(window.dispatchEvent(new Event("store-scroll-offset")),o=new Element("tr"),a=e.getChildren(),l=0;l<a.length;l++)r=a[l].clone(!0).inject(o,"bottom"),(s=a[l].getFirst("input"))&&(r.getFirst().value=s.value);o.inject(e,"after"),i(o),n(t),o.getFirst("td").getFirst("input").select()}));break;case"delete":c.addEvent("click",(function(){window.dispatchEvent(new Event("store-scroll-offset")),t.getChildren().length>1&&e.destroy(),n(t)}));break;case null:c.addEvent("keydown",(function(i){38==i.event.keyCode?(i.preventDefault(),(o=e.getPrevious("tr"))?e.inject(o,"before"):e.inject(t,"bottom"),c.focus(),n(t)):40==i.event.keyCode&&(i.preventDefault(),(o=e.getNext("tr"))?e.inject(o,"after"):e.inject(t,"top"),c.focus(),n(t))}))}}))};n(t),t.getChildren().each((function(e){i(e)}))},checkboxWizard:function(e){var t=$(e).getElement(".sortable");!function(e){new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle"})}(t),t.getChildren().each((function(e){!function(e){var n;e.getElements("button").each((function(i){i.hasEvent("click")||i.addEvent("keydown",(function(s){38==s.event.keyCode?(s.preventDefault(),(n=e.getPrevious("span"))?e.inject(n,"before"):e.inject(t,"bottom"),i.focus()):40==s.event.keyCode&&(s.preventDefault(),(n=e.getNext("span"))?e.inject(n,"after"):e.inject(t,"top"),i.focus())}))}))}(e)}))},enableImageSizeWidgets:function(){$$(".tl_image_size").each((function(e){var t=e.getElement("select"),n=e.getChildren("input")[0],i=e.getChildren("input")[1],s=function(){if(""===t.get("value")||0===t.get("value").indexOf("_")||t.get("value").toInt().toString()===t.get("value")){n.readOnly=!0,i.readOnly=!0;var e=$(t.getSelected()[0]).get("text");e=e.split("(").length>1?e.split("(").getLast().split(")")[0].split("x"):["",""],n.set("value","").set("placeholder",1*e[0]||""),i.set("value","").set("placeholder",1*e[1]||"")}else n.set("placeholder",""),i.set("placeholder",""),n.readOnly=!1,i.readOnly=!1};s(),t.addEvent("change",s),t.addEvent("keyup",s)}))},enableToggleSelect:function(){var e,t,n,i,s,r,o=$("tl_listing"),a=function(o){for(t=c.indexOf(o),n=c.indexOf(e),s=Math.min(t,n),r=Math.max(t,n),i=!!c[n].checked;s<=r;s++)c[s].checked=i},l=function(t){var n=this.getElement('input[type="checkbox"],input[type="radio"]'),i=$(t.target).getParent(".limit_toggler");n&&!n.get("disabled")&&null===i&&("radio"!=n.type?(t.shift&&e?a(n):(n.checked=n.checked?"":"checked","Backend.toggleCheckboxes(this)"==n.get("onclick")&&Backend.toggleCheckboxes(n)),e=n):n.checked||(n.checked="checked"))},c=[];o&&(c=o.getElements('input[type="checkbox"]')),$$(".toggle_select").each((function(e){var t=e.retrieve("boundEvent");t&&e.removeEvent("click",t),e.getElements('label,input[type="checkbox"],input[type="radio"]').each((function(e){e.addEvent("click",(function(e){e.stopPropagation()}))})),t=l.bind(e),e.addEvent("click",t),e.store("boundEvent",t)})),c.each((function(t){t.addEvent("click",(function(t){t.shift&&e&&a(this),e=this}))}))},editPreviewWizard:function(e){var t,n,i=(e=$(e)).getElement("img"),s={},r=!1,o=function(){return{x:i.getComputedSize().width,y:i.getComputedSize().height}},a=function(){var e=o(),n=i.getComputedSize();t.setStyles({top:n.computedTop+(s.y.get("value")*e.y).round()+"px",left:n.computedLeft+(s.x.get("value")*e.x).round()+"px",width:(s.width.get("value")*e.x).round()+"px",height:(s.height.get("value")*e.y).round()+"px"}),s.width.get("value").toFloat()&&s.height.get("value").toFloat()?t.setStyle("display",null):t.setStyle("display","none")},l=function(t){t.preventDefault(),r||(r=!0,n={x:t.page.x-e.getPosition().x-i.getComputedSize().computedLeft,y:t.page.y-e.getPosition().y-i.getComputedSize().computedTop},c(t))},c=function(a){if(r){a.preventDefault();var l=i.getComputedSize(),c={x:[Math.max(0,Math.min(l.width,n.x)),Math.max(0,Math.min(l.width,a.page.x-e.getPosition().x-l.computedLeft))],y:[Math.max(0,Math.min(l.height,n.y)),Math.max(0,Math.min(l.height,a.page.y-e.getPosition().y-l.computedTop))]};t.setStyles({top:Math.min(c.y[0],c.y[1])+l.computedTop+"px",left:Math.min(c.x[0],c.x[1])+l.computedLeft+"px",width:Math.abs(c.x[0]-c.x[1])+"px",height:Math.abs(c.y[0]-c.y[1])+"px"}),function(){var e=o(),n=t.getStyles("top","left","width","height"),r=i.getComputedSize(),a={x:Math.max(0,Math.min(1,(n.left.toFloat()-r.computedLeft)/e.x)),y:Math.max(0,Math.min(1,(n.top.toFloat()-r.computedTop)/e.y))};a.width=Math.min(1-a.x,n.width.toFloat()/e.x),a.height=Math.min(1-a.y,n.height.toFloat()/e.y),a.width&&a.height?t.setStyle("display",null):(a.x=a.y=a.width=a.height="",t.setStyle("display","none")),Object.each(a,(function(e,t){s[t].set("value",""===e?"":Number(e).toFixed(15))}))}()}},d=function(e){c(e),r=!1};window.addEvent("domready",(function(){e.getParent(".tl_tbox,.tl_box").getElements('input[name^="importantPart"]').each((function(e){["x","y","width","height"].each((function(t){e.get("name").substr(13,t.length)===t.capitalize()&&(s[t]=e=$(e))}))})),4===Object.getLength(s)&&(Object.each(s,(function(e){e.getParent().setStyle("display","none")})),e.addClass("tl_edit_preview_enabled"),t=new Element("div",{class:"tl_edit_preview_important_part"}).inject(e),a(),i.addEvent("load",a),e.addEvents({mousedown:l,touchstart:l}),$(document.documentElement).addEvents({mousemove:c,touchmove:c,mouseup:d,touchend:d,touchcancel:d,resize:a}))}))},enableFileTreeUpload:function(e,t){e=$(e);var n,i,s,r=t.url,o=new Element("div",{class:"dropzone dropzone-filetree",html:'<span class="dropzone-previews"></span>'}).inject(e,"top");t.previewsContainer=o.getElement(".dropzone-previews"),t.clickable=!1;var a=new Dropzone(e,t);a.on("queuecomplete",(function(){window.location.reload()})),a.on("dragover",(function(t){if(t.dataTransfer&&t.dataTransfer.types&&-1!==t.dataTransfer.types.indexOf("Files")){e.getElements(".tl_folder_dropping").removeClass("tl_folder_dropping");var o=t.target&&$(t.target);if(o){var l=o.match(".tl_folder")?o:o.getParent(".tl_folder");if(l||(l=(l=o.getParent(".parent"))&&l.getPrevious(".tl_folder")),l){var c=l.getElement('img[src$="/icons/new.svg"]');c=c&&c.getParent("a")}}c&&c.href?(a.options.url=""+c.href,l.addClass("tl_folder_dropping"),n!==l&&(n=l,i=(new Date).getTime(),(s=l.getElement("a.foldable"))&&!s.hasClass("foldable--open")&&setTimeout((function(){if(n===l&&i+900<(new Date).getTime()){var e=document.createEvent("HTMLEvents");e.initEvent("click",!0,!0),s.dispatchEvent(e),n=void 0,i=void 0}}),1e3))):(a.options.url=r,n=void 0,i=void 0)}})),a.on("drop",(function(e){e.dataTransfer&&e.dataTransfer.types&&-1!==e.dataTransfer.types.indexOf("Files")&&(o.addClass("dropzone-filetree-enabled"),window.dispatchEvent(new Event("store-scroll-offset")))})),a.on("dragleave",(function(){e.getElements(".tl_folder_dropping").removeClass("tl_folder_dropping"),n=void 0,i=void 0}))},crawl:function(){var e=$("tl_crawl"),t=e.getElement("div.progress-bar"),n=e.getElement("p.progress-count"),i=e.getElement("div.results"),s=e.getElement("p.debug-log");!function e(){let r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];new Request({url:window.location.href,headers:{"Only-Status-Update":r},onSuccess:function(r){var o=JSON.decode(r);!function(e){var r,o=e.total,a=o-e.pending,l=o>0?parseInt(a/o*100,10):100;if(a<1&&l<1&&(a=1,l=10,o=10),t.setStyle("width",l+"%"),t.set("html",l+"%"),t.setAttribute("aria-valuenow",l),n.set("html",a+" / "+o),e.hasDebugLog&&s.setStyle("display","block"),e.hasDebugLog&&s.setStyle("display","block"),e.finished)for(r in t.removeClass("running").addClass("finished"),i.removeClass("running").addClass("finished"),e.results)if(e.results.hasOwnProperty(r)){var c=i.getElement('.result[data-subscriber="'+r+'"] p.summary'),d=i.getElement('.result[data-subscriber="'+r+'"] p.warning'),u=i.getElement('.result[data-subscriber="'+r+'"] p.subscriber-log'),h=e.results[r],g=h.summary;h.warning&&d.set("html",h.warning),h.hasLog&&u.setStyle("display","block"),c.addClass(h.wasSuccessful?"success":"failure"),c.set("html",g)}}(o),o.finished||setTimeout(e,2e3)}}).send()}(!0)}},window.Theme={isWebkit:Browser.chrome||Browser.safari||navigator.userAgent.match(/(?:webkit|khtml)/i),stopClickPropagation:function(){$$(".picker_selector").each((function(e){e.getElements("a").each((function(e){e.addEvent("click",(function(e){e.stopPropagation()}))}))})),$$(".picker_selector,.click2edit").each((function(e){e.getElements('input[type="checkbox"]').each((function(e){e.addEvent("click",(function(e){e.stopPropagation()}))}))}))},setupCtrlClick:function(){$$(".click2edit").each((function(e){e.getElements("a").each((function(e){e.addEvent("click",(function(e){e.stopPropagation()}))})),Browser.Features.Touch?e.addEvent("click",(function(){e.getAttribute("data-visited")?(e.getElements("a").each((function(e){e.hasClass("edit")&&(document.location.href=e.href)})),e.removeAttribute("data-visited")):e.setAttribute("data-visited","1")})):e.addEvent("click",(function(t){(Browser.Platform.mac?t.event.metaKey:t.event.ctrlKey)&&(t.event.shiftKey?e.getElements("a").each((function(e){e.hasClass("children")&&(document.location.href=e.href)})):e.getElements("a").each((function(e){e.hasClass("edit")&&(document.location.href=e.href)})))}))}))},setupTextareaResizing:function(){$$(".tl_textarea").each((function(e){if(!(Browser.ie6||Browser.ie7||Browser.ie8||e.hasClass("noresize")||e.retrieve("autogrow"))){var t=new Element("div",{html:"X",styles:{position:"absolute",top:0,left:"-999em","overflow-x":"hidden"}}).setStyles(e.getStyles("font-size","font-family","width","line-height")).inject(document.body);"border-box"!=e.getStyle("-moz-box-sizing")&&"border-box"!=e.getStyle("-webkit-box-sizing")&&"border-box"!=e.getStyle("box-sizing")||t.setStyles({padding:e.getStyle("padding"),border:e.getStyle("border-left")});var n=Math.max(t.clientHeight,30);e.addEvent("input",(function(){t.set("html",this.get("value").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n|\r\n/g,"<br>X"));var e=Math.max(n,t.getSize().y);this.clientHeight!=e&&this.tween("height",e)})).set("tween",{duration:100}).setStyle("height",n+"px"),e.fireEvent("input"),e.store("autogrow",!0)}}))},setupMenuToggle:function(){var e=$("burger");if(e&&(e.addEvent("click",(function(){document.body.toggleClass("show-navigation"),e.setAttribute("aria-expanded",document.body.hasClass("show-navigation")?"true":"false")})).addEvent("keydown",(function(e){27==e.event.keyCode&&document.body.removeClass("show-navigation")})),window.matchMedia)){var t=window.matchMedia("(max-width:991px)"),n=function(){t.matches?(e.setAttribute("aria-controls","left"),e.setAttribute("aria-expanded",document.body.hasClass("show-navigation")?"true":"false")):(e.removeAttribute("aria-controls"),e.removeAttribute("aria-expanded"))};t.addEventListener("change",n),n()}},setupProfileToggle:function(){var e=$("tmenu");if(e){var t=e.getElement(".submenu"),n=t.getFirst("span").getFirst("button"),i=t.getFirst("ul");t&&n&&i&&(n.setAttribute("aria-controls","tmenu__profile"),n.setAttribute("aria-expanded","false"),i.id="tmenu__profile",n.addEvent("click",(function(e){t.hasClass("active")?(t.removeClass("active"),n.setAttribute("aria-expanded","false")):(t.addClass("active"),n.setAttribute("aria-expanded","true")),e.stopPropagation()})),$(document.body).addEvent("click",(function(){t.hasClass("active")&&t.removeClass("active")})))}},setupSplitButtonToggle:function(){var e=$("sbtog");if(e){var t,n,i=e.getParent(".split-button").getElement("ul");e.addEvent("click",(function(n){t=!1,i.toggleClass("invisible"),e.toggleClass("active"),n.stopPropagation()})),$(document.body).addEvent("click",(function(){t=!1,i.addClass("invisible"),e.removeClass("active")})),$(document.body).addEvent("keydown",(function(e){t=9==e.event.keyCode})),[e].append(i.getElements("button")).each((function(s){s.addEvent("focus",(function(){t&&(i.removeClass("invisible"),e.addClass("active"),clearTimeout(n))})),s.addEvent("blur",(function(){t&&(n=setTimeout((function(){i.addClass("invisible"),e.removeClass("active")}),100))}))})),e.set("tabindex","-1")}}},window.addEvent("domready",(function(){$(document.body).addClass("js"),Browser.Features.Touch&&$(document.body).addClass("touch"),Backend.tableWizardSetWidth(),Backend.enableImageSizeWidgets(),Backend.enableToggleSelect(),null!=Elements.chosen&&$$("select.tl_chosen").chosen(),Theme.stopClickPropagation(),Theme.setupCtrlClick(),Theme.setupTextareaResizing(),Theme.setupMenuToggle(),Theme.setupProfileToggle(),Theme.setupSplitButtonToggle()})),window.addEvent("resize",(function(){Backend.tableWizardSetWidth()})),window.addEvent("ajax_change",(function(){Backend.enableImageSizeWidgets(),Backend.enableToggleSelect(),null!=Elements.chosen&&$$("select.tl_chosen").filter((function(e){return"none"!=e.getStyle("display")})).chosen(),Theme.stopClickPropagation(),Theme.setupCtrlClick(),Theme.setupTextareaResizing()}))},597:function(){window.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll("div.limit_height").forEach((function(e){window.console&&console.warn('Using "limit_height" class on child_record_callback is deprecated. Set a list.sorting.limitHeight in your DCA instead.');const t=e.parentNode.closest(".tl_content");if(t&&(t.classList.contains("wrapper_start")||t.classList.contains("wrapper_stop")))return;const n=Number(e.className.replace(/[^0-9]*/,""));if(!n)return;const i=window.getComputedStyle(e,null),s=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom);if(e.clientHeight-s<=n)return;e.style.height=n+"px";const r=document.createElement("button");r.setAttribute("type","button"),r.title=Contao.lang.expand,r.innerHTML="<span>...</span>",r.classList.add("unselectable"),r.addEventListener("click",(function(){"auto"==e.style.height?(e.style.height=n+"px",r.title=Contao.lang.expand):(e.style.height="auto",r.title=Contao.lang.collapse)}));const o=document.createElement("div");o.classList.add("limit_toggler"),o.append(r),e.append(o)}))}))},499:function(){!function(){"use strict";const e=new WeakMap,t=new Event("store-scroll-offset"),n=n=>{if(e.has(n))return;if(9!==n.querySelectorAll("select, button, a.module_link, img.module_image").length)return;e.set(n,!0);const i=n.closest("tbody"),s=e=>{Array.from(e.children).forEach(((e,t)=>{e.querySelectorAll("input, select").forEach((e=>{e.name=e.name.replace(/\[[0-9]+]/g,"["+t+"]")}))})),new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){s(e)}})},r=n=>{n.querySelectorAll("button").forEach((o=>{switch(o.dataset.command){case"copy":o.addEventListener("click",(()=>{window.dispatchEvent(t);const o=n.cloneNode(!0),a=n.querySelectorAll("select"),l=o.querySelectorAll("select");for(let e=0;e<a.length;e++)l[e].value=a[e].value;o.querySelectorAll("[data-original-title]").forEach((e=>{e.setAttribute("title",e.getAttribute("data-original-title")),e.removeAttribute("data-original-title")})),e.set(o,!0),n.parentNode.insertBefore(o,n.nextSibling);const c=o.querySelector("select.tl_select");c.removeAttribute("id"),o.querySelector(".chzn-container").remove(),new Chosen(c),r(o),s(i)}));break;case"delete":o.addEventListener("click",(()=>{window.dispatchEvent(t),i.children.length>1?n.remove():n.querySelectorAll("select").forEach((e=>{e.value=e.children[0].value})),s(i)}));break;case"enable":o.addEventListener("click",(function(){window.dispatchEvent(t);const e=o.previousElementSibling;e.checked?e.checked="":e.checked="checked"}));break;default:o.classList.contains("drag-handle")&&o.addEventListener("keydown",(e=>{"ArrowUp"===e.code||38===e.keyCode?(e.preventDefault(),n.previousElementSibling?n.previousElementSibling.insertAdjacentElement("beforebegin",n):i.insertAdjacentElement("beforeend",n),o.focus(),s(i)):"ArrowDown"!==e.code&&40!==e.keyCode||(e.preventDefault(),n.nextElementSibling?n.nextElementSibling.insertAdjacentElement("afterend",n):i.insertAdjacentElement("afterbegin",n),o.focus(),s(i))}))}}));const o=n.querySelector("td:first-child select");if(!o)return;const a=n.querySelector("a.module_link"),l=n.querySelectorAll("img.module_image"),c=()=>{a.href=a.href.replace(/id=[0-9]+/,"id="+o.value),o.value>0?(a.classList.remove("hidden"),l.forEach((e=>{e.classList.add("hidden")}))):(a.classList.add("hidden"),l.forEach((e=>{e.classList.remove("hidden")})))};o.addEventListener("change",c),o.addEvent("change",c)};s(i),r(n)};document.querySelectorAll(".tl_modulewizard tr").forEach(n),new MutationObserver((function(e){for(const t of e)"childList"===t.type&&t.addedNodes.forEach((function(e){e.matches&&e.matches(".tl_modulewizard tr, .tl_modulewizard tr *")&&n(e.closest("tr"))}))})).observe(document,{attributes:!1,childList:!0,subtree:!0})}()},326:function(){Request.Contao=new Class({Extends:Request.JSON,options:{followRedirects:!0,url:window.location.href},initialize:function(e){e&&!e.url&&e.field&&e.field.form&&e.field.form.action&&(this.options.url=e.field.form.action),this.parent(e)},success:function(e){var t,n=this.getHeader("X-Ajax-Location");if(n&&this.options.followRedirects)location.replace(n);else{try{t=this.response.json=JSON.decode(e,this.options.secure)}catch(n){t={content:e}}null===t?t={content:""}:"object"!=typeof t&&(t={content:e}),""!=t.content&&(t.content=t.content.stripScripts((function(e){t.javascript=e.replace(/<!--|\/\/-->|<!\[CDATA\[\/\/>|<!]]>/g,"")})),t.javascript&&this.options.evalScripts&&Browser.exec(t.javascript)),this.onSuccess(t.content,t)}},failure:function(){var e=this.getHeader("X-Ajax-Location");e&&401===this.status||e&&this.options.followRedirects&&this.status>=300&&this.status<400?location.replace(e):this.onFailure()}}),Class.refactor(Drag,{attach:function(){return this.handles.addEvent("touchstart",this.bound.start),this.previous.apply(this,arguments)},detach:function(){return this.handles.removeEvent("touchstart",this.bound.start),this.previous.apply(this,arguments)},start:function(){document.addEvents({touchmove:this.bound.check,touchend:this.bound.cancel}),this.previous.apply(this,arguments)},check:function(e){this.options.preventDefault&&e.preventDefault(),Math.round(Math.sqrt(Math.pow(e.page.x-this.mouse.start.x,2)+Math.pow(e.page.y-this.mouse.start.y,2)))>this.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop}),document.addEvents({touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent("start",[this.element,e]).fireEvent("snap",this.element))},cancel:function(){return document.removeEvents({touchmove:this.bound.check,touchend:this.bound.cancel}),this.previous.apply(this,arguments)},stop:function(){return document.removeEvents({touchmove:this.bound.drag,touchend:this.bound.stop}),this.previous.apply(this,arguments)}}),Class.refactor(Sortables,{initialize:function(e,t){return t.dragOptions=Object.merge(t.dragOptions||{},{preventDefault:t.dragOptions&&t.dragOptions.preventDefault||Browser.Features.Touch}),void 0===t.dragOptions.unDraggableTags&&(t.dragOptions.unDraggableTags=this.options.unDraggableTags.filter((function(e){return"button"!=e}))),this.previous.apply(this,arguments)},addItems:function(){return Array.flatten(arguments).each((function(e){this.elements.push(e);var t=e.retrieve("sortables:start",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle&&e.getElement(this.options.handle)||e).addEvents({mousedown:t,touchstart:t})}),this),this},removeItems:function(){return $$(Array.flatten(arguments).map((function(e){this.elements.erase(e);var t=e.retrieve("sortables:start");return(this.options.handle&&e.getElement(this.options.handle)||e).removeEvents({mousedown:t,touchend:t}),e}),this))},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if("function"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var n=this.previous.apply(this,arguments);return n.addEvent("touchstart",(function(e){t.fireEvent("touchstart",e)})),n}}),Class.refactor(Request.Queue,{onComplete:function(){this.fireEvent("complete",arguments)},onCancel:function(){this.options.autoAdvance&&!this.error&&this.resume(),this.fireEvent("cancel",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.resume(),this.fireEvent("success",arguments),this.queue.length||this.isRunning()||this.fireEvent("end")},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.resume(),this.fireEvent("failure",arguments),this.queue.length||this.isRunning()||this.fireEvent("end")},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.resume(),this.fireEvent("exception",arguments)}}),Contao.SerpPreview=new Class({options:{id:0,trail:null,titleField:null,titleFallbackField:null,aliasField:null,descriptionField:null,descriptionFallbackField:null,titleTag:null},shorten:function(e,t){return e.length<=t?e:e.substr(0,e.lastIndexOf(" ",t))+" …"},html2string:function(e){return(new DOMParser).parseFromString(e,"text/html").body.textContent.replace(/\[-]/g,"­").replace(/\[nbsp]/g," ")},getTinymce:function(){if(window.tinyMCE&&this.options.descriptionFallbackField)return window.tinyMCE.get(this.options.descriptionFallbackField)},initialize:function(){this.options=Object.merge.apply(null,[{},this.options].append(arguments));var e=$("serp_title_"+this.options.id),t=$("serp_url_"+this.options.id),n=$("serp_description_"+this.options.id),i=$(this.options.titleField),s=$(this.options.titleFallbackField),r=$(this.options.aliasField),o=$(this.options.descriptionField),a=$(this.options.descriptionFallbackField),l=-1===this.options.trail.indexOf("›"),c=this.options.titleTag||"%s";i&&i.addEvent("input",function(){i.value?e.set("text",this.shorten(this.html2string(c.replace(/%s/,i.value)).replace(/%%/g,"%"),64)):s&&s.value?e.set("text",this.shorten(this.html2string(c.replace(/%s/,s.value)).replace(/%%/g,"%"),64)):e.set("text","")}.bind(this)),s&&s.addEvent("input",function(){i&&i.value||e.set("text",this.shorten(this.html2string(c.replace(/%s/,s.value)).replace(/%%/g,"%"),64))}.bind(this)),r&&r.addEvent("input",function(){"index"==r.value&&l?t.set("text",this.options.trail):t.set("text",this.options.trail+" › "+(r.value||this.options.id).replace(/\//g," › "))}.bind(this)),o&&o.addEvent("input",function(){if(o.value)n.set("text",this.shorten(o.value,160));else{var e=this.getTinymce();e?n.set("text",this.shorten(this.html2string(e.getContent()),160)):a&&a.value?n.set("text",this.shorten(this.html2string(a.value),160)):n.set("text","")}}.bind(this)),a&&a.addEvent("input",function(){o&&o.value||n.set("text",this.shorten(this.html2string(a.value),160))}.bind(this)),setTimeout(function(){var e=this.getTinymce();e&&e.on("keyup",function(){o&&o.value||n.set("text",this.shorten(this.html2string(window.tinyMCE.activeEditor.getContent()),160))}.bind(this))}.bind(this),4)}})},252:function(){!function(){"use strict";const e=new WeakMap,t=new Event("store-scroll-offset"),n=n=>{if(e.has(n))return;if(7!==n.querySelectorAll("input, select, button").length)return;e.set(n,!0);const i=n.closest("tbody"),s=e=>{Array.from(e.children).forEach(((e,t)=>{e.querySelectorAll("input, select").forEach((e=>{e.name=e.name.replace(/\[[0-9]+]/g,"["+t+"]")}))})),new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){s(e)}})},r=e=>{e.querySelectorAll("button").forEach((n=>{switch(n.dataset.command){case"copy":n.addEventListener("click",(()=>{window.dispatchEvent(t);const n=e.cloneNode(!0),o=e.querySelectorAll("select"),a=n.querySelectorAll("select");for(let e=0;e<o.length;e++)a[e].value=o[e].value;e.parentNode.insertBefore(n,e.nextSibling),r(n),s(i)}));break;case"delete":n.addEventListener("click",(()=>{window.dispatchEvent(t),i.children.length>1?e.remove():(e.querySelectorAll("input").forEach((e=>{e.value=""})),e.querySelectorAll("select").forEach((e=>{e.value=e.children[0].value}))),s(i)}));break;default:n.classList.contains("drag-handle")&&n.addEventListener("keydown",(t=>{"ArrowUp"===t.code||38===t.keyCode?(t.preventDefault(),e.previousElementSibling?e.previousElementSibling.insertAdjacentElement("beforebegin",e):i.insertAdjacentElement("beforeend",e),n.focus(),s(i)):"ArrowDown"!==t.code&&40!==t.keyCode||(t.preventDefault(),e.nextElementSibling?e.nextElementSibling.insertAdjacentElement("afterend",e):i.insertAdjacentElement("afterbegin",e),n.focus(),s(i))}))}}))};s(i),r(n)};document.querySelectorAll(".tl_sectionwizard tr").forEach(n),new MutationObserver((function(e){for(const t of e)"childList"===t.type&&t.addedNodes.forEach((function(e){e.matches&&e.matches(".tl_sectionwizard tr, .tl_sectionwizard tr *")&&n(e.closest("tr"))}))})).observe(document,{attributes:!1,childList:!0,subtree:!0})}()},122:function(){!function(){const e=[],t=document.createElement("div");t.setAttribute("role","tooltip"),t.classList.add("tip"),t.style.position="absolute",t.style.display="none";const n=function(n,i,s,r){if(e.includes(n))return;let o,a;e.push(n),n.addEventListener("mouseenter",(function(){r?o=n.innerHTML:(o=n.getAttribute("title"),n.setAttribute("data-original-title",o),n.removeAttribute("title")),o&&(clearTimeout(a),t.style.willChange="display,contents",a=setTimeout((function(){const e=n.getBoundingClientRect(),r="rtl"===getComputedStyle(n).direction,a=document.html.clientWidth;r&&e.x<200||!r&&e.x<a-200?(t.style.left=`${window.scrollX+e.left+i}px`,t.style.right="auto",t.classList.remove("tip--rtl")):(t.style.left="auto",t.style.right=`${a-window.scrollX-e.right+i}px`,t.classList.add("tip--rtl")),t.innerHTML=`<div>${o}</div>`,t.style.top=`${window.scrollY+e.top+s}px`,t.style.display="block",t.style.willChange="auto",!t.parentNode&&document.body&&document.body.append(t)}),1e3))})),n.addEventListener("mouseleave",(function(){n.hasAttribute("data-original-title")&&(n.hasAttribute("title")||n.setAttribute("title",n.getAttribute("data-original-title")),n.removeAttribute("data-original-title")),clearTimeout(a),t.style.willChange="auto","block"===t.style.display&&(t.style.willChange="display",a=setTimeout((function(){t.style.display="none",t.style.willChange="auto"}),100))}));const l=n.closest("button, a");l&&l.addEventListener("click",(function(){clearTimeout(a),t.style.display="none",t.style.willChange="auto"}))};function i(e,t){return e.matches(t)?[e,...e.querySelectorAll(t)]:e.querySelectorAll(t)}function s(e){i(e,"p.tl_tip").forEach((function(e){n(e,0,23,!0)})),i(e,"#home").forEach((function(e){n(e,6,42)})),i(e,"#tmenu a[title]").forEach((function(e){n(e,0,42)})),i(e,'a[title][class^="group-"]').forEach((function(e){n(e,-6,27)})),i(e,"a[title].navigation").forEach((function(e){n(e,25,32)})),i(e,"img[title]").forEach((function(e){n(e,-9,e.classList.contains("gimage")?60:30)})),i(e,"a[title]").forEach((function(e){e.classList.contains("picker-wizard")?n(e,-4,30):n(e,-9,30)})),i(e,"button[title]").forEach((function(e){e.classList.contains("unselectable")?n(e,-4,20):n(e,-9,30)})),["input[title]","time[title]","span[title]"].forEach((function(t){i(e,t).forEach((function(e){n(e,-9,"time[title]"===t||"span[title]"===t?26:30)}))}))}s(document.documentElement),new MutationObserver((function(e){for(const t of e)"childList"===t.type&&t.addedNodes.forEach((function(e){e.matches&&e.querySelectorAll&&s(e)}))})).observe(document,{attributes:!1,childList:!0,subtree:!0})}()},483:function(e,t,n){var i={"./clipboard-controller.js":836,"./color-scheme-controller.js":316,"./image-size-controller.js":910,"./jump-targets-controller.js":547,"./limit-height-controller.js":5,"./metawizard-controller.js":17,"./scroll-offset-controller.js":470,"./toggle-fieldset-controller.js":554,"./toggle-navigation-controller.js":125,"./toggle-nodes-controller.js":634};function s(e){var t=r(e);return n(t)}function r(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}s.keys=function(){return Object.keys(i)},s.resolve=r,e.exports=s,s.id=483}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){"use strict";var e=n(448);function t(e,t){const n=e.default;if("function"==typeof n)return{identifier:t,controllerConstructor:n}}function i(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}n(326),n(944),n(597),n(499),n(252),n(122);const s=e.Mx.start();s.debug=!1;const r=n(483);s.load(r.keys().map((e=>{const n=i(e);if(n)return t(r(e),`contao--${n}`)})).filter((e=>e)))}()}();
//# sourceMappingURL=backend.1d61970f.js.map
        "/bundles/contaocore/backend.1d61970f.js"
  "backend.js": "/bundles/contaocore/backend.1d61970f.js",
  "backend.1d61970f.js.map": "/bundles/contaocore/backend.1d61970f.js.map"

Fixed code:
			'title': opt.title?.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/'/g, '&apos;'),
			'title': opt.title?.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/'/g, '&apos;'),
			'title': opt.title?.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/'/g, '&apos;'),
                el.removeAttribute('title');
                text = text?.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/'/g, '&apos;');
			$strFolderNameEncoded = StringUtil::convertEncoding(StringUtil::specialchars(basename($currentFolder), false, true), System::getContainer()->getParameter('kernel.charset'));
			$strFileNameEncoded = StringUtil::convertEncoding(StringUtil::specialchars(basename($currentFile), false, true), System::getContainer()->getParameter('kernel.charset'));
!function(){var e={667:function(e,t,n){"use strict";n.d(t,{Mx:function(){return Z},Qr:function(){return ce}});class i{constructor(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=function(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort(((e,t)=>{const n=e.index,i=t.index;return n<i?-1:n>i?1:0}))}}class s{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach((e=>e.connect())))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach((e=>e.disconnect())))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce(((e,t)=>e.concat(Array.from(t.values()))),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,n={}){this.application.handleError(e,`Error ${t}`,n)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:n,eventOptions:i}=e,s=this.fetchEventListenerMapForEventTarget(t),r=this.cacheKey(n,i);s.delete(r),0==s.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:n,eventOptions:i}=e;return this.fetchEventListener(t,n,i)}fetchEventListener(e,t,n){const i=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,n);let r=i.get(s);return r||(r=this.createEventListener(e,t,n),i.set(s,r)),r}createEventListener(e,t,n){const s=new i(e,t,n);return this.started&&s.connect(),s}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){const n=[e];return Object.keys(t).sort().forEach((e=>{n.push(`${t[e]?"":"!"}${e}`)})),n.join(":")}}const r={stop({event:e,value:t}){return t&&e.stopPropagation(),!0},prevent({event:e,value:t}){return t&&e.preventDefault(),!0},self({event:e,value:t,element:n}){return!t||n===e.target}},o=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function a(e){return"window"==e?window:"document"==e?document:void 0}function l(e){return e.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function c(e){return l(e.replace(/--/g,"-").replace(/__/g,"_"))}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}function u(e){return e.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function h(e){return null!=e}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const p=["meta","ctrl","alt","shift"];class f{constructor(e,t,n,i){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(e){const t=e.tagName.toLowerCase();if(t in m)return m[t](e)}(e)||v("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||v("missing identifier"),this.methodName=n.methodName||v("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=i}static forToken(e,t){return new this(e.element,e.index,function(e){const t=e.trim().match(o)||[];let n=t[2],i=t[3];return i&&!["keydown","keyup","keypress"].includes(n)&&(n+=`.${i}`,i=""),{eventTarget:a(t[4]),eventName:n,eventOptions:t[7]?(s=t[7],s.split(":").reduce(((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)})),{})):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||i};var s}(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;const n=t.filter((e=>!p.includes(e)))[0];return!!n&&(g(this.keyMappings,n)||v(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[n].toLowerCase()!==e.key.toLowerCase())}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:n,value:i}of Array.from(this.element.attributes)){const s=n.match(t),r=s&&s[1];r&&(e[l(r)]=b(i))}return e}get eventTargetName(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[n,i,s,r]=p.map((e=>t.includes(e)));return e.metaKey!==n||e.ctrlKey!==i||e.altKey!==s||e.shiftKey!==r}}const m={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function v(e){throw new Error(e)}function b(e){try{return JSON.parse(e)}catch(t){return e}}class y{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action,{actionDescriptorFilters:n}=this.context.application,{controller:i}=this.context;let s=!0;for(const[r,o]of Object.entries(this.eventOptions))if(r in n){const a=n[r];s=s&&a({name:r,value:o,event:e,element:t,controller:i})}return s}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:n}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:n,action:this.methodName})}catch(t){const{identifier:n,controller:i,element:s,index:r}=this,o={identifier:n,controller:i,element:s,index:r,event:e};this.context.handleError(t,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&(!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element))))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class w{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const n of this.matchElementsInTree(e))t.call(this,n)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}}class E{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new w(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function k(e,t,n){S(e,t).add(n)}function C(e,t,n){S(e,t).delete(n),function(e,t){const n=e.get(t);null!=n&&0==n.size&&e.delete(t)}(e,t)}function S(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}class x{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e.concat(Array.from(t))),[])}get size(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e+t.size),0)}add(e,t){k(this.valuesByKey,e,t)}delete(e,t){C(this.valuesByKey,e,t)}has(e,t){const n=this.valuesByKey.get(e);return null!=n&&n.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some((t=>t.has(e)))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter((([t,n])=>n.has(e))).map((([e,t])=>e))}}class A{constructor(e,t,n,i){this._selector=t,this.details=i,this.elementObserver=new w(e,this),this.delegate=n,this.matchesByElement=new x}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const n=e.matches(t);return this.delegate.selectorMatchElement?n&&this.delegate.selectorMatchElement(e,this.details):n}return!1}matchElementsInTree(e){const{selector:t}=this;if(t){const n=this.matchElement(e)?[e]:[],i=Array.from(e.querySelectorAll(t)).filter((e=>this.matchElement(e)));return n.concat(i)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const n of t)this.selectorUnmatched(e,n)}elementAttributeChanged(e,t){const{selector:n}=this;if(n){const t=this.matchElement(e),i=this.matchesByElement.has(n,e);t&&!i?this.selectorMatched(e,n):!t&&i&&this.selectorUnmatched(e,n)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}}class O{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const n=this.delegate.getStringMapKeyForAttribute(e);if(null!=n){this.stringMap.has(e)||this.stringMapKeyAdded(n,e);const i=this.element.getAttribute(e);if(this.stringMap.get(e)!=i&&this.stringMapValueChanged(i,n,t),null==i){const t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(n,e,t)}else this.stringMap.set(e,i)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,n){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,n)}stringMapKeyRemoved(e,t,n){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,n)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map((e=>e.name))}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class T{constructor(e,t,n){this.attributeObserver=new E(e,t,this),this.delegate=n,this.tokensByElement=new x}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,n]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(n)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach((e=>this.tokenMatched(e)))}tokensUnmatched(e){e.forEach((e=>this.tokenUnmatched(e)))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),i=function(e,t){const n=Math.max(e.length,t.length);return Array.from({length:n},((n,i)=>[e[i],t[i]]))}(t,n).findIndex((([e,t])=>{return i=t,!((n=e)&&i&&n.index==i.index&&n.content==i.content);var n,i}));return-1==i?[[],[]]:[t.slice(i),n.slice(i)]}readTokensForElement(e){const t=this.attributeName;return function(e,t,n){return e.trim().split(/\s+/).filter((e=>e.length)).map(((e,i)=>({element:t,attributeName:n,content:e,index:i})))}(e.getAttribute(t)||"",e,t)}}class M{constructor(e,t,n){this.tokenListObserver=new T(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))}tokenUnmatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}}class ${constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new M(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new y(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach((e=>this.delegate.bindingDisconnected(e,!0))),this.bindingsByAction.clear()}parseValueForToken(e){const t=f.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class F{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new O(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const n=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,n.writer(this.receiver[e]),n.writer(n.defaultValue))}stringMapValueChanged(e,t,n){const i=this.valueDescriptorNameMap[t];null!==e&&(null===n&&(n=i.writer(i.defaultValue)),this.invokeChangedCallback(t,e,n))}stringMapKeyRemoved(e,t,n){const i=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,i.writer(this.receiver[e]),n):this.invokeChangedCallback(e,i.writer(i.defaultValue),n)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:n,writer:i}of this.valueDescriptors)null==n||this.controller.data.has(e)||this.invokeChangedCallback(t,i(n),void 0)}invokeChangedCallback(e,t,n){const i=`${e}Changed`,s=this.receiver[i];if("function"==typeof s){const i=this.valueDescriptorNameMap[e];try{const e=i.reader(t);let r=n;n&&(r=i.reader(n)),s.call(this.receiver,e,r)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${i.name}" - ${e.message}`),e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map((t=>e[t]))}get valueDescriptorNameMap(){const e={};return Object.keys(this.valueDescriptorMap).forEach((t=>{const n=this.valueDescriptorMap[t];e[n.name]=n})),e}hasValue(e){const t=`has${d(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class _{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new x}start(){this.tokenListObserver||(this.tokenListObserver=new T(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var n;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetConnected(e,t))))}disconnectTarget(e,t){var n;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetDisconnected(e,t))))}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function N(e,t){const n=j(e);return Array.from(n.reduce(((e,n)=>(function(e,t){const n=e[t];return Array.isArray(n)?n:[]}(n,t).forEach((t=>e.add(t))),e)),new Set))}function L(e,t){return j(e).reduce(((e,n)=>(e.push(...function(e,t){const n=e[t];return n?Object.keys(n).map((e=>[e,n[e]])):[]}(n,t)),e)),[])}function j(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}class B{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new x,this.outletElementsByName=new x,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach((e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)})),this.started=!0,this.dependentContexts.forEach((e=>e.refresh())))}refresh(){this.selectorObserverMap.forEach((e=>e.refresh())),this.attributeObserverMap.forEach((e=>e.refresh()))}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach((e=>e.stop())),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach((e=>e.stop())),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:n}){const i=this.getOutlet(e,n);i&&this.connectOutlet(i,e,n)}selectorUnmatched(e,t,{outletName:n}){const i=this.getOutletFromMap(e,n);i&&this.disconnectOutlet(i,e,n)}selectorMatchElement(e,{outletName:t}){const n=this.selector(t),i=this.hasOutlet(e,t),s=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!n&&(i&&s&&e.matches(n))}elementMatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementAttributeValueChanged(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementUnmatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}connectOutlet(e,t,n){var i;this.outletElementsByName.has(n,t)||(this.outletsByName.add(n,e),this.outletElementsByName.add(n,t),null===(i=this.selectorObserverMap.get(n))||void 0===i||i.pause((()=>this.delegate.outletConnected(e,t,n))))}disconnectOutlet(e,t,n){var i;this.outletElementsByName.has(n,t)&&(this.outletsByName.delete(n,e),this.outletElementsByName.delete(n,t),null===(i=this.selectorObserverMap.get(n))||void 0===i||i.pause((()=>this.delegate.outletDisconnected(e,t,n))))}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const n of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(n,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e),n=new A(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,n),n.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),n=new E(this.scope.element,t,this);this.attributeObserverMap.set(e,n),n.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find((t=>this.attributeNameForOutletName(t)===e))}get outletDependencies(){const e=new x;return this.router.modules.forEach((t=>{N(t.definition.controllerConstructor,"outlets").forEach((n=>e.add(n,t.identifier)))})),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter((t=>e.includes(t.identifier)))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find((t=>t.element===e))}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class D{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:n,controller:i,element:s}=this;t=Object.assign({identifier:n,controller:i,element:s},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new $(this,this.dispatcher),this.valueObserver=new F(this,this.controller),this.targetObserver=new _(this,this),this.outletObserver=new B(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,n={}){const{identifier:i,controller:s,element:r}=this;n=Object.assign({identifier:i,controller:s,element:r},n),this.application.handleError(e,`Error ${t}`,n)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,n){this.invokeControllerMethod(`${c(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${c(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const n=this.controller;"function"==typeof n[e]&&n[e](...t)}}function P(e){return function(e,t){const n=R(e),i=function(e,t){return q(t).reduce(((n,i)=>{const s=function(e,t,n){const i=Object.getOwnPropertyDescriptor(e,n);if(!i||!("value"in i)){const e=Object.getOwnPropertyDescriptor(t,n).value;return i&&(e.get=i.get||e.get,e.set=i.set||e.set),e}}(e,t,i);return s&&Object.assign(n,{[i]:s}),n}),{})}(e.prototype,t);return Object.defineProperties(n.prototype,i),n}(e,function(e){const t=N(e,"blessings");return t.reduce(((t,n)=>{const i=n(e);for(const e in i){const n=t[e]||{};t[e]=Object.assign(n,i[e])}return t}),{})}(e))}const q="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,R=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e((function(){this.a.call(this)}));t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();class I{constructor(e,t){this.application=e,this.definition=function(e){return{identifier:e.identifier,controllerConstructor:P(e.controllerConstructor)}}(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new D(this,e),this.contextsByScope.set(e,t)),t}}class V{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){const t=this.data.get(this.getDataKey(e))||"";return t.match(/[^\s]+/g)||[]}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class z{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${u(e)}`}}class K{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,n){let i=this.warnedKeysByObject.get(e);i||(i=new Set,this.warnedKeysByObject.set(e,i)),i.has(t)||(i.add(t),this.logger.warn(n,e))}}function U(e,t){return`[${e}~="${t}"]`}class W{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)]),[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return U(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map((t=>this.deprecate(t,e)))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return U(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:n}=this,i=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${i}="${n}.${t}" with ${s}="${t}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class H{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findOutlet(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllOutlets(t)]),[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))}matchesElement(e,t,n){const i=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&i.split(" ").includes(n)}}class Q{constructor(e,t,n,i){this.targets=new W(this),this.classes=new V(this),this.data=new z(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new K(i),this.outlets=new H(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return U(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new Q(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class X{constructor(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new M(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:n}=e;return this.parseValueForElementAndIdentifier(t,n)}parseValueForElementAndIdentifier(e,t){const n=this.fetchScopesByIdentifierForElement(e);let i=n.get(t);return i||(i=this.delegate.createScopeForElementAndIdentifier(e,t),n.set(t,i)),i}elementMatchedValue(e,t){const n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}}class J{constructor(e){this.application=e,this.scopeObserver=new X(this.element,this.schema,this),this.scopesByIdentifier=new x,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce(((e,t)=>e.concat(t.contexts)),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new I(this.application,e);this.connectModule(t);const n=e.controllerConstructor.afterLoad;n&&n.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const n=this.modulesByIdentifier.get(t);if(n)return n.contexts.find((t=>t.element==e))}proposeToConnectScopeForElementAndIdentifier(e,t){const n=this.scopeObserver.parseValueForElementAndIdentifier(e,t);n?this.scopeObserver.elementMatchedValue(n.element,n):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,n){this.application.handleError(e,t,n)}createScopeForElementAndIdentifier(e,t){return new Q(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.connectContextForScope(t)))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.disconnectContextForScope(t)))}}const G={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},Y("abcdefghijklmnopqrstuvwxyz".split("").map((e=>[e,e])))),Y("0123456789".split("").map((e=>[e,e]))))};function Y(e){return e.reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{})}class Z{constructor(e=document.documentElement,t=G){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,n={})=>{this.debug&&this.logFormattedMessage(e,t,n)},this.element=e,this.schema=t,this.dispatcher=new s(this),this.router=new J(this),this.actionDescriptorFilters=Object.assign({},r)}static start(e,t){const n=new this(e,t);return n.start(),n}async start(){await new Promise((e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>e())):e()})),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)}))}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>this.router.unloadIdentifier(e)))}get controllers(){return this.router.contexts.map((e=>e.controller))}getControllerForElementAndIdentifier(e,t){const n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null}handleError(e,t,n){var i;this.logger.error("%s\n\n%o\n\n%o",t,e,n),null===(i=window.onerror)||void 0===i||i.call(window,t,"",0,0,e)}logFormattedMessage(e,t,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}}function ee(e,t,n){return e.application.getControllerForElementAndIdentifier(t,n)}function te(e,t,n){let i=ee(e,t,n);return i||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,n),i=ee(e,t,n),i||void 0)}function ne([e,t],n){return function(e){const{token:t,typeDefinition:n}=e,i=`${u(t)}-value`,s=function(e){const{controller:t,token:n,typeDefinition:i}=e,s={controller:t,token:n,typeObject:i},r=function(e){const{controller:t,token:n,typeObject:i}=e,s=h(i.type),r=h(i.default),o=s&&r,a=s&&!r,l=!s&&r,c=ie(i.type),d=se(e.typeObject.default);if(a)return c;if(l)return d;if(c!==d){throw new Error(`The specified default value for the Stimulus Value "${t?`${t}.${n}`:n}" must match the defined type "${c}". The provided default value of "${i.default}" is of type "${d}".`)}if(o)return c}(s),o=se(i),a=ie(i),l=r||o||a;if(l)return l;const c=t?`${t}.${i}`:n;throw new Error(`Unknown value type "${c}" for "${n}" value`)}(e);return{type:s,key:i,name:l(i),get defaultValue(){return function(e){const t=ie(e);if(t)return re[t];const n=g(e,"default"),i=g(e,"type"),s=e;if(n)return s.default;if(i){const{type:e}=s,t=ie(e);if(t)return re[t]}return e}(n)},get hasCustomDefaultValue(){return void 0!==se(n)},reader:oe[s],writer:ae[s]||ae.default}}({controller:n,token:e,typeDefinition:t})}function ie(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function se(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}const re={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},oe={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${se(t)}"`);return t},boolean(e){return!("0"==e||"false"==String(e).toLowerCase())},number(e){return Number(e.replace(/_/g,""))},object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${se(t)}"`);return t},string(e){return e}},ae={default:function(e){return`${e}`},array:le,object:le};function le(e){return JSON.stringify(e)}class ce{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:i=this.identifier,bubbles:s=!0,cancelable:r=!0}={}){const o=new CustomEvent(i?`${i}:${e}`:e,{detail:n,bubbles:s,cancelable:r});return t.dispatchEvent(o),o}}ce.blessings=[function(e){return N(e,"classes").reduce(((e,t)=>{return Object.assign(e,{[`${n=t}Class`]:{get(){const{classes:e}=this;if(e.has(n))return e.get(n);{const t=e.getAttributeName(n);throw new Error(`Missing attribute "${t}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${d(n)}Class`]:{get(){return this.classes.has(n)}}});var n}),{})},function(e){return N(e,"targets").reduce(((e,t)=>{return Object.assign(e,{[`${n=t}Target`]:{get(){const e=this.targets.find(n);if(e)return e;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${d(n)}Target`]:{get(){return this.targets.has(n)}}});var n}),{})},function(e){const t=L(e,"values"),n={valueDescriptorMap:{get(){return t.reduce(((e,t)=>{const n=ne(t,this.identifier),i=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[i]:n})}),{})}}};return t.reduce(((e,t)=>Object.assign(e,function(e,t){const n=ne(e,t),{key:i,name:s,reader:r,writer:o}=n;return{[s]:{get(){const e=this.data.get(i);return null!==e?r(e):n.defaultValue},set(e){void 0===e?this.data.delete(i):this.data.set(i,o(e))}},[`has${d(s)}`]:{get(){return this.data.has(i)||n.hasCustomDefaultValue}}}}(t))),n)},function(e){return N(e,"outlets").reduce(((e,t)=>Object.assign(e,function(e){const t=c(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t){const n=te(this,t,e);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map((t=>{const n=te(this,t,e);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)})).filter((e=>e)):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${d(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}(t))),{})}],ce.targets=[],ce.outlets=[],ce.values={}},424:function(e,t,n){"use strict";n.r(t);var i=n(667);t.default=class extends i.Qr{static values={content:String};write(){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(this.contentValue).catch(this.clipboardFallback.bind(this)):this.clipboardFallback()}clipboardFallback(){const e=document.createElement("input");e.value=this.contentValue,document.body.appendChild(e),e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(e)}}},1:function(e,t,n){"use strict";n.r(t);var i=n(667);const s=()=>{const e=localStorage.getItem("contao--prefers-dark");return null===e?!!window.matchMedia("(prefers-color-scheme: dark)").matches:"true"===e},r=()=>{document.documentElement.dataset.colorScheme=s()?"dark":"light"};window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),r(),t.default=class extends i.Qr{static targets=["label"];static values={i18n:{type:Object,default:{light:"Disable dark mode",dark:"Enable dark mode"}}};initialize(){this.toggle=this.toggle.bind(this),this.setLabel=this.setLabel.bind(this)}connect(){this.element.addEventListener("click",this.toggle),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",this.setLabel),this.setLabel()}disconnect(){this.element.removeEventListener("click",this.toggle)}toggle(e){e.preventDefault();const t=!s();t===window.matchMedia("(prefers-color-scheme: dark)").matches?localStorage.removeItem("contao--prefers-dark"):localStorage.setItem("contao--prefers-dark",String(t)),r(),setTimeout(this.setLabel,300)}setLabel(){if(!this.hasLabelTarget)return;const e=this.i18nValue[s()?"light":"dark"];this.labelTarget.title=e,this.labelTarget.innerText=e}}},572:function(e,t,n){"use strict";n.r(t);var i=n(667);t.default=class extends i.Qr{static values={config:Object};initialize(){this.updateWizard=this.updateWizard.bind(this),this.openModal=this.openModal.bind(this)}connect(){this.select=this.element.querySelector("select"),this.button=document.createElement("button"),this.button.type="button",this.button.title="",this.buttonImage=document.createElement("img"),this.button.append(this.buttonImage),this.element.parentNode.classList.add("wizard"),this.element.after(this.button),this.select.addEventListener("change",this.updateWizard),this.button.addEventListener("click",this.openModal),this.updateWizard()}disconnect(){this.element.parentNode.classList.remove("wizard"),this.select.removeEventListener("change",this.updateWizard),this.buttonImage.remove(),this.button.remove()}updateWizard(){this.canEdit()?(this.button.title=this.configValue.title,this.button.disabled=!1,this.buttonImage.src=this.configValue.icon):(this.button.title="",this.button.disabled=!0,this.buttonImage.src=this.configValue.iconDisabled)}openModal(){Backend.openModalIframe({title:this.configValue.title,url:`${this.configValue.href}&id=${this.select.value}`})}canEdit(){return this.configValue.ids.includes(Number(this.select.value))}}},395:function(e,t,n){"use strict";n.r(t);var i=n(667);t.default=class extends i.Qr{static targets=["navigation","section"];connect(){this.rebuildNavigation(),this.connected=!0}sectionTargetConnected(){this.connected&&this.rebuildNavigation()}rebuildNavigation(){if(!this.hasNavigationTarget)return;const e=document.createElement("ul");this.sectionTargets.forEach((t=>{const n=document.createElement("button");n.innerText=t.getAttribute(`data-${this.identifier}-label-value`),n.addEventListener("click",(e=>{e.preventDefault(),this.dispatch("scrollto",{target:t}),t.scrollIntoView()}));const i=document.createElement("li");i.append(n),e.append(i)})),this.navigationTarget.replaceChildren(e)}}},780:function(e,t,n){"use strict";n.r(t);var i=n(667);t.default=class extends i.Qr{static values={max:Number,expand:String,collapse:String,expandAll:String,expandAllTitle:String,collapseAll:String,collapseAllTitle:String};static targets=["operation","node"];initialize(){super.initialize(),this.togglerMap=new WeakMap,this.nextId=1}operationTargetConnected(){this.updateOperation()}nodeTargetConnected(e){const t=window.getComputedStyle(e,null),n=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),i=e.clientHeight-n;if(this.maxValue>i)return;e.id||(e.id="limit-height-"+this.nextId++),e.style.overflow="hidden",e.style.maxHeight=`${this.maxValue}px`;const s=document.createElement("button");s.setAttribute("type","button"),s.title=this.expandValue,s.innerHTML="<span>...</span>",s.classList.add("unselectable"),s.setAttribute("aria-expanded","false"),s.setAttribute("aria-controls",e.id),s.addEventListener("click",(t=>{t.preventDefault(),this.toggle(e),this.updateOperation(t)}));const r=document.createElement("div");r.classList.add("limit_toggler"),r.append(s),this.togglerMap.set(e,r),e.append(r),this.updateOperation()}nodeTargetDisconnected(e){this.togglerMap.has(e)&&(this.togglerMap.get(e).remove(),this.togglerMap.delete(e),e.style.overflow="",e.style.maxHeight="")}toggle(e){""===e.style.maxHeight?this.collapse(e):this.expand(e)}expand(e){if(!this.togglerMap.has(e))return;e.style.maxHeight="";const t=this.togglerMap.get(e).querySelector("button");t.title=this.collapseValue,t.setAttribute("aria-expanded","true")}collapse(e){if(!this.togglerMap.has(e))return;e.style.maxHeight=`${this.maxValue}px`;const t=this.togglerMap.get(e).querySelector("button");t.title=this.expandValue,t.setAttribute("aria-expanded","false")}toggleAll(e){e.preventDefault();const t=this.hasExpanded()^e.altKey;this.nodeTargets.forEach((e=>{t?this.collapse(e):this.expand(e)})),this.updateOperation(e)}keypress(e){this.updateOperation(e)}updateOperation(e){if(!this.hasOperationTarget)return;const t=!!this.nodeTargets.find((e=>this.togglerMap.has(e))),n=this.hasExpanded();this.operationTarget.style.display=t?"":"none",this.operationTarget.setAttribute("aria-controls",this.nodeTargets.map((e=>e.id)).join(" ")),this.operationTarget.setAttribute("aria-expanded",n?"true":"false"),n^(!!e&&e.altKey)?(this.operationTarget.innerText=this.collapseAllValue,this.operationTarget.title=this.collapseAllTitleValue):(this.operationTarget.innerText=this.expandAllValue,this.operationTarget.title=this.expandAllTitleValue)}hasExpanded(){return!!this.nodeTargets.find((e=>this.togglerMap.has(e)&&""===e.style.maxHeight))}}},208:function(e,t,n){"use strict";n.r(t);var i=n(667);t.default=class extends i.Qr{static targets=["input"];delete(){this.inputTargets.forEach((e=>{e.value=""}))}}},423:function(e,t,n){"use strict";n.r(t);var i=n(667);t.default=class extends i.Qr{static targets=["scrollTo","autoFocus"];static values={sessionKey:{type:String,default:"contao_backend_offset"},behavior:{type:String,default:"instant"},block:{type:String,default:"center"}};static afterLoad(e,t){const n=()=>new Promise(((n,i)=>{const s=t.getControllerForElementAndIdentifier(document.documentElement,e);if(s)return void n(s);const{controllerAttribute:r}=t.schema;document.documentElement.setAttribute(r,`${document.documentElement.getAttribute(r)||""} ${e}`),setTimeout((()=>{const s=t.getControllerForElementAndIdentifier(document.documentElement,e);s&&n(s)||i(s)}),100)}));window.Backend&&!window.Backend.initScrollOffset&&(window.Backend.initScrollOffset=()=>{console.warn("Backend.initScrollOffset() is deprecated. Please use the Stimulus controller instead."),n()}),window.Backend&&!window.Backend.getScrollOffset&&(window.Backend.getScrollOffset=()=>{console.warn("Backend.getScrollOffset() is deprecated. Please use the Stimulus controller instead."),n().then((e=>e.discard()))})}initialize(){this.store=this.store.bind(this)}connect(){this.offset&&(window.scrollTo({top:this.offset,behavior:this.behaviorValue,block:this.blockValue}),this.offset=null)}scrollToTargetConnected(){this.scrollToTarget.scrollIntoView({behavior:this.behaviorValue,block:this.blockValue})}autoFocusTargetConnected(){if(this.offset||this.autoFocus)return;const e=this.autoFocusTarget;e.disabled||e.readonly||!e.offsetWidth||!e.offsetHeight||e.closest(".chzn-search")||e.autocomplete&&"off"!==e.autocomplete||(this.autoFocus=!0,e.focus())}store(){this.offset=this.element.scrollTop}discard(){this.offset=null}get offset(){const e=window.sessionStorage.getItem(this.sessionKeyValue);return e?parseInt(e):null}set offset(e){null==e?window.sessionStorage.removeItem(this.sessionKeyValue):window.sessionStorage.setItem(this.sessionKeyValue,String(e))}}},991:function(e,t,n){"use strict";n.r(t);var i=n(667);t.default=class extends i.Qr{static values={id:String,table:String};static classes=["collapsed"];static afterLoad(e,t){const n=(t,n,i)=>{const s=t.parentNode;s.dataset.controller=`${s.dataset.controller||""} ${e}`,s.setAttribute(`data-${e}-id-value`,n),s.setAttribute(`data-${e}-table-value`,i),s.setAttribute(`data-${e}-collapsed-class`,"collapsed"),t.setAttribute("data-action",`click->${e}#toggle`)},i=()=>{document.querySelectorAll("legend[data-toggle-fieldset]").forEach((function(t){window.console&&console.warn(`Using the "data-toggle-fieldset" attribute on fieldset legends is deprecated and will be removed in Contao 6. Apply the "${e}" Stimulus controller instead.`);const{id:i,table:s}=JSON.parse(t.getAttribute("data-toggle-fieldset"));n(t,i,s)})),AjaxRequest.toggleFieldset=(i,s,r)=>{const o=i.parentNode;t.getControllerForElementAndIdentifier(o,e)||(window.console&&console.warn("Using AjaxRequest.toggleFieldset() is deprecated and will be removed in Contao 6. Apply the Stimulus actions instead."),n(i,s,r),setTimeout((()=>{t.getControllerForElementAndIdentifier(o,e).toggle()}),100))}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):i()}connect(){this.element.querySelectorAll("label.error, label.mandatory").length?this.element.classList.remove(this.collapsedClass):this.element.classList.contains("hide")&&(window.console&&console.warn(`Using class "hide" on a fieldset is deprecated and will be removed in Contao 6. Use class "${this.collapsedClass}" instead.`),this.element.classList.add(this.collapsedClass))}toggle(){this.element.classList.contains(this.collapsedClass)?this.open():this.close()}open(){this.element.classList.contains(this.collapsedClass)&&(this.element.classList.remove(this.collapsedClass),this.storeState(1))}close(){if(this.element.classList.contains(this.collapsedClass))return;const e=this.element.closest("form"),t=this.element.querySelectorAll("[required]");let n=!0;for(let e=0;e<t.length;e++)if(!t[e].value){n=!1;break}n?(this.element.classList.add(this.collapsedClass),this.storeState(0)):"function"==typeof e.checkValidity&&e.querySelector('button[type="submit"]').click()}storeState(e){this.hasIdValue&&this.hasTableValue&&fetch(window.location.href,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({action:"toggleFieldset",id:this.idValue,table:this.tableValue,state:e})})}}},441:function(e,t,n){"use strict";n.r(t);var i=n(667);t.default=class extends i.Qr{static classes=["collapsed"];static values={url:String,requestToken:String,expandTitle:String,collapseTitle:String};toggle(e){let{currentTarget:t,params:{category:n}}=e;const i=t.parentNode.classList.toggle(this.collapsedClass);t.setAttribute("aria-expanded",i?"false":"true"),t.setAttribute("title",i?this.expandTitleValue:this.collapseTitleValue),this.sendRequest(n,i)}sendRequest(e,t){fetch(this.urlValue,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({action:"toggleNavigation",id:e,state:t?0:1,REQUEST_TOKEN:this.requestTokenValue})})}}},577:function(e,t,n){"use strict";n.r(t);var i=n(667);t.default=class extends i.Qr{static values={mode:{type:Number,default:5},toggleAction:String,loadAction:String,requestToken:String,refererId:String,expand:String,collapse:String,expandAll:String,expandAllTitle:String,collapseAll:String,collapseAllTitle:String};static targets=["operation","node","toggle","child","rootChild"];operationTargetConnected(){this.updateOperation()}childTargetConnected(){this.updateOperation()}toggle(e){e.preventDefault();const t=e.currentTarget;t.blur(),this.toggleToggler(t,e.params.id,e.params.level,e.params.folder)}toggleToggler(e,t,n,i){const s=document.id(t);s&&"none"===s.style.display?(this.showChild(s),this.expandToggler(e),this.updateState(e,t,1)):s?(this.hideChild(s),this.collapseToggler(e),this.updateState(e,t,0)):this.fetchChild(e,t,n,i),this.updateOperation()}expandToggler(e){e.classList.add("foldable--open"),e.title=this.collapseValue}collapseToggler(e){e.classList.remove("foldable--open"),e.title=this.expandValue}loadToggler(e,t){e.classList[t?"add":"remove"]("foldable--loading")}showChild(e){e.style.display=""}hideChild(e){e.style.display="none"}async fetchChild(e,t,n,i){this.loadToggler(e,!0);const s=new URL(location.href),r=s.searchParams;r.set("ref",this.refererIdValue),s.search=r.toString();const o=await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({action:this.loadActionValue,id:t,level:n,folder:i,state:1,REQUEST_TOKEN:this.requestTokenValue})});if(o.ok){const i=await o.text(),s=document.createElement("li");s.id=t,s.classList.add("parent"),s.style.display="inline",s.setAttribute(`data-${this.identifier}-target`,0===n?"child rootChild":"child");const r=document.createElement("ul");if(r.classList.add("level_"+n),r.innerHTML=i,s.append(r),5===this.modeValue)e.closest("li").after(s);else{let t,n=!1,i=e.closest("li");for(;"element"===typeOf(i)&&"LI"===i.tagName&&(t=i.nextElementSibling);)if(i=t,i.classList.contains("tl_folder")){n=!0;break}n?i.before(s):i.after(s)}window.dispatchEvent(new CustomEvent("structure")),this.expandToggler(e),window.fireEvent("ajax_change")}this.loadToggler(e,!1)}async toggleAll(e){e.preventDefault();const t=e.currentTarget.href;if(this.hasExpandedRoot()^(!!e&&e.altKey))this.updateAllState(t,0),this.toggleTargets.forEach((e=>this.collapseToggler(e))),this.childTargets.forEach((e=>e.style.display="none"));else{this.childTargets.forEach((e=>e.remove())),this.toggleTargets.forEach((e=>this.loadToggler(e,!0))),await this.updateAllState(t,1);const e=[];this.toggleTargets.forEach((t=>{e.push(this.fetchChild(t,t.getAttribute(`data-${this.identifier}-id-param`),0,t.getAttribute(`data-${this.identifier}-folder-param`)))})),await Promise.all(e)}this.updateOperation()}keypress(e){this.updateOperation(e)}async updateState(e,t,n){await fetch(location.href,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({action:this.toggleActionValue,id:t,state:n,REQUEST_TOKEN:this.requestTokenValue})})}async updateAllState(e,t){await fetch(`${e}&state=${t}`)}updateOperation(e){this.hasOperationTarget&&(this.hasExpandedRoot()^(!!e&&e.altKey)?(this.operationTarget.innerText=this.collapseAllValue,this.operationTarget.title=this.collapseAllTitleValue):(this.operationTarget.innerText=this.expandAllValue,this.operationTarget.title=this.expandAllTitleValue))}hasExpandedRoot(){return!!this.rootChildTargets.find((e=>"none"!==e.style.display))}}},95:function(){window.AjaxRequest={toggleNavigation:function(e,t,n){window.console&&console.warn("AjaxRequest.toggleNavigation() is deprecated. Please use the stimulus controller instead.");var i=$(t),s=$(e).getParent("li");return!!i&&(s.hasClass("collapsed")?(s.removeClass("collapsed"),$(e).setAttribute("aria-expanded","true"),$(e).setAttribute("title",Contao.lang.collapse),new Request.Contao({url:n}).post({action:"toggleNavigation",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(s.addClass("collapsed"),$(e).setAttribute("aria-expanded","false"),$(e).setAttribute("title",Contao.lang.expand),new Request.Contao({url:n}).post({action:"toggleNavigation",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!1)},toggleStructure:function(e,t,n,i){window.console&&console.warn("AjaxRequest.toggleStructure() is deprecated. Please use the stimulus controller instead."),e.blur();var s=$(t);return s?("none"==s.getStyle("display")?(s.setStyle("display",null),$(e).addClass("foldable--open"),$(e).setAttribute("title",Contao.lang.collapse),new Request.Contao({field:e}).post({action:"toggleStructure",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(s.setStyle("display","none"),$(e).removeClass("foldable--open"),$(e).setAttribute("title",Contao.lang.expand),new Request.Contao({field:e}).post({action:"toggleStructure",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!1):(new Request.Contao({field:e,evalScripts:!0,onRequest:function(){AjaxRequest.displayBox(Contao.lang.loading+" …")},onSuccess:function(s){var r=new Element("li",{id:t,class:"parent",styles:{display:"inline"}});if(new Element("ul",{class:"level_"+n,html:s}).inject(r,"bottom"),5==i)r.inject($(e).getParent("li"),"after");else{for(var o,a=!1,l=$(e).getParent("li");"element"==typeOf(l)&&(o=l.getNext("li"));)if((l=o).hasClass("tl_folder")){a=!0;break}a?r.inject(l,"before"):r.inject(l,"after")}r.getElements("a").each((function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)})),$(e).addClass("foldable--open"),$(e).setAttribute("title",Contao.lang.collapse),window.fireEvent("structure"),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"loadStructure",id:t,level:n,state:1,REQUEST_TOKEN:Contao.request_token}),!1)},toggleFileManager:function(e,t,n,i){window.console&&console.warn("AjaxRequest.toggleFileManager() is deprecated. Please use the stimulus controller instead."),e.blur();var s=$(t);return s?("none"==s.getStyle("display")?(s.setStyle("display",null),$(e).addClass("foldable--open"),$(e).setAttribute("title",Contao.lang.collapse),new Request.Contao({field:e}).post({action:"toggleFileManager",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(s.setStyle("display","none"),$(e).removeClass("foldable--open"),$(e).setAttribute("title",Contao.lang.expand),new Request.Contao({field:e}).post({action:"toggleFileManager",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!1):(new Request.Contao({field:e,evalScripts:!0,onRequest:function(){AjaxRequest.displayBox(Contao.lang.loading+" …")},onSuccess:function(n){var s=new Element("li",{id:t,class:"parent",styles:{display:"inline"}});new Element("ul",{class:"level_"+i,html:n}).inject(s,"bottom"),s.inject($(e).getParent("li"),"after"),s.getElements("a").each((function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)})),$(e).addClass("foldable--open"),$(e).setAttribute("title",Contao.lang.collapse),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"loadFileManager",id:t,level:i,folder:n,state:1,REQUEST_TOKEN:Contao.request_token}),!1)},toggleSubpalette:function(e,t,n){e.blur();var i=$(t);function s(t){var n=e.form.elements.VERSION_NUMBER||[];n.forEach||(n=[n]),n.forEach((function(e){e.value=/<input\s+[^>]*?name="VERSION_NUMBER"\s+[^>]*?value="([^"]*)"/i.exec(t)[1]}))}i?e.value?(e.value="",e.checked="",i.setStyle("display","none"),i.getElements("[required]").each((function(e){e.set("required",null).set("data-required","")})),new Request.Contao({field:e,onSuccess:s}).post({action:"toggleSubpalette",id:t,field:n,state:0,REQUEST_TOKEN:Contao.request_token})):(e.value=1,e.checked="checked",i.setStyle("display",null),i.getElements("[data-required]").each((function(e){e.set("required","").set("data-required",null)})),new Request.Contao({field:e,onSuccess:s}).post({action:"toggleSubpalette",id:t,field:n,state:1,REQUEST_TOKEN:Contao.request_token})):new Request.Contao({field:e,evalScripts:!1,onRequest:function(){AjaxRequest.displayBox(Contao.lang.loading+" …")},onSuccess:function(n,i){var r=new Element("div",{id:t,class:"subpal cf",html:n,styles:{display:"block"}}).inject($(e).getParent("div").getParent("div"),"after");i.javascript&&(document.write=function(e){var t="";e.replace(/<script src="([^"]+)"/i,(function(e,n){t=n})),t&&Asset.javascript(t,{onLoad:function(){Browser.exec(i.javascript)}})},Browser.exec(i.javascript)),e.value=1,e.checked="checked",r.getElements("a").each((function(e){e.href=e.href.replace(/&ref=[a-f0-9]+/,"&ref="+Contao.referer_id)})),s(n),AjaxRequest.hideBox(),window.fireEvent("ajax_change")}}).post({action:"toggleSubpalette",id:t,field:n,load:1,state:1,REQUEST_TOKEN:Contao.request_token})},toggleField:function(e,t){e.blur();var n,i,s=null,r=$(e).getElements("img"),o=1==r[0].get("data-state"),a=e.getParent("div");return t&&(a.hasClass("tl_right")?s=a.getPrevious("div").getElements("img"):a.hasClass("tl_listing_container")?(null===(s=e.getParent("td").getPrevious("td").getFirst("div.list_icon"))&&(s=e.getParent("td").getPrevious("td").getElement("div.cte_type")),null===s&&(s=e.getParent("tr").getFirst("td").getElement("div.list_icon_new"))):(n=a.getNext("div"))&&(n.hasClass("cte_type")&&(s=n),null===s&&(s=n.getFirst("div.list_icon"))),null!==s&&(s instanceof HTMLElement||!s.forEach?s.hasClass("cte_type")?o?(s.addClass("unpublished"),s.removeClass("published")):(s.addClass("published"),s.removeClass("unpublished")):s.setStyle("background-image","url("+(o?s.get("data-icon-disabled"):s.get("data-icon"))+")"):s.forEach((e=>{if("img"==e.nodeName.toLowerCase()){e.getParent("ul.tl_listing").hasClass("tl_tree_xtnd")||(i=e.getParent("a"))&&-1==i.href.indexOf("contao/preview")&&(e=(n=i.getNext("a"))?n.getElement("img"):new Element("img"));const t=o?e.get("data-icon-disabled"):e.get("data-icon");e.src=e.src.includes("/")&&!t.includes("/")?e.src.slice(0,e.src.lastIndexOf("/")+1)+t:t}})))),r.forEach((function(e){const t=o?e.get("data-icon-disabled"):e.get("data-icon");e.src=e.src.includes("/")&&!t.includes("/")?e.src.slice(0,e.src.lastIndexOf("/")+1)+t:t,e.set("data-state",o?0:1)})),!o&&$(e).get("data-title")?e.title=$(e).get("data-title"):o&&$(e).get("data-title-disabled")&&(e.title=$(e).get("data-title-disabled")),new Request.Contao({url:e.href,followRedirects:!1}).get(),!1},toggleCheckboxGroup:function(e,t){e.blur();var n=$(t);return!!n&&("none"==n.getStyle("display")?(n.setStyle("display",null),$(e).addClass("foldable--open"),(new Request.Contao).post({action:"toggleCheckboxGroup",id:t,state:1,REQUEST_TOKEN:Contao.request_token})):(n.setStyle("display","none"),$(e).removeClass("foldable--open"),(new Request.Contao).post({action:"toggleCheckboxGroup",id:t,state:0,REQUEST_TOKEN:Contao.request_token})),!0)},displayBox:function(e){var t=$("tl_ajaxBox"),n=$("tl_ajaxOverlay"),i=window.getScroll();null===n&&(n=new Element("div",{id:"tl_ajaxOverlay"}).inject($(document.body),"bottom")),n.set({styles:{display:"block",top:i.y+"px"}}),null===t&&(t=new Element("div",{id:"tl_ajaxBox"}).inject($(document.body),"bottom")),t.set({html:e,styles:{display:"block",top:i.y+100+"px"}})},hideBox:function(){var e=$("tl_ajaxBox"),t=$("tl_ajaxOverlay");t&&t.setStyle("display","none"),e&&e.setStyle("display","none")}},window.Backend={currentId:null,popupWindow:null,themePath:Contao.script_url+"system/themes/"+Contao.theme+"/",openModalWindow:function(e,t,n){new SimpleModal({width:e,hideFooter:!0,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.setStyle("overflow","hidden")},onHide:function(){document.body.setStyle("overflow","auto")}}).show({title:t,contents:n})},openModalImage:function(e){var t=e||{},n=(window.getSize().x-20).toInt();(!t.width||t.width>n)&&(t.width=Math.min(n,900)),new SimpleModal({width:t.width,hideFooter:!0,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.setStyle("overflow","hidden")},onHide:function(){document.body.setStyle("overflow","auto")}}).show({title:t.title?.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"),contents:'<img src="'+t.url+'" alt="">'})},openModalIframe:function(e){var t=e||{},n=(window.getSize().x-20).toInt(),i=(window.getSize().y-137).toInt();(!t.width||t.width>n)&&(t.width=Math.min(n,900)),(!t.height||t.height>i)&&(t.height=i),new SimpleModal({width:t.width,hideFooter:!0,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.setStyle("overflow","hidden")},onHide:function(){document.body.setStyle("overflow","auto")}}).show({title:t.title?.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"),contents:'<iframe src="'+t.url+'" width="100%" height="'+t.height+'" frameborder="0"></iframe>',model:"modal"})},openModalSelector:function(e){var t=e||{},n=(window.getSize().x-20).toInt(),i=(window.getSize().y-192).toInt();t.id||(t.id="tl_select"),(!t.width||t.width>n)&&(t.width=Math.min(n,900)),(!t.height||t.height>i)&&(t.height=i);var s=new SimpleModal({width:t.width,draggable:!1,overlayOpacity:.7,onShow:function(){document.body.setStyle("overflow","hidden")},onHide:function(){document.body.setStyle("overflow","auto")}});s.addButton(Contao.lang.cancel,"btn",(function(){this.buttons[0].hasClass("btn-disabled")||this.hide()})),s.addButton(Contao.lang.apply,"btn primary",(function(){if(!this.buttons[1].hasClass("btn-disabled")){var e,n,i,s,r,o=window.frames["simple-modal-iframe"],a=[];if(void 0!==o){for((s=(e=o.document.getElementById(t.id)).get("data-picker-value"))&&(a=JSON.parse(s)),n=e.getElementsByTagName("input"),i=0;i<n.length;i++)n[i].id.match(/^(check_all_|reset_)/)||(r=a.indexOf(n[i].get("value")),n[i].checked?-1==r&&a.push(n[i].get("value")):-1!=r&&a.splice(r,1));t.callback(e.get("data-table"),a),this.hide()}else alert("Could not find the SimpleModal frame")}})),s.show({title:t.title?.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"),contents:'<iframe src="'+t.url+'" name="simple-modal-iframe" width="100%" height="'+t.height+'" frameborder="0"></iframe>',model:"modal"})},openModalBrowser:function(e,t,n,i,s){Backend.openModalSelector({id:"tl_listing",title:i.document.getElement("div.mce-title").get("text"),url:Contao.routes.backend_picker+"?context="+("file"==n?"link":"file")+"&amp;extras[fieldType]=radio&amp;extras[filesOnly]=true&amp;extras[source]="+s+"&amp;value="+t+"&amp;popup=1",callback:function(t,n){i.document.getElementById(e).value=n.join(",")}})},autoSubmit:function(e){window.dispatchEvent(new Event("store-scroll-offset"));var t=new Element("input",{type:"hidden",name:"SUBMIT_TYPE",value:"auto"}),n=$(e)||e;t.inject(n,"bottom"),n.submit()},vScrollTo:function(e){window.addEvent("load",(function(){window.scrollTo(null,parseInt(e))}))},toggleCheckboxes:function(e,t){for(var n=$$("input"),i=$(e).checked?"checked":"",s=0;s<n.length;s++)"checkbox"==n[s].type.toLowerCase()&&(void 0!==t&&t!=n[s].id.substr(0,t.length)||(n[s].checked=i))},toggleCheckboxGroup:function(e,t){var n=$(e).className,i=$(e).checked?"checked":"";"tl_checkbox"==n?($(t)?$$("#"+t+" .tl_checkbox"):$(e).getParent("fieldset").getElements(".tl_checkbox")).each((function(e){e.checked=i})):"tl_tree_checkbox"==n&&$$("#"+t+" .parent .tl_tree_checkbox").each((function(e){e.checked=i}));window.dispatchEvent(new Event("store-scroll-offset"))},toggleCheckboxElements:function(e,t){var n=$(e).checked?"checked":"";$$("."+t).each((function(e){e.hasClass("tl_checkbox")&&(e.checked=n)})),window.dispatchEvent(new Event("store-scroll-offset"))},makeParentViewSortable:function(e){var t=new Scroller(document.getElement("body"),{onChange:function(e,t){this.element.scrollTo(this.element.getScroll().x,t)}}),n=new Sortables(e,{constrain:!0,opacity:.6,onStart:function(){t.start()},onComplete:function(){t.stop()},onSort:function(e){var t,n,i=e.getParent("ul"),s=0;if(i&&(t=i.getChildren("li > div:first-child")))for(n=0;n<t.length;n++)t[n].hasClass("wrapper_stop")&&s>0&&s--,t[n].className=t[n].className.replace(/(^|\s)indent[^\s]*/g,""),s>0&&t[n].addClass("indent").addClass("indent_"+s),t[n].hasClass("wrapper_start")&&s++,t[n].removeClass("indent_first"),t[n].removeClass("indent_last"),t[n-1]&&t[n-1].hasClass("wrapper_start")&&t[n].addClass("indent_first"),t[n+1]&&t[n+1].hasClass("wrapper_stop")&&t[n].addClass("indent_last")},handle:".drag-handle"});n.active=!1,n.addEvent("start",(function(){n.active=!0})),n.addEvent("complete",(function(e){var t,i,s,r;n.active&&(e.getPrevious("li")?(t=e.get("id").replace(/li_/,""),i=e.getPrevious("li").get("id").replace(/li_/,""),s=window.location.search.replace(/id=[0-9]*/,"id="+t)+"&act=cut&mode=1&pid="+i,r=window.location.href.replace(/\?.*$/,""),new Request.Contao({url:r+s,followRedirects:!1}).get()):e.getParent("ul")&&(t=e.get("id").replace(/li_/,""),i=e.getParent("ul").get("id").replace(/ul_/,""),s=window.location.search.replace(/id=[0-9]*/,"id="+t)+"&act=cut&mode=2&pid="+i,r=window.location.href.replace(/\?.*$/,""),new Request.Contao({url:r+s,followRedirects:!1}).get()))}))},makeMultiSrcSortable:function(e,t,n){var i=new Sortables($(e),{constrain:!0,opacity:.6}).addEvent("complete",(function(){var i,s=[],r=$(e).getChildren("[data-id]");for(i=0;i<r.length;i++)s.push(r[i].get("data-id"));t===n&&$(n).value.split(",").forEach((function(e){-1===s.indexOf(e)&&s.push(e)})),$(t).value=s.join(",")}));$(e).getElements(".gimage").each((function(e){e.hasClass("removable")?new Element("button",{type:"button",html:"&times;",class:"tl_red"}).addEvent("click",(function(){var i=e.getParent("li"),s=i.get("data-id");$(n).value=$(n).value.split(",").filter((function(e){return e!=s})).join(","),$(t).value=$(t).value.split(",").filter((function(e){return e!=s})).join(","),i.dispose()})).inject(e,"after"):new Element("button",{type:"button",html:"&times",disabled:!0}).inject(e,"after")})),i.fireEvent("complete")},enableFileTreeDragAndDrop:function(e,t){var n=new Scroller(document.getElement("body"),{onChange:function(e,t){this.element.scrollTo(this.element.getScroll().x,t)}});function i(e){return e&&e.hasClass("parent")&&e.getPrevious(".tl_folder")?e.getPrevious(".tl_folder"):e}e.addEvent("mousedown",(function(s){var r=s.target.hasClass("drag-handle")?s.target:s.target.getParent(".drag-handle"),o=s.target.getParent(".tl_file,.tl_folder");if(r&&o&&!s.rightClick){n.start(),e.addClass("tl_listing_dragging");var a,l,c,d=o.getElements(".tl_left")[0]||o,u=d.clone(!0).inject(e).addClass("tl_left_dragging");u.setPosition({x:s.page.x-d.getOffsetParent().getPosition().x-u.getSize().x,y:d.getPosition(d.getOffsetParent()).y}).setStyle("display","none");var h=new Drag.Move(u,{droppables:$$([e]).append(e.getElements(".tl_folder,li.parent,.tl_folder_top")),unDraggableTags:[],modifiers:{x:"left",y:"top"},onStart:function(){u.setStyle("display","")},onEnter:function(t,n){(n=i(n)).addClass("tl_folder_dropping"),n.hasClass("tl_folder")&&a!==n&&(a=n,l=(new Date).getTime(),(c=n.getElement("a.foldable"))&&!c.hasClass("foldable--open")&&setTimeout((function(){if(a===n&&l+900<(new Date).getTime()){var t=document.createEvent("HTMLEvents");t.initEvent("click",!0,!0),c.dispatchEvent(t),a=void 0,l=void 0,window.addEvent("ajax_change",(function t(){h&&h.droppables&&e&&e.getElements&&(h.droppables=$$([e]).append(e.getElements(".tl_folder,li.parent"))),window.removeEvent("ajax_change",t)}))}}),1e3))},onCancel:function(){a=void 0,l=void 0,n.stop(),u.destroy(),window.removeEvent("keyup",g),e.getElements(".tl_folder_dropping").removeClass("tl_folder_dropping"),e.removeClass("tl_listing_dragging")},onDrop:function(s,r){if(a=void 0,l=void 0,n.stop(),u.destroy(),window.removeEvent("keyup",g),e.getElements(".tl_folder_dropping").removeClass("tl_folder_dropping"),e.removeClass("tl_listing_dragging"),r=i(r)){var c=o.get("data-id"),d=r.get("data-id")||decodeURIComponent(t.url.split(/[?&]pid=/)[1].split("&")[0]);c&&d&&(0===(d+"/").indexOf(c+"/")||d+"/"===c.replace(/[^/]+$/,""))||(window.dispatchEvent(new Event("store-scroll-offset")),document.location.href=t.url+"&id="+encodeURIComponent(c)+"&pid="+encodeURIComponent(d))}},onLeave:function(e,t){(t=i(t)).removeClass("tl_folder_dropping"),a=void 0,l=void 0}});h.start(s),window.addEvent("keyup",g)}function g(e){"esc"===e.key&&h&&h.stop&&(h.droppables=$$([]),h.stop())}}))},listWizard:function(e){var t=$(e),n=function(e){var i,s,r,o;e.getElements("button").each((function(a){if(!a.hasEvent("click"))switch(a.getProperty("data-command")){case"copy":a.addEvent("click",(function(){window.dispatchEvent(new Event("store-scroll-offset")),i=e.clone(!0).inject(e,"before"),(s=e.getFirst("input"))&&(i.getFirst("input").value=s.value),n(i),s.select()}));break;case"delete":a.addEvent("click",(function(){window.dispatchEvent(new Event("store-scroll-offset")),t.getChildren().length>1&&e.destroy()}));break;case null:a.addEvent("keydown",(function(n){38==n.event.keyCode?(n.preventDefault(),(r=e.getPrevious("li"))?e.inject(r,"before"):e.inject(t,"bottom"),a.focus()):40==n.event.keyCode&&(n.preventDefault(),(o=e.getNext("li"))?e.inject(o,"after"):e.inject(t.getFirst("li"),"before"),a.focus())}))}}))};!function(e){new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle"})}(t),t.getChildren().each((function(e){n(e)}))},tableWizard:function(e){var t=$(e),n=t.getElement("thead"),i=t.getElement("tbody"),s=function(e){var t,n,i,r,o=e.getChildren();for(i=0;i<o.length;i++)for(n=o[i].getChildren(),r=0;r<n.length;r++)(t=n[r].getFirst("textarea"))&&(t.name=t.name.replace(/\[[0-9]+][[0-9]+]/g,"["+i+"]["+r+"]"));new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){s(e)}})},r=function(e){var t,a,l,c,d,u,h,g=n.getFirst("tr");e.getElements("button").each((function(n){if(!n.hasEvent("click"))switch(n.getProperty("data-command")){case"rcopy":n.addEvent("click",(function(){for(window.dispatchEvent(new Event("store-scroll-offset")),c=new Element("tr"),d=e.getChildren(),h=0;h<d.length;h++)l=d[h].clone(!0).inject(c,"bottom"),(t=d[h].getFirst("textarea"))&&(l.getFirst("textarea").value=t.value);c.inject(e,"after"),r(c),s(i),c.getFirst("td").getFirst("textarea").select()}));break;case"rdelete":n.addEvent("click",(function(){window.dispatchEvent(new Event("store-scroll-offset")),i.getChildren().length>1&&e.destroy(),s(i)}));break;case"ccopy":n.addEvent("click",(function(){for(window.dispatchEvent(new Event("store-scroll-offset")),u=o(n),d=i.getChildren(),h=0;h<d.length;h++)a=d[h].getChildren()[u],l=a.clone(!0).inject(a,"after"),(t=a.getFirst("textarea"))&&(l.getFirst("textarea").value=t.value),r(l);var e=g.getFirst("td");l=e.clone(!0).inject(g.getLast("td"),"before"),r(l),s(i),d[0].getChildren()[u+1].getFirst("textarea").select()}));break;case"cmovel":n.addEvent("click",(function(){if(window.dispatchEvent(new Event("store-scroll-offset")),u=o(n),d=i.getChildren(),u>0)for(h=0;h<d.length;h++)(a=d[h].getChildren()[u]).inject(a.getPrevious(),"before");else for(h=0;h<d.length;h++)(a=d[h].getChildren()[u]).inject(d[h].getLast(),"before");s(i)}));break;case"cmover":n.addEvent("click",(function(){if(window.dispatchEvent(new Event("store-scroll-offset")),u=o(n),d=i.getChildren(),u<e.getChildren().length-2)for(h=0;h<d.length;h++)(a=d[h].getChildren()[u]).inject(a.getNext(),"after");else for(h=0;h<d.length;h++)(a=d[h].getChildren()[u]).inject(d[h].getFirst(),"before");s(i)}));break;case"cdelete":n.addEvent("click",(function(){if(window.dispatchEvent(new Event("store-scroll-offset")),u=o(n),d=i.getChildren(),e.getChildren().length>2){for(h=0;h<d.length;h++)d[h].getChildren()[u].destroy();g.getFirst("td").destroy()}s(i)}));break;case null:n.addEvent("keydown",(function(t){38==t.event.keyCode?(t.preventDefault(),(c=e.getPrevious("tr"))?e.inject(c,"before"):e.inject(i,"bottom"),n.focus(),s(i)):40==t.event.keyCode&&(t.preventDefault(),(c=e.getNext("tr"))?e.inject(c,"after"):e.inject(i,"top"),n.focus(),s(i))}))}}))},o=function(e){var t,n=$(e).getParent("td"),i=n.getParent("tr").getChildren(),s=0;for(t=0;t<i.length&&i[t]!=n;t++)s++;return s};s(i),n.getChildren().each((function(e){r(e)})),i.getChildren().each((function(e){r(e)})),Backend.tableWizardResize()},tableWizardResize:function(e){var t=window.localStorage.getItem("contao_table_wizard_cell_size");if(void 0!==e)t="",$$(".tl_tablewizard textarea").each((function(n){n.setStyle("width",(n.getStyle("width").toInt()*e).round().limit(142,284)),n.setStyle("height",(n.getStyle("height").toInt()*e).round().limit(66,132)),""==t&&(t=n.getStyle("width")+"|"+n.getStyle("height"))})),window.localStorage.setItem("contao_table_wizard_cell_size",t);else if(null!==t){var n=t.split("|");$$(".tl_tablewizard textarea").each((function(e){e.setStyle("width",n[0]),e.setStyle("height",n[1])}))}},tableWizardSetWidth:function(){var e=$("tl_tablewizard");e&&e.setStyle("width",Math.round(.96*e.getParent(".tl_formbody_edit").getComputedSize().width))},optionsWizard:function(e){var t=$(e).getElement("tbody"),n=function(e){var t,i,s,r,o=e.getChildren();for(i=0;i<o.length;i++)for(t=o[i].getChildren(),s=0;s<t.length;s++)(r=t[s].getFirst("input"))&&(r.name=r.name.replace(/\[[0-9]+]/g,"["+i+"]"),"checkbox"==r.type&&(r.id=r.name.replace(/\[[0-9]+]/g,"").replace(/\[/g,"_").replace(/]/g,"")+"_"+i,r.getNext("label").set("for",r.id)));new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){n(e)}})},i=function(e){var s,r,o,a,l;e.getElements("button").each((function(c){if(!c.hasEvent("click"))switch(c.getProperty("data-command")){case"copy":c.addEvent("click",(function(){for(window.dispatchEvent(new Event("store-scroll-offset")),o=new Element("tr"),a=e.getChildren(),l=0;l<a.length;l++)r=a[l].clone(!0).inject(o,"bottom"),(s=a[l].getFirst("input"))&&(r.getFirst("input").value=s.value,"checkbox"==s.type&&(r.getFirst("input").checked=s.checked?"checked":""));o.inject(e,"after"),i(o),n(t),o.getFirst("td").getFirst("input").select()}));break;case"delete":c.addEvent("click",(function(){window.dispatchEvent(new Event("store-scroll-offset")),t.getChildren().length>1&&e.destroy(),n(t)}));break;case null:c.addEvent("keydown",(function(i){38==i.event.keyCode?(i.preventDefault(),(o=e.getPrevious("tr"))?e.inject(o,"before"):e.inject(t,"bottom"),c.focus(),n(t)):40==i.event.keyCode&&(i.preventDefault(),(o=e.getNext("tr"))?e.inject(o,"after"):e.inject(t,"top"),c.focus(),n(t))}))}}))};n(t),t.getChildren().each((function(e){i(e)}))},keyValueWizard:function(e){var t=$(e).getElement("tbody"),n=function(e){var t,i,s,r,o=e.getChildren();for(i=0;i<o.length;i++)for(t=o[i].getChildren(),s=0;s<t.length;s++)(r=t[s].getFirst("input"))&&(r.name=r.name.replace(/\[[0-9]+]/g,"["+i+"]"));new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){n(e)}})},i=function(e){var s,r,o,a,l;e.getElements("button").each((function(c){if(!c.hasEvent("click"))switch(c.getProperty("data-command")){case"copy":c.addEvent("click",(function(){for(window.dispatchEvent(new Event("store-scroll-offset")),o=new Element("tr"),a=e.getChildren(),l=0;l<a.length;l++)r=a[l].clone(!0).inject(o,"bottom"),(s=a[l].getFirst("input"))&&(r.getFirst().value=s.value);o.inject(e,"after"),i(o),n(t),o.getFirst("td").getFirst("input").select()}));break;case"delete":c.addEvent("click",(function(){window.dispatchEvent(new Event("store-scroll-offset")),t.getChildren().length>1&&e.destroy(),n(t)}));break;case null:c.addEvent("keydown",(function(i){38==i.event.keyCode?(i.preventDefault(),(o=e.getPrevious("tr"))?e.inject(o,"before"):e.inject(t,"bottom"),c.focus(),n(t)):40==i.event.keyCode&&(i.preventDefault(),(o=e.getNext("tr"))?e.inject(o,"after"):e.inject(t,"top"),c.focus(),n(t))}))}}))};n(t),t.getChildren().each((function(e){i(e)}))},checkboxWizard:function(e){var t=$(e).getElement(".sortable");!function(e){new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle"})}(t),t.getChildren().each((function(e){!function(e){var n;e.getElements("button").each((function(i){i.hasEvent("click")||i.addEvent("keydown",(function(s){38==s.event.keyCode?(s.preventDefault(),(n=e.getPrevious("span"))?e.inject(n,"before"):e.inject(t,"bottom"),i.focus()):40==s.event.keyCode&&(s.preventDefault(),(n=e.getNext("span"))?e.inject(n,"after"):e.inject(t,"top"),i.focus())}))}))}(e)}))},enableImageSizeWidgets:function(){$$(".tl_image_size").each((function(e){var t=e.getElement("select"),n=e.getChildren("input")[0],i=e.getChildren("input")[1],s=function(){if(""===t.get("value")||0===t.get("value").indexOf("_")||t.get("value").toInt().toString()===t.get("value")){n.readOnly=!0,i.readOnly=!0;var e=$(t.getSelected()[0]).get("text");e=e.split("(").length>1?e.split("(").getLast().split(")")[0].split("x"):["",""],n.set("value","").set("placeholder",1*e[0]||""),i.set("value","").set("placeholder",1*e[1]||"")}else n.set("placeholder",""),i.set("placeholder",""),n.readOnly=!1,i.readOnly=!1};s(),t.addEvent("change",s),t.addEvent("keyup",s)}))},enableToggleSelect:function(){var e,t,n,i,s,r,o=$("tl_listing"),a=function(o){for(t=c.indexOf(o),n=c.indexOf(e),s=Math.min(t,n),r=Math.max(t,n),i=!!c[n].checked;s<=r;s++)c[s].checked=i},l=function(t){var n=this.getElement('input[type="checkbox"],input[type="radio"]'),i=$(t.target).getParent(".limit_toggler");n&&!n.get("disabled")&&null===i&&("radio"!=n.type?(t.shift&&e?a(n):(n.checked=n.checked?"":"checked","Backend.toggleCheckboxes(this)"==n.get("onclick")&&Backend.toggleCheckboxes(n)),e=n):n.checked||(n.checked="checked"))},c=[];o&&(c=o.getElements('input[type="checkbox"]')),$$(".toggle_select").each((function(e){var t=e.retrieve("boundEvent");t&&e.removeEvent("click",t),e.getElements('label,input[type="checkbox"],input[type="radio"]').each((function(e){e.addEvent("click",(function(e){e.stopPropagation()}))})),t=l.bind(e),e.addEvent("click",t),e.store("boundEvent",t)})),c.each((function(t){t.addEvent("click",(function(t){t.shift&&e&&a(this),e=this}))}))},editPreviewWizard:function(e){var t,n,i=(e=$(e)).getElement("img"),s={},r=!1,o=function(){return{x:i.getComputedSize().width,y:i.getComputedSize().height}},a=function(){var e=o(),n=i.getComputedSize();t.setStyles({top:n.computedTop+(s.y.get("value")*e.y).round()+"px",left:n.computedLeft+(s.x.get("value")*e.x).round()+"px",width:(s.width.get("value")*e.x).round()+"px",height:(s.height.get("value")*e.y).round()+"px"}),s.width.get("value").toFloat()&&s.height.get("value").toFloat()?t.setStyle("display",null):t.setStyle("display","none")},l=function(t){t.preventDefault(),r||(r=!0,n={x:t.page.x-e.getPosition().x-i.getComputedSize().computedLeft,y:t.page.y-e.getPosition().y-i.getComputedSize().computedTop},c(t))},c=function(a){if(r){a.preventDefault();var l=i.getComputedSize(),c={x:[Math.max(0,Math.min(l.width,n.x)),Math.max(0,Math.min(l.width,a.page.x-e.getPosition().x-l.computedLeft))],y:[Math.max(0,Math.min(l.height,n.y)),Math.max(0,Math.min(l.height,a.page.y-e.getPosition().y-l.computedTop))]};t.setStyles({top:Math.min(c.y[0],c.y[1])+l.computedTop+"px",left:Math.min(c.x[0],c.x[1])+l.computedLeft+"px",width:Math.abs(c.x[0]-c.x[1])+"px",height:Math.abs(c.y[0]-c.y[1])+"px"}),function(){var e=o(),n=t.getStyles("top","left","width","height"),r=i.getComputedSize(),a={x:Math.max(0,Math.min(1,(n.left.toFloat()-r.computedLeft)/e.x)),y:Math.max(0,Math.min(1,(n.top.toFloat()-r.computedTop)/e.y))};a.width=Math.min(1-a.x,n.width.toFloat()/e.x),a.height=Math.min(1-a.y,n.height.toFloat()/e.y),a.width&&a.height?t.setStyle("display",null):(a.x=a.y=a.width=a.height="",t.setStyle("display","none")),Object.each(a,(function(e,t){s[t].set("value",""===e?"":Number(e).toFixed(15))}))}()}},d=function(e){c(e),r=!1};window.addEvent("domready",(function(){e.getParent(".tl_tbox,.tl_box").getElements('input[name^="importantPart"]').each((function(e){["x","y","width","height"].each((function(t){e.get("name").substr(13,t.length)===t.capitalize()&&(s[t]=e=$(e))}))})),4===Object.getLength(s)&&(Object.each(s,(function(e){e.getParent().setStyle("display","none")})),e.addClass("tl_edit_preview_enabled"),t=new Element("div",{class:"tl_edit_preview_important_part"}).inject(e),a(),i.addEvent("load",a),e.addEvents({mousedown:l,touchstart:l}),$(document.documentElement).addEvents({mousemove:c,touchmove:c,mouseup:d,touchend:d,touchcancel:d,resize:a}))}))},enableFileTreeUpload:function(e,t){e=$(e);var n,i,s,r=t.url,o=new Element("div",{class:"dropzone dropzone-filetree",html:'<span class="dropzone-previews"></span>'}).inject(e,"top");t.previewsContainer=o.getElement(".dropzone-previews"),t.clickable=!1;var a=new Dropzone(e,t);a.on("queuecomplete",(function(){window.location.reload()})),a.on("dragover",(function(t){if(t.dataTransfer&&t.dataTransfer.types&&-1!==t.dataTransfer.types.indexOf("Files")){e.getElements(".tl_folder_dropping").removeClass("tl_folder_dropping");var o=t.target&&$(t.target);if(o){var l=o.match(".tl_folder")?o:o.getParent(".tl_folder");if(l||(l=(l=o.getParent(".parent"))&&l.getPrevious(".tl_folder")),l){var c=l.getElement('img[src$="/icons/new.svg"]');c=c&&c.getParent("a")}}c&&c.href?(a.options.url=""+c.href,l.addClass("tl_folder_dropping"),n!==l&&(n=l,i=(new Date).getTime(),(s=l.getElement("a.foldable"))&&!s.hasClass("foldable--open")&&setTimeout((function(){if(n===l&&i+900<(new Date).getTime()){var e=document.createEvent("HTMLEvents");e.initEvent("click",!0,!0),s.dispatchEvent(e),n=void 0,i=void 0}}),1e3))):(a.options.url=r,n=void 0,i=void 0)}})),a.on("drop",(function(e){e.dataTransfer&&e.dataTransfer.types&&-1!==e.dataTransfer.types.indexOf("Files")&&(o.addClass("dropzone-filetree-enabled"),window.dispatchEvent(new Event("store-scroll-offset")))})),a.on("dragleave",(function(){e.getElements(".tl_folder_dropping").removeClass("tl_folder_dropping"),n=void 0,i=void 0}))},crawl:function(){var e=$("tl_crawl"),t=e.getElement("div.progress-bar"),n=e.getElement("p.progress-count"),i=e.getElement("div.results"),s=e.getElement("p.debug-log");!function e(){let r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];new Request({url:window.location.href,headers:{"Only-Status-Update":r},onSuccess:function(r){var o=JSON.decode(r);!function(e){var r,o=e.total,a=o-e.pending,l=o>0?parseInt(a/o*100,10):100;if(a<1&&l<1&&(a=1,l=10,o=10),t.setStyle("width",l+"%"),t.set("html",l+"%"),t.setAttribute("aria-valuenow",l),n.set("html",a+" / "+o),e.hasDebugLog&&s.setStyle("display","block"),e.hasDebugLog&&s.setStyle("display","block"),e.finished)for(r in t.removeClass("running").addClass("finished"),i.removeClass("running").addClass("finished"),e.results)if(e.results.hasOwnProperty(r)){var c=i.getElement('.result[data-subscriber="'+r+'"] p.summary'),d=i.getElement('.result[data-subscriber="'+r+'"] p.warning'),u=i.getElement('.result[data-subscriber="'+r+'"] p.subscriber-log'),h=e.results[r],g=h.summary;h.warning&&d.set("html",h.warning),h.hasLog&&u.setStyle("display","block"),c.addClass(h.wasSuccessful?"success":"failure"),c.set("html",g)}}(o),o.finished||setTimeout(e,2e3)}}).send()}(!0)}},window.Theme={isWebkit:Browser.chrome||Browser.safari||navigator.userAgent.match(/(?:webkit|khtml)/i),stopClickPropagation:function(){$$(".picker_selector").each((function(e){e.getElements("a").each((function(e){e.addEvent("click",(function(e){e.stopPropagation()}))}))})),$$(".picker_selector,.click2edit").each((function(e){e.getElements('input[type="checkbox"]').each((function(e){e.addEvent("click",(function(e){e.stopPropagation()}))}))}))},setupCtrlClick:function(){$$(".click2edit").each((function(e){e.getElements("a").each((function(e){e.addEvent("click",(function(e){e.stopPropagation()}))})),Browser.Features.Touch?e.addEvent("click",(function(){e.getAttribute("data-visited")?(e.getElements("a").each((function(e){e.hasClass("edit")&&(document.location.href=e.href)})),e.removeAttribute("data-visited")):e.setAttribute("data-visited","1")})):e.addEvent("click",(function(t){(Browser.Platform.mac?t.event.metaKey:t.event.ctrlKey)&&(t.event.shiftKey?e.getElements("a").each((function(e){e.hasClass("children")&&(document.location.href=e.href)})):e.getElements("a").each((function(e){e.hasClass("edit")&&(document.location.href=e.href)})))}))}))},setupTextareaResizing:function(){$$(".tl_textarea").each((function(e){if(!(Browser.ie6||Browser.ie7||Browser.ie8||e.hasClass("noresize")||e.retrieve("autogrow"))){var t=new Element("div",{html:"X",styles:{position:"absolute",top:0,left:"-999em","overflow-x":"hidden"}}).setStyles(e.getStyles("font-size","font-family","width","line-height")).inject(document.body);"border-box"!=e.getStyle("-moz-box-sizing")&&"border-box"!=e.getStyle("-webkit-box-sizing")&&"border-box"!=e.getStyle("box-sizing")||t.setStyles({padding:e.getStyle("padding"),border:e.getStyle("border-left")});var n=Math.max(t.clientHeight,30);e.addEvent("input",(function(){t.set("html",this.get("value").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n|\r\n/g,"<br>X"));var e=Math.max(n,t.getSize().y);this.clientHeight!=e&&this.tween("height",e)})).set("tween",{duration:100}).setStyle("height",n+"px"),e.fireEvent("input"),e.store("autogrow",!0)}}))},setupMenuToggle:function(){var e=$("burger");if(e&&(e.addEvent("click",(function(){document.body.toggleClass("show-navigation"),e.setAttribute("aria-expanded",document.body.hasClass("show-navigation")?"true":"false")})).addEvent("keydown",(function(e){27==e.event.keyCode&&document.body.removeClass("show-navigation")})),window.matchMedia)){var t=window.matchMedia("(max-width:991px)"),n=function(){t.matches?(e.setAttribute("aria-controls","left"),e.setAttribute("aria-expanded",document.body.hasClass("show-navigation")?"true":"false")):(e.removeAttribute("aria-controls"),e.removeAttribute("aria-expanded"))};t.addEventListener("change",n),n()}},setupProfileToggle:function(){var e=$("tmenu");if(e){var t=e.getElement(".submenu"),n=t.getFirst("span").getFirst("button"),i=t.getFirst("ul");t&&n&&i&&(n.setAttribute("aria-controls","tmenu__profile"),n.setAttribute("aria-expanded","false"),i.id="tmenu__profile",n.addEvent("click",(function(e){t.hasClass("active")?(t.removeClass("active"),n.setAttribute("aria-expanded","false")):(t.addClass("active"),n.setAttribute("aria-expanded","true")),e.stopPropagation()})),$(document.body).addEvent("click",(function(){t.hasClass("active")&&t.removeClass("active")})))}},setupSplitButtonToggle:function(){var e=$("sbtog");if(e){var t,n,i=e.getParent(".split-button").getElement("ul");e.addEvent("click",(function(n){t=!1,i.toggleClass("invisible"),e.toggleClass("active"),n.stopPropagation()})),$(document.body).addEvent("click",(function(){t=!1,i.addClass("invisible"),e.removeClass("active")})),$(document.body).addEvent("keydown",(function(e){t=9==e.event.keyCode})),[e].append(i.getElements("button")).each((function(s){s.addEvent("focus",(function(){t&&(i.removeClass("invisible"),e.addClass("active"),clearTimeout(n))})),s.addEvent("blur",(function(){t&&(n=setTimeout((function(){i.addClass("invisible"),e.removeClass("active")}),100))}))})),e.set("tabindex","-1")}}},window.addEvent("domready",(function(){$(document.body).addClass("js"),Browser.Features.Touch&&$(document.body).addClass("touch"),Backend.tableWizardSetWidth(),Backend.enableImageSizeWidgets(),Backend.enableToggleSelect(),null!=Elements.chosen&&$$("select.tl_chosen").chosen(),Theme.stopClickPropagation(),Theme.setupCtrlClick(),Theme.setupTextareaResizing(),Theme.setupMenuToggle(),Theme.setupProfileToggle(),Theme.setupSplitButtonToggle()})),window.addEvent("resize",(function(){Backend.tableWizardSetWidth()})),window.addEvent("ajax_change",(function(){Backend.enableImageSizeWidgets(),Backend.enableToggleSelect(),null!=Elements.chosen&&$$("select.tl_chosen").filter((function(e){return"none"!=e.getStyle("display")})).chosen(),Theme.stopClickPropagation(),Theme.setupCtrlClick(),Theme.setupTextareaResizing()}))},962:function(){window.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll("div.limit_height").forEach((function(e){window.console&&console.warn('Using "limit_height" class on child_record_callback is deprecated. Set a list.sorting.limitHeight in your DCA instead.');const t=e.parentNode.closest(".tl_content");if(t&&(t.classList.contains("wrapper_start")||t.classList.contains("wrapper_stop")))return;const n=Number(e.className.replace(/[^0-9]*/,""));if(!n)return;const i=window.getComputedStyle(e,null),s=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom);if(e.clientHeight-s<=n)return;e.style.height=n+"px";const r=document.createElement("button");r.setAttribute("type","button"),r.title=Contao.lang.expand,r.innerHTML="<span>...</span>",r.classList.add("unselectable"),r.addEventListener("click",(function(){"auto"==e.style.height?(e.style.height=n+"px",r.title=Contao.lang.expand):(e.style.height="auto",r.title=Contao.lang.collapse)}));const o=document.createElement("div");o.classList.add("limit_toggler"),o.append(r),e.append(o)}))}))},801:function(){!function(){"use strict";const e=new WeakMap,t=new Event("store-scroll-offset"),n=n=>{if(e.has(n))return;if(9!==n.querySelectorAll("select, button, a.module_link, img.module_image").length)return;e.set(n,!0);const i=n.closest("tbody"),s=e=>{Array.from(e.children).forEach(((e,t)=>{e.querySelectorAll("input, select").forEach((e=>{e.name=e.name.replace(/\[[0-9]+]/g,"["+t+"]")}))})),new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){s(e)}})},r=n=>{n.querySelectorAll("button").forEach((o=>{switch(o.dataset.command){case"copy":o.addEventListener("click",(()=>{window.dispatchEvent(t);const o=n.cloneNode(!0),a=n.querySelectorAll("select"),l=o.querySelectorAll("select");for(let e=0;e<a.length;e++)l[e].value=a[e].value;o.querySelectorAll("[data-original-title]").forEach((e=>{e.setAttribute("title",e.getAttribute("data-original-title")),e.removeAttribute("data-original-title")})),e.set(o,!0),n.parentNode.insertBefore(o,n.nextSibling);const c=o.querySelector("select.tl_select");c.removeAttribute("id"),o.querySelector(".chzn-container").remove(),new Chosen(c),r(o),s(i)}));break;case"delete":o.addEventListener("click",(()=>{window.dispatchEvent(t),i.children.length>1?n.remove():n.querySelectorAll("select").forEach((e=>{e.value=e.children[0].value})),s(i)}));break;case"enable":o.addEventListener("click",(function(){window.dispatchEvent(t);const e=o.previousElementSibling;e.checked?e.checked="":e.checked="checked"}));break;default:o.classList.contains("drag-handle")&&o.addEventListener("keydown",(e=>{"ArrowUp"===e.code||38===e.keyCode?(e.preventDefault(),n.previousElementSibling?n.previousElementSibling.insertAdjacentElement("beforebegin",n):i.insertAdjacentElement("beforeend",n),o.focus(),s(i)):"ArrowDown"!==e.code&&40!==e.keyCode||(e.preventDefault(),n.nextElementSibling?n.nextElementSibling.insertAdjacentElement("afterend",n):i.insertAdjacentElement("afterbegin",n),o.focus(),s(i))}))}}));const o=n.querySelector("td:first-child select");if(!o)return;const a=n.querySelector("a.module_link"),l=n.querySelectorAll("img.module_image"),c=()=>{a.href=a.href.replace(/id=[0-9]+/,"id="+o.value),o.value>0?(a.classList.remove("hidden"),l.forEach((e=>{e.classList.add("hidden")}))):(a.classList.add("hidden"),l.forEach((e=>{e.classList.remove("hidden")})))};o.addEventListener("change",c),o.addEvent("change",c)};s(i),r(n)};document.querySelectorAll(".tl_modulewizard tr").forEach(n),new MutationObserver((function(e){for(const t of e)"childList"===t.type&&t.addedNodes.forEach((function(e){e.matches&&e.matches(".tl_modulewizard tr, .tl_modulewizard tr *")&&n(e.closest("tr"))}))})).observe(document,{attributes:!1,childList:!0,subtree:!0})}()},845:function(){Request.Contao=new Class({Extends:Request.JSON,options:{followRedirects:!0,url:window.location.href},initialize:function(e){e&&!e.url&&e.field&&e.field.form&&e.field.form.action&&(this.options.url=e.field.form.action),this.parent(e)},success:function(e){var t,n=this.getHeader("X-Ajax-Location");if(n&&this.options.followRedirects)location.replace(n);else{try{t=this.response.json=JSON.decode(e,this.options.secure)}catch(n){t={content:e}}null===t?t={content:""}:"object"!=typeof t&&(t={content:e}),""!=t.content&&(t.content=t.content.stripScripts((function(e){t.javascript=e.replace(/<!--|\/\/-->|<!\[CDATA\[\/\/>|<!]]>/g,"")})),t.javascript&&this.options.evalScripts&&Browser.exec(t.javascript)),this.onSuccess(t.content,t)}},failure:function(){var e=this.getHeader("X-Ajax-Location");e&&401===this.status||e&&this.options.followRedirects&&this.status>=300&&this.status<400?location.replace(e):this.onFailure()}}),Class.refactor(Drag,{attach:function(){return this.handles.addEvent("touchstart",this.bound.start),this.previous.apply(this,arguments)},detach:function(){return this.handles.removeEvent("touchstart",this.bound.start),this.previous.apply(this,arguments)},start:function(){document.addEvents({touchmove:this.bound.check,touchend:this.bound.cancel}),this.previous.apply(this,arguments)},check:function(e){this.options.preventDefault&&e.preventDefault(),Math.round(Math.sqrt(Math.pow(e.page.x-this.mouse.start.x,2)+Math.pow(e.page.y-this.mouse.start.y,2)))>this.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop}),document.addEvents({touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent("start",[this.element,e]).fireEvent("snap",this.element))},cancel:function(){return document.removeEvents({touchmove:this.bound.check,touchend:this.bound.cancel}),this.previous.apply(this,arguments)},stop:function(){return document.removeEvents({touchmove:this.bound.drag,touchend:this.bound.stop}),this.previous.apply(this,arguments)}}),Class.refactor(Sortables,{initialize:function(e,t){return t.dragOptions=Object.merge(t.dragOptions||{},{preventDefault:t.dragOptions&&t.dragOptions.preventDefault||Browser.Features.Touch}),void 0===t.dragOptions.unDraggableTags&&(t.dragOptions.unDraggableTags=this.options.unDraggableTags.filter((function(e){return"button"!=e}))),this.previous.apply(this,arguments)},addItems:function(){return Array.flatten(arguments).each((function(e){this.elements.push(e);var t=e.retrieve("sortables:start",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle&&e.getElement(this.options.handle)||e).addEvents({mousedown:t,touchstart:t})}),this),this},removeItems:function(){return $$(Array.flatten(arguments).map((function(e){this.elements.erase(e);var t=e.retrieve("sortables:start");return(this.options.handle&&e.getElement(this.options.handle)||e).removeEvents({mousedown:t,touchend:t}),e}),this))},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if("function"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var n=this.previous.apply(this,arguments);return n.addEvent("touchstart",(function(e){t.fireEvent("touchstart",e)})),n}}),Class.refactor(Request.Queue,{onComplete:function(){this.fireEvent("complete",arguments)},onCancel:function(){this.options.autoAdvance&&!this.error&&this.resume(),this.fireEvent("cancel",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.resume(),this.fireEvent("success",arguments),this.queue.length||this.isRunning()||this.fireEvent("end")},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.resume(),this.fireEvent("failure",arguments),this.queue.length||this.isRunning()||this.fireEvent("end")},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.resume(),this.fireEvent("exception",arguments)}}),Contao.SerpPreview=new Class({options:{id:0,trail:null,titleField:null,titleFallbackField:null,aliasField:null,descriptionField:null,descriptionFallbackField:null,titleTag:null},shorten:function(e,t){return e.length<=t?e:e.substr(0,e.lastIndexOf(" ",t))+" …"},html2string:function(e){return(new DOMParser).parseFromString(e,"text/html").body.textContent.replace(/\[-]/g,"­").replace(/\[nbsp]/g," ")},getTinymce:function(){if(window.tinyMCE&&this.options.descriptionFallbackField)return window.tinyMCE.get(this.options.descriptionFallbackField)},initialize:function(){this.options=Object.merge.apply(null,[{},this.options].append(arguments));var e=$("serp_title_"+this.options.id),t=$("serp_url_"+this.options.id),n=$("serp_description_"+this.options.id),i=$(this.options.titleField),s=$(this.options.titleFallbackField),r=$(this.options.aliasField),o=$(this.options.descriptionField),a=$(this.options.descriptionFallbackField),l=-1===this.options.trail.indexOf("›"),c=this.options.titleTag||"%s";i&&i.addEvent("input",function(){i.value?e.set("text",this.shorten(this.html2string(c.replace(/%s/,i.value)).replace(/%%/g,"%"),64)):s&&s.value?e.set("text",this.shorten(this.html2string(c.replace(/%s/,s.value)).replace(/%%/g,"%"),64)):e.set("text","")}.bind(this)),s&&s.addEvent("input",function(){i&&i.value||e.set("text",this.shorten(this.html2string(c.replace(/%s/,s.value)).replace(/%%/g,"%"),64))}.bind(this)),r&&r.addEvent("input",function(){"index"==r.value&&l?t.set("text",this.options.trail):t.set("text",this.options.trail+" › "+(r.value||this.options.id).replace(/\//g," › "))}.bind(this)),o&&o.addEvent("input",function(){if(o.value)n.set("text",this.shorten(o.value,160));else{var e=this.getTinymce();e?n.set("text",this.shorten(this.html2string(e.getContent()),160)):a&&a.value?n.set("text",this.shorten(this.html2string(a.value),160)):n.set("text","")}}.bind(this)),a&&a.addEvent("input",function(){o&&o.value||n.set("text",this.shorten(this.html2string(a.value),160))}.bind(this)),setTimeout(function(){var e=this.getTinymce();e&&e.on("keyup",function(){o&&o.value||n.set("text",this.shorten(this.html2string(window.tinyMCE.activeEditor.getContent()),160))}.bind(this))}.bind(this),4)}})},905:function(){!function(){"use strict";const e=new WeakMap,t=new Event("store-scroll-offset"),n=n=>{if(e.has(n))return;if(7!==n.querySelectorAll("input, select, button").length)return;e.set(n,!0);const i=n.closest("tbody"),s=e=>{Array.from(e.children).forEach(((e,t)=>{e.querySelectorAll("input, select").forEach((e=>{e.name=e.name.replace(/\[[0-9]+]/g,"["+t+"]")}))})),new Sortables(e,{constrain:!0,opacity:.6,handle:".drag-handle",onComplete:function(){s(e)}})},r=e=>{e.querySelectorAll("button").forEach((n=>{switch(n.dataset.command){case"copy":n.addEventListener("click",(()=>{window.dispatchEvent(t);const n=e.cloneNode(!0),o=e.querySelectorAll("select"),a=n.querySelectorAll("select");for(let e=0;e<o.length;e++)a[e].value=o[e].value;e.parentNode.insertBefore(n,e.nextSibling),r(n),s(i)}));break;case"delete":n.addEventListener("click",(()=>{window.dispatchEvent(t),i.children.length>1?e.remove():(e.querySelectorAll("input").forEach((e=>{e.value=""})),e.querySelectorAll("select").forEach((e=>{e.value=e.children[0].value}))),s(i)}));break;default:n.classList.contains("drag-handle")&&n.addEventListener("keydown",(t=>{"ArrowUp"===t.code||38===t.keyCode?(t.preventDefault(),e.previousElementSibling?e.previousElementSibling.insertAdjacentElement("beforebegin",e):i.insertAdjacentElement("beforeend",e),n.focus(),s(i)):"ArrowDown"!==t.code&&40!==t.keyCode||(t.preventDefault(),e.nextElementSibling?e.nextElementSibling.insertAdjacentElement("afterend",e):i.insertAdjacentElement("afterbegin",e),n.focus(),s(i))}))}}))};s(i),r(n)};document.querySelectorAll(".tl_sectionwizard tr").forEach(n),new MutationObserver((function(e){for(const t of e)"childList"===t.type&&t.addedNodes.forEach((function(e){e.matches&&e.matches(".tl_sectionwizard tr, .tl_sectionwizard tr *")&&n(e.closest("tr"))}))})).observe(document,{attributes:!1,childList:!0,subtree:!0})}()},502:function(){!function(){const e=[],t=document.createElement("div");t.setAttribute("role","tooltip"),t.classList.add("tip"),t.style.position="absolute",t.style.display="none";const n=function(n,i,s,r){if(e.includes(n))return;let o,a;e.push(n),n.addEventListener("mouseenter",(function(){r?o=n.innerHTML:(o=n.getAttribute("title"),n.setAttribute("data-original-title",o),n.removeAttribute("title"),o=o?.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")),o&&(clearTimeout(a),t.style.willChange="display,contents",a=setTimeout((function(){const e=n.getBoundingClientRect(),r="rtl"===getComputedStyle(n).direction,a=document.html.clientWidth;r&&e.x<200||!r&&e.x<a-200?(t.style.left=`${window.scrollX+e.left+i}px`,t.style.right="auto",t.classList.remove("tip--rtl")):(t.style.left="auto",t.style.right=`${a-window.scrollX-e.right+i}px`,t.classList.add("tip--rtl")),t.innerHTML=`<div>${o}</div>`,t.style.top=`${window.scrollY+e.top+s}px`,t.style.display="block",t.style.willChange="auto",!t.parentNode&&document.body&&document.body.append(t)}),1e3))})),n.addEventListener("mouseleave",(function(){n.hasAttribute("data-original-title")&&(n.hasAttribute("title")||n.setAttribute("title",n.getAttribute("data-original-title")),n.removeAttribute("data-original-title")),clearTimeout(a),t.style.willChange="auto","block"===t.style.display&&(t.style.willChange="display",a=setTimeout((function(){t.style.display="none",t.style.willChange="auto"}),100))}));const l=n.closest("button, a");l&&l.addEventListener("click",(function(){clearTimeout(a),t.style.display="none",t.style.willChange="auto"}))};function i(e,t){return e.matches(t)?[e,...e.querySelectorAll(t)]:e.querySelectorAll(t)}function s(e){i(e,"p.tl_tip").forEach((function(e){n(e,0,23,!0)})),i(e,"#home").forEach((function(e){n(e,6,42)})),i(e,"#tmenu a[title]").forEach((function(e){n(e,0,42)})),i(e,'a[title][class^="group-"]').forEach((function(e){n(e,-6,27)})),i(e,"a[title].navigation").forEach((function(e){n(e,25,32)})),i(e,"img[title]").forEach((function(e){n(e,-9,e.classList.contains("gimage")?60:30)})),i(e,"a[title]").forEach((function(e){e.classList.contains("picker-wizard")?n(e,-4,30):n(e,-9,30)})),i(e,"button[title]").forEach((function(e){e.classList.contains("unselectable")?n(e,-4,20):n(e,-9,30)})),["input[title]","time[title]","span[title]"].forEach((function(t){i(e,t).forEach((function(e){n(e,-9,"time[title]"===t||"span[title]"===t?26:30)}))}))}s(document.documentElement),new MutationObserver((function(e){for(const t of e)"childList"===t.type&&t.addedNodes.forEach((function(e){e.matches&&e.querySelectorAll&&s(e)}))})).observe(document,{attributes:!1,childList:!0,subtree:!0})}()},483:function(e,t,n){var i={"./clipboard-controller.js":424,"./color-scheme-controller.js":1,"./image-size-controller.js":572,"./jump-targets-controller.js":395,"./limit-height-controller.js":780,"./metawizard-controller.js":208,"./scroll-offset-controller.js":423,"./toggle-fieldset-controller.js":991,"./toggle-navigation-controller.js":441,"./toggle-nodes-controller.js":577};function s(e){var t=r(e);return n(t)}function r(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}s.keys=function(){return Object.keys(i)},s.resolve=r,e.exports=s,s.id=483}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){"use strict";var e=n(667);function t(e,t){const n=e.default;if("function"==typeof n)return{identifier:t,controllerConstructor:n}}function i(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}n(845),n(95),n(962),n(801),n(905),n(502);const s=e.Mx.start();s.debug=!1;const r=n(483);s.load(r.keys().map((e=>{const n=i(e);if(n)return t(r(e),`contao--${n}`)})).filter((e=>e)))}()}();
//# sourceMappingURL=backend.7d12ce36.js.map
{"version":3,"file":"backend.7d12ce36.js","mappings":"8GAIA,MAAMA,EACF,WAAAC,CAAYC,EAAaC,EAAWC,GAChCC,KAAKH,YAAcA,EACnBG,KAAKF,UAAYA,EACjBE,KAAKD,aAAeA,EACpBC,KAAKC,kBAAoB,IAAIC,GACjC,CACA,OAAAC,GACIH,KAAKH,YAAYO,iBAAiBJ,KAAKF,UAAWE,KA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re,QAChCJ,EAAY0e,OAAQutB,EAEpB,MAAMrkC,EAAUskC,EAAAA,KAChBlsC,EAAYgf,KAAKpX,EAAQ9F,OAAOlB,KAAKmB,IACjC,MAAMwC,EAAawnC,EAAwBhqC,GAC3C,GAAIwC,EACA,OAAOunC,EAAiClkC,EAAQ7F,GAAO,WAAWwC,IACtE,IACDqB,QAAQzD,GAAUA,I","sources":["webpack:///../../.yarn/berry/cache/@hotwired-stimulus-npm-3.2.2-e1e064f1fe-10c0.zip/node_modules/@hotwired/stimulus/dist/stimulus.js","webpack:///./core-bundle/assets/controllers/clipboard-controller.js","webpack:///./core-bundle/assets/controllers/color-scheme-controller.js","webpack:///./core-bundle/assets/controllers/image-size-controller.js","webpack:///./core-bundle/assets/controllers/jump-targets-controller.js","webpack:///./core-bundle/assets/controllers/limit-height-controller.js","webpack:///./core-bundle/assets/controllers/metawizard-controller.js","webpack:///./core-bundle/assets/controllers/scroll-offset-controller.js","webpack:///./core-bundle/assets/controllers/toggle-fieldset-controller.js","webpack:///./core-bundle/assets/controllers/toggle-navigation-controller.js","webpack:///./core-bundle/assets/controllers/toggle-nodes-controller.js","webpack:///./core-bundle/assets/scripts/core.js","webpack:///./core-bundle/assets/scripts/limit-height.js","webpack:///./core-bundle/assets/scripts/modulewizard.js","webpack:///./core-bundle/assets/scripts/mootao.js","webpack:///./core-bundle/assets/scripts/sectionwizard.js","webpack:///./core-bundle/assets/scripts/tips.js","webpack:///./core-bundle/assets/controllers/ sync \\.js$","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./.yarn/__virtual__/@hotwired-stimulus-webpack-helpers-virtual-5fc151b2eb/3/.yarn/berry/cache/@hotwired-stimulus-webpack-helpers-npm-1.0.1-91fa2baa17-10c0.zip/node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js","webpack:///./core-bundle/assets/backend.js"],"sourcesContent":["/*\nStimulus 3.2.1\nCopyright © 2023 Basecamp, LLC\n */\nclass EventListener {\n    constructor(eventTarget, eventName, eventOptions) {\n        this.eventTarget = eventTarget;\n        this.eventName = eventName;\n        this.eventOptions = eventOptions;\n        this.unorderedBindings = new Set();\n    }\n    connect() {\n        this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n    }\n    disconnect() {\n        this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n    }\n    bindingConnected(binding) {\n        this.unorderedBindings.add(binding);\n    }\n    bindingDisconnected(binding) {\n        this.unorderedBindings.delete(binding);\n    }\n    handleEvent(event) {\n        const extendedEvent = extendEvent(event);\n        for (const binding of this.bindings) {\n            if (extendedEvent.immediatePropagationStopped) {\n                break;\n            }\n            else {\n                binding.handleEvent(extendedEvent);\n            }\n        }\n    }\n    hasBindings() {\n        return this.unorderedBindings.size > 0;\n    }\n    get bindings() {\n        return Array.from(this.unorderedBindings).sort((left, right) => {\n            const leftIndex = left.index, rightIndex = right.index;\n            return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n        });\n    }\n}\nfunction extendEvent(event) {\n    if (\"immediatePropagationStopped\" in event) {\n        return event;\n    }\n    else {\n        const { stopImmediatePropagation } = event;\n        return Object.assign(event, {\n            immediatePropagationStopped: false,\n            stopImmediatePropagation() {\n                this.immediatePropagationStopped = true;\n                stopImmediatePropagation.call(this);\n            },\n        });\n    }\n}\n\nclass Dispatcher {\n    constructor(application) {\n        this.application = application;\n        this.eventListenerMaps = new Map();\n        this.started = false;\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.eventListeners.forEach((eventListener) => eventListener.connect());\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            this.eventListeners.forEach((eventListener) => eventListener.disconnect());\n        }\n    }\n    get eventListeners() {\n        return Array.from(this.eventListenerMaps.values()).reduce((listeners, map) => listeners.concat(Array.from(map.values())), []);\n    }\n    bindingConnected(binding) {\n        this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n    }\n    bindingDisconnected(binding, clearEventListeners = false) {\n        this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n        if (clearEventListeners)\n            this.clearEventListenersForBinding(binding);\n    }\n    handleError(error, message, detail = {}) {\n        this.application.handleError(error, `Error ${message}`, detail);\n    }\n    clearEventListenersForBinding(binding) {\n        const eventListener = this.fetchEventListenerForBinding(binding);\n        if (!eventListener.hasBindings()) {\n            eventListener.disconnect();\n            this.removeMappedEventListenerFor(binding);\n        }\n    }\n    removeMappedEventListenerFor(binding) {\n        const { eventTarget, eventName, eventOptions } = binding;\n        const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n        const cacheKey = this.cacheKey(eventName, eventOptions);\n        eventListenerMap.delete(cacheKey);\n        if (eventListenerMap.size == 0)\n            this.eventListenerMaps.delete(eventTarget);\n    }\n    fetchEventListenerForBinding(binding) {\n        const { eventTarget, eventName, eventOptions } = binding;\n        return this.fetchEventListener(eventTarget, eventName, eventOptions);\n    }\n    fetchEventListener(eventTarget, eventName, eventOptions) {\n        const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n        const cacheKey = this.cacheKey(eventName, eventOptions);\n        let eventListener = eventListenerMap.get(cacheKey);\n        if (!eventListener) {\n            eventListener = this.createEventListener(eventTarget, eventName, eventOptions);\n            eventListenerMap.set(cacheKey, eventListener);\n        }\n        return eventListener;\n    }\n    createEventListener(eventTarget, eventName, eventOptions) {\n        const eventListener = new EventListener(eventTarget, eventName, eventOptions);\n        if (this.started) {\n            eventListener.connect();\n        }\n        return eventListener;\n    }\n    fetchEventListenerMapForEventTarget(eventTarget) {\n        let eventListenerMap = this.eventListenerMaps.get(eventTarget);\n        if (!eventListenerMap) {\n            eventListenerMap = new Map();\n            this.eventListenerMaps.set(eventTarget, eventListenerMap);\n        }\n        return eventListenerMap;\n    }\n    cacheKey(eventName, eventOptions) {\n        const parts = [eventName];\n        Object.keys(eventOptions)\n            .sort()\n            .forEach((key) => {\n            parts.push(`${eventOptions[key] ? \"\" : \"!\"}${key}`);\n        });\n        return parts.join(\":\");\n    }\n}\n\nconst defaultActionDescriptorFilters = {\n    stop({ event, value }) {\n        if (value)\n            event.stopPropagation();\n        return true;\n    },\n    prevent({ event, value }) {\n        if (value)\n            event.preventDefault();\n        return true;\n    },\n    self({ event, value, element }) {\n        if (value) {\n            return element === event.target;\n        }\n        else {\n            return true;\n        }\n    },\n};\nconst descriptorPattern = /^(?:(?:([^.]+?)\\+)?(.+?)(?:\\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n    const source = descriptorString.trim();\n    const matches = source.match(descriptorPattern) || [];\n    let eventName = matches[2];\n    let keyFilter = matches[3];\n    if (keyFilter && ![\"keydown\", \"keyup\", \"keypress\"].includes(eventName)) {\n        eventName += `.${keyFilter}`;\n        keyFilter = \"\";\n    }\n    return {\n        eventTarget: parseEventTarget(matches[4]),\n        eventName,\n        eventOptions: matches[7] ? parseEventOptions(matches[7]) : {},\n        identifier: matches[5],\n        methodName: matches[6],\n        keyFilter: matches[1] || keyFilter,\n    };\n}\nfunction parseEventTarget(eventTargetName) {\n    if (eventTargetName == \"window\") {\n        return window;\n    }\n    else if (eventTargetName == \"document\") {\n        return document;\n    }\n}\nfunction parseEventOptions(eventOptions) {\n    return eventOptions\n        .split(\":\")\n        .reduce((options, token) => Object.assign(options, { [token.replace(/^!/, \"\")]: !/^!/.test(token) }), {});\n}\nfunction stringifyEventTarget(eventTarget) {\n    if (eventTarget == window) {\n        return \"window\";\n    }\n    else if (eventTarget == document) {\n        return \"document\";\n    }\n}\n\nfunction camelize(value) {\n    return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());\n}\nfunction namespaceCamelize(value) {\n    return camelize(value.replace(/--/g, \"-\").replace(/__/g, \"_\"));\n}\nfunction capitalize(value) {\n    return value.charAt(0).toUpperCase() + value.slice(1);\n}\nfunction dasherize(value) {\n    return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`);\n}\nfunction tokenize(value) {\n    return value.match(/[^\\s]+/g) || [];\n}\n\nfunction isSomething(object) {\n    return object !== null && object !== undefined;\n}\nfunction hasProperty(object, property) {\n    return Object.prototype.hasOwnProperty.call(object, property);\n}\n\nconst allModifiers = [\"meta\", \"ctrl\", \"alt\", \"shift\"];\nclass Action {\n    constructor(element, index, descriptor, schema) {\n        this.element = element;\n        this.index = index;\n        this.eventTarget = descriptor.eventTarget || element;\n        this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error(\"missing event name\");\n        this.eventOptions = descriptor.eventOptions || {};\n        this.identifier = descriptor.identifier || error(\"missing identifier\");\n        this.methodName = descriptor.methodName || error(\"missing method name\");\n        this.keyFilter = descriptor.keyFilter || \"\";\n        this.schema = schema;\n    }\n    static forToken(token, schema) {\n        return new this(token.element, token.index, parseActionDescriptorString(token.content), schema);\n    }\n    toString() {\n        const eventFilter = this.keyFilter ? `.${this.keyFilter}` : \"\";\n        const eventTarget = this.eventTargetName ? `@${this.eventTargetName}` : \"\";\n        return `${this.eventName}${eventFilter}${eventTarget}->${this.identifier}#${this.methodName}`;\n    }\n    shouldIgnoreKeyboardEvent(event) {\n        if (!this.keyFilter) {\n            return false;\n        }\n        const filters = this.keyFilter.split(\"+\");\n        if (this.keyFilterDissatisfied(event, filters)) {\n            return true;\n        }\n        const standardFilter = filters.filter((key) => !allModifiers.includes(key))[0];\n        if (!standardFilter) {\n            return false;\n        }\n        if (!hasProperty(this.keyMappings, standardFilter)) {\n            error(`contains unknown key filter: ${this.keyFilter}`);\n        }\n        return this.keyMappings[standardFilter].toLowerCase() !== event.key.toLowerCase();\n    }\n    shouldIgnoreMouseEvent(event) {\n        if (!this.keyFilter) {\n            return false;\n        }\n        const filters = [this.keyFilter];\n        if (this.keyFilterDissatisfied(event, filters)) {\n            return true;\n        }\n        return false;\n    }\n    get params() {\n        const params = {};\n        const pattern = new RegExp(`^data-${this.identifier}-(.+)-param$`, \"i\");\n        for (const { name, value } of Array.from(this.element.attributes)) {\n            const match = name.match(pattern);\n            const key = match && match[1];\n            if (key) {\n                params[camelize(key)] = typecast(value);\n            }\n        }\n        return params;\n    }\n    get eventTargetName() {\n        return stringifyEventTarget(this.eventTarget);\n    }\n    get keyMappings() {\n        return this.schema.keyMappings;\n    }\n    keyFilterDissatisfied(event, filters) {\n        const [meta, ctrl, alt, shift] = allModifiers.map((modifier) => filters.includes(modifier));\n        return event.metaKey !== meta || event.ctrlKey !== ctrl || event.altKey !== alt || event.shiftKey !== shift;\n    }\n}\nconst defaultEventNames = {\n    a: () => \"click\",\n    button: () => \"click\",\n    form: () => \"submit\",\n    details: () => \"toggle\",\n    input: (e) => (e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\"),\n    select: () => \"change\",\n    textarea: () => \"input\",\n};\nfunction getDefaultEventNameForElement(element) {\n    const tagName = element.tagName.toLowerCase();\n    if (tagName in defaultEventNames) {\n        return defaultEventNames[tagName](element);\n    }\n}\nfunction error(message) {\n    throw new Error(message);\n}\nfunction typecast(value) {\n    try {\n        return JSON.parse(value);\n    }\n    catch (o_O) {\n        return value;\n    }\n}\n\nclass Binding {\n    constructor(context, action) {\n        this.context = context;\n        this.action = action;\n    }\n    get index() {\n        return this.action.index;\n    }\n    get eventTarget() {\n        return this.action.eventTarget;\n    }\n    get eventOptions() {\n        return this.action.eventOptions;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    handleEvent(event) {\n        const actionEvent = this.prepareActionEvent(event);\n        if (this.willBeInvokedByEvent(event) && this.applyEventModifiers(actionEvent)) {\n            this.invokeWithEvent(actionEvent);\n        }\n    }\n    get eventName() {\n        return this.action.eventName;\n    }\n    get method() {\n        const method = this.controller[this.methodName];\n        if (typeof method == \"function\") {\n            return method;\n        }\n        throw new Error(`Action \"${this.action}\" references undefined method \"${this.methodName}\"`);\n    }\n    applyEventModifiers(event) {\n        const { element } = this.action;\n        const { actionDescriptorFilters } = this.context.application;\n        const { controller } = this.context;\n        let passes = true;\n        for (const [name, value] of Object.entries(this.eventOptions)) {\n            if (name in actionDescriptorFilters) {\n                const filter = actionDescriptorFilters[name];\n                passes = passes && filter({ name, value, event, element, controller });\n            }\n            else {\n                continue;\n            }\n        }\n        return passes;\n    }\n    prepareActionEvent(event) {\n        return Object.assign(event, { params: this.action.params });\n    }\n    invokeWithEvent(event) {\n        const { target, currentTarget } = event;\n        try {\n            this.method.call(this.controller, event);\n            this.context.logDebugActivity(this.methodName, { event, target, currentTarget, action: this.methodName });\n        }\n        catch (error) {\n            const { identifier, controller, element, index } = this;\n            const detail = { identifier, controller, element, index, event };\n            this.context.handleError(error, `invoking action \"${this.action}\"`, detail);\n        }\n    }\n    willBeInvokedByEvent(event) {\n        const eventTarget = event.target;\n        if (event instanceof KeyboardEvent && this.action.shouldIgnoreKeyboardEvent(event)) {\n            return false;\n        }\n        if (event instanceof MouseEvent && this.action.shouldIgnoreMouseEvent(event)) {\n            return false;\n        }\n        if (this.element === eventTarget) {\n            return true;\n        }\n        else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n            return this.scope.containsElement(eventTarget);\n        }\n        else {\n            return this.scope.containsElement(this.action.element);\n        }\n    }\n    get controller() {\n        return this.context.controller;\n    }\n    get methodName() {\n        return this.action.methodName;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n}\n\nclass ElementObserver {\n    constructor(element, delegate) {\n        this.mutationObserverInit = { attributes: true, childList: true, subtree: true };\n        this.element = element;\n        this.started = false;\n        this.delegate = delegate;\n        this.elements = new Set();\n        this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.mutationObserver.observe(this.element, this.mutationObserverInit);\n            this.refresh();\n        }\n    }\n    pause(callback) {\n        if (this.started) {\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n        callback();\n        if (!this.started) {\n            this.mutationObserver.observe(this.element, this.mutationObserverInit);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.mutationObserver.takeRecords();\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n    }\n    refresh() {\n        if (this.started) {\n            const matches = new Set(this.matchElementsInTree());\n            for (const element of Array.from(this.elements)) {\n                if (!matches.has(element)) {\n                    this.removeElement(element);\n                }\n            }\n            for (const element of Array.from(matches)) {\n                this.addElement(element);\n            }\n        }\n    }\n    processMutations(mutations) {\n        if (this.started) {\n            for (const mutation of mutations) {\n                this.processMutation(mutation);\n            }\n        }\n    }\n    processMutation(mutation) {\n        if (mutation.type == \"attributes\") {\n            this.processAttributeChange(mutation.target, mutation.attributeName);\n        }\n        else if (mutation.type == \"childList\") {\n            this.processRemovedNodes(mutation.removedNodes);\n            this.processAddedNodes(mutation.addedNodes);\n        }\n    }\n    processAttributeChange(element, attributeName) {\n        if (this.elements.has(element)) {\n            if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n                this.delegate.elementAttributeChanged(element, attributeName);\n            }\n            else {\n                this.removeElement(element);\n            }\n        }\n        else if (this.matchElement(element)) {\n            this.addElement(element);\n        }\n    }\n    processRemovedNodes(nodes) {\n        for (const node of Array.from(nodes)) {\n            const element = this.elementFromNode(node);\n            if (element) {\n                this.processTree(element, this.removeElement);\n            }\n        }\n    }\n    processAddedNodes(nodes) {\n        for (const node of Array.from(nodes)) {\n            const element = this.elementFromNode(node);\n            if (element && this.elementIsActive(element)) {\n                this.processTree(element, this.addElement);\n            }\n        }\n    }\n    matchElement(element) {\n        return this.delegate.matchElement(element);\n    }\n    matchElementsInTree(tree = this.element) {\n        return this.delegate.matchElementsInTree(tree);\n    }\n    processTree(tree, processor) {\n        for (const element of this.matchElementsInTree(tree)) {\n            processor.call(this, element);\n        }\n    }\n    elementFromNode(node) {\n        if (node.nodeType == Node.ELEMENT_NODE) {\n            return node;\n        }\n    }\n    elementIsActive(element) {\n        if (element.isConnected != this.element.isConnected) {\n            return false;\n        }\n        else {\n            return this.element.contains(element);\n        }\n    }\n    addElement(element) {\n        if (!this.elements.has(element)) {\n            if (this.elementIsActive(element)) {\n                this.elements.add(element);\n                if (this.delegate.elementMatched) {\n                    this.delegate.elementMatched(element);\n                }\n            }\n        }\n    }\n    removeElement(element) {\n        if (this.elements.has(element)) {\n            this.elements.delete(element);\n            if (this.delegate.elementUnmatched) {\n                this.delegate.elementUnmatched(element);\n            }\n        }\n    }\n}\n\nclass AttributeObserver {\n    constructor(element, attributeName, delegate) {\n        this.attributeName = attributeName;\n        this.delegate = delegate;\n        this.elementObserver = new ElementObserver(element, this);\n    }\n    get element() {\n        return this.elementObserver.element;\n    }\n    get selector() {\n        return `[${this.attributeName}]`;\n    }\n    start() {\n        this.elementObserver.start();\n    }\n    pause(callback) {\n        this.elementObserver.pause(callback);\n    }\n    stop() {\n        this.elementObserver.stop();\n    }\n    refresh() {\n        this.elementObserver.refresh();\n    }\n    get started() {\n        return this.elementObserver.started;\n    }\n    matchElement(element) {\n        return element.hasAttribute(this.attributeName);\n    }\n    matchElementsInTree(tree) {\n        const match = this.matchElement(tree) ? [tree] : [];\n        const matches = Array.from(tree.querySelectorAll(this.selector));\n        return match.concat(matches);\n    }\n    elementMatched(element) {\n        if (this.delegate.elementMatchedAttribute) {\n            this.delegate.elementMatchedAttribute(element, this.attributeName);\n        }\n    }\n    elementUnmatched(element) {\n        if (this.delegate.elementUnmatchedAttribute) {\n            this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n        }\n    }\n    elementAttributeChanged(element, attributeName) {\n        if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n            this.delegate.elementAttributeValueChanged(element, attributeName);\n        }\n    }\n}\n\nfunction add(map, key, value) {\n    fetch(map, key).add(value);\n}\nfunction del(map, key, value) {\n    fetch(map, key).delete(value);\n    prune(map, key);\n}\nfunction fetch(map, key) {\n    let values = map.get(key);\n    if (!values) {\n        values = new Set();\n        map.set(key, values);\n    }\n    return values;\n}\nfunction prune(map, key) {\n    const values = map.get(key);\n    if (values != null && values.size == 0) {\n        map.delete(key);\n    }\n}\n\nclass Multimap {\n    constructor() {\n        this.valuesByKey = new Map();\n    }\n    get keys() {\n        return Array.from(this.valuesByKey.keys());\n    }\n    get values() {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.reduce((values, set) => values.concat(Array.from(set)), []);\n    }\n    get size() {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.reduce((size, set) => size + set.size, 0);\n    }\n    add(key, value) {\n        add(this.valuesByKey, key, value);\n    }\n    delete(key, value) {\n        del(this.valuesByKey, key, value);\n    }\n    has(key, value) {\n        const values = this.valuesByKey.get(key);\n        return values != null && values.has(value);\n    }\n    hasKey(key) {\n        return this.valuesByKey.has(key);\n    }\n    hasValue(value) {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.some((set) => set.has(value));\n    }\n    getValuesForKey(key) {\n        const values = this.valuesByKey.get(key);\n        return values ? Array.from(values) : [];\n    }\n    getKeysForValue(value) {\n        return Array.from(this.valuesByKey)\n            .filter(([_key, values]) => values.has(value))\n            .map(([key, _values]) => key);\n    }\n}\n\nclass IndexedMultimap extends Multimap {\n    constructor() {\n        super();\n        this.keysByValue = new Map();\n    }\n    get values() {\n        return Array.from(this.keysByValue.keys());\n    }\n    add(key, value) {\n        super.add(key, value);\n        add(this.keysByValue, value, key);\n    }\n    delete(key, value) {\n        super.delete(key, value);\n        del(this.keysByValue, value, key);\n    }\n    hasValue(value) {\n        return this.keysByValue.has(value);\n    }\n    getKeysForValue(value) {\n        const set = this.keysByValue.get(value);\n        return set ? Array.from(set) : [];\n    }\n}\n\nclass SelectorObserver {\n    constructor(element, selector, delegate, details) {\n        this._selector = selector;\n        this.details = details;\n        this.elementObserver = new ElementObserver(element, this);\n        this.delegate = delegate;\n        this.matchesByElement = new Multimap();\n    }\n    get started() {\n        return this.elementObserver.started;\n    }\n    get selector() {\n        return this._selector;\n    }\n    set selector(selector) {\n        this._selector = selector;\n        this.refresh();\n    }\n    start() {\n        this.elementObserver.start();\n    }\n    pause(callback) {\n        this.elementObserver.pause(callback);\n    }\n    stop() {\n        this.elementObserver.stop();\n    }\n    refresh() {\n        this.elementObserver.refresh();\n    }\n    get element() {\n        return this.elementObserver.element;\n    }\n    matchElement(element) {\n        const { selector } = this;\n        if (selector) {\n            const matches = element.matches(selector);\n            if (this.delegate.selectorMatchElement) {\n                return matches && this.delegate.selectorMatchElement(element, this.details);\n            }\n            return matches;\n        }\n        else {\n            return false;\n        }\n    }\n    matchElementsInTree(tree) {\n        const { selector } = this;\n        if (selector) {\n            const match = this.matchElement(tree) ? [tree] : [];\n            const matches = Array.from(tree.querySelectorAll(selector)).filter((match) => this.matchElement(match));\n            return match.concat(matches);\n        }\n        else {\n            return [];\n        }\n    }\n    elementMatched(element) {\n        const { selector } = this;\n        if (selector) {\n            this.selectorMatched(element, selector);\n        }\n    }\n    elementUnmatched(element) {\n        const selectors = this.matchesByElement.getKeysForValue(element);\n        for (const selector of selectors) {\n            this.selectorUnmatched(element, selector);\n        }\n    }\n    elementAttributeChanged(element, _attributeName) {\n        const { selector } = this;\n        if (selector) {\n            const matches = this.matchElement(element);\n            const matchedBefore = this.matchesByElement.has(selector, element);\n            if (matches && !matchedBefore) {\n                this.selectorMatched(element, selector);\n            }\n            else if (!matches && matchedBefore) {\n                this.selectorUnmatched(element, selector);\n            }\n        }\n    }\n    selectorMatched(element, selector) {\n        this.delegate.selectorMatched(element, selector, this.details);\n        this.matchesByElement.add(selector, element);\n    }\n    selectorUnmatched(element, selector) {\n        this.delegate.selectorUnmatched(element, selector, this.details);\n        this.matchesByElement.delete(selector, element);\n    }\n}\n\nclass StringMapObserver {\n    constructor(element, delegate) {\n        this.element = element;\n        this.delegate = delegate;\n        this.started = false;\n        this.stringMap = new Map();\n        this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.mutationObserver.observe(this.element, { attributes: true, attributeOldValue: true });\n            this.refresh();\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.mutationObserver.takeRecords();\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n    }\n    refresh() {\n        if (this.started) {\n            for (const attributeName of this.knownAttributeNames) {\n                this.refreshAttribute(attributeName, null);\n            }\n        }\n    }\n    processMutations(mutations) {\n        if (this.started) {\n            for (const mutation of mutations) {\n                this.processMutation(mutation);\n            }\n        }\n    }\n    processMutation(mutation) {\n        const attributeName = mutation.attributeName;\n        if (attributeName) {\n            this.refreshAttribute(attributeName, mutation.oldValue);\n        }\n    }\n    refreshAttribute(attributeName, oldValue) {\n        const key = this.delegate.getStringMapKeyForAttribute(attributeName);\n        if (key != null) {\n            if (!this.stringMap.has(attributeName)) {\n                this.stringMapKeyAdded(key, attributeName);\n            }\n            const value = this.element.getAttribute(attributeName);\n            if (this.stringMap.get(attributeName) != value) {\n                this.stringMapValueChanged(value, key, oldValue);\n            }\n            if (value == null) {\n                const oldValue = this.stringMap.get(attributeName);\n                this.stringMap.delete(attributeName);\n                if (oldValue)\n                    this.stringMapKeyRemoved(key, attributeName, oldValue);\n            }\n            else {\n                this.stringMap.set(attributeName, value);\n            }\n        }\n    }\n    stringMapKeyAdded(key, attributeName) {\n        if (this.delegate.stringMapKeyAdded) {\n            this.delegate.stringMapKeyAdded(key, attributeName);\n        }\n    }\n    stringMapValueChanged(value, key, oldValue) {\n        if (this.delegate.stringMapValueChanged) {\n            this.delegate.stringMapValueChanged(value, key, oldValue);\n        }\n    }\n    stringMapKeyRemoved(key, attributeName, oldValue) {\n        if (this.delegate.stringMapKeyRemoved) {\n            this.delegate.stringMapKeyRemoved(key, attributeName, oldValue);\n        }\n    }\n    get knownAttributeNames() {\n        return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n    }\n    get currentAttributeNames() {\n        return Array.from(this.element.attributes).map((attribute) => attribute.name);\n    }\n    get recordedAttributeNames() {\n        return Array.from(this.stringMap.keys());\n    }\n}\n\nclass TokenListObserver {\n    constructor(element, attributeName, delegate) {\n        this.attributeObserver = new AttributeObserver(element, attributeName, this);\n        this.delegate = delegate;\n        this.tokensByElement = new Multimap();\n    }\n    get started() {\n        return this.attributeObserver.started;\n    }\n    start() {\n        this.attributeObserver.start();\n    }\n    pause(callback) {\n        this.attributeObserver.pause(callback);\n    }\n    stop() {\n        this.attributeObserver.stop();\n    }\n    refresh() {\n        this.attributeObserver.refresh();\n    }\n    get element() {\n        return this.attributeObserver.element;\n    }\n    get attributeName() {\n        return this.attributeObserver.attributeName;\n    }\n    elementMatchedAttribute(element) {\n        this.tokensMatched(this.readTokensForElement(element));\n    }\n    elementAttributeValueChanged(element) {\n        const [unmatchedTokens, matchedTokens] = this.refreshTokensForElement(element);\n        this.tokensUnmatched(unmatchedTokens);\n        this.tokensMatched(matchedTokens);\n    }\n    elementUnmatchedAttribute(element) {\n        this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n    }\n    tokensMatched(tokens) {\n        tokens.forEach((token) => this.tokenMatched(token));\n    }\n    tokensUnmatched(tokens) {\n        tokens.forEach((token) => this.tokenUnmatched(token));\n    }\n    tokenMatched(token) {\n        this.delegate.tokenMatched(token);\n        this.tokensByElement.add(token.element, token);\n    }\n    tokenUnmatched(token) {\n        this.delegate.tokenUnmatched(token);\n        this.tokensByElement.delete(token.element, token);\n    }\n    refreshTokensForElement(element) {\n        const previousTokens = this.tokensByElement.getValuesForKey(element);\n        const currentTokens = this.readTokensForElement(element);\n        const firstDifferingIndex = zip(previousTokens, currentTokens).findIndex(([previousToken, currentToken]) => !tokensAreEqual(previousToken, currentToken));\n        if (firstDifferingIndex == -1) {\n            return [[], []];\n        }\n        else {\n            return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n        }\n    }\n    readTokensForElement(element) {\n        const attributeName = this.attributeName;\n        const tokenString = element.getAttribute(attributeName) || \"\";\n        return parseTokenString(tokenString, element, attributeName);\n    }\n}\nfunction parseTokenString(tokenString, element, attributeName) {\n    return tokenString\n        .trim()\n        .split(/\\s+/)\n        .filter((content) => content.length)\n        .map((content, index) => ({ element, attributeName, content, index }));\n}\nfunction zip(left, right) {\n    const length = Math.max(left.length, right.length);\n    return Array.from({ length }, (_, index) => [left[index], right[index]]);\n}\nfunction tokensAreEqual(left, right) {\n    return left && right && left.index == right.index && left.content == right.content;\n}\n\nclass ValueListObserver {\n    constructor(element, attributeName, delegate) {\n        this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n        this.delegate = delegate;\n        this.parseResultsByToken = new WeakMap();\n        this.valuesByTokenByElement = new WeakMap();\n    }\n    get started() {\n        return this.tokenListObserver.started;\n    }\n    start() {\n        this.tokenListObserver.start();\n    }\n    stop() {\n        this.tokenListObserver.stop();\n    }\n    refresh() {\n        this.tokenListObserver.refresh();\n    }\n    get element() {\n        return this.tokenListObserver.element;\n    }\n    get attributeName() {\n        return this.tokenListObserver.attributeName;\n    }\n    tokenMatched(token) {\n        const { element } = token;\n        const { value } = this.fetchParseResultForToken(token);\n        if (value) {\n            this.fetchValuesByTokenForElement(element).set(token, value);\n            this.delegate.elementMatchedValue(element, value);\n        }\n    }\n    tokenUnmatched(token) {\n        const { element } = token;\n        const { value } = this.fetchParseResultForToken(token);\n        if (value) {\n            this.fetchValuesByTokenForElement(element).delete(token);\n            this.delegate.elementUnmatchedValue(element, value);\n        }\n    }\n    fetchParseResultForToken(token) {\n        let parseResult = this.parseResultsByToken.get(token);\n        if (!parseResult) {\n            parseResult = this.parseToken(token);\n            this.parseResultsByToken.set(token, parseResult);\n        }\n        return parseResult;\n    }\n    fetchValuesByTokenForElement(element) {\n        let valuesByToken = this.valuesByTokenByElement.get(element);\n        if (!valuesByToken) {\n            valuesByToken = new Map();\n            this.valuesByTokenByElement.set(element, valuesByToken);\n        }\n        return valuesByToken;\n    }\n    parseToken(token) {\n        try {\n            const value = this.delegate.parseValueForToken(token);\n            return { value };\n        }\n        catch (error) {\n            return { error };\n        }\n    }\n}\n\nclass BindingObserver {\n    constructor(context, delegate) {\n        this.context = context;\n        this.delegate = delegate;\n        this.bindingsByAction = new Map();\n    }\n    start() {\n        if (!this.valueListObserver) {\n            this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n            this.valueListObserver.start();\n        }\n    }\n    stop() {\n        if (this.valueListObserver) {\n            this.valueListObserver.stop();\n            delete this.valueListObserver;\n            this.disconnectAllActions();\n        }\n    }\n    get element() {\n        return this.context.element;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    get actionAttribute() {\n        return this.schema.actionAttribute;\n    }\n    get schema() {\n        return this.context.schema;\n    }\n    get bindings() {\n        return Array.from(this.bindingsByAction.values());\n    }\n    connectAction(action) {\n        const binding = new Binding(this.context, action);\n        this.bindingsByAction.set(action, binding);\n        this.delegate.bindingConnected(binding);\n    }\n    disconnectAction(action) {\n        const binding = this.bindingsByAction.get(action);\n        if (binding) {\n            this.bindingsByAction.delete(action);\n            this.delegate.bindingDisconnected(binding);\n        }\n    }\n    disconnectAllActions() {\n        this.bindings.forEach((binding) => this.delegate.bindingDisconnected(binding, true));\n        this.bindingsByAction.clear();\n    }\n    parseValueForToken(token) {\n        const action = Action.forToken(token, this.schema);\n        if (action.identifier == this.identifier) {\n            return action;\n        }\n    }\n    elementMatchedValue(element, action) {\n        this.connectAction(action);\n    }\n    elementUnmatchedValue(element, action) {\n        this.disconnectAction(action);\n    }\n}\n\nclass ValueObserver {\n    constructor(context, receiver) {\n        this.context = context;\n        this.receiver = receiver;\n        this.stringMapObserver = new StringMapObserver(this.element, this);\n        this.valueDescriptorMap = this.controller.valueDescriptorMap;\n    }\n    start() {\n        this.stringMapObserver.start();\n        this.invokeChangedCallbacksForDefaultValues();\n    }\n    stop() {\n        this.stringMapObserver.stop();\n    }\n    get element() {\n        return this.context.element;\n    }\n    get controller() {\n        return this.context.controller;\n    }\n    getStringMapKeyForAttribute(attributeName) {\n        if (attributeName in this.valueDescriptorMap) {\n            return this.valueDescriptorMap[attributeName].name;\n        }\n    }\n    stringMapKeyAdded(key, attributeName) {\n        const descriptor = this.valueDescriptorMap[attributeName];\n        if (!this.hasValue(key)) {\n            this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), descriptor.writer(descriptor.defaultValue));\n        }\n    }\n    stringMapValueChanged(value, name, oldValue) {\n        const descriptor = this.valueDescriptorNameMap[name];\n        if (value === null)\n            return;\n        if (oldValue === null) {\n            oldValue = descriptor.writer(descriptor.defaultValue);\n        }\n        this.invokeChangedCallback(name, value, oldValue);\n    }\n    stringMapKeyRemoved(key, attributeName, oldValue) {\n        const descriptor = this.valueDescriptorNameMap[key];\n        if (this.hasValue(key)) {\n            this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), oldValue);\n        }\n        else {\n            this.invokeChangedCallback(key, descriptor.writer(descriptor.defaultValue), oldValue);\n        }\n    }\n    invokeChangedCallbacksForDefaultValues() {\n        for (const { key, name, defaultValue, writer } of this.valueDescriptors) {\n            if (defaultValue != undefined && !this.controller.data.has(key)) {\n                this.invokeChangedCallback(name, writer(defaultValue), undefined);\n            }\n        }\n    }\n    invokeChangedCallback(name, rawValue, rawOldValue) {\n        const changedMethodName = `${name}Changed`;\n        const changedMethod = this.receiver[changedMethodName];\n        if (typeof changedMethod == \"function\") {\n            const descriptor = this.valueDescriptorNameMap[name];\n            try {\n                const value = descriptor.reader(rawValue);\n                let oldValue = rawOldValue;\n                if (rawOldValue) {\n                    oldValue = descriptor.reader(rawOldValue);\n                }\n                changedMethod.call(this.receiver, value, oldValue);\n            }\n            catch (error) {\n                if (error instanceof TypeError) {\n                    error.message = `Stimulus Value \"${this.context.identifier}.${descriptor.name}\" - ${error.message}`;\n                }\n                throw error;\n            }\n        }\n    }\n    get valueDescriptors() {\n        const { valueDescriptorMap } = this;\n        return Object.keys(valueDescriptorMap).map((key) => valueDescriptorMap[key]);\n    }\n    get valueDescriptorNameMap() {\n        const descriptors = {};\n        Object.keys(this.valueDescriptorMap).forEach((key) => {\n            const descriptor = this.valueDescriptorMap[key];\n            descriptors[descriptor.name] = descriptor;\n        });\n        return descriptors;\n    }\n    hasValue(attributeName) {\n        const descriptor = this.valueDescriptorNameMap[attributeName];\n        const hasMethodName = `has${capitalize(descriptor.name)}`;\n        return this.receiver[hasMethodName];\n    }\n}\n\nclass TargetObserver {\n    constructor(context, delegate) {\n        this.context = context;\n        this.delegate = delegate;\n        this.targetsByName = new Multimap();\n    }\n    start() {\n        if (!this.tokenListObserver) {\n            this.tokenListObserver = new TokenListObserver(this.element, this.attributeName, this);\n            this.tokenListObserver.start();\n        }\n    }\n    stop() {\n        if (this.tokenListObserver) {\n            this.disconnectAllTargets();\n            this.tokenListObserver.stop();\n            delete this.tokenListObserver;\n        }\n    }\n    tokenMatched({ element, content: name }) {\n        if (this.scope.containsElement(element)) {\n            this.connectTarget(element, name);\n        }\n    }\n    tokenUnmatched({ element, content: name }) {\n        this.disconnectTarget(element, name);\n    }\n    connectTarget(element, name) {\n        var _a;\n        if (!this.targetsByName.has(name, element)) {\n            this.targetsByName.add(name, element);\n            (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetConnected(element, name));\n        }\n    }\n    disconnectTarget(element, name) {\n        var _a;\n        if (this.targetsByName.has(name, element)) {\n            this.targetsByName.delete(name, element);\n            (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetDisconnected(element, name));\n        }\n    }\n    disconnectAllTargets() {\n        for (const name of this.targetsByName.keys) {\n            for (const element of this.targetsByName.getValuesForKey(name)) {\n                this.disconnectTarget(element, name);\n            }\n        }\n    }\n    get attributeName() {\n        return `data-${this.context.identifier}-target`;\n    }\n    get element() {\n        return this.context.element;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n}\n\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n    const ancestors = getAncestorsForConstructor(constructor);\n    return Array.from(ancestors.reduce((values, constructor) => {\n        getOwnStaticArrayValues(constructor, propertyName).forEach((name) => values.add(name));\n        return values;\n    }, new Set()));\n}\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n    const ancestors = getAncestorsForConstructor(constructor);\n    return ancestors.reduce((pairs, constructor) => {\n        pairs.push(...getOwnStaticObjectPairs(constructor, propertyName));\n        return pairs;\n    }, []);\n}\nfunction getAncestorsForConstructor(constructor) {\n    const ancestors = [];\n    while (constructor) {\n        ancestors.push(constructor);\n        constructor = Object.getPrototypeOf(constructor);\n    }\n    return ancestors.reverse();\n}\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n    const definition = constructor[propertyName];\n    return Array.isArray(definition) ? definition : [];\n}\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n    const definition = constructor[propertyName];\n    return definition ? Object.keys(definition).map((key) => [key, definition[key]]) : [];\n}\n\nclass OutletObserver {\n    constructor(context, delegate) {\n        this.started = false;\n        this.context = context;\n        this.delegate = delegate;\n        this.outletsByName = new Multimap();\n        this.outletElementsByName = new Multimap();\n        this.selectorObserverMap = new Map();\n        this.attributeObserverMap = new Map();\n    }\n    start() {\n        if (!this.started) {\n            this.outletDefinitions.forEach((outletName) => {\n                this.setupSelectorObserverForOutlet(outletName);\n                this.setupAttributeObserverForOutlet(outletName);\n            });\n            this.started = true;\n            this.dependentContexts.forEach((context) => context.refresh());\n        }\n    }\n    refresh() {\n        this.selectorObserverMap.forEach((observer) => observer.refresh());\n        this.attributeObserverMap.forEach((observer) => observer.refresh());\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            this.disconnectAllOutlets();\n            this.stopSelectorObservers();\n            this.stopAttributeObservers();\n        }\n    }\n    stopSelectorObservers() {\n        if (this.selectorObserverMap.size > 0) {\n            this.selectorObserverMap.forEach((observer) => observer.stop());\n            this.selectorObserverMap.clear();\n        }\n    }\n    stopAttributeObservers() {\n        if (this.attributeObserverMap.size > 0) {\n            this.attributeObserverMap.forEach((observer) => observer.stop());\n            this.attributeObserverMap.clear();\n        }\n    }\n    selectorMatched(element, _selector, { outletName }) {\n        const outlet = this.getOutlet(element, outletName);\n        if (outlet) {\n            this.connectOutlet(outlet, element, outletName);\n        }\n    }\n    selectorUnmatched(element, _selector, { outletName }) {\n        const outlet = this.getOutletFromMap(element, outletName);\n        if (outlet) {\n            this.disconnectOutlet(outlet, element, outletName);\n        }\n    }\n    selectorMatchElement(element, { outletName }) {\n        const selector = this.selector(outletName);\n        const hasOutlet = this.hasOutlet(element, outletName);\n        const hasOutletController = element.matches(`[${this.schema.controllerAttribute}~=${outletName}]`);\n        if (selector) {\n            return hasOutlet && hasOutletController && element.matches(selector);\n        }\n        else {\n            return false;\n        }\n    }\n    elementMatchedAttribute(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    elementAttributeValueChanged(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    elementUnmatchedAttribute(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    connectOutlet(outlet, element, outletName) {\n        var _a;\n        if (!this.outletElementsByName.has(outletName, element)) {\n            this.outletsByName.add(outletName, outlet);\n            this.outletElementsByName.add(outletName, element);\n            (_a = this.selectorObserverMap.get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletConnected(outlet, element, outletName));\n        }\n    }\n    disconnectOutlet(outlet, element, outletName) {\n        var _a;\n        if (this.outletElementsByName.has(outletName, element)) {\n            this.outletsByName.delete(outletName, outlet);\n            this.outletElementsByName.delete(outletName, element);\n            (_a = this.selectorObserverMap\n                .get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletDisconnected(outlet, element, outletName));\n        }\n    }\n    disconnectAllOutlets() {\n        for (const outletName of this.outletElementsByName.keys) {\n            for (const element of this.outletElementsByName.getValuesForKey(outletName)) {\n                for (const outlet of this.outletsByName.getValuesForKey(outletName)) {\n                    this.disconnectOutlet(outlet, element, outletName);\n                }\n            }\n        }\n    }\n    updateSelectorObserverForOutlet(outletName) {\n        const observer = this.selectorObserverMap.get(outletName);\n        if (observer) {\n            observer.selector = this.selector(outletName);\n        }\n    }\n    setupSelectorObserverForOutlet(outletName) {\n        const selector = this.selector(outletName);\n        const selectorObserver = new SelectorObserver(document.body, selector, this, { outletName });\n        this.selectorObserverMap.set(outletName, selectorObserver);\n        selectorObserver.start();\n    }\n    setupAttributeObserverForOutlet(outletName) {\n        const attributeName = this.attributeNameForOutletName(outletName);\n        const attributeObserver = new AttributeObserver(this.scope.element, attributeName, this);\n        this.attributeObserverMap.set(outletName, attributeObserver);\n        attributeObserver.start();\n    }\n    selector(outletName) {\n        return this.scope.outlets.getSelectorForOutletName(outletName);\n    }\n    attributeNameForOutletName(outletName) {\n        return this.scope.schema.outletAttributeForScope(this.identifier, outletName);\n    }\n    getOutletNameFromOutletAttributeName(attributeName) {\n        return this.outletDefinitions.find((outletName) => this.attributeNameForOutletName(outletName) === attributeName);\n    }\n    get outletDependencies() {\n        const dependencies = new Multimap();\n        this.router.modules.forEach((module) => {\n            const constructor = module.definition.controllerConstructor;\n            const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n            outlets.forEach((outlet) => dependencies.add(outlet, module.identifier));\n        });\n        return dependencies;\n    }\n    get outletDefinitions() {\n        return this.outletDependencies.getKeysForValue(this.identifier);\n    }\n    get dependentControllerIdentifiers() {\n        return this.outletDependencies.getValuesForKey(this.identifier);\n    }\n    get dependentContexts() {\n        const identifiers = this.dependentControllerIdentifiers;\n        return this.router.contexts.filter((context) => identifiers.includes(context.identifier));\n    }\n    hasOutlet(element, outletName) {\n        return !!this.getOutlet(element, outletName) || !!this.getOutletFromMap(element, outletName);\n    }\n    getOutlet(element, outletName) {\n        return this.application.getControllerForElementAndIdentifier(element, outletName);\n    }\n    getOutletFromMap(element, outletName) {\n        return this.outletsByName.getValuesForKey(outletName).find((outlet) => outlet.element === element);\n    }\n    get scope() {\n        return this.context.scope;\n    }\n    get schema() {\n        return this.context.schema;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    get application() {\n        return this.context.application;\n    }\n    get router() {\n        return this.application.router;\n    }\n}\n\nclass Context {\n    constructor(module, scope) {\n        this.logDebugActivity = (functionName, detail = {}) => {\n            const { identifier, controller, element } = this;\n            detail = Object.assign({ identifier, controller, element }, detail);\n            this.application.logDebugActivity(this.identifier, functionName, detail);\n        };\n        this.module = module;\n        this.scope = scope;\n        this.controller = new module.controllerConstructor(this);\n        this.bindingObserver = new BindingObserver(this, this.dispatcher);\n        this.valueObserver = new ValueObserver(this, this.controller);\n        this.targetObserver = new TargetObserver(this, this);\n        this.outletObserver = new OutletObserver(this, this);\n        try {\n            this.controller.initialize();\n            this.logDebugActivity(\"initialize\");\n        }\n        catch (error) {\n            this.handleError(error, \"initializing controller\");\n        }\n    }\n    connect() {\n        this.bindingObserver.start();\n        this.valueObserver.start();\n        this.targetObserver.start();\n        this.outletObserver.start();\n        try {\n            this.controller.connect();\n            this.logDebugActivity(\"connect\");\n        }\n        catch (error) {\n            this.handleError(error, \"connecting controller\");\n        }\n    }\n    refresh() {\n        this.outletObserver.refresh();\n    }\n    disconnect() {\n        try {\n            this.controller.disconnect();\n            this.logDebugActivity(\"disconnect\");\n        }\n        catch (error) {\n            this.handleError(error, \"disconnecting controller\");\n        }\n        this.outletObserver.stop();\n        this.targetObserver.stop();\n        this.valueObserver.stop();\n        this.bindingObserver.stop();\n    }\n    get application() {\n        return this.module.application;\n    }\n    get identifier() {\n        return this.module.identifier;\n    }\n    get schema() {\n        return this.application.schema;\n    }\n    get dispatcher() {\n        return this.application.dispatcher;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get parentElement() {\n        return this.element.parentElement;\n    }\n    handleError(error, message, detail = {}) {\n        const { identifier, controller, element } = this;\n        detail = Object.assign({ identifier, controller, element }, detail);\n        this.application.handleError(error, `Error ${message}`, detail);\n    }\n    targetConnected(element, name) {\n        this.invokeControllerMethod(`${name}TargetConnected`, element);\n    }\n    targetDisconnected(element, name) {\n        this.invokeControllerMethod(`${name}TargetDisconnected`, element);\n    }\n    outletConnected(outlet, element, name) {\n        this.invokeControllerMethod(`${namespaceCamelize(name)}OutletConnected`, outlet, element);\n    }\n    outletDisconnected(outlet, element, name) {\n        this.invokeControllerMethod(`${namespaceCamelize(name)}OutletDisconnected`, outlet, element);\n    }\n    invokeControllerMethod(methodName, ...args) {\n        const controller = this.controller;\n        if (typeof controller[methodName] == \"function\") {\n            controller[methodName](...args);\n        }\n    }\n}\n\nfunction bless(constructor) {\n    return shadow(constructor, getBlessedProperties(constructor));\n}\nfunction shadow(constructor, properties) {\n    const shadowConstructor = extend(constructor);\n    const shadowProperties = getShadowProperties(constructor.prototype, properties);\n    Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n    return shadowConstructor;\n}\nfunction getBlessedProperties(constructor) {\n    const blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n    return blessings.reduce((blessedProperties, blessing) => {\n        const properties = blessing(constructor);\n        for (const key in properties) {\n            const descriptor = blessedProperties[key] || {};\n            blessedProperties[key] = Object.assign(descriptor, properties[key]);\n        }\n        return blessedProperties;\n    }, {});\n}\nfunction getShadowProperties(prototype, properties) {\n    return getOwnKeys(properties).reduce((shadowProperties, key) => {\n        const descriptor = getShadowedDescriptor(prototype, properties, key);\n        if (descriptor) {\n            Object.assign(shadowProperties, { [key]: descriptor });\n        }\n        return shadowProperties;\n    }, {});\n}\nfunction getShadowedDescriptor(prototype, properties, key) {\n    const shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n    const shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n    if (!shadowedByValue) {\n        const descriptor = Object.getOwnPropertyDescriptor(properties, key).value;\n        if (shadowingDescriptor) {\n            descriptor.get = shadowingDescriptor.get || descriptor.get;\n            descriptor.set = shadowingDescriptor.set || descriptor.set;\n        }\n        return descriptor;\n    }\n}\nconst getOwnKeys = (() => {\n    if (typeof Object.getOwnPropertySymbols == \"function\") {\n        return (object) => [...Object.getOwnPropertyNames(object), ...Object.getOwnPropertySymbols(object)];\n    }\n    else {\n        return Object.getOwnPropertyNames;\n    }\n})();\nconst extend = (() => {\n    function extendWithReflect(constructor) {\n        function extended() {\n            return Reflect.construct(constructor, arguments, new.target);\n        }\n        extended.prototype = Object.create(constructor.prototype, {\n            constructor: { value: extended },\n        });\n        Reflect.setPrototypeOf(extended, constructor);\n        return extended;\n    }\n    function testReflectExtension() {\n        const a = function () {\n            this.a.call(this);\n        };\n        const b = extendWithReflect(a);\n        b.prototype.a = function () { };\n        return new b();\n    }\n    try {\n        testReflectExtension();\n        return extendWithReflect;\n    }\n    catch (error) {\n        return (constructor) => class extended extends constructor {\n        };\n    }\n})();\n\nfunction blessDefinition(definition) {\n    return {\n        identifier: definition.identifier,\n        controllerConstructor: bless(definition.controllerConstructor),\n    };\n}\n\nclass Module {\n    constructor(application, definition) {\n        this.application = application;\n        this.definition = blessDefinition(definition);\n        this.contextsByScope = new WeakMap();\n        this.connectedContexts = new Set();\n    }\n    get identifier() {\n        return this.definition.identifier;\n    }\n    get controllerConstructor() {\n        return this.definition.controllerConstructor;\n    }\n    get contexts() {\n        return Array.from(this.connectedContexts);\n    }\n    connectContextForScope(scope) {\n        const context = this.fetchContextForScope(scope);\n        this.connectedContexts.add(context);\n        context.connect();\n    }\n    disconnectContextForScope(scope) {\n        const context = this.contextsByScope.get(scope);\n        if (context) {\n            this.connectedContexts.delete(context);\n            context.disconnect();\n        }\n    }\n    fetchContextForScope(scope) {\n        let context = this.contextsByScope.get(scope);\n        if (!context) {\n            context = new Context(this, scope);\n            this.contextsByScope.set(scope, context);\n        }\n        return context;\n    }\n}\n\nclass ClassMap {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    has(name) {\n        return this.data.has(this.getDataKey(name));\n    }\n    get(name) {\n        return this.getAll(name)[0];\n    }\n    getAll(name) {\n        const tokenString = this.data.get(this.getDataKey(name)) || \"\";\n        return tokenize(tokenString);\n    }\n    getAttributeName(name) {\n        return this.data.getAttributeNameForKey(this.getDataKey(name));\n    }\n    getDataKey(name) {\n        return `${name}-class`;\n    }\n    get data() {\n        return this.scope.data;\n    }\n}\n\nclass DataMap {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get(key) {\n        const name = this.getAttributeNameForKey(key);\n        return this.element.getAttribute(name);\n    }\n    set(key, value) {\n        const name = this.getAttributeNameForKey(key);\n        this.element.setAttribute(name, value);\n        return this.get(key);\n    }\n    has(key) {\n        const name = this.getAttributeNameForKey(key);\n        return this.element.hasAttribute(name);\n    }\n    delete(key) {\n        if (this.has(key)) {\n            const name = this.getAttributeNameForKey(key);\n            this.element.removeAttribute(name);\n            return true;\n        }\n        else {\n            return false;\n        }\n    }\n    getAttributeNameForKey(key) {\n        return `data-${this.identifier}-${dasherize(key)}`;\n    }\n}\n\nclass Guide {\n    constructor(logger) {\n        this.warnedKeysByObject = new WeakMap();\n        this.logger = logger;\n    }\n    warn(object, key, message) {\n        let warnedKeys = this.warnedKeysByObject.get(object);\n        if (!warnedKeys) {\n            warnedKeys = new Set();\n            this.warnedKeysByObject.set(object, warnedKeys);\n        }\n        if (!warnedKeys.has(key)) {\n            warnedKeys.add(key);\n            this.logger.warn(message, object);\n        }\n    }\n}\n\nfunction attributeValueContainsToken(attributeName, token) {\n    return `[${attributeName}~=\"${token}\"]`;\n}\n\nclass TargetSet {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get schema() {\n        return this.scope.schema;\n    }\n    has(targetName) {\n        return this.find(targetName) != null;\n    }\n    find(...targetNames) {\n        return targetNames.reduce((target, targetName) => target || this.findTarget(targetName) || this.findLegacyTarget(targetName), undefined);\n    }\n    findAll(...targetNames) {\n        return targetNames.reduce((targets, targetName) => [\n            ...targets,\n            ...this.findAllTargets(targetName),\n            ...this.findAllLegacyTargets(targetName),\n        ], []);\n    }\n    findTarget(targetName) {\n        const selector = this.getSelectorForTargetName(targetName);\n        return this.scope.findElement(selector);\n    }\n    findAllTargets(targetName) {\n        const selector = this.getSelectorForTargetName(targetName);\n        return this.scope.findAllElements(selector);\n    }\n    getSelectorForTargetName(targetName) {\n        const attributeName = this.schema.targetAttributeForScope(this.identifier);\n        return attributeValueContainsToken(attributeName, targetName);\n    }\n    findLegacyTarget(targetName) {\n        const selector = this.getLegacySelectorForTargetName(targetName);\n        return this.deprecate(this.scope.findElement(selector), targetName);\n    }\n    findAllLegacyTargets(targetName) {\n        const selector = this.getLegacySelectorForTargetName(targetName);\n        return this.scope.findAllElements(selector).map((element) => this.deprecate(element, targetName));\n    }\n    getLegacySelectorForTargetName(targetName) {\n        const targetDescriptor = `${this.identifier}.${targetName}`;\n        return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n    }\n    deprecate(element, targetName) {\n        if (element) {\n            const { identifier } = this;\n            const attributeName = this.schema.targetAttribute;\n            const revisedAttributeName = this.schema.targetAttributeForScope(identifier);\n            this.guide.warn(element, `target:${targetName}`, `Please replace ${attributeName}=\"${identifier}.${targetName}\" with ${revisedAttributeName}=\"${targetName}\". ` +\n                `The ${attributeName} attribute is deprecated and will be removed in a future version of Stimulus.`);\n        }\n        return element;\n    }\n    get guide() {\n        return this.scope.guide;\n    }\n}\n\nclass OutletSet {\n    constructor(scope, controllerElement) {\n        this.scope = scope;\n        this.controllerElement = controllerElement;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get schema() {\n        return this.scope.schema;\n    }\n    has(outletName) {\n        return this.find(outletName) != null;\n    }\n    find(...outletNames) {\n        return outletNames.reduce((outlet, outletName) => outlet || this.findOutlet(outletName), undefined);\n    }\n    findAll(...outletNames) {\n        return outletNames.reduce((outlets, outletName) => [...outlets, ...this.findAllOutlets(outletName)], []);\n    }\n    getSelectorForOutletName(outletName) {\n        const attributeName = this.schema.outletAttributeForScope(this.identifier, outletName);\n        return this.controllerElement.getAttribute(attributeName);\n    }\n    findOutlet(outletName) {\n        const selector = this.getSelectorForOutletName(outletName);\n        if (selector)\n            return this.findElement(selector, outletName);\n    }\n    findAllOutlets(outletName) {\n        const selector = this.getSelectorForOutletName(outletName);\n        return selector ? this.findAllElements(selector, outletName) : [];\n    }\n    findElement(selector, outletName) {\n        const elements = this.scope.queryElements(selector);\n        return elements.filter((element) => this.matchesElement(element, selector, outletName))[0];\n    }\n    findAllElements(selector, outletName) {\n        const elements = this.scope.queryElements(selector);\n        return elements.filter((element) => this.matchesElement(element, selector, outletName));\n    }\n    matchesElement(element, selector, outletName) {\n        const controllerAttribute = element.getAttribute(this.scope.schema.controllerAttribute) || \"\";\n        return element.matches(selector) && controllerAttribute.split(\" \").includes(outletName);\n    }\n}\n\nclass Scope {\n    constructor(schema, element, identifier, logger) {\n        this.targets = new TargetSet(this);\n        this.classes = new ClassMap(this);\n        this.data = new DataMap(this);\n        this.containsElement = (element) => {\n            return element.closest(this.controllerSelector) === this.element;\n        };\n        this.schema = schema;\n        this.element = element;\n        this.identifier = identifier;\n        this.guide = new Guide(logger);\n        this.outlets = new OutletSet(this.documentScope, element);\n    }\n    findElement(selector) {\n        return this.element.matches(selector) ? this.element : this.queryElements(selector).find(this.containsElement);\n    }\n    findAllElements(selector) {\n        return [\n            ...(this.element.matches(selector) ? [this.element] : []),\n            ...this.queryElements(selector).filter(this.containsElement),\n        ];\n    }\n    queryElements(selector) {\n        return Array.from(this.element.querySelectorAll(selector));\n    }\n    get controllerSelector() {\n        return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n    }\n    get isDocumentScope() {\n        return this.element === document.documentElement;\n    }\n    get documentScope() {\n        return this.isDocumentScope\n            ? this\n            : new Scope(this.schema, document.documentElement, this.identifier, this.guide.logger);\n    }\n}\n\nclass ScopeObserver {\n    constructor(element, schema, delegate) {\n        this.element = element;\n        this.schema = schema;\n        this.delegate = delegate;\n        this.valueListObserver = new ValueListObserver(this.element, this.controllerAttribute, this);\n        this.scopesByIdentifierByElement = new WeakMap();\n        this.scopeReferenceCounts = new WeakMap();\n    }\n    start() {\n        this.valueListObserver.start();\n    }\n    stop() {\n        this.valueListObserver.stop();\n    }\n    get controllerAttribute() {\n        return this.schema.controllerAttribute;\n    }\n    parseValueForToken(token) {\n        const { element, content: identifier } = token;\n        return this.parseValueForElementAndIdentifier(element, identifier);\n    }\n    parseValueForElementAndIdentifier(element, identifier) {\n        const scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n        let scope = scopesByIdentifier.get(identifier);\n        if (!scope) {\n            scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);\n            scopesByIdentifier.set(identifier, scope);\n        }\n        return scope;\n    }\n    elementMatchedValue(element, value) {\n        const referenceCount = (this.scopeReferenceCounts.get(value) || 0) + 1;\n        this.scopeReferenceCounts.set(value, referenceCount);\n        if (referenceCount == 1) {\n            this.delegate.scopeConnected(value);\n        }\n    }\n    elementUnmatchedValue(element, value) {\n        const referenceCount = this.scopeReferenceCounts.get(value);\n        if (referenceCount) {\n            this.scopeReferenceCounts.set(value, referenceCount - 1);\n            if (referenceCount == 1) {\n                this.delegate.scopeDisconnected(value);\n            }\n        }\n    }\n    fetchScopesByIdentifierForElement(element) {\n        let scopesByIdentifier = this.scopesByIdentifierByElement.get(element);\n        if (!scopesByIdentifier) {\n            scopesByIdentifier = new Map();\n            this.scopesByIdentifierByElement.set(element, scopesByIdentifier);\n        }\n        return scopesByIdentifier;\n    }\n}\n\nclass Router {\n    constructor(application) {\n        this.application = application;\n        this.scopeObserver = new ScopeObserver(this.element, this.schema, this);\n        this.scopesByIdentifier = new Multimap();\n        this.modulesByIdentifier = new Map();\n    }\n    get element() {\n        return this.application.element;\n    }\n    get schema() {\n        return this.application.schema;\n    }\n    get logger() {\n        return this.application.logger;\n    }\n    get controllerAttribute() {\n        return this.schema.controllerAttribute;\n    }\n    get modules() {\n        return Array.from(this.modulesByIdentifier.values());\n    }\n    get contexts() {\n        return this.modules.reduce((contexts, module) => contexts.concat(module.contexts), []);\n    }\n    start() {\n        this.scopeObserver.start();\n    }\n    stop() {\n        this.scopeObserver.stop();\n    }\n    loadDefinition(definition) {\n        this.unloadIdentifier(definition.identifier);\n        const module = new Module(this.application, definition);\n        this.connectModule(module);\n        const afterLoad = definition.controllerConstructor.afterLoad;\n        if (afterLoad) {\n            afterLoad.call(definition.controllerConstructor, definition.identifier, this.application);\n        }\n    }\n    unloadIdentifier(identifier) {\n        const module = this.modulesByIdentifier.get(identifier);\n        if (module) {\n            this.disconnectModule(module);\n        }\n    }\n    getContextForElementAndIdentifier(element, identifier) {\n        const module = this.modulesByIdentifier.get(identifier);\n        if (module) {\n            return module.contexts.find((context) => context.element == element);\n        }\n    }\n    proposeToConnectScopeForElementAndIdentifier(element, identifier) {\n        const scope = this.scopeObserver.parseValueForElementAndIdentifier(element, identifier);\n        if (scope) {\n            this.scopeObserver.elementMatchedValue(scope.element, scope);\n        }\n        else {\n            console.error(`Couldn't find or create scope for identifier: \"${identifier}\" and element:`, element);\n        }\n    }\n    handleError(error, message, detail) {\n        this.application.handleError(error, message, detail);\n    }\n    createScopeForElementAndIdentifier(element, identifier) {\n        return new Scope(this.schema, element, identifier, this.logger);\n    }\n    scopeConnected(scope) {\n        this.scopesByIdentifier.add(scope.identifier, scope);\n        const module = this.modulesByIdentifier.get(scope.identifier);\n        if (module) {\n            module.connectContextForScope(scope);\n        }\n    }\n    scopeDisconnected(scope) {\n        this.scopesByIdentifier.delete(scope.identifier, scope);\n        const module = this.modulesByIdentifier.get(scope.identifier);\n        if (module) {\n            module.disconnectContextForScope(scope);\n        }\n    }\n    connectModule(module) {\n        this.modulesByIdentifier.set(module.identifier, module);\n        const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n        scopes.forEach((scope) => module.connectContextForScope(scope));\n    }\n    disconnectModule(module) {\n        this.modulesByIdentifier.delete(module.identifier);\n        const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n        scopes.forEach((scope) => module.disconnectContextForScope(scope));\n    }\n}\n\nconst defaultSchema = {\n    controllerAttribute: \"data-controller\",\n    actionAttribute: \"data-action\",\n    targetAttribute: \"data-target\",\n    targetAttributeForScope: (identifier) => `data-${identifier}-target`,\n    outletAttributeForScope: (identifier, outlet) => `data-${identifier}-${outlet}-outlet`,\n    keyMappings: Object.assign(Object.assign({ enter: \"Enter\", tab: \"Tab\", esc: \"Escape\", space: \" \", up: \"ArrowUp\", down: \"ArrowDown\", left: \"ArrowLeft\", right: \"ArrowRight\", home: \"Home\", end: \"End\", page_up: \"PageUp\", page_down: \"PageDown\" }, objectFromEntries(\"abcdefghijklmnopqrstuvwxyz\".split(\"\").map((c) => [c, c]))), objectFromEntries(\"0123456789\".split(\"\").map((n) => [n, n]))),\n};\nfunction objectFromEntries(array) {\n    return array.reduce((memo, [k, v]) => (Object.assign(Object.assign({}, memo), { [k]: v })), {});\n}\n\nclass Application {\n    constructor(element = document.documentElement, schema = defaultSchema) {\n        this.logger = console;\n        this.debug = false;\n        this.logDebugActivity = (identifier, functionName, detail = {}) => {\n            if (this.debug) {\n                this.logFormattedMessage(identifier, functionName, detail);\n            }\n        };\n        this.element = element;\n        this.schema = schema;\n        this.dispatcher = new Dispatcher(this);\n        this.router = new Router(this);\n        this.actionDescriptorFilters = Object.assign({}, defaultActionDescriptorFilters);\n    }\n    static start(element, schema) {\n        const application = new this(element, schema);\n        application.start();\n        return application;\n    }\n    async start() {\n        await domReady();\n        this.logDebugActivity(\"application\", \"starting\");\n        this.dispatcher.start();\n        this.router.start();\n        this.logDebugActivity(\"application\", \"start\");\n    }\n    stop() {\n        this.logDebugActivity(\"application\", \"stopping\");\n        this.dispatcher.stop();\n        this.router.stop();\n        this.logDebugActivity(\"application\", \"stop\");\n    }\n    register(identifier, controllerConstructor) {\n        this.load({ identifier, controllerConstructor });\n    }\n    registerActionOption(name, filter) {\n        this.actionDescriptorFilters[name] = filter;\n    }\n    load(head, ...rest) {\n        const definitions = Array.isArray(head) ? head : [head, ...rest];\n        definitions.forEach((definition) => {\n            if (definition.controllerConstructor.shouldLoad) {\n                this.router.loadDefinition(definition);\n            }\n        });\n    }\n    unload(head, ...rest) {\n        const identifiers = Array.isArray(head) ? head : [head, ...rest];\n        identifiers.forEach((identifier) => this.router.unloadIdentifier(identifier));\n    }\n    get controllers() {\n        return this.router.contexts.map((context) => context.controller);\n    }\n    getControllerForElementAndIdentifier(element, identifier) {\n        const context = this.router.getContextForElementAndIdentifier(element, identifier);\n        return context ? context.controller : null;\n    }\n    handleError(error, message, detail) {\n        var _a;\n        this.logger.error(`%s\\n\\n%o\\n\\n%o`, message, error, detail);\n        (_a = window.onerror) === null || _a === void 0 ? void 0 : _a.call(window, message, \"\", 0, 0, error);\n    }\n    logFormattedMessage(identifier, functionName, detail = {}) {\n        detail = Object.assign({ application: this }, detail);\n        this.logger.groupCollapsed(`${identifier} #${functionName}`);\n        this.logger.log(\"details:\", Object.assign({}, detail));\n        this.logger.groupEnd();\n    }\n}\nfunction domReady() {\n    return new Promise((resolve) => {\n        if (document.readyState == \"loading\") {\n            document.addEventListener(\"DOMContentLoaded\", () => resolve());\n        }\n        else {\n            resolve();\n        }\n    });\n}\n\nfunction ClassPropertiesBlessing(constructor) {\n    const classes = readInheritableStaticArrayValues(constructor, \"classes\");\n    return classes.reduce((properties, classDefinition) => {\n        return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n    }, {});\n}\nfunction propertiesForClassDefinition(key) {\n    return {\n        [`${key}Class`]: {\n            get() {\n                const { classes } = this;\n                if (classes.has(key)) {\n                    return classes.get(key);\n                }\n                else {\n                    const attribute = classes.getAttributeName(key);\n                    throw new Error(`Missing attribute \"${attribute}\"`);\n                }\n            },\n        },\n        [`${key}Classes`]: {\n            get() {\n                return this.classes.getAll(key);\n            },\n        },\n        [`has${capitalize(key)}Class`]: {\n            get() {\n                return this.classes.has(key);\n            },\n        },\n    };\n}\n\nfunction OutletPropertiesBlessing(constructor) {\n    const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n    return outlets.reduce((properties, outletDefinition) => {\n        return Object.assign(properties, propertiesForOutletDefinition(outletDefinition));\n    }, {});\n}\nfunction getOutletController(controller, element, identifier) {\n    return controller.application.getControllerForElementAndIdentifier(element, identifier);\n}\nfunction getControllerAndEnsureConnectedScope(controller, element, outletName) {\n    let outletController = getOutletController(controller, element, outletName);\n    if (outletController)\n        return outletController;\n    controller.application.router.proposeToConnectScopeForElementAndIdentifier(element, outletName);\n    outletController = getOutletController(controller, element, outletName);\n    if (outletController)\n        return outletController;\n}\nfunction propertiesForOutletDefinition(name) {\n    const camelizedName = namespaceCamelize(name);\n    return {\n        [`${camelizedName}Outlet`]: {\n            get() {\n                const outletElement = this.outlets.find(name);\n                const selector = this.outlets.getSelectorForOutletName(name);\n                if (outletElement) {\n                    const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n                    if (outletController)\n                        return outletController;\n                    throw new Error(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`);\n                }\n                throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n            },\n        },\n        [`${camelizedName}Outlets`]: {\n            get() {\n                const outlets = this.outlets.findAll(name);\n                if (outlets.length > 0) {\n                    return outlets\n                        .map((outletElement) => {\n                        const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n                        if (outletController)\n                            return outletController;\n                        console.warn(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`, outletElement);\n                    })\n                        .filter((controller) => controller);\n                }\n                return [];\n            },\n        },\n        [`${camelizedName}OutletElement`]: {\n            get() {\n                const outletElement = this.outlets.find(name);\n                const selector = this.outlets.getSelectorForOutletName(name);\n                if (outletElement) {\n                    return outletElement;\n                }\n                else {\n                    throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n                }\n            },\n        },\n        [`${camelizedName}OutletElements`]: {\n            get() {\n                return this.outlets.findAll(name);\n            },\n        },\n        [`has${capitalize(camelizedName)}Outlet`]: {\n            get() {\n                return this.outlets.has(name);\n            },\n        },\n    };\n}\n\nfunction TargetPropertiesBlessing(constructor) {\n    const targets = readInheritableStaticArrayValues(constructor, \"targets\");\n    return targets.reduce((properties, targetDefinition) => {\n        return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n    }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n    return {\n        [`${name}Target`]: {\n            get() {\n                const target = this.targets.find(name);\n                if (target) {\n                    return target;\n                }\n                else {\n                    throw new Error(`Missing target element \"${name}\" for \"${this.identifier}\" controller`);\n                }\n            },\n        },\n        [`${name}Targets`]: {\n            get() {\n                return this.targets.findAll(name);\n            },\n        },\n        [`has${capitalize(name)}Target`]: {\n            get() {\n                return this.targets.has(name);\n            },\n        },\n    };\n}\n\nfunction ValuePropertiesBlessing(constructor) {\n    const valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n    const propertyDescriptorMap = {\n        valueDescriptorMap: {\n            get() {\n                return valueDefinitionPairs.reduce((result, valueDefinitionPair) => {\n                    const valueDescriptor = parseValueDefinitionPair(valueDefinitionPair, this.identifier);\n                    const attributeName = this.data.getAttributeNameForKey(valueDescriptor.key);\n                    return Object.assign(result, { [attributeName]: valueDescriptor });\n                }, {});\n            },\n        },\n    };\n    return valueDefinitionPairs.reduce((properties, valueDefinitionPair) => {\n        return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n    }, propertyDescriptorMap);\n}\nfunction propertiesForValueDefinitionPair(valueDefinitionPair, controller) {\n    const definition = parseValueDefinitionPair(valueDefinitionPair, controller);\n    const { key, name, reader: read, writer: write } = definition;\n    return {\n        [name]: {\n            get() {\n                const value = this.data.get(key);\n                if (value !== null) {\n                    return read(value);\n                }\n                else {\n                    return definition.defaultValue;\n                }\n            },\n            set(value) {\n                if (value === undefined) {\n                    this.data.delete(key);\n                }\n                else {\n                    this.data.set(key, write(value));\n                }\n            },\n        },\n        [`has${capitalize(name)}`]: {\n            get() {\n                return this.data.has(key) || definition.hasCustomDefaultValue;\n            },\n        },\n    };\n}\nfunction parseValueDefinitionPair([token, typeDefinition], controller) {\n    return valueDescriptorForTokenAndTypeDefinition({\n        controller,\n        token,\n        typeDefinition,\n    });\n}\nfunction parseValueTypeConstant(constant) {\n    switch (constant) {\n        case Array:\n            return \"array\";\n        case Boolean:\n            return \"boolean\";\n        case Number:\n            return \"number\";\n        case Object:\n            return \"object\";\n        case String:\n            return \"string\";\n    }\n}\nfunction parseValueTypeDefault(defaultValue) {\n    switch (typeof defaultValue) {\n        case \"boolean\":\n            return \"boolean\";\n        case \"number\":\n            return \"number\";\n        case \"string\":\n            return \"string\";\n    }\n    if (Array.isArray(defaultValue))\n        return \"array\";\n    if (Object.prototype.toString.call(defaultValue) === \"[object Object]\")\n        return \"object\";\n}\nfunction parseValueTypeObject(payload) {\n    const { controller, token, typeObject } = payload;\n    const hasType = isSomething(typeObject.type);\n    const hasDefault = isSomething(typeObject.default);\n    const fullObject = hasType && hasDefault;\n    const onlyType = hasType && !hasDefault;\n    const onlyDefault = !hasType && hasDefault;\n    const typeFromObject = parseValueTypeConstant(typeObject.type);\n    const typeFromDefaultValue = parseValueTypeDefault(payload.typeObject.default);\n    if (onlyType)\n        return typeFromObject;\n    if (onlyDefault)\n        return typeFromDefaultValue;\n    if (typeFromObject !== typeFromDefaultValue) {\n        const propertyPath = controller ? `${controller}.${token}` : token;\n        throw new Error(`The specified default value for the Stimulus Value \"${propertyPath}\" must match the defined type \"${typeFromObject}\". The provided default value of \"${typeObject.default}\" is of type \"${typeFromDefaultValue}\".`);\n    }\n    if (fullObject)\n        return typeFromObject;\n}\nfunction parseValueTypeDefinition(payload) {\n    const { controller, token, typeDefinition } = payload;\n    const typeObject = { controller, token, typeObject: typeDefinition };\n    const typeFromObject = parseValueTypeObject(typeObject);\n    const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n    const typeFromConstant = parseValueTypeConstant(typeDefinition);\n    const type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n    if (type)\n        return type;\n    const propertyPath = controller ? `${controller}.${typeDefinition}` : token;\n    throw new Error(`Unknown value type \"${propertyPath}\" for \"${token}\" value`);\n}\nfunction defaultValueForDefinition(typeDefinition) {\n    const constant = parseValueTypeConstant(typeDefinition);\n    if (constant)\n        return defaultValuesByType[constant];\n    const hasDefault = hasProperty(typeDefinition, \"default\");\n    const hasType = hasProperty(typeDefinition, \"type\");\n    const typeObject = typeDefinition;\n    if (hasDefault)\n        return typeObject.default;\n    if (hasType) {\n        const { type } = typeObject;\n        const constantFromType = parseValueTypeConstant(type);\n        if (constantFromType)\n            return defaultValuesByType[constantFromType];\n    }\n    return typeDefinition;\n}\nfunction valueDescriptorForTokenAndTypeDefinition(payload) {\n    const { token, typeDefinition } = payload;\n    const key = `${dasherize(token)}-value`;\n    const type = parseValueTypeDefinition(payload);\n    return {\n        type,\n        key,\n        name: camelize(key),\n        get defaultValue() {\n            return defaultValueForDefinition(typeDefinition);\n        },\n        get hasCustomDefaultValue() {\n            return parseValueTypeDefault(typeDefinition) !== undefined;\n        },\n        reader: readers[type],\n        writer: writers[type] || writers.default,\n    };\n}\nconst defaultValuesByType = {\n    get array() {\n        return [];\n    },\n    boolean: false,\n    number: 0,\n    get object() {\n        return {};\n    },\n    string: \"\",\n};\nconst readers = {\n    array(value) {\n        const array = JSON.parse(value);\n        if (!Array.isArray(array)) {\n            throw new TypeError(`expected value of type \"array\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(array)}\"`);\n        }\n        return array;\n    },\n    boolean(value) {\n        return !(value == \"0\" || String(value).toLowerCase() == \"false\");\n    },\n    number(value) {\n        return Number(value.replace(/_/g, \"\"));\n    },\n    object(value) {\n        const object = JSON.parse(value);\n        if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n            throw new TypeError(`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(object)}\"`);\n        }\n        return object;\n    },\n    string(value) {\n        return value;\n    },\n};\nconst writers = {\n    default: writeString,\n    array: writeJSON,\n    object: writeJSON,\n};\nfunction writeJSON(value) {\n    return JSON.stringify(value);\n}\nfunction writeString(value) {\n    return `${value}`;\n}\n\nclass Controller {\n    constructor(context) {\n        this.context = context;\n    }\n    static get shouldLoad() {\n        return true;\n    }\n    static afterLoad(_identifier, _application) {\n        return;\n    }\n    get application() {\n        return this.context.application;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get targets() {\n        return this.scope.targets;\n    }\n    get outlets() {\n        return this.scope.outlets;\n    }\n    get classes() {\n        return this.scope.classes;\n    }\n    get data() {\n        return this.scope.data;\n    }\n    initialize() {\n    }\n    connect() {\n    }\n    disconnect() {\n    }\n    dispatch(eventName, { target = this.element, detail = {}, prefix = this.identifier, bubbles = true, cancelable = true, } = {}) {\n        const type = prefix ? `${prefix}:${eventName}` : eventName;\n        const event = new CustomEvent(type, { detail, bubbles, cancelable });\n        target.dispatchEvent(event);\n        return event;\n    }\n}\nController.blessings = [\n    ClassPropertiesBlessing,\n    TargetPropertiesBlessing,\n    ValuePropertiesBlessing,\n    OutletPropertiesBlessing,\n];\nController.targets = [];\nController.outlets = [];\nController.values = {};\n\nexport { Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, SelectorObserver, StringMapObserver, TokenListObserver, ValueListObserver, add, defaultSchema, del, fetch, prune };\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static values = {\n        content: String\n    }\n\n    write () {\n        if (navigator.clipboard && navigator.clipboard.writeText) {\n            navigator.clipboard.writeText(this.contentValue).catch(this.clipboardFallback.bind(this));\n        } else {\n            this.clipboardFallback();\n        }\n    }\n\n    clipboardFallback  () {\n        const input = document.createElement('input');\n        input.value = this.contentValue;\n        document.body.appendChild(input);\n        input.select();\n        input.setSelectionRange(0, 99999);\n        document.execCommand('copy');\n        document.body.removeChild(input);\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nconst prefersDark = () => {\n    const prefersDark = localStorage.getItem('contao--prefers-dark');\n\n    if (null === prefersDark) {\n        return !!window.matchMedia('(prefers-color-scheme: dark)').matches;\n    }\n\n    return prefersDark === 'true';\n}\n\nconst setColorScheme = () => {\n    document.documentElement.dataset.colorScheme = prefersDark() ? 'dark' : 'light';\n};\n\nwindow.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', setColorScheme);\nsetColorScheme();\n\nexport default class extends Controller {\n    static targets = ['label'];\n\n    static values = {\n        i18n: {\n            type: Object,\n            default: { light: 'Disable dark mode', dark: 'Enable dark mode' }\n        }\n    };\n\n    initialize () {\n        this.toggle = this.toggle.bind(this);\n        this.setLabel = this.setLabel.bind(this);\n    }\n\n    connect () {\n        this.element.addEventListener('click', this.toggle);\n\n        window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', this.setLabel);\n        this.setLabel();\n    }\n\n    disconnect () {\n        this.element.removeEventListener('click', this.toggle);\n    }\n\n    toggle (e) {\n        e.preventDefault();\n\n        const isDark = !prefersDark();\n\n        if (isDark === window.matchMedia('(prefers-color-scheme: dark)').matches) {\n            localStorage.removeItem('contao--prefers-dark');\n        } else {\n            localStorage.setItem('contao--prefers-dark', String(isDark));\n        }\n\n        setColorScheme();\n\n        // Change the label after the dropdown is hidden\n        setTimeout(this.setLabel, 300);\n    }\n\n    setLabel () {\n        if (!this.hasLabelTarget) {\n            return;\n        }\n\n        const label = this.i18nValue[prefersDark() ? 'light' : 'dark'];\n\n        this.labelTarget.title = label;\n        this.labelTarget.innerText = label;\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static values = {\n        config: Object,\n    }\n\n    initialize () {\n        this.updateWizard = this.updateWizard.bind(this);\n        this.openModal = this.openModal.bind(this);\n    }\n\n    connect () {\n        this.select = this.element.querySelector('select');\n        this.button = document.createElement('button');\n        this.button.type = 'button';\n        this.button.title = '';\n        this.buttonImage = document.createElement('img');\n        this.button.append(this.buttonImage);\n        this.element.parentNode.classList.add('wizard');\n        this.element.after(this.button);\n\n        this.select.addEventListener('change', this.updateWizard);\n        this.button.addEventListener('click', this.openModal);\n\n        this.updateWizard();\n    }\n\n    disconnect () {\n        this.element.parentNode.classList.remove('wizard');\n        this.select.removeEventListener('change', this.updateWizard);\n        this.buttonImage.remove();\n        this.button.remove();\n    }\n\n    updateWizard () {\n        if (this.canEdit()) {\n            this.button.title = this.configValue.title;\n            this.button.disabled = false;\n            this.buttonImage.src = this.configValue.icon;\n        } else {\n            this.button.title = '';\n            this.button.disabled = true;\n            this.buttonImage.src = this.configValue.iconDisabled;\n        }\n    }\n\n    openModal () {\n        Backend.openModalIframe({\n            title: this.configValue.title,\n            url: `${ this.configValue.href }&id=${ this.select.value }`\n        });\n    }\n\n    canEdit () {\n        return this.configValue.ids.includes(Number(this.select.value));\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static targets = ['navigation', 'section'];\n\n    connect () {\n        this.rebuildNavigation();\n        this.connected = true;\n    }\n\n    sectionTargetConnected () {\n        if (!this.connected) {\n            return;\n        }\n\n        this.rebuildNavigation();\n    }\n\n    rebuildNavigation () {\n        if (!this.hasNavigationTarget) {\n            return;\n        }\n\n        const links = document.createElement('ul');\n\n        this.sectionTargets.forEach((el) => {\n            const action = document.createElement('button');\n            action.innerText = el.getAttribute(`data-${this.identifier}-label-value`);\n\n            action.addEventListener('click', (event) => {\n                event.preventDefault();\n                this.dispatch('scrollto', { target: el });\n                el.scrollIntoView();\n            });\n\n            const li = document.createElement('li');\n            li.append(action);\n\n            links.append(li);\n        });\n\n        this.navigationTarget.replaceChildren(links);\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static values = {\n        max: Number,\n        expand: String,\n        collapse: String,\n        expandAll: String,\n        expandAllTitle: String,\n        collapseAll: String,\n        collapseAllTitle: String,\n    }\n\n    static targets = ['operation', 'node'];\n\n    initialize () {\n        super.initialize();\n        this.togglerMap = new WeakMap();\n        this.nextId = 1;\n    }\n\n    operationTargetConnected () {\n        this.updateOperation();\n    }\n\n    nodeTargetConnected (node) {\n        const style = window.getComputedStyle(node, null);\n        const padding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);\n        const height = node.clientHeight - padding;\n\n        // Resize the element if it is higher than the maximum height\n        if (this.maxValue > height) {\n            return;\n        }\n\n        if (!node.id) {\n            node.id = `limit-height-${this.nextId++}`;\n        }\n\n        node.style.overflow = 'hidden';\n        node.style.maxHeight = `${this.maxValue}px`;\n\n        const button = document.createElement('button');\n        button.setAttribute('type', 'button');\n        button.title = this.expandValue;\n        button.innerHTML = '<span>...</span>';\n        button.classList.add('unselectable');\n        button.setAttribute('aria-expanded', 'false');\n        button.setAttribute('aria-controls', node.id);\n\n        button.addEventListener('click', (event) => {\n            event.preventDefault();\n            this.toggle(node);\n            this.updateOperation(event);\n        });\n\n        const toggler = document.createElement('div');\n        toggler.classList.add('limit_toggler');\n        toggler.append(button);\n\n        this.togglerMap.set(node, toggler);\n\n        node.append(toggler);\n        this.updateOperation();\n    }\n\n    nodeTargetDisconnected (node) {\n        if (!this.togglerMap.has(node)) {\n            return;\n        }\n\n        this.togglerMap.get(node).remove();\n        this.togglerMap.delete(node);\n        node.style.overflow = '';\n        node.style.maxHeight = '';\n    }\n\n    toggle (node) {\n        if (node.style.maxHeight === '') {\n            this.collapse(node);\n        } else {\n            this.expand(node);\n        }\n    }\n\n    expand (node) {\n        if (!this.togglerMap.has(node)) {\n            return;\n        }\n\n        node.style.maxHeight = '';\n        const button = this.togglerMap.get(node).querySelector('button');\n        button.title = this.collapseValue;\n        button.setAttribute('aria-expanded', 'true');\n    }\n\n    collapse (node) {\n        if (!this.togglerMap.has(node)) {\n            return;\n        }\n\n        node.style.maxHeight = `${this.maxValue}px`;\n        const button = this.togglerMap.get(node).querySelector('button');\n        button.title = this.expandValue;\n        button.setAttribute('aria-expanded', 'false');\n    }\n\n    toggleAll (event) {\n        event.preventDefault();\n        const isExpanded = this.hasExpanded() ^ event.altKey;\n\n        this.nodeTargets.forEach((node) => {\n            if (isExpanded) {\n                this.collapse(node);\n            } else {\n                this.expand(node);\n            }\n        });\n\n        this.updateOperation(event);\n    }\n\n    keypress (event) {\n        this.updateOperation(event);\n    }\n\n    updateOperation (event) {\n        if (!this.hasOperationTarget) {\n            return;\n        }\n\n        const hasTogglers = !!this.nodeTargets.find((el) => this.togglerMap.has(el));\n        const expanded = this.hasExpanded();\n\n        this.operationTarget.style.display = hasTogglers ? '' : 'none';\n        this.operationTarget.setAttribute('aria-controls', this.nodeTargets.map((el) => el.id).join(' '));\n        this.operationTarget.setAttribute('aria-expanded', expanded ? 'true' : 'false');\n\n        if (expanded ^ (event ? event.altKey : false)) {\n            this.operationTarget.innerText = this.collapseAllValue;\n            this.operationTarget.title = this.collapseAllTitleValue;\n        } else {\n            this.operationTarget.innerText = this.expandAllValue;\n            this.operationTarget.title = this.expandAllTitleValue;\n        }\n    }\n\n    hasExpanded () {\n        return !!this.nodeTargets.find((el) => this.togglerMap.has(el) && el.style.maxHeight === '');\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static targets = ['input']\n\n    delete () {\n        this.inputTargets.forEach((input) => {\n            input.value = '';\n        })\n    }\n}\n","import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n    static targets = ['scrollTo', 'autoFocus'];\n\n    static values = {\n        sessionKey: {\n            type: String,\n            default: 'contao_backend_offset'\n        },\n        behavior: {\n            type: String,\n            default: 'instant'\n        },\n        block: {\n            type: String,\n            default: 'center'\n        }\n    };\n\n    // Backwards compatibility: automatically register the Stimulus controller if the legacy methods are used\n    static afterLoad(identifier, application) {\n        const loadFallback = () => {\n            return new Promise((resolve, reject) => {\n                const controller = application.getControllerForElementAndIdentifier(document.documentElement, identifier);\n\n                if (controller) {\n                    resolve(controller);\n                    return;\n                }\n\n                const { controllerAttribute } = application.schema;\n                document.documentElement.setAttribute(controllerAttribute, `${document.documentElement.getAttribute(controllerAttribute) || ''} ${ identifier }`);\n\n                setTimeout(() => {\n                    const controller = application.getControllerForElementAndIdentifier(document.documentElement, identifier);\n                    controller && resolve(controller) || reject(controller);\n                }, 100);\n            });\n        }\n\n        if (window.Backend && !window.Backend.initScrollOffset) {\n            window.Backend.initScrollOffset = () => {\n                console.warn('Backend.initScrollOffset() is deprecated. Please use the Stimulus controller instead.');\n                loadFallback();\n            }\n        }\n\n        if (window.Backend && !window.Backend.getScrollOffset) {\n            window.Backend.getScrollOffset = () => {\n                console.warn('Backend.getScrollOffset() is deprecated. Please use the Stimulus controller instead.');\n                loadFallback().then((controller) => controller.discard());\n            }\n        }\n    }\n\n    initialize () {\n        this.store = this.store.bind(this);\n    }\n\n    connect () {\n        if (!this.offset) return;\n\n        window.scrollTo({\n            top: this.offset,\n            behavior: this.behaviorValue,\n            block: this.blockValue\n        });\n\n        this.offset = null;\n    }\n\n    scrollToTargetConnected() {\n        this.scrollToTarget.scrollIntoView({\n            behavior: this.behaviorValue,\n            block: this.blockValue\n        });\n    }\n\n    autoFocusTargetConnected() {\n        if (this.offset || this.autoFocus) return;\n\n        const input = this.autoFocusTarget;\n\n        if (\n            input.disabled || input.readonly\n            || !input.offsetWidth || !input.offsetHeight\n            || input.closest('.chzn-search')\n            || input.autocomplete && input.autocomplete !== 'off'\n        ) {\n            return;\n        }\n\n        this.autoFocus = true;\n        input.focus();\n    }\n\n    store () {\n        this.offset = this.element.scrollTop;\n    }\n\n    discard () {\n        this.offset = null;\n    }\n\n    get offset () {\n        const value = window.sessionStorage.getItem(this.sessionKeyValue);\n\n        return value ? parseInt(value) : null;\n    }\n\n    set offset (value) {\n        if (value === null || value === undefined) {\n            window.sessionStorage.removeItem(this.sessionKeyValue);\n        } else {\n            window.sessionStorage.setItem(this.sessionKeyValue, String(value));\n        }\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static values = {\n        id: String,\n        table: String,\n    }\n\n    static classes = ['collapsed'];\n\n    static afterLoad (identifier, application) {\n        const addController = (el, id, table) => {\n            const fs = el.parentNode;\n\n            fs.dataset.controller = `${fs.dataset.controller || ''} ${identifier}`;\n            fs.setAttribute(`data-${identifier}-id-value`, id);\n            fs.setAttribute(`data-${identifier}-table-value`, table);\n            fs.setAttribute(`data-${identifier}-collapsed-class`, 'collapsed');\n            el.setAttribute('data-action', `click->${identifier}#toggle`);\n        }\n\n        const migrateLegacy = () => {\n            document.querySelectorAll('legend[data-toggle-fieldset]').forEach(function(el) {\n                if (window.console) {\n                    console.warn(`Using the \"data-toggle-fieldset\" attribute on fieldset legends is deprecated and will be removed in Contao 6. Apply the \"${identifier}\" Stimulus controller instead.`);\n                }\n\n                const { id, table } = JSON.parse(el.getAttribute('data-toggle-fieldset'));\n                addController(el, id, table);\n            });\n\n            AjaxRequest.toggleFieldset = (el, id, table) => {\n                const fs = el.parentNode;\n\n                // Already clicked, Stimulus controller was added dynamically\n                if (application.getControllerForElementAndIdentifier(fs, identifier)) {\n                    return;\n                }\n\n                if (window.console) {\n                    console.warn('Using AjaxRequest.toggleFieldset() is deprecated and will be removed in Contao 6. Apply the Stimulus actions instead.');\n                }\n\n                addController(el, id, table);\n\n                // Optimistically wait until Stimulus has registered the new controller\n                setTimeout(() => { application.getControllerForElementAndIdentifier(fs, identifier).toggle(); }, 100);\n            };\n        }\n\n        // Called as soon as registered, so DOM may not have been loaded yet\n        if (document.readyState === \"loading\") {\n            document.addEventListener(\"DOMContentLoaded\", migrateLegacy)\n        } else {\n            migrateLegacy();\n        }\n    }\n\n    connect () {\n        if (this.element.querySelectorAll('label.error, label.mandatory').length) {\n            this.element.classList.remove(this.collapsedClass);\n        } else if (this.element.classList.contains('hide')) {\n            if (window.console) {\n                console.warn(`Using class \"hide\" on a fieldset is deprecated and will be removed in Contao 6. Use class \"${this.collapsedClass}\" instead.`);\n            }\n\n            this.element.classList.add(this.collapsedClass);\n        }\n    }\n\n    toggle () {\n        if (this.element.classList.contains(this.collapsedClass)) {\n            this.open();\n        } else {\n            this.close();\n        }\n    }\n\n    open () {\n        if (!this.element.classList.contains(this.collapsedClass)) {\n            return;\n        }\n\n        this.element.classList.remove(this.collapsedClass);\n        this.storeState(1);\n    }\n\n    close () {\n        if (this.element.classList.contains(this.collapsedClass)) {\n            return;\n        }\n\n        const form = this.element.closest('form');\n        const input = this.element.querySelectorAll('[required]');\n\n        let collapse = true;\n        for (let i = 0; i < input.length; i++) {\n            if (!input[i].value) {\n                collapse = false;\n                break;\n            }\n        }\n\n        if (!collapse) {\n            if (typeof(form.checkValidity) == 'function') {\n                form.querySelector('button[type=\"submit\"]').click();\n            }\n        } else {\n            this.element.classList.add(this.collapsedClass);\n            this.storeState(0);\n        }\n    }\n\n    storeState (state) {\n        if (!this.hasIdValue || !this.hasTableValue) {\n            return;\n        }\n\n        fetch(window.location.href, {\n            method: 'POST',\n            headers: {\n                'X-Requested-With': 'XMLHttpRequest'\n            },\n            body: new URLSearchParams({\n                action: 'toggleFieldset',\n                id: this.idValue,\n                table: this.tableValue,\n                state: state,\n            })\n        });\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static classes = ['collapsed']\n\n    static values = {\n        url: String,\n        requestToken: String,\n        expandTitle: String,\n        collapseTitle: String,\n    }\n\n    toggle ({ currentTarget, params: { category }}) {\n        const el = currentTarget.parentNode;\n        const collapsed = el.classList.toggle(this.collapsedClass);\n\n        currentTarget.setAttribute('aria-expanded', collapsed ? 'false' : 'true');\n        currentTarget.setAttribute('title', collapsed ? this.expandTitleValue : this.collapseTitleValue);\n\n        this.sendRequest(category, collapsed)\n    }\n\n    sendRequest (category, collapsed) {\n        fetch(this.urlValue, {\n            method: 'POST',\n            headers: {\n                'X-Requested-With': 'XMLHttpRequest'\n            },\n            body: new URLSearchParams({\n                action: 'toggleNavigation',\n                id: category,\n                state: collapsed ? 0 : 1,\n                REQUEST_TOKEN: this.requestTokenValue\n            })\n        });\n    }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n    static values = {\n        mode: {\n            type: Number,\n            default: 5\n        },\n        toggleAction: String,\n        loadAction: String,\n        requestToken: String,\n        refererId: String,\n        expand: String,\n        collapse: String,\n        expandAll: String,\n        expandAllTitle: String,\n        collapseAll: String,\n        collapseAllTitle: String,\n    }\n\n    static targets = ['operation', 'node', 'toggle', 'child', 'rootChild'];\n\n    operationTargetConnected () {\n        this.updateOperation();\n    }\n\n    childTargetConnected () {\n        this.updateOperation();\n    }\n\n    toggle (event) {\n        event.preventDefault();\n\n        const el = event.currentTarget;\n        el.blur();\n\n        this.toggleToggler(el, event.params.id, event.params.level, event.params.folder);\n    }\n\n    toggleToggler (el, id, level, folder) {\n        const item = document.id(id);\n\n        if (item && item.style.display === 'none') {\n            this.showChild(item);\n            this.expandToggler(el);\n            this.updateState(el, id, 1);\n        } else if (item) {\n            this.hideChild(item);\n            this.collapseToggler(el);\n            this.updateState(el, id, 0);\n        } else {\n            this.fetchChild(el, id, level, folder)\n        }\n\n        this.updateOperation();\n    }\n\n    expandToggler (el) {\n        el.classList.add('foldable--open');\n        el.title = this.collapseValue;\n    }\n\n    collapseToggler (el) {\n        el.classList.remove('foldable--open');\n        el.title = this.expandValue;\n    }\n\n    loadToggler (el, enabled) {\n        el.classList[enabled ? 'add' : 'remove']('foldable--loading');\n    }\n\n    showChild (item) {\n        item.style.display = '';\n    }\n\n    hideChild (item) {\n        item.style.display = 'none';\n    }\n\n    async fetchChild (el, id, level, folder) {\n        this.loadToggler(el, true);\n\n        const url = new URL(location.href);\n        const search = url.searchParams;\n        search.set('ref', this.refererIdValue);\n        url.search = search.toString();\n\n        const response = await fetch(url, {\n            method: 'POST',\n            headers: {\n                'Content-Type': 'application/x-www-form-urlencoded',\n                'X-Requested-With': 'XMLHttpRequest'\n            },\n            body: new URLSearchParams({\n                'action': this.loadActionValue,\n                'id': id,\n                'level': level,\n                'folder': folder,\n                'state': 1,\n                'REQUEST_TOKEN': this.requestTokenValue\n            })\n        });\n\n        if (response.ok) {\n            const txt = await response.text();\n\n            const li = document.createElement('li');\n            li.id = id;\n            li.classList.add('parent');\n            li.style.display = 'inline';\n            li.setAttribute(`data-${this.identifier}-target`, level === 0 ? 'child rootChild' : 'child')\n\n            const ul = document.createElement('ul');\n            ul.classList.add('level_' + level);\n            ul.innerHTML = txt;\n            li.append(ul);\n\n            if (this.modeValue === 5) {\n                el.closest('li').after(li);\n            } else {\n                let isFolder = false,\n                    parent = el.closest('li'),\n                    next;\n\n                while (typeOf(parent) === 'element' && parent.tagName === 'LI' && (next = parent.nextElementSibling)) {\n                    parent = next;\n                    if (parent.classList.contains('tl_folder')) {\n                        isFolder = true;\n                        break;\n                    }\n                }\n\n                if (isFolder) {\n                    parent.before(li);\n                } else {\n                    parent.after(li);\n                }\n            }\n\n            window.dispatchEvent(new CustomEvent('structure'));\n            this.expandToggler(el);\n\n            // HOOK (see #6752)\n            window.fireEvent('ajax_change')\n        }\n\n        this.loadToggler(el, false);\n    }\n\n    async toggleAll (event) {\n        event.preventDefault();\n\n        const href = event.currentTarget.href;\n\n        if (this.hasExpandedRoot() ^ (event ? event.altKey : false)) {\n            this.updateAllState(href, 0);\n            this.toggleTargets.forEach((el) => this.collapseToggler(el));\n            this.childTargets.forEach((item) => item.style.display = 'none');\n        } else {\n            this.childTargets.forEach((el) => el.remove());\n            this.toggleTargets.forEach((el) => this.loadToggler(el, true));\n\n            await this.updateAllState(href, 1);\n            const promises = [];\n\n            this.toggleTargets.forEach((el) => {\n                promises.push(this.fetchChild(\n                    el,\n                    el.getAttribute(`data-${this.identifier}-id-param`),\n                    0,\n                    el.getAttribute(`data-${this.identifier}-folder-param`)\n                ));\n            });\n\n            await Promise.all(promises);\n        }\n\n        this.updateOperation();\n    }\n\n    keypress (event) {\n        this.updateOperation(event)\n    }\n\n    async updateState (el, id, state) {\n        await fetch(location.href, {\n            method: 'POST',\n            headers: {\n                'Content-Type': 'application/x-www-form-urlencoded',\n                'X-Requested-With': 'XMLHttpRequest'\n            },\n            body: new URLSearchParams({\n                'action': this.toggleActionValue,\n                'id': id,\n                'state': state,\n                'REQUEST_TOKEN': this.requestTokenValue\n            })\n        });\n    }\n\n    async updateAllState (href, state) {\n        await fetch(`${href}&state=${state}`);\n    }\n\n    updateOperation (event) {\n        if (!this.hasOperationTarget) {\n            return;\n        }\n\n        if (this.hasExpandedRoot() ^ (event ? event.altKey : false)) {\n            this.operationTarget.innerText = this.collapseAllValue;\n            this.operationTarget.title = this.collapseAllTitleValue;\n        } else {\n            this.operationTarget.innerText = this.expandAllValue;\n            this.operationTarget.title = this.expandAllTitleValue;\n        }\n    }\n\n    hasExpandedRoot () {\n        return !!this.rootChildTargets.find((el) => el.style.display !== 'none')\n    }\n}\n","/**\n * Provide methods to handle Ajax requests.\n *\n * @author Leo Feyer <https://github.com/leofeyer>\n */\nwindow.AjaxRequest =\n{\n\t/**\n\t * Toggle the navigation menu\n\t *\n\t * @param {object} el  The DOM element\n\t * @param {string} id  The ID of the menu item\n\t * @param {string} url The Ajax URL\n\t *\n\t * @returns {boolean}\n\t */\n\ttoggleNavigation: function(el, id, url) {\n\t\tif (window.console) {\n\t\t\tconsole.warn('AjaxRequest.toggleNavigation() is deprecated. Please use the stimulus controller instead.');\n\t\t}\n\n\t\tvar item = $(id),\n\t\t\tparent = $(el).getParent('li');\n\n\t\tif (item) {\n\t\t\tif (parent.hasClass('collapsed')) {\n\t\t\t\tparent.removeClass('collapsed');\n\t\t\t\t$(el).setAttribute('aria-expanded', 'true');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.collapse);\n\t\t\t\tnew Request.Contao({ url: url }).post({'action':'toggleNavigation', 'id':id, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t} else {\n\t\t\t\tparent.addClass('collapsed');\n\t\t\t\t$(el).setAttribute('aria-expanded', 'false');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.expand);\n\t\t\t\tnew Request.Contao({ url: url }).post({'action':'toggleNavigation', 'id':id, 'state':0, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * Toggle the page tree\n\t *\n\t * @param {object} el    The DOM element\n\t * @param {string} id    The ID of the target element\n\t * @param {int}    level The indentation level\n\t * @param {int}    mode  The insert mode\n\t *\n\t * @returns {boolean}\n\t */\n\ttoggleStructure: function(el, id, level, mode) {\n\t\tif (window.console) {\n\t\t\tconsole.warn('AjaxRequest.toggleStructure() is deprecated. Please use the stimulus controller instead.');\n\t\t}\n\n\t\tel.blur();\n\n\t\tvar item = $(id);\n\n\t\tif (item) {\n\t\t\tif (item.getStyle('display') == 'none') {\n\t\t\t\titem.setStyle('display', null);\n\n\t\t\t\t$(el).addClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.collapse);\n\n\t\t\t\tnew Request.Contao({field:el}).post({'action':'toggleStructure', 'id':id, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t} else {\n\t\t\t\titem.setStyle('display', 'none');\n\n\t\t\t\t$(el).removeClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.expand);\n\n\t\t\t\tnew Request.Contao({field:el}).post({'action':'toggleStructure', 'id':id, 'state':0, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tnew Request.Contao({\n\t\t\tfield: el,\n\t\t\tevalScripts: true,\n\t\t\tonRequest: function() {\n\t\t\t\tAjaxRequest.displayBox(Contao.lang.loading + ' …');\n\t\t\t},\n\t\t\tonSuccess: function(txt) {\n\t\t\t\tvar li = new Element('li', {\n\t\t\t\t\t'id': id,\n\t\t\t\t\t'class': 'parent',\n\t\t\t\t\t'styles': {\n\t\t\t\t\t\t'display': 'inline'\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tnew Element('ul', {\n\t\t\t\t\t'class': 'level_' + level,\n\t\t\t\t\t'html': txt\n\t\t\t\t}).inject(li, 'bottom');\n\n\t\t\t\tif (mode == 5) {\n\t\t\t\t\tli.inject($(el).getParent('li'), 'after');\n\t\t\t\t} else {\n\t\t\t\t\tvar folder = false,\n\t\t\t\t\t\tparent = $(el).getParent('li'),\n\t\t\t\t\t\tnext;\n\n\t\t\t\t\twhile (typeOf(parent) == 'element' && (next = parent.getNext('li'))) {\n\t\t\t\t\t\tparent = next;\n\t\t\t\t\t\tif (parent.hasClass('tl_folder')) {\n\t\t\t\t\t\t\tfolder = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (folder) {\n\t\t\t\t\t\tli.inject(parent, 'before');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tli.inject(parent, 'after');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Update the referer ID\n\t\t\t\tli.getElements('a').each(function(el) {\n\t\t\t\t\tel.href = el.href.replace(/&ref=[a-f0-9]+/, '&ref=' + Contao.referer_id);\n\t\t\t\t});\n\n\t\t\t\t$(el).addClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.collapse);\n\n\t\t\t\twindow.fireEvent('structure');\n\t\t\t\tAjaxRequest.hideBox();\n\n\t\t\t\t// HOOK\n\t\t\t\twindow.fireEvent('ajax_change');\n   \t\t\t}\n\t\t}).post({'action':'loadStructure', 'id':id, 'level':level, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * Toggle the file tree\n\t *\n\t * @param {object} el     The DOM element\n\t * @param {string} id     The ID of the target element\n\t * @param {string} folder The folder's path\n\t * @param {int}    level  The indentation level\n\t *\n\t * @returns {boolean}\n\t */\n\ttoggleFileManager: function(el, id, folder, level) {\n\t\tif (window.console) {\n\t\t\tconsole.warn('AjaxRequest.toggleFileManager() is deprecated. Please use the stimulus controller instead.');\n\t\t}\n\n\t\tel.blur();\n\n\t\tvar item = $(id);\n\n\t\tif (item) {\n\t\t\tif (item.getStyle('display') == 'none') {\n\t\t\t\titem.setStyle('display', null);\n\n\t\t\t\t$(el).addClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.collapse);\n\n\t\t\t\tnew Request.Contao({field:el}).post({'action':'toggleFileManager', 'id':id, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t} else {\n\t\t\t\titem.setStyle('display', 'none');\n\n\t\t\t\t$(el).removeClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.expand);\n\n\t\t\t\tnew Request.Contao({field:el}).post({'action':'toggleFileManager', 'id':id, 'state':0, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tnew Request.Contao({\n\t\t\tfield: el,\n\t\t\tevalScripts: true,\n\t\t\tonRequest: function() {\n\t\t\t\tAjaxRequest.displayBox(Contao.lang.loading + ' …');\n\t\t\t},\n\t\t\tonSuccess: function(txt) {\n\t\t\t\tvar li = new Element('li', {\n\t\t\t\t\t'id': id,\n\t\t\t\t\t'class': 'parent',\n\t\t\t\t\t'styles': {\n\t\t\t\t\t\t'display': 'inline'\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tnew Element('ul', {\n\t\t\t\t\t'class': 'level_' + level,\n\t\t\t\t\t'html': txt\n\t\t\t\t}).inject(li, 'bottom');\n\n\t\t\t\tli.inject($(el).getParent('li'), 'after');\n\n\t\t\t\t// Update the referer ID\n\t\t\t\tli.getElements('a').each(function(el) {\n\t\t\t\t\tel.href = el.href.replace(/&ref=[a-f0-9]+/, '&ref=' + Contao.referer_id);\n\t\t\t\t});\n\n\t\t\t\t$(el).addClass('foldable--open');\n\t\t\t\t$(el).setAttribute('title', Contao.lang.collapse);\n\n\t\t\t\tAjaxRequest.hideBox();\n\n\t\t\t\t// HOOK\n\t\t\t\twindow.fireEvent('ajax_change');\n   \t\t\t}\n\t\t}).post({'action':'loadFileManager', 'id':id, 'level':level, 'folder':folder, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * Toggle sub-palettes in edit mode\n\t *\n\t * @param {object} el    The DOM element\n\t * @param {string} id    The ID of the target element\n\t * @param {string} field The field name\n\t */\n\ttoggleSubpalette: function(el, id, field) {\n\t\tel.blur();\n\t\tvar item = $(id);\n\n\t\tif (item) {\n\t\t\tif (!el.value) {\n\t\t\t\tel.value = 1;\n\t\t\t\tel.checked = 'checked';\n\t\t\t\titem.setStyle('display', null);\n\t\t\t\titem.getElements('[data-required]').each(function(el) {\n\t\t\t\t\tel.set('required', '').set('data-required', null);\n\t\t\t\t});\n\t\t\t\tnew Request.Contao({field: el, onSuccess:updateVersionNumber}).post({'action':'toggleSubpalette', 'id':id, 'field':field, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t} else {\n\t\t\t\tel.value = '';\n\t\t\t\tel.checked = '';\n\t\t\t\titem.setStyle('display', 'none');\n\t\t\t\titem.getElements('[required]').each(function(el) {\n\t\t\t\t\tel.set('required', null).set('data-required', '');\n\t\t\t\t});\n\t\t\t\tnew Request.Contao({field: el, onSuccess:updateVersionNumber}).post({'action':'toggleSubpalette', 'id':id, 'field':field, 'state':0, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tnew Request.Contao({\n\t\t\tfield: el,\n\t\t\tevalScripts: false,\n\t\t\tonRequest: function() {\n\t\t\t\tAjaxRequest.displayBox(Contao.lang.loading + ' …');\n\t\t\t},\n\t\t\tonSuccess: function(txt, json) {\n\t\t\t\tvar div = new Element('div', {\n\t\t\t\t\t'id': id,\n\t\t\t\t\t'class': 'subpal cf',\n\t\t\t\t\t'html': txt,\n\t\t\t\t\t'styles': {\n\t\t\t\t\t\t'display': 'block'\n\t\t\t\t\t}\n\t\t\t\t}).inject($(el).getParent('div').getParent('div'), 'after');\n\n\t\t\t\t// Execute scripts after the DOM has been updated\n\t\t\t\tif (json.javascript) {\n\n\t\t\t\t\t// Use Asset.javascript() instead of document.write() to load a\n\t\t\t\t\t// JavaScript file and re-execute the code after it has been loaded\n\t\t\t\t\tdocument.write = function(str) {\n\t\t\t\t\t\tvar src = '';\n\t\t\t\t\t\tstr.replace(/<script src=\"([^\"]+)\"/i, function(all, match){\n\t\t\t\t\t\t\tsrc = match;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsrc && Asset.javascript(src, {\n\t\t\t\t\t\t\tonLoad: function() {\n\t\t\t\t\t\t\t\tBrowser.exec(json.javascript);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\n\t\t\t\t\tBrowser.exec(json.javascript);\n\t\t\t\t}\n\n\t\t\t\tel.value = 1;\n\t\t\t\tel.checked = 'checked';\n\n\t\t\t\t// Update the referer ID\n\t\t\t\tdiv.getElements('a').each(function(el) {\n\t\t\t\t\tel.href = el.href.replace(/&ref=[a-f0-9]+/, '&ref=' + Contao.referer_id);\n\t\t\t\t});\n\n\t\t\t\tupdateVersionNumber(txt);\n\n\t\t\t\tAjaxRequest.hideBox();\n\t\t\t\twindow.fireEvent('ajax_change');\n\t\t\t}\n\t\t}).post({'action':'toggleSubpalette', 'id':id, 'field':field, 'load':1, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\n\t\tfunction updateVersionNumber(html) {\n\t\t\tvar fields = el.form.elements.VERSION_NUMBER || [];\n\t\t\tif (!fields.forEach) {\n\t\t\t\tfields = [fields];\n\t\t\t}\n\t\t\tfields.forEach(function(field) {\n\t\t\t\tfield.value = /<input\\s+[^>]*?name=\"VERSION_NUMBER\"\\s+[^>]*?value=\"([^\"]*)\"/i.exec(html)[1];\n\t\t\t});\n\t\t}\n\t},\n\n\t/**\n\t * Toggle the state of a checkbox field\n\t *\n\t * @param {object}  el      The DOM element\n\t * @param {boolean} rowIcon Whether the row icon should be toggled as well\n\t *\n\t * @returns {boolean}\n\t */\n\ttoggleField: function(el, rowIcon) {\n\t\tel.blur();\n\n\t\tvar img = null,\n\t\t\timages = $(el).getElements('img'),\n\t\t\tpublished = (images[0].get('data-state') == 1),\n\t\t\tdiv = el.getParent('div'),\n\t\t\tnext, pa;\n\n\t\tif (rowIcon) {\n\t\t\t// Find the icon depending on the view (tree view, list view, parent view)\n\t\t\tif (div.hasClass('tl_right')) {\n\t\t\t\timg = div.getPrevious('div').getElements('img');\n\t\t\t} else if (div.hasClass('tl_listing_container')) {\n\t\t\t\timg = el.getParent('td').getPrevious('td').getFirst('div.list_icon');\n\t\t\t\tif (img === null) { // comments\n\t\t\t\t\timg = el.getParent('td').getPrevious('td').getElement('div.cte_type');\n\t\t\t\t}\n\t\t\t\tif (img === null) { // showColumns\n\t\t\t\t\timg = el.getParent('tr').getFirst('td').getElement('div.list_icon_new');\n\t\t\t\t}\n\t\t\t} else if (next = div.getNext('div')) {\n\t\t\t\tif (next.hasClass('cte_type')) {\n\t\t\t\t\timg = next;\n\t\t\t\t}\n\t\t\t\tif (img === null) { // newsletter recipients\n\t\t\t\t\timg = next.getFirst('div.list_icon');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Change the row icon\n\t\t\tif (img !== null) {\n\t\t\t\t// Tree view\n\t\t\t\tif (!(img instanceof HTMLElement) && img.forEach) {\n\t\t\t\t\timg.forEach((img) => {\n\t\t\t\t\t\tif (img.nodeName.toLowerCase() == 'img') {\n\t\t\t\t\t\t\tif (!img.getParent('ul.tl_listing').hasClass('tl_tree_xtnd')) {\n\t\t\t\t\t\t\t\tpa = img.getParent('a');\n\n\t\t\t\t\t\t\t\tif (pa && pa.href.indexOf('contao/preview') == -1) {\n\t\t\t\t\t\t\t\t\tif (next = pa.getNext('a')) {\n\t\t\t\t\t\t\t\t\t\timg = next.getElement('img');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\timg = new Element('img'); // no icons used (see #2286)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst newSrc = !published ? img.get('data-icon') : img.get('data-icon-disabled');\n\t\t\t\t\t\t\timg.src = (img.src.includes('/') && !newSrc.includes('/')) ? img.src.slice(0, img.src.lastIndexOf('/') + 1) + newSrc : newSrc;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\t// Parent view\n\t\t\t\telse if (img.hasClass('cte_type')) {\n\t\t\t\t\tif (!published) {\n\t\t\t\t\t\timg.addClass('published');\n\t\t\t\t\t\timg.removeClass('unpublished');\n\t\t\t\t\t} else {\n\t\t\t\t\t\timg.addClass('unpublished');\n\t\t\t\t\t\timg.removeClass('published');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// List view\n\t\t\t\telse {\n\t\t\t\t\timg.setStyle('background-image', 'url(' + (!published ? img.get('data-icon') : img.get('data-icon-disabled')) + ')');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Send request\n\t\timages.forEach(function(image) {\n\t\t\tconst newSrc = !published ? image.get('data-icon') : image.get('data-icon-disabled');\n\t\t\timage.src = (image.src.includes('/') && !newSrc.includes('/')) ? image.src.slice(0, image.src.lastIndexOf('/') + 1) + newSrc : newSrc;\n\t\t\timage.set('data-state', !published ? 1 : 0);\n\t\t});\n\n\t\tif (!published && $(el).get('data-title')) {\n\t\t\tel.title = $(el).get('data-title');\n\t\t} else if (published && $(el).get('data-title-disabled')) {\n\t\t\tel.title = $(el).get('data-title-disabled');\n\t\t}\n\n\t\tnew Request.Contao({'url':el.href, 'followRedirects':false}).get();\n\n\t\t// Return false to stop the click event on link\n\t\treturn false;\n\t},\n\n\t/**\n\t * Toggle a group of a multi-checkbox field\n\t *\n\t * @param {object} el The DOM element\n\t * @param {string} id The ID of the target element\n\t *\n\t * @returns {boolean}\n\t */\n\ttoggleCheckboxGroup: function(el, id) {\n\t\tel.blur();\n\n\t\tvar item = $(id);\n\n\t\tif (item) {\n\t\t\tif (item.getStyle('display') == 'none') {\n\t\t\t\titem.setStyle('display', null);\n\t\t\t\t$(el).addClass('foldable--open');\n\n\t\t\t\tnew Request.Contao().post({'action':'toggleCheckboxGroup', 'id':id, 'state':1, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t} else {\n\t\t\t\titem.setStyle('display', 'none');\n\t\t\t\t$(el).removeClass('foldable--open');\n\n\t\t\t\tnew Request.Contao().post({'action':'toggleCheckboxGroup', 'id':id, 'state':0, 'REQUEST_TOKEN':Contao.request_token});\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * Display the \"loading data\" message\n\t *\n\t * @param {string} message The message text\n\t */\n\tdisplayBox: function(message) {\n\t\tvar box = $('tl_ajaxBox'),\n\t\t\toverlay = $('tl_ajaxOverlay'),\n\t\t\tscroll = window.getScroll();\n\n\t\tif (overlay === null) {\n\t\t\toverlay = new Element('div', {\n\t\t\t\t'id': 'tl_ajaxOverlay'\n\t\t\t}).inject($(document.body), 'bottom');\n\t\t}\n\n\t\toverlay.set({\n\t\t\t'styles': {\n\t\t\t\t'display': 'block',\n\t\t\t\t'top': scroll.y + 'px'\n\t\t\t}\n\t\t});\n\n\t\tif (box === null) {\n\t\t\tbox = new Element('div', {\n\t\t\t\t'id': 'tl_ajaxBox'\n\t\t\t}).inject($(document.body), 'bottom');\n\t\t}\n\n\t\tbox.set({\n\t\t\t'html': message,\n\t\t\t'styles': {\n\t\t\t\t'display': 'block',\n\t\t\t\t'top': (scroll.y + 100) + 'px'\n\t\t\t}\n\t\t})\n\t},\n\n\t/**\n\t * Hide the \"loading data\" message\n\t */\n\thideBox: function() {\n\t\tvar box = $('tl_ajaxBox'),\n\t\t\toverlay = $('tl_ajaxOverlay');\n\n\t\tif (overlay) {\n\t\t\toverlay.setStyle('display', 'none');\n\t\t}\n\n\t\tif (box) {\n\t\t\tbox.setStyle('display', 'none');\n\t\t}\n\t}\n};\n\n/**\n * Provide methods to handle back end tasks.\n *\n * @author Leo Feyer <https://github.com/leofeyer>\n */\nwindow.Backend =\n{\n\t/**\n\t * The current ID\n\t * @member {(string|null)}\n\t */\n\tcurrentId: null,\n\n\t/**\n\t * The popup window\n\t * @member {object}\n\t */\n\tpopupWindow: null,\n\n\t/**\n\t * The theme path\n\t * @member {string}\n\t */\n\tthemePath: Contao.script_url + 'system/themes/' + Contao.theme + '/',\n\n\t/**\n\t * Open a modal window\n\t *\n\t * @param {int}    width   The width in pixels\n\t * @param {string} title   The window's title\n\t * @param {string} content The window's content\n\t */\n\topenModalWindow: function(width, title, content) {\n\t\tnew SimpleModal({\n\t\t\t'width': width,\n\t\t\t'hideFooter': true,\n\t\t\t'draggable': false,\n\t\t\t'overlayOpacity': .7,\n\t\t\t'onShow': function() { document.body.setStyle('overflow', 'hidden'); },\n\t\t\t'onHide': function() { document.body.setStyle('overflow', 'auto'); }\n\t\t}).show({\n\t\t\t'title': title,\n\t\t\t'contents': content\n\t\t});\n\t},\n\n\t/**\n\t * Open an image in a modal window\n\t *\n\t * @param {object} options An optional options object\n\t */\n\topenModalImage: function(options) {\n\t\tvar opt = options || {},\n\t\t\tmaxWidth = (window.getSize().x - 20).toInt();\n\t\tif (!opt.width || opt.width > maxWidth) opt.width = Math.min(maxWidth, 900);\n\t\tvar M = new SimpleModal({\n\t\t\t'width': opt.width,\n\t\t\t'hideFooter': true,\n\t\t\t'draggable': false,\n\t\t\t'overlayOpacity': .7,\n\t\t\t'onShow': function() { document.body.setStyle('overflow', 'hidden'); },\n\t\t\t'onHide': function() { document.body.setStyle('overflow', 'auto'); }\n\t\t});\n\t\tM.show({\n\t\t\t'title': opt.title?.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\"/g, '&quot;').replace(/'/g, '&apos;'),\n\t\t\t'contents': '<img src=\"' + opt.url + '\" alt=\"\">'\n\t\t});\n\t},\n\n\t/**\n\t * Open an iframe in a modal window\n\t *\n\t * @param {object} options An optional options object\n\t */\n\topenModalIframe: function(options) {\n\t\tvar opt = options || {},\n\t\t\tmaxWidth = (window.getSize().x - 20).toInt(),\n\t\t\tmaxHeight = (window.getSize().y - 137).toInt();\n\t\tif (!opt.width || opt.width > maxWidth) opt.width = Math.min(maxWidth, 900);\n\t\tif (!opt.height || opt.height > maxHeight) opt.height = maxHeight;\n\t\tvar M = new SimpleModal({\n\t\t\t'width': opt.width,\n\t\t\t'hideFooter': true,\n\t\t\t'draggable': false,\n\t\t\t'overlayOpacity': .7,\n\t\t\t'onShow': function() { document.body.setStyle('overflow', 'hidden'); },\n\t\t\t'onHide': function() { document.body.setStyle('overflow', 'auto'); }\n\t\t});\n\t\tM.show({\n\t\t\t'title': opt.title?.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\"/g, '&quot;').replace(/'/g, '&apos;'),\n\t\t\t'contents': '<iframe src=\"' + opt.url + '\" width=\"100%\" height=\"' + opt.height + '\" frameborder=\"0\"></iframe>',\n\t\t\t'model': 'modal'\n\t\t});\n\t},\n\n\t/**\n\t * Open a selector page in a modal window\n\t *\n\t * @param {object} options An optional options object\n\t */\n\topenModalSelector: function(options) {\n\t\tvar opt = options || {},\n\t\t\tmaxWidth = (window.getSize().x - 20).toInt(),\n\t\t\tmaxHeight = (window.getSize().y - 192).toInt();\n\t\tif (!opt.id) opt.id = 'tl_select';\n\t\tif (!opt.width || opt.width > maxWidth) opt.width = Math.min(maxWidth, 900);\n\t\tif (!opt.height || opt.height > maxHeight) opt.height = maxHeight;\n\t\tvar M = new SimpleModal({\n\t\t\t'width': opt.width,\n\t\t\t'draggable': false,\n\t\t\t'overlayOpacity': .7,\n\t\t\t'onShow': function() { document.body.setStyle('overflow', 'hidden'); },\n\t\t\t'onHide': function() { document.body.setStyle('overflow', 'auto'); }\n\t\t});\n\t\tM.addButton(Contao.lang.cancel, 'btn', function() {\n\t\t\tif (this.buttons[0].hasClass('btn-disabled')) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.hide();\n\t\t});\n\t\tM.addButton(Contao.lang.apply, 'btn primary', function() {\n\t\t\tif (this.buttons[1].hasClass('btn-disabled')) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar frm = window.frames['simple-modal-iframe'],\n\t\t\t\tval = [], ul, inp, i, pickerValue, sIndex;\n\t\t\tif (frm === undefined) {\n\t\t\t\talert('Could not find the SimpleModal frame');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tul = frm.document.getElementById(opt.id);\n\t\t\t// Load the previous values (#1816)\n\t\t\tif (pickerValue = ul.get('data-picker-value')) {\n\t\t\t\tval = JSON.parse(pickerValue);\n\t\t\t}\n\t\t\tinp = ul.getElementsByTagName('input');\n\t\t\tfor (i=0; i<inp.length; i++) {\n\t\t\t\tif (inp[i].id.match(/^(check_all_|reset_)/)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Add currently selected value, otherwise remove (#1816)\n\t\t\t\tsIndex = val.indexOf(inp[i].get('value'));\n\t\t\t\tif (inp[i].checked) {\n\t\t\t\t\tif (sIndex == -1) {\n\t\t\t\t\t\tval.push(inp[i].get('value'));\n\t\t\t\t\t}\n\t\t\t\t} else if (sIndex != -1) {\n\t\t\t\t\tval.splice(sIndex, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\topt.callback(ul.get('data-table'), val);\n\t\t\tthis.hide();\n\t\t});\n\t\tM.show({\n\t\t\t'title': opt.title?.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\"/g, '&quot;').replace(/'/g, '&apos;'),\n\t\t\t'contents': '<iframe src=\"' + opt.url + '\" name=\"simple-modal-iframe\" width=\"100%\" height=\"' + opt.height + '\" frameborder=\"0\"></iframe>',\n\t\t\t'model': 'modal'\n\t\t});\n\t},\n\n\t/**\n\t * Open a TinyMCE file browser in a modal window\n\t *\n\t * @param {string} field_name The field name\n\t * @param {string} url        The URL\n\t * @param {string} type       The picker type\n\t * @param {object} win        The window object\n\t * @param {string} source     The source record\n\t */\n\topenModalBrowser: function(field_name, url, type, win, source) {\n\t\tBackend.openModalSelector({\n\t\t\t'id': 'tl_listing',\n\t\t\t'title': win.document.getElement('div.mce-title').get('text'),\n\t\t\t'url': Contao.routes.backend_picker + '?context=' + (type == 'file' ? 'link' : 'file') + '&amp;extras[fieldType]=radio&amp;extras[filesOnly]=true&amp;extras[source]=' + source + '&amp;value=' + url + '&amp;popup=1',\n\t\t\t'callback': function(table, value) {\n\t\t\t\twin.document.getElementById(field_name).value = value.join(',');\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Automatically submit a form\n\t *\n\t * @param {object} el The DOM element\n\t */\n\tautoSubmit: function(el) {\n\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\n\t\tvar hidden = new Element('input', {\n\t\t\t'type': 'hidden',\n\t\t\t'name': 'SUBMIT_TYPE',\n\t\t\t'value': 'auto'\n\t\t});\n\n\t\tvar form = $(el) || el;\n\t\thidden.inject(form, 'bottom');\n\t\tform.submit();\n\t},\n\n\t/**\n\t * Scroll the window to a certain vertical position\n\t *\n\t * @param {int} offset The offset to scroll to\n\t */\n\tvScrollTo: function(offset) {\n\t\twindow.addEvent('load', function() {\n\t\t\twindow.scrollTo(null, parseInt(offset));\n\t\t});\n\t},\n\n\t/**\n\t * Toggle checkboxes\n\t *\n\t * @param {object} el   The DOM element\n\t * @param {string} [id] The ID of the target element\n\t */\n\ttoggleCheckboxes: function(el, id) {\n\t\tvar items = $$('input'),\n\t\t\tstatus = $(el).checked ? 'checked' : '';\n\n\t\tfor (var i=0; i<items.length; i++) {\n\t\t\tif (items[i].type.toLowerCase() != 'checkbox') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (id !== undefined && id != items[i].id.substr(0, id.length)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\titems[i].checked = status;\n\t\t}\n\t},\n\n\t/**\n\t * Toggle a checkbox group\n\t *\n\t * @param {object} el The DOM element\n\t * @param {string} id The ID of the target element\n\t */\n\ttoggleCheckboxGroup: function(el, id) {\n\t\tvar cls = $(el).className,\n\t\t\tstatus = $(el).checked ? 'checked' : '';\n\n\t\tif (cls == 'tl_checkbox') {\n\t\t\tvar cbx = $(id) ? $$('#' + id + ' .tl_checkbox') : $(el).getParent('fieldset').getElements('.tl_checkbox');\n\t\t\tcbx.each(function(checkbox) {\n\t\t\t\tcheckbox.checked = status;\n\t\t\t});\n\t\t} else if (cls == 'tl_tree_checkbox') {\n\t\t\t$$('#' + id + ' .parent .tl_tree_checkbox').each(function(checkbox) {\n\t\t\t\tcheckbox.checked = status;\n\t\t\t});\n\t\t}\n\n\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t},\n\n\t/**\n\t * Toggle checkbox elements\n\t *\n\t * @param {string} el  The DOM element\n\t * @param {string} cls The CSS class name\n\t */\n\ttoggleCheckboxElements: function(el, cls) {\n\t\tvar status = $(el).checked ? 'checked' : '';\n\n\t\t$$('.' + cls).each(function(checkbox) {\n\t\t\tif (checkbox.hasClass('tl_checkbox')) {\n\t\t\t\tcheckbox.checked = status;\n\t\t\t}\n\t\t});\n\n\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t},\n\n\t/**\n\t * Make parent view items sortable\n\t *\n\t * @param {object} ul The DOM element\n\t *\n\t * @author Joe Ray Gregory\n\t * @author Martin Auswöger\n\t */\n\tmakeParentViewSortable: function(ul) {\n\t\tvar ds = new Scroller(document.getElement('body'), {\n\t\t\tonChange: function(x, y) {\n\t\t\t\tthis.element.scrollTo(this.element.getScroll().x, y);\n\t\t\t}\n\t\t});\n\n\t\tvar list = new Sortables(ul, {\n\t\t\tconstrain: true,\n\t\t\topacity: 0.6,\n\t\t\tonStart: function() {\n\t\t\t\tds.start();\n\t\t\t},\n\t\t\tonComplete: function() {\n\t\t\t\tds.stop();\n\t\t\t},\n\t\t\tonSort: function(el) {\n\t\t\t\tvar ul = el.getParent('ul'),\n\t\t\t\t\twrapLevel = 0, divs, i;\n\n\t\t\t\tif (!ul) return;\n\n\t\t\t\tdivs = ul.getChildren('li > div:first-child');\n\n\t\t\t\tif (!divs) return;\n\n\t\t\t\tfor (i=0; i<divs.length; i++) {\n\t\t\t\t\tif (divs[i].hasClass('wrapper_stop') && wrapLevel > 0) {\n\t\t\t\t\t\twrapLevel--;\n\t\t\t\t\t}\n\n\t\t\t\t\tdivs[i].className = divs[i].className.replace(/(^|\\s)indent[^\\s]*/g, '');\n\n\t\t\t\t\tif (wrapLevel > 0) {\n\t\t\t\t\t\tdivs[i].addClass('indent').addClass('indent_' + wrapLevel);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (divs[i].hasClass('wrapper_start')) {\n\t\t\t\t\t\twrapLevel++;\n\t\t\t\t\t}\n\n\t\t\t\t\tdivs[i].removeClass('indent_first');\n\t\t\t\t\tdivs[i].removeClass('indent_last');\n\n\t\t\t\t\tif (divs[i-1] && divs[i-1].hasClass('wrapper_start')) {\n\t\t\t\t\t\tdivs[i].addClass('indent_first');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (divs[i+1] && divs[i+1].hasClass('wrapper_stop')) {\n\t\t\t\t\t\tdivs[i].addClass('indent_last');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\thandle: '.drag-handle'\n\t\t});\n\n\t\tlist.active = false;\n\n\t\tlist.addEvent('start', function() {\n\t\t\tlist.active = true;\n\t\t});\n\n\t\tlist.addEvent('complete', function(el) {\n\t\t\tif (!list.active) return;\n\t\t\tvar id, pid, req, href;\n\n\t\t\tif (el.getPrevious('li')) {\n\t\t\t\tid = el.get('id').replace(/li_/, '');\n\t\t\t\tpid = el.getPrevious('li').get('id').replace(/li_/, '');\n\t\t\t\treq = window.location.search.replace(/id=[0-9]*/, 'id=' + id) + '&act=cut&mode=1&pid=' + pid;\n\t\t\t\thref = window.location.href.replace(/\\?.*$/, '');\n\t\t\t\tnew Request.Contao({'url':href + req, 'followRedirects':false}).get();\n\t\t\t} else if (el.getParent('ul')) {\n\t\t\t\tid = el.get('id').replace(/li_/, '');\n\t\t\t\tpid = el.getParent('ul').get('id').replace(/ul_/, '');\n\t\t\t\treq = window.location.search.replace(/id=[0-9]*/, 'id=' + id) + '&act=cut&mode=2&pid=' + pid;\n\t\t\t\thref = window.location.href.replace(/\\?.*$/, '');\n\t\t\t\tnew Request.Contao({'url':href + req, 'followRedirects':false}).get();\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Make multiSRC items sortable\n\t *\n\t * @param {string} id  The ID of the target element\n\t * @param {string} oid The order field\n\t * @param {string} val The value field\n\t */\n\tmakeMultiSrcSortable: function(id, oid, val) {\n\t\tvar list = new Sortables($(id), {\n\t\t\tconstrain: true,\n\t\t\topacity: 0.6\n\t\t}).addEvent('complete', function() {\n\t\t\tvar els = [],\n\t\t\t\tlis = $(id).getChildren('[data-id]'),\n\t\t\t\ti;\n\t\t\tfor (i=0; i<lis.length; i++) {\n\t\t\t\tels.push(lis[i].get('data-id'));\n\t\t\t}\n\t\t\tif (oid === val) {\n\t\t\t\t$(val).value.split(',').forEach(function(j) {\n\t\t\t\t\tif (els.indexOf(j) === -1) {\n\t\t\t\t\t\tels.push(j);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t$(oid).value = els.join(',');\n\t\t});\n\t\t$(id).getElements('.gimage').each(function(el) {\n\t\t\tif (el.hasClass('removable')) {\n\t\t\t\tnew Element('button', {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\thtml: '&times;',\n\t\t\t\t\t'class': 'tl_red'\n\t\t\t\t}).addEvent('click', function() {\n\t\t\t\t\tvar li = el.getParent('li'),\n\t\t\t\t\t\tdid = li.get('data-id');\n\t\t\t\t\t$(val).value = $(val).value.split(',').filter(function(j) { return j != did; }).join(',');\n\t\t\t\t\t$(oid).value = $(oid).value.split(',').filter(function(j) { return j != did; }).join(',');\n\t\t\t\t\tli.dispose();\n\t\t\t\t}).inject(el, 'after');\n\t\t\t} else {\n\t\t\t\tnew Element('button', {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\thtml: '&times',\n\t\t\t\t\tdisabled: true\n\t\t\t\t}).inject(el, 'after');\n\t\t\t}\n\t\t});\n\t\tlist.fireEvent(\"complete\"); // Initial sorting\n\t},\n\n\t/**\n\t * Enable drag and drop for the file tree\n\t *\n\t * @param {object} ul      The DOM element\n\t * @param {object} options An optional options object\n\t */\n\tenableFileTreeDragAndDrop: function(ul, options) {\n\t\tvar ds = new Scroller(document.getElement('body'), {\n\t\t\tonChange: function(x, y) {\n\t\t\t\tthis.element.scrollTo(this.element.getScroll().x, y);\n\t\t\t}\n\t\t});\n\n\t\tul.addEvent('mousedown', function(event) {\n\t\t\tvar dragHandle = event.target.hasClass('drag-handle') ? event.target : event.target.getParent('.drag-handle');\n\t\t\tvar dragElement = event.target.getParent('.tl_file,.tl_folder');\n\n\t\t\tif (!dragHandle || !dragElement || event.rightClick) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tds.start();\n\t\t\tul.addClass('tl_listing_dragging');\n\n\t\t\tvar cloneBase = (dragElement.getElements('.tl_left')[0] || dragElement),\n\t\t\t\tclone = cloneBase.clone(true)\n\t\t\t\t\t.inject(ul)\n\t\t\t\t\t.addClass('tl_left_dragging'),\n\t\t\t\tcurrentHover, currentHoverTime, expandLink;\n\n\t\t\tclone.setPosition({\n\t\t\t\tx: event.page.x - cloneBase.getOffsetParent().getPosition().x - clone.getSize().x,\n\t\t\t\ty: cloneBase.getPosition(cloneBase.getOffsetParent()).y\n\t\t\t}).setStyle('display', 'none');\n\n\t\t\tvar move = new Drag.Move(clone, {\n\t\t\t\tdroppables: $$([ul]).append(ul.getElements('.tl_folder,li.parent,.tl_folder_top')),\n\t\t\t\tunDraggableTags: [],\n\t\t\t\tmodifiers: {\n\t\t\t\t\tx: 'left',\n\t\t\t\t\ty: 'top'\n\t\t\t\t},\n\t\t\t\tonStart: function() {\n\t\t\t\t\tclone.setStyle('display', '');\n\t\t\t\t},\n\t\t\t\tonEnter: function(element, droppable) {\n\t\t\t\t\tdroppable = fixDroppable(droppable);\n\t\t\t\t\tdroppable.addClass('tl_folder_dropping');\n\n\t\t\t\t\tif (droppable.hasClass('tl_folder') && currentHover !== droppable) {\n\t\t\t\t\t\tcurrentHover = droppable;\n\t\t\t\t\t\tcurrentHoverTime = new Date().getTime();\n\t\t\t\t\t\texpandLink = droppable.getElement('a.foldable');\n\n\t\t\t\t\t\tif (expandLink && !expandLink.hasClass('foldable--open')) {\n\t\t\t\t\t\t\t// Expand the folder after one second hover time\n\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tif (currentHover === droppable && currentHoverTime + 900 < new Date().getTime()) {\n\t\t\t\t\t\t\t\t\tvar event = document.createEvent('HTMLEvents');\n\t\t\t\t\t\t\t\t\tevent.initEvent('click', true, true);\n\t\t\t\t\t\t\t\t\texpandLink.dispatchEvent(event);\n\n\t\t\t\t\t\t\t\t\tcurrentHover = undefined;\n\t\t\t\t\t\t\t\t\tcurrentHoverTime = undefined;\n\n\t\t\t\t\t\t\t\t\twindow.addEvent('ajax_change', function onAjax() {\n\t\t\t\t\t\t\t\t\t\tif (move && move.droppables && ul && ul.getElements) {\n\t\t\t\t\t\t\t\t\t\t\tmove.droppables = $$([ul]).append(ul.getElements('.tl_folder,li.parent'));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\twindow.removeEvent('ajax_change', onAjax);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonCancel: function() {\n\t\t\t\t\tcurrentHover = undefined;\n\t\t\t\t\tcurrentHoverTime = undefined;\n\n\t\t\t\t\tds.stop();\n\t\t\t\t\tclone.destroy();\n\t\t\t\t\twindow.removeEvent('keyup', onKeyup);\n\t\t\t\t\tul.getElements('.tl_folder_dropping').removeClass('tl_folder_dropping');\n\t\t\t\t\tul.removeClass('tl_listing_dragging');\n\t\t\t\t},\n\t\t\t\tonDrop: function(element, droppable) {\n\t\t\t\t\tcurrentHover = undefined;\n\t\t\t\t\tcurrentHoverTime = undefined;\n\n\t\t\t\t\tds.stop();\n\t\t\t\t\tclone.destroy();\n\t\t\t\t\twindow.removeEvent('keyup', onKeyup);\n\t\t\t\t\tul.getElements('.tl_folder_dropping').removeClass('tl_folder_dropping');\n\t\t\t\t\tul.removeClass('tl_listing_dragging');\n\n\t\t\t\t\tdroppable = fixDroppable(droppable);\n\n\t\t\t\t\tif (!droppable) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar id = dragElement.get('data-id'),\n\t\t\t\t\t\tpid = droppable.get('data-id') || decodeURIComponent(options.url.split(/[?&]pid=/)[1].split('&')[0]);\n\n\t\t\t\t\t// Ignore invalid move operations\n\t\t\t\t\tif (id && pid && ((pid+'/').indexOf(id+'/') === 0 || pid+'/' === id.replace(/[^/]+$/, ''))) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\tdocument.location.href = options.url + '&id=' + encodeURIComponent(id) + '&pid=' + encodeURIComponent(pid);\n\t\t\t\t},\n\t\t\t\tonLeave: function(element, droppable) {\n\t\t\t\t\tdroppable = fixDroppable(droppable);\n\t\t\t\t\tdroppable.removeClass('tl_folder_dropping');\n\t\t\t\t\tcurrentHover = undefined;\n\t\t\t\t\tcurrentHoverTime = undefined;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tmove.start(event);\n\t\t\twindow.addEvent('keyup', onKeyup);\n\n\t\t\tfunction onKeyup(event) {\n\t\t\t\tif (event.key === 'esc' && move && move.stop) {\n\t\t\t\t\tmove.droppables = $$([]);\n\t\t\t\t\tmove.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfunction fixDroppable(droppable) {\n\t\t\tif (droppable && droppable.hasClass('parent') && droppable.getPrevious('.tl_folder')) {\n\t\t\t\treturn droppable.getPrevious('.tl_folder');\n\t\t\t}\n\n\t\t\treturn droppable;\n\t\t}\n\t},\n\n\t/**\n\t * List wizard\n\t *\n\t * @param {string} id The ID of the target element\n\t */\n\tlistWizard: function(id) {\n\t\tvar ul = $(id),\n\t\t\tmakeSortable = function(ul) {\n\t\t\t\tnew Sortables(ul, {\n\t\t\t\t\tconstrain: true,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t\thandle: '.drag-handle'\n\t\t\t\t});\n\t\t\t},\n\t\t\taddEventsTo = function(li) {\n\t\t\t\tvar command, clone, input, previous, next;\n\n\t\t\t\tli.getElements('button').each(function(bt) {\n\t\t\t\t\tif (bt.hasEvent('click')) return;\n\t\t\t\t\tcommand = bt.getProperty('data-command');\n\n\t\t\t\t\tswitch (command) {\n\t\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tclone = li.clone(true).inject(li, 'before');\n\t\t\t\t\t\t\t\tif (input = li.getFirst('input')) {\n\t\t\t\t\t\t\t\t\tclone.getFirst('input').value = input.value;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taddEventsTo(clone);\n\t\t\t\t\t\t\t\tinput.select();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tif (ul.getChildren().length > 1) {\n\t\t\t\t\t\t\t\t\tli.destroy();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase null:\n\t\t\t\t\t\t\tbt.addEvent('keydown', function(e) {\n\t\t\t\t\t\t\t\tif (e.event.keyCode == 38) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (previous = li.getPrevious('li')) {\n\t\t\t\t\t\t\t\t\t\tli.inject(previous, 'before');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tli.inject(ul, 'bottom');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t} else if (e.event.keyCode == 40) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (next = li.getNext('li')) {\n\t\t\t\t\t\t\t\t\t\tli.inject(next, 'after');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tli.inject(ul.getFirst('li'), 'before');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\n\t\tmakeSortable(ul);\n\n\t\tul.getChildren().each(function(li) {\n\t\t\taddEventsTo(li);\n\t\t});\n\t},\n\n\t/**\n\t * Table wizard\n\t *\n\t * @param {string} id The ID of the target element\n\t */\n\ttableWizard: function(id) {\n\t\tvar table = $(id),\n\t\t\tthead = table.getElement('thead'),\n\t\t\ttbody = table.getElement('tbody'),\n\t\t\tmakeSortable = function(tbody) {\n\t\t\t\tvar rows = tbody.getChildren(),\n\t\t\t\t\ttextarea, children, i, j;\n\n\t\t\t\tfor (i=0; i<rows.length; i++) {\n\t\t\t\t\tchildren = rows[i].getChildren();\n\t\t\t\t\tfor (j=0; j<children.length; j++) {\n\t\t\t\t\t\tif (textarea = children[j].getFirst('textarea')) {\n\t\t\t\t\t\t\ttextarea.name = textarea.name.replace(/\\[[0-9]+][[0-9]+]/g, '[' + i + '][' + j + ']')\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnew Sortables(tbody, {\n\t\t\t\t\tconstrain: true,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t\thandle: '.drag-handle',\n\t\t\t\t\tonComplete: function() {\n\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\taddEventsTo = function(tr) {\n\t\t\t\tvar head = thead.getFirst('tr'),\n\t\t\t\t\tcommand, textarea, current, next, ntr, children, index, i;\n\n\t\t\t\ttr.getElements('button').each(function(bt) {\n\t\t\t\t\tif (bt.hasEvent('click')) return;\n\t\t\t\t\tcommand = bt.getProperty('data-command');\n\n\t\t\t\t\tswitch (command) {\n\t\t\t\t\t\tcase 'rcopy':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tntr = new Element('tr');\n\t\t\t\t\t\t\t\tchildren = tr.getChildren();\n\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\tnext = children[i].clone(true).inject(ntr, 'bottom');\n\t\t\t\t\t\t\t\t\tif (textarea = children[i].getFirst('textarea')) {\n\t\t\t\t\t\t\t\t\t\tnext.getFirst('textarea').value = textarea.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tntr.inject(tr, 'after');\n\t\t\t\t\t\t\t\taddEventsTo(ntr);\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\tntr.getFirst('td').getFirst('textarea').select();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'rdelete':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tif (tbody.getChildren().length > 1) {\n\t\t\t\t\t\t\t\t\ttr.destroy();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'ccopy':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tindex = getIndex(bt);\n\t\t\t\t\t\t\t\tchildren = tbody.getChildren();\n\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\tcurrent = children[i].getChildren()[index];\n\t\t\t\t\t\t\t\t\tnext = current.clone(true).inject(current, 'after');\n\t\t\t\t\t\t\t\t\tif (textarea = current.getFirst('textarea')) {\n\t\t\t\t\t\t\t\t\t\tnext.getFirst('textarea').value = textarea.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taddEventsTo(next);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar headFirst = head.getFirst('td');\n\t\t\t\t\t\t\t\tnext = headFirst.clone(true).inject(head.getLast('td'), 'before');\n\t\t\t\t\t\t\t\taddEventsTo(next);\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\tchildren[0].getChildren()[index + 1].getFirst('textarea').select();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'cmovel':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tindex = getIndex(bt);\n\t\t\t\t\t\t\t\tchildren = tbody.getChildren();\n\t\t\t\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\t\tcurrent = children[i].getChildren()[index];\n\t\t\t\t\t\t\t\t\t\tcurrent.inject(current.getPrevious(), 'before');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\t\tcurrent = children[i].getChildren()[index];\n\t\t\t\t\t\t\t\t\t\tcurrent.inject(children[i].getLast(), 'before');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'cmover':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tindex = getIndex(bt);\n\t\t\t\t\t\t\t\tchildren = tbody.getChildren();\n\t\t\t\t\t\t\t\tif (index < (tr.getChildren().length - 2)) {\n\t\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\t\tcurrent = children[i].getChildren()[index];\n\t\t\t\t\t\t\t\t\t\tcurrent.inject(current.getNext(), 'after');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\t\tcurrent = children[i].getChildren()[index];\n\t\t\t\t\t\t\t\t\t\tcurrent.inject(children[i].getFirst(), 'before');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'cdelete':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tindex = getIndex(bt);\n\t\t\t\t\t\t\t\tchildren = tbody.getChildren();\n\t\t\t\t\t\t\t\tif (tr.getChildren().length > 2) {\n\t\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\t\tchildren[i].getChildren()[index].destroy();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\thead.getFirst('td').destroy();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase null:\n\t\t\t\t\t\t\tbt.addEvent('keydown', function(e) {\n\t\t\t\t\t\t\t\tif (e.event.keyCode == 38) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getPrevious('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'before');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'bottom');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t} else if (e.event.keyCode == 40) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getNext('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'after');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'top');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\tgetIndex = function(bt) {\n\t\t\t\tvar td = $(bt).getParent('td'),\n\t\t\t\t\ttr = td.getParent('tr'),\n\t\t\t\t\tcols = tr.getChildren(),\n\t\t\t\t\tindex = 0, i;\n\n\t\t\t\tfor (i=0; i<cols.length; i++) {\n\t\t\t\t\tif (cols[i] == td) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\n\t\t\t\treturn index;\n\t\t\t};\n\n\t\tmakeSortable(tbody);\n\n\t\tthead.getChildren().each(function(tr) {\n\t\t\taddEventsTo(tr);\n\t\t});\n\n\t\ttbody.getChildren().each(function(tr) {\n\t\t\taddEventsTo(tr);\n\t\t});\n\n\t\tBackend.tableWizardResize();\n\t},\n\n\t/**\n\t * Resize the table wizard fields on focus\n\t *\n\t * @param {float} [factor] The resize factor\n\t */\n\ttableWizardResize: function(factor) {\n\t\tvar size = window.localStorage.getItem('contao_table_wizard_cell_size');\n\n\t\tif (factor !== undefined) {\n\t\t\tsize = '';\n\t\t\t$$('.tl_tablewizard textarea').each(function(el) {\n\t\t\t\tel.setStyle('width', (el.getStyle('width').toInt() * factor).round().limit(142, 284));\n\t\t\t\tel.setStyle('height', (el.getStyle('height').toInt() * factor).round().limit(66, 132));\n\t\t\t\tif (size == '') {\n\t\t\t\t\tsize = el.getStyle('width') + '|' + el.getStyle('height');\n\t\t\t\t}\n\t\t\t});\n\t\t\twindow.localStorage.setItem('contao_table_wizard_cell_size', size);\n\t\t} else if (size !== null) {\n\t\t\tvar chunks = size.split('|');\n\t\t\t$$('.tl_tablewizard textarea').each(function(el) {\n\t\t\t\tel.setStyle('width', chunks[0]);\n\t\t\t\tel.setStyle('height', chunks[1]);\n\t\t\t});\n\t\t}\n\t},\n\n\t/**\n\t * Set the width of the table wizard\n\t */\n\ttableWizardSetWidth: function() {\n\t\tvar wrap = $('tl_tablewizard');\n\t\tif (!wrap) return;\n\t\twrap.setStyle('width', Math.round(wrap.getParent('.tl_formbody_edit').getComputedSize().width * 0.96));\n\t},\n\n\t/**\n\t * Options wizard\n\t *\n\t * @param {string} id The ID of the target element\n\t */\n\toptionsWizard: function(id) {\n\t\tvar table = $(id),\n\t\t\ttbody = table.getElement('tbody'),\n\t\t\tmakeSortable = function(tbody) {\n\t\t\t\tvar rows = tbody.getChildren(),\n\t\t\t\t\tchildren, i, j, input;\n\n\t\t\t\tfor (i=0; i<rows.length; i++) {\n\t\t\t\t\tchildren = rows[i].getChildren();\n\t\t\t\t\tfor (j=0; j<children.length; j++) {\n\t\t\t\t\t\tif (input = children[j].getFirst('input')) {\n\t\t\t\t\t\t\tinput.name = input.name.replace(/\\[[0-9]+]/g, '[' + i + ']');\n\t\t\t\t\t\t\tif (input.type == 'checkbox') {\n\t\t\t\t\t\t\t\tinput.id = input.name.replace(/\\[[0-9]+]/g, '').replace(/\\[/g, '_').replace(/]/g, '') + '_' + i;\n\t\t\t\t\t\t\t\tinput.getNext('label').set('for', input.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnew Sortables(tbody, {\n\t\t\t\t\tconstrain: true,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t\thandle: '.drag-handle',\n\t\t\t\t\tonComplete: function() {\n\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\taddEventsTo = function(tr) {\n\t\t\t\tvar command, input, next, ntr, children, i;\n\t\t\t\ttr.getElements('button').each(function(bt) {\n\t\t\t\t\tif (bt.hasEvent('click')) return;\n\t\t\t\t\tcommand = bt.getProperty('data-command');\n\n\t\t\t\t\tswitch (command) {\n\t\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tntr = new Element('tr');\n\t\t\t\t\t\t\t\tchildren = tr.getChildren();\n\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\tnext = children[i].clone(true).inject(ntr, 'bottom');\n\t\t\t\t\t\t\t\t\tif (input = children[i].getFirst('input')) {\n\t\t\t\t\t\t\t\t\t\tnext.getFirst('input').value = input.value;\n\t\t\t\t\t\t\t\t\t\tif (input.type == 'checkbox') {\n\t\t\t\t\t\t\t\t\t\t\tnext.getFirst('input').checked = input.checked ? 'checked' : '';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tntr.inject(tr, 'after');\n\t\t\t\t\t\t\t\taddEventsTo(ntr);\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\tntr.getFirst('td').getFirst('input').select();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tif (tbody.getChildren().length > 1) {\n\t\t\t\t\t\t\t\t\ttr.destroy();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase null:\n\t\t\t\t\t\t\tbt.addEvent('keydown', function(e) {\n\t\t\t\t\t\t\t\tif (e.event.keyCode == 38) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getPrevious('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'before');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'bottom');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t} else if (e.event.keyCode == 40) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getNext('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'after');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'top');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\n\t\tmakeSortable(tbody);\n\n\t\ttbody.getChildren().each(function(tr) {\n\t\t\taddEventsTo(tr);\n\t\t});\n\t},\n\n\t/**\n\t * Key/value wizard\n\t *\n\t * @param {string} id The ID of the target element\n\t */\n\tkeyValueWizard: function(id) {\n\t\tvar table = $(id),\n\t\t\ttbody = table.getElement('tbody'),\n\t\t\tmakeSortable = function(tbody) {\n\t\t\t\tvar rows = tbody.getChildren(),\n\t\t\t\t\tchildren, i, j, input;\n\n\t\t\t\tfor (i=0; i<rows.length; i++) {\n\t\t\t\t\tchildren = rows[i].getChildren();\n\t\t\t\t\tfor (j=0; j<children.length; j++) {\n\t\t\t\t\t\tif (input = children[j].getFirst('input')) {\n\t\t\t\t\t\t\tinput.name = input.name.replace(/\\[[0-9]+]/g, '[' + i + ']')\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnew Sortables(tbody, {\n\t\t\t\t\tconstrain: true,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t\thandle: '.drag-handle',\n\t\t\t\t\tonComplete: function() {\n\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\taddEventsTo = function(tr) {\n\t\t\t\tvar command, input, next, ntr, children, i;\n\t\t\t\ttr.getElements('button').each(function(bt) {\n\t\t\t\t\tif (bt.hasEvent('click')) return;\n\t\t\t\t\tcommand = bt.getProperty('data-command');\n\n\t\t\t\t\tswitch (command) {\n\t\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tntr = new Element('tr');\n\t\t\t\t\t\t\t\tchildren = tr.getChildren();\n\t\t\t\t\t\t\t\tfor (i=0; i<children.length; i++) {\n\t\t\t\t\t\t\t\t\tnext = children[i].clone(true).inject(ntr, 'bottom');\n\t\t\t\t\t\t\t\t\tif (input = children[i].getFirst('input')) {\n\t\t\t\t\t\t\t\t\t\tnext.getFirst().value = input.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tntr.inject(tr, 'after');\n\t\t\t\t\t\t\t\taddEventsTo(ntr);\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\tntr.getFirst('td').getFirst('input').select();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t\tbt.addEvent('click', function() {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t\t\t\t\t\t\tif (tbody.getChildren().length > 1) {\n\t\t\t\t\t\t\t\t\ttr.destroy();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase null:\n\t\t\t\t\t\t\tbt.addEvent('keydown', function(e) {\n\t\t\t\t\t\t\t\tif (e.event.keyCode == 38) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getPrevious('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'before');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'bottom');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t} else if (e.event.keyCode == 40) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (ntr = tr.getNext('tr')) {\n\t\t\t\t\t\t\t\t\t\ttr.inject(ntr, 'after');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttr.inject(tbody, 'top');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t\t\t\tmakeSortable(tbody);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\n\t\tmakeSortable(tbody);\n\n\t\ttbody.getChildren().each(function(tr) {\n\t\t\taddEventsTo(tr);\n\t\t});\n\t},\n\n\t/**\n\t * Checkbox wizard\n\t *\n\t * @param {string} id The ID of the target element\n\t */\n\tcheckboxWizard: function(id) {\n\t\tvar container = $(id).getElement('.sortable'),\n\t\t\tmakeSortable = function(container) {\n\t\t\t\tnew Sortables(container, {\n\t\t\t\t\tconstrain: true,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t\thandle: '.drag-handle'\n\t\t\t\t});\n\t\t\t},\n\t\t\taddEventsTo = function(span) {\n\t\t\t\tvar nspan;\n\t\t\t\tspan.getElements('button').each(function(bt) {\n\t\t\t\t\tif (bt.hasEvent('click')) return;\n\t\t\t\t\tbt.addEvent('keydown', function(e) {\n\t\t\t\t\t\tif (e.event.keyCode == 38) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tif ((nspan = span.getPrevious('span'))) {\n\t\t\t\t\t\t\t\tspan.inject(nspan, 'before');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tspan.inject(container, 'bottom');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t} else if (e.event.keyCode == 40) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tif (nspan = span.getNext('span')) {\n\t\t\t\t\t\t\t\tspan.inject(nspan, 'after');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tspan.inject(container, 'top');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbt.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t};\n\n\t\tmakeSortable(container);\n\n\t\tcontainer.getChildren().each(function(span) {\n\t\t\taddEventsTo(span);\n\t\t});\n\t},\n\n\t/**\n\t * Update the fields of the imageSize widget upon change\n\t */\n\tenableImageSizeWidgets: function() {\n\t\t$$('.tl_image_size').each(function(el) {\n\t\t\tvar select = el.getElement('select'),\n\t\t\t\twidthInput = el.getChildren('input')[0],\n\t\t\t\theightInput = el.getChildren('input')[1],\n\t\t\t\tupdate = function() {\n\t\t\t\t\tif (select.get('value') === '' || select.get('value').indexOf('_') === 0 || select.get('value').toInt().toString() === select.get('value')) {\n\t\t\t\t\t\twidthInput.readOnly = true;\n\t\t\t\t\t\theightInput.readOnly = true;\n\t\t\t\t\t\tvar dimensions = $(select.getSelected()[0]).get('text');\n\t\t\t\t\t\tdimensions = dimensions.split('(').length > 1\n\t\t\t\t\t\t\t? dimensions.split('(').getLast().split(')')[0].split('x')\n\t\t\t\t\t\t\t: ['', ''];\n\t\t\t\t\t\twidthInput.set('value', '').set('placeholder', dimensions[0] * 1 || '');\n\t\t\t\t\t\theightInput.set('value', '').set('placeholder', dimensions[1] * 1 || '');\n\t\t\t\t\t} else {\n\t\t\t\t\t\twidthInput.set('placeholder', '');\n\t\t\t\t\t\theightInput.set('placeholder', '');\n\t\t\t\t\t\twidthInput.readOnly = false;\n\t\t\t\t\t\theightInput.readOnly = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t;\n\n\t\t\tupdate();\n\t\t\tselect.addEvent('change', update);\n\t\t\tselect.addEvent('keyup', update);\n\t\t});\n\t},\n\n\t/**\n\t * Allow toggling checkboxes or radio buttons by clicking a row\n\t *\n\t * @author Kamil Kuzminski\n\t */\n\tenableToggleSelect: function() {\n\t\tvar container = $('tl_listing'),\n\t\t\tshiftToggle = function(el) {\n\t\t\t\tthisIndex = checkboxes.indexOf(el);\n\t\t\t\tstartIndex = checkboxes.indexOf(start);\n\t\t\t\tfrom = Math.min(thisIndex, startIndex);\n\t\t\t\tto = Math.max(thisIndex, startIndex);\n\t\t\t\tstatus = !!checkboxes[startIndex].checked;\n\n\t\t\t\tfor (from; from<=to; from++) {\n\t\t\t\t\tcheckboxes[from].checked = status;\n\t\t\t\t}\n\t\t\t},\n\t\t\tclickEvent = function(e) {\n\t\t\t\tvar input = this.getElement('input[type=\"checkbox\"],input[type=\"radio\"]'),\n\t\t\t\t\tlimitToggler = $(e.target).getParent('.limit_toggler');\n\n\t\t\t\tif (!input || input.get('disabled') || limitToggler !== null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Radio buttons\n\t\t\t\tif (input.type == 'radio') {\n\t\t\t\t\tif (!input.checked) {\n\t\t\t\t\t\tinput.checked = 'checked';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Checkboxes\n\t\t\t\tif (e.shift && start) {\n\t\t\t\t\tshiftToggle(input);\n\t\t\t\t} else {\n\t\t\t\t\tinput.checked = input.checked ? '' : 'checked';\n\n\t\t\t\t\tif (input.get('onclick') == 'Backend.toggleCheckboxes(this)') {\n\t\t\t\t\t\tBackend.toggleCheckboxes(input); // see #6399\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstart = input;\n\t\t\t},\n\t\t\tcheckboxes = [], start, thisIndex, startIndex, status, from, to;\n\n\t\tif (container) {\n\t\t\tcheckboxes = container.getElements('input[type=\"checkbox\"]');\n\t\t}\n\n\t\t// Row click\n\t\t$$('.toggle_select').each(function(el) {\n\t\t\tvar boundEvent = el.retrieve('boundEvent');\n\n\t\t\tif (boundEvent) {\n\t\t\t\tel.removeEvent('click', boundEvent);\n\t\t\t}\n\n\t\t\t// Do not propagate the form field click events\n\t\t\tel.getElements('label,input[type=\"checkbox\"],input[type=\"radio\"]').each(function(i) {\n\t\t\t\ti.addEvent('click', function(e) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tboundEvent = clickEvent.bind(el);\n\n\t\t\tel.addEvent('click', boundEvent);\n\t\t\tel.store('boundEvent', boundEvent);\n\t\t});\n\n\t\t// Checkbox click\n\t\tcheckboxes.each(function(el) {\n\t\t\tel.addEvent('click', function(e) {\n\t\t\t\tif (e.shift && start) {\n\t\t\t\t\tshiftToggle(this);\n\t\t\t\t}\n\n\t\t\t\tstart = this;\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n\t * Allow to mark the important part of an image\n\t *\n\t * @param {object} el The DOM element\n\t */\n\teditPreviewWizard: function(el) {\n\t\tel = $(el);\n\t\tvar imageElement = el.getElement('img'),\n\t\t\tinputElements = {},\n\t\t\tisDrawing = false,\n\t\t\tpartElement, startPos,\n\t\t\tgetScale = function() {\n\t\t\t\treturn {\n\t\t\t\t\tx: imageElement.getComputedSize().width,\n\t\t\t\t\ty: imageElement.getComputedSize().height\n\t\t\t\t};\n\t\t\t},\n\t\t\tupdateImage = function() {\n\t\t\t\tvar scale = getScale(),\n\t\t\t\t\timageSize = imageElement.getComputedSize();\n\t\t\t\tpartElement.setStyles({\n\t\t\t\t\ttop: imageSize.computedTop + (inputElements.y.get('value') * scale.y).round() + 'px',\n\t\t\t\t\tleft: imageSize.computedLeft + (inputElements.x.get('value') * scale.x).round() + 'px',\n\t\t\t\t\twidth: (inputElements.width.get('value') * scale.x).round() + 'px',\n\t\t\t\t\theight: (inputElements.height.get('value') * scale.y).round() + 'px'\n\t\t\t\t});\n\t\t\t\tif (!inputElements.width.get('value').toFloat() || !inputElements.height.get('value').toFloat()) {\n\t\t\t\t\tpartElement.setStyle('display', 'none');\n\t\t\t\t} else {\n\t\t\t\t\tpartElement.setStyle('display', null);\n\t\t\t\t}\n\t\t\t},\n\t\t\tupdateValues = function() {\n\t\t\t\tvar scale = getScale(),\n\t\t\t\t\tstyles = partElement.getStyles('top', 'left', 'width', 'height'),\n\t\t\t\t\timageSize = imageElement.getComputedSize(),\n\t\t\t\t\tvalues = {\n\t\t\t\t\t\tx: Math.max(0, Math.min(1, (styles.left.toFloat() - imageSize.computedLeft) / scale.x)),\n\t\t\t\t\t\ty: Math.max(0, Math.min(1, (styles.top.toFloat() - imageSize.computedTop) / scale.y))\n\t\t\t\t\t};\n\t\t\t\tvalues.width = Math.min(1 - values.x, styles.width.toFloat() / scale.x);\n\t\t\t\tvalues.height = Math.min(1 - values.y, styles.height.toFloat() / scale.y);\n\t\t\t\tif (!values.width || !values.height) {\n\t\t\t\t\tvalues.x = values.y = values.width = values.height = '';\n\t\t\t\t\tpartElement.setStyle('display', 'none');\n\t\t\t\t} else {\n\t\t\t\t\tpartElement.setStyle('display', null);\n\t\t\t\t}\n\t\t\t\tObject.each(values, function(value, key) {\n\t\t\t\t\tinputElements[key].set('value', value === '' ? '' : Number(value).toFixed(15));\n\t\t\t\t});\n\t\t\t},\n\t\t\tstart = function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (isDrawing) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tisDrawing = true;\n\t\t\t\tstartPos = {\n\t\t\t\t\tx: event.page.x - el.getPosition().x - imageElement.getComputedSize().computedLeft,\n\t\t\t\t\ty: event.page.y - el.getPosition().y - imageElement.getComputedSize().computedTop\n\t\t\t\t};\n\t\t\t\tmove(event);\n\t\t\t},\n\t\t\tmove = function(event) {\n\t\t\t\tif (!isDrawing) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar imageSize = imageElement.getComputedSize();\n\t\t\t\tvar rect = {\n\t\t\t\t\tx: [\n\t\t\t\t\t\tMath.max(0, Math.min(imageSize.width, startPos.x)),\n\t\t\t\t\t\tMath.max(0, Math.min(imageSize.width, event.page.x - el.getPosition().x - imageSize.computedLeft))\n\t\t\t\t\t],\n\t\t\t\t\ty: [\n\t\t\t\t\t\tMath.max(0, Math.min(imageSize.height, startPos.y)),\n\t\t\t\t\t\tMath.max(0, Math.min(imageSize.height, event.page.y - el.getPosition().y - imageSize.computedTop))\n\t\t\t\t\t]\n\t\t\t\t};\n\t\t\t\tpartElement.setStyles({\n\t\t\t\t\ttop: Math.min(rect.y[0], rect.y[1]) + imageSize.computedTop + 'px',\n\t\t\t\t\tleft: Math.min(rect.x[0], rect.x[1]) + imageSize.computedLeft + 'px',\n\t\t\t\t\twidth: Math.abs(rect.x[0] - rect.x[1]) + 'px',\n\t\t\t\t\theight: Math.abs(rect.y[0] - rect.y[1]) + 'px'\n\t\t\t\t});\n\t\t\t\tupdateValues();\n\t\t\t},\n\t\t\tstop = function(event) {\n\t\t\t\tmove(event);\n\t\t\t\tisDrawing = false;\n\t\t\t},\n\t\t\tinit = function() {\n\t\t\t\tel.getParent('.tl_tbox,.tl_box').getElements('input[name^=\"importantPart\"]').each(function(input) {\n\t\t\t\t\t['x', 'y', 'width', 'height'].each(function(key) {\n\t\t\t\t\t\tif (input.get('name').substr(13, key.length) === key.capitalize()) {\n\t\t\t\t\t\t\tinputElements[key] = input = $(input);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tif (Object.getLength(inputElements) !== 4) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tObject.each(inputElements, function(input) {\n\t\t\t\t\tinput.getParent().setStyle('display', 'none');\n\t\t\t\t});\n\t\t\t\tel.addClass('tl_edit_preview_enabled');\n\t\t\t\tpartElement = new Element('div', {\n\t\t\t\t\t'class': 'tl_edit_preview_important_part'\n\t\t\t\t}).inject(el);\n\t\t\t\tupdateImage();\n\t\t\t\timageElement.addEvent('load', updateImage);\n\t\t\t\tel.addEvents({\n\t\t\t\t\tmousedown: start,\n\t\t\t\t\ttouchstart: start\n\t\t\t\t});\n\t\t\t\t$(document.documentElement).addEvents({\n\t\t\t\t\tmousemove: move,\n\t\t\t\t\ttouchmove: move,\n\t\t\t\t\tmouseup: stop,\n\t\t\t\t\ttouchend: stop,\n\t\t\t\t\ttouchcancel: stop,\n\t\t\t\t\tresize: updateImage\n\t\t\t\t});\n\t\t\t}\n\t\t;\n\n\t\twindow.addEvent('domready', init);\n\t},\n\n\t/**\n\t * Enable drag and drop file upload for the file tree\n\t *\n\t * @param {object} wrap    The DOM element\n\t * @param {object} options An optional options object\n\t */\n\tenableFileTreeUpload: function(wrap, options) {\n\t\twrap = $(wrap);\n\n\t\tvar fallbackUrl = options.url,\n\t\t\tdzElement = new Element('div', {\n\t\t\t\t'class': 'dropzone dropzone-filetree',\n\t\t\t\thtml: '<span class=\"dropzone-previews\"></span>'\n\t\t\t}).inject(wrap, 'top'),\n\t\t\tcurrentHover, currentHoverTime, expandLink;\n\n\t\toptions.previewsContainer = dzElement.getElement('.dropzone-previews');\n\t\toptions.clickable = false;\n\n\t\tvar dz = new Dropzone(wrap, options);\n\n\t\tdz.on('queuecomplete', function() {\n\t\t\twindow.location.reload();\n\t\t});\n\n\t\tdz.on('dragover', function(event) {\n\t\t\tif (!event.dataTransfer || !event.dataTransfer.types || event.dataTransfer.types.indexOf('Files') === -1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twrap.getElements('.tl_folder_dropping').removeClass('tl_folder_dropping');\n\t\t\tvar target = event.target && $(event.target);\n\n\t\t\tif (target) {\n\t\t\t\tvar folder = target.match('.tl_folder') ? target : target.getParent('.tl_folder');\n\n\t\t\t\tif (!folder) {\n\t\t\t\t\tfolder = target.getParent('.parent');\n\t\t\t\t\tfolder = folder && folder.getPrevious('.tl_folder');\n\t\t\t\t}\n\n\t\t\t\tif (folder) {\n\t\t\t\t\tvar link = folder.getElement('img[src$=\"/icons/new.svg\"]');\n\t\t\t\t\tlink = link && link.getParent('a');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (link && link.href) {\n\t\t\t\tdz.options.url = ''+link.href;\n\t\t\t\tfolder.addClass('tl_folder_dropping');\n\n\t\t\t\tif (currentHover !== folder) {\n\t\t\t\t\tcurrentHover = folder;\n\t\t\t\t\tcurrentHoverTime = new Date().getTime();\n\t\t\t\t\texpandLink = folder.getElement('a.foldable');\n\n\t\t\t\t\tif (expandLink && !expandLink.hasClass('foldable--open')) {\n\t\t\t\t\t\t// Expand the folder after one second hover time\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\tif (currentHover === folder && currentHoverTime + 900 < new Date().getTime()) {\n\t\t\t\t\t\t\t\tvar event = document.createEvent('HTMLEvents');\n\t\t\t\t\t\t\t\tevent.initEvent('click', true, true);\n\t\t\t\t\t\t\t\texpandLink.dispatchEvent(event);\n\t\t\t\t\t\t\t\tcurrentHover = undefined;\n\t\t\t\t\t\t\t\tcurrentHoverTime = undefined;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdz.options.url = fallbackUrl;\n\t\t\t\tcurrentHover = undefined;\n\t\t\t\tcurrentHoverTime = undefined;\n\t\t\t}\n\t\t});\n\n\t\tdz.on('drop', function(event) {\n\t\t\tif (!event.dataTransfer || !event.dataTransfer.types || event.dataTransfer.types.indexOf('Files') === -1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdzElement.addClass('dropzone-filetree-enabled');\n\t\t\twindow.dispatchEvent(new Event('store-scroll-offset'));\n\t\t});\n\n\t\tdz.on('dragleave', function() {\n\t\t\twrap.getElements('.tl_folder_dropping').removeClass('tl_folder_dropping');\n\t\t\tcurrentHover = undefined;\n\t\t\tcurrentHoverTime = undefined;\n\t\t});\n\t},\n\n\t/**\n\t * Crawl the website\n\t */\n\tcrawl: function() {\n\t\tvar timeout = 2000,\n\t\t\tcrawl = $('tl_crawl'),\n\t\t\tprogressBar = crawl.getElement('div.progress-bar'),\n\t\t\tprogressCount = crawl.getElement('p.progress-count'),\n\t\t\tresults = crawl.getElement('div.results'),\n\t\t\tdebugLog = crawl.getElement('p.debug-log');\n\n\t\tfunction updateData(response) {\n\t\t\tvar total = response.total,\n\t\t\t\tdone = total - response.pending,\n\t\t\t\tpercentage = total > 0 ? parseInt(done / total * 100, 10) : 100,\n\t\t\t\tresult;\n\n\t\t\t// Initialize the status bar at 10%\n\t\t\tif (done < 1 && percentage < 1) {\n\t\t\t\tdone = 1;\n\t\t\t\tpercentage = 10;\n\t\t\t\ttotal = 10;\n\t\t\t}\n\n\t\t\tprogressBar.setStyle('width', percentage + '%');\n\t\t\tprogressBar.set('html', percentage + '%');\n\t\t\tprogressBar.setAttribute('aria-valuenow', percentage);\n\t\t\tprogressCount.set('html', done + ' / ' + total);\n\n\t\t\tif (response.hasDebugLog) {\n\t\t\t\tdebugLog.setStyle('display', 'block');\n\t\t\t}\n\n\t\t\tif (response.hasDebugLog) {\n\t\t\t\tdebugLog.setStyle('display', 'block');\n\t\t\t}\n\n\t\t\tif (!response.finished) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tprogressBar.removeClass('running').addClass('finished');\n\t\t\tresults.removeClass('running').addClass('finished');\n\n\t\t\tfor (result in response.results) {\n\t\t\t\tif (response.results.hasOwnProperty(result)) {\n\t\t\t\t\tvar summary = results.getElement('.result[data-subscriber=\"' + result + '\"] p.summary'),\n\t\t\t\t\t\twarning = results.getElement('.result[data-subscriber=\"' + result + '\"] p.warning'),\n\t\t\t\t\t\tlog = results.getElement('.result[data-subscriber=\"' + result + '\"] p.subscriber-log'),\n\t\t\t\t\t\tsubscriberResults = response.results[result],\n\t\t\t\t\t\tsubscriberSummary = subscriberResults.summary;\n\n\t\t\t\t\tif (subscriberResults.warning) {\n\t\t\t\t\t\twarning.set('html', subscriberResults.warning);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (subscriberResults.hasLog) {\n\t\t\t\t\t\tlog.setStyle('display', 'block');\n\t\t\t\t\t}\n\n\t\t\t\t\tsummary.addClass(subscriberResults.wasSuccessful ? 'success' : 'failure');\n\t\t\t\t\tsummary.set('html', subscriberSummary);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction execRequest(onlyStatusUpdate = false) {\n\t\t\tnew Request({\n\t\t\t\turl: window.location.href,\n\t\t\t\theaders: {\n\t\t\t\t\t'Only-Status-Update': onlyStatusUpdate\n\t\t\t\t},\n\t\t\t\tonSuccess: function(responseText) {\n\t\t\t\t\tvar response = JSON.decode(responseText);\n\n\t\t\t\t\tupdateData(response);\n\n\t\t\t\t\tif (!response.finished) {\n\t\t\t\t\t\tsetTimeout(execRequest, timeout);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}).send();\n\t\t}\n\n\t\texecRequest(true);\n\t}\n};\n\nwindow.Theme =\n{\n\t/**\n\t * Check for WebKit\n\t * @member {boolean}\n \t */\n\tisWebkit: (Browser.chrome || Browser.safari || navigator.userAgent.match(/(?:webkit|khtml)/i)),\n\n\t/**\n\t * Stop the propagation of click events of certain elements\n\t */\n\tstopClickPropagation: function() {\n\t\t// Do not propagate the click events of the icons\n\t\t$$('.picker_selector').each(function(ul) {\n\t\t\tul.getElements('a').each(function(el) {\n\t\t\t\tel.addEvent('click', function(e) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// Do not propagate the click events of the checkboxes\n\t\t$$('.picker_selector,.click2edit').each(function(ul) {\n\t\t\tul.getElements('input[type=\"checkbox\"]').each(function(el) {\n\t\t\t\tel.addEvent('click', function(e) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n\t * Set up the [Ctrl] + click to edit functionality\n\t */\n\tsetupCtrlClick: function() {\n\t\t$$('.click2edit').each(function(el) {\n\n\t\t\t// Do not propagate the click events of the default buttons (see #5731)\n\t\t\tel.getElements('a').each(function(a) {\n\t\t\t\ta.addEvent('click', function(e) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Set up regular click events on touch devices\n\t\t\tif (Browser.Features.Touch) {\n\t\t\t\tel.addEvent('click', function() {\n\t\t\t\t\tif (!el.getAttribute('data-visited')) {\n\t\t\t\t\t\tel.setAttribute('data-visited', '1');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tel.getElements('a').each(function(a) {\n\t\t\t\t\t\t\tif (a.hasClass('edit')) {\n\t\t\t\t\t\t\t\tdocument.location.href = a.href;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tel.removeAttribute('data-visited');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tel.addEvent('click', function(e) {\n\t\t\t\t\tvar key = Browser.Platform.mac ? e.event.metaKey : e.event.ctrlKey;\n\t\t\t\t\tif (!key) return;\n\n\t\t\t\t\tif (e.event.shiftKey) {\n\t\t\t\t\t\tel.getElements('a').each(function(a) {\n\t\t\t\t\t\t\tif (a.hasClass('children')) {\n\t\t\t\t\t\t\t\tdocument.location.href = a.href;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tel.getElements('a').each(function(a) {\n\t\t\t\t\t\t\tif (a.hasClass('edit')) {\n\t\t\t\t\t\t\t\tdocument.location.href = a.href;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Set up the textarea resizing\n\t */\n\tsetupTextareaResizing: function() {\n\t\t$$('.tl_textarea').each(function(el) {\n\t\t\tif (Browser.ie6 || Browser.ie7 || Browser.ie8) return;\n\t\t\tif (el.hasClass('noresize') || el.retrieve('autogrow')) return;\n\n\t\t\t// Set up the dummy element\n\t\t\tvar dummy = new Element('div', {\n\t\t\t\thtml: 'X',\n\t\t\t\tstyles: {\n\t\t\t\t\t'position':'absolute',\n\t\t\t\t\t'top':0,\n\t\t\t\t\t'left':'-999em',\n\t\t\t\t\t'overflow-x':'hidden'\n\t\t\t\t}\n\t\t\t}).setStyles(\n\t\t\t\tel.getStyles('font-size', 'font-family', 'width', 'line-height')\n\t\t\t).inject(document.body);\n\n\t\t\t// Also consider the box-sizing\n\t\t\tif (el.getStyle('-moz-box-sizing') == 'border-box' || el.getStyle('-webkit-box-sizing') == 'border-box' || el.getStyle('box-sizing') == 'border-box') {\n\t\t\t\tdummy.setStyles({\n\t\t\t\t\t'padding': el.getStyle('padding'),\n\t\t\t\t\t'border': el.getStyle('border-left')\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Single line height\n\t\t\tvar line = Math.max(dummy.clientHeight, 30);\n\n\t\t\t// Respond to the \"input\" event\n\t\t\tel.addEvent('input', function() {\n\t\t\t\tdummy.set('html', this.get('value')\n\t\t\t\t\t.replace(/</g, '&lt;')\n\t\t\t\t\t.replace(/>/g, '&gt;')\n\t\t\t\t\t.replace(/\\n|\\r\\n/g, '<br>X'));\n\t\t\t\tvar height = Math.max(line, dummy.getSize().y);\n\t\t\t\tif (this.clientHeight != height) this.tween('height', height);\n\t\t\t}).set('tween', { 'duration':100 }).setStyle('height', line + 'px');\n\n\t\t\t// Fire the event\n\t\t\tel.fireEvent('input');\n\t\t\tel.store('autogrow', true);\n\t\t});\n\t},\n\n\t/**\n\t * Set up the menu toggle\n\t */\n\tsetupMenuToggle: function() {\n\t\tvar burger = $('burger');\n\t\tif (!burger) return;\n\n\t\tburger\n\t\t\t.addEvent('click', function() {\n\t\t\t\tdocument.body.toggleClass('show-navigation');\n\t\t\t\tburger.setAttribute('aria-expanded', document.body.hasClass('show-navigation') ? 'true' : 'false')\n\t\t\t})\n\t\t\t.addEvent('keydown', function(e) {\n\t\t\t\tif (e.event.keyCode == 27) {\n\t\t\t\t\tdocument.body.removeClass('show-navigation');\n\t\t\t\t}\n\t\t\t})\n\t\t;\n\n\t\tif (window.matchMedia) {\n\t\t\tvar matchMedia = window.matchMedia('(max-width:991px)');\n\t\t\tvar setAriaControls = function() {\n\t\t\t\tif (matchMedia.matches) {\n\t\t\t\t\tburger.setAttribute('aria-controls', 'left')\n\t\t\t\t\tburger.setAttribute('aria-expanded', document.body.hasClass('show-navigation') ? 'true' : 'false')\n\t\t\t\t} else {\n\t\t\t\t\tburger.removeAttribute('aria-controls');\n\t\t\t\t\tburger.removeAttribute('aria-expanded');\n\t\t\t\t}\n\t\t\t};\n\t\t\tmatchMedia.addEventListener('change', setAriaControls);\n\t\t\tsetAriaControls();\n\t\t}\n\t},\n\n\t/**\n\t * Set up the profile toggle\n\t */\n\tsetupProfileToggle: function() {\n\t\tvar tmenu = $('tmenu');\n\t\tif (!tmenu) return;\n\n\t\tvar li = tmenu.getElement('.submenu'),\n\t\t\tbutton = li.getFirst('span').getFirst('button'),\n\t\t\tmenu = li.getFirst('ul');\n\t\tif (!li || !button || !menu) return;\n\n\t\tbutton.setAttribute('aria-controls', 'tmenu__profile');\n\t\tbutton.setAttribute('aria-expanded', 'false');\n\n\t\tmenu.id = 'tmenu__profile';\n\n\t\tbutton.addEvent('click', function(e) {\n\t\t\tif (li.hasClass('active')) {\n\t\t\t\tli.removeClass('active');\n\t\t\t\tbutton.setAttribute('aria-expanded', 'false');\n\t\t\t} else {\n\t\t\t\tli.addClass('active');\n\t\t\t\tbutton.setAttribute('aria-expanded', 'true');\n\t\t\t}\n\t\t\te.stopPropagation();\n\t\t});\n\n\t\t$(document.body).addEvent('click', function() {\n\t\t\tif (li.hasClass('active')) {\n\t\t\t\tli.removeClass('active');\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Set up the split button toggle\n\t */\n\tsetupSplitButtonToggle: function() {\n\t\tvar toggle = $('sbtog');\n\t\tif (!toggle) return;\n\n\t\tvar ul = toggle.getParent('.split-button').getElement('ul'),\n\t\t\ttab, timer;\n\n\t\ttoggle.addEvent('click', function(e) {\n\t\t\ttab = false;\n\t\t\tul.toggleClass('invisible');\n\t\t\ttoggle.toggleClass('active');\n\t\t\te.stopPropagation();\n\t\t});\n\n\t\t$(document.body).addEvent('click', function() {\n\t\t\ttab = false;\n\t\t\tul.addClass('invisible');\n\t\t\ttoggle.removeClass('active');\n\t\t});\n\n\t\t$(document.body).addEvent('keydown', function(e) {\n\t\t\ttab = (e.event.keyCode == 9);\n\t\t});\n\n\t\t[toggle].append(ul.getElements('button')).each(function(el) {\n\t\t\tel.addEvent('focus', function() {\n\t\t\t\tif (!tab) return;\n\t\t\t\tul.removeClass('invisible');\n\t\t\t\ttoggle.addClass('active');\n\t\t\t\tclearTimeout(timer);\n\t\t\t});\n\n\t\t\tel.addEvent('blur', function() {\n\t\t\t\tif (!tab) return;\n\t\t\t\ttimer = setTimeout(function() {\n\t\t\t\t\tul.addClass('invisible');\n\t\t\t\t\ttoggle.removeClass('active');\n\t\t\t\t}, 100);\n\t\t\t});\n\t\t});\n\n\t\ttoggle.set('tabindex', '-1');\n\t}\n};\n\n// Initialize the back end script\nwindow.addEvent('domready', function() {\n\t$(document.body).addClass('js');\n\n\t// Mark touch devices (see #5563)\n\tif (Browser.Features.Touch) {\n\t\t$(document.body).addClass('touch');\n\t}\n\n\tBackend.tableWizardSetWidth();\n\tBackend.enableImageSizeWidgets();\n\tBackend.enableToggleSelect();\n\n\t// Chosen\n\tif (Elements.chosen != undefined) {\n\t\t$$('select.tl_chosen').chosen();\n\t}\n\n\tTheme.stopClickPropagation();\n\tTheme.setupCtrlClick();\n\tTheme.setupTextareaResizing();\n\tTheme.setupMenuToggle();\n\tTheme.setupProfileToggle();\n\tTheme.setupSplitButtonToggle();\n});\n\n// Resize the table wizard\nwindow.addEvent('resize', function() {\n\tBackend.tableWizardSetWidth();\n});\n\n// Re-apply certain changes upon ajax_change\nwindow.addEvent('ajax_change', function() {\n\tBackend.enableImageSizeWidgets();\n\tBackend.enableToggleSelect();\n\n\t// Chosen\n\tif (Elements.chosen != undefined) {\n\t\t$$('select.tl_chosen').filter(function(el) {\n\t\t\treturn el.getStyle('display') != 'none';\n\t\t}).chosen();\n\t}\n\n\tTheme.stopClickPropagation();\n\tTheme.setupCtrlClick();\n\tTheme.setupTextareaResizing();\n});\n","window.addEventListener('DOMContentLoaded', function() {\n    document.querySelectorAll('div.limit_height').forEach(function(div) {\n        if (window.console) {\n            console.warn('Using \"limit_height\" class on child_record_callback is deprecated. Set a list.sorting.limitHeight in your DCA instead.');\n        }\n\n        const parent = div.parentNode.closest('.tl_content');\n\n        // Return if the element is a wrapper\n        if (parent && (parent.classList.contains('wrapper_start') || parent.classList.contains('wrapper_stop'))) return;\n\n        const hgt = Number(div.className.replace(/[^0-9]*/, ''))\n\n        // Return if there is no height value\n        if (!hgt) return;\n\n        const style = window.getComputedStyle(div, null);\n        const padding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);\n        const height = div.clientHeight - padding;\n\n        // Do not add the toggle if the preview height is below the max-height\n        if (height <= hgt) return;\n\n        // Resize the element if it is higher than the maximum height\n        div.style.height = hgt+'px';\n\n        const button = document.createElement('button');\n        button.setAttribute('type', 'button');\n        button.title = Contao.lang.expand;\n        button.innerHTML = '<span>...</span>';\n        button.classList.add('unselectable');\n\n        button.addEventListener('click', function() {\n            if (div.style.height == 'auto') {\n                div.style.height = hgt+'px';\n                button.title = Contao.lang.expand;\n            } else {\n                div.style.height = 'auto';\n                button.title = Contao.lang.collapse;\n            }\n        });\n\n        const toggler = document.createElement('div');\n        toggler.classList.add('limit_toggler');\n        toggler.append(button);\n\n        div.append(toggler);\n    });\n});\n","(function(){\n    'use strict';\n\n    const initializedRows = new WeakMap();\n    const saveScrollOffsetEvent = new Event('store-scroll-offset');\n\n    const init = (row) => {\n        // Check if this row has already been initialized\n        if (initializedRows.has(row)) {\n            return;\n        }\n\n        // Check if this row has all necessary elements\n        if (9 !== row.querySelectorAll('select, button, a.module_link, img.module_image').length) {\n            return;\n        }\n\n        initializedRows.set(row, true);\n\n        const tbody = row.closest('tbody');\n\n        const makeSortable = (tbody) => {\n            Array.from(tbody.children).forEach((tr, i) => {\n                tr.querySelectorAll('input, select').forEach((el) => {\n                    el.name = el.name.replace(/\\[[0-9]+]/g, '[' + i + ']');\n                });\n            });\n\n            // TODO: replace this with a vanilla JS solution\n            new Sortables(tbody, {\n                constrain: true,\n                opacity: 0.6,\n                handle: '.drag-handle',\n                onComplete: function() {\n                    makeSortable(tbody);\n                }\n            });\n        };\n\n        const addEventsTo = (tr) => {\n            tr.querySelectorAll('button').forEach((bt) => {\n                const command = bt.dataset.command;\n\n                switch (command) {\n                    case 'copy':\n                        bt.addEventListener('click', () => {\n                            window.dispatchEvent(saveScrollOffsetEvent)\n\n                            const ntr = tr.cloneNode(true);\n                            const selects = tr.querySelectorAll('select');\n                            const nselects = ntr.querySelectorAll('select');\n\n                            for (let j=0; j<selects.length; j++) {\n                                nselects[j].value = selects[j].value;\n                            }\n\n                            ntr.querySelectorAll('[data-original-title]').forEach((el) => {\n                                el.setAttribute('title', el.getAttribute('data-original-title'));\n                                el.removeAttribute('data-original-title');\n                            });\n\n                            initializedRows.set(ntr, true);\n                            tr.parentNode.insertBefore(ntr, tr.nextSibling);\n\n                            // Remove the ID of the select before initializing Chosen\n                            const select = ntr.querySelector('select.tl_select')\n                            select.removeAttribute('id');\n\n                            ntr.querySelector('.chzn-container').remove();\n                            new Chosen(select);\n\n                            addEventsTo(ntr);\n                            makeSortable(tbody);\n                        });\n                        break;\n\n                    case 'delete':\n                        bt.addEventListener('click', () => {\n                            window.dispatchEvent(saveScrollOffsetEvent);\n\n                            if (tbody.children.length > 1) {\n                                tr.remove();\n                            } else {\n                                // Reset values for last element (#689)\n                                tr.querySelectorAll('select').forEach((select) => {\n                                    select.value = select.children[0].value;\n                                });\n                            }\n\n                            makeSortable(tbody);\n                        });\n                        break;\n\n                    case 'enable':\n                        bt.addEventListener('click', function() {\n                            window.dispatchEvent(saveScrollOffsetEvent);\n\n                            const cbx = bt.previousElementSibling;\n\n                            if (cbx.checked) {\n                                cbx.checked = '';\n                            } else {\n                                cbx.checked = 'checked';\n                            }\n                        });\n                        break;\n\n                    default:\n                        if (bt.classList.contains('drag-handle')) {\n                            bt.addEventListener('keydown', (event) => {\n                                if (event.code === 'ArrowUp' || event.keyCode === 38) {\n                                    event.preventDefault();\n\n                                    if (tr.previousElementSibling) {\n                                        tr.previousElementSibling.insertAdjacentElement('beforebegin', tr);\n                                    } else {\n                                        tbody.insertAdjacentElement('beforeend', tr);\n                                    }\n\n                                    bt.focus();\n                                    makeSortable(tbody);\n                                } else if (event.code === 'ArrowDown' || event.keyCode === 40) {\n                                    event.preventDefault();\n\n                                    if (tr.nextElementSibling) {\n                                        tr.nextElementSibling.insertAdjacentElement('afterend', tr);\n                                    } else {\n                                        tbody.insertAdjacentElement('afterbegin', tr);\n                                    }\n\n                                    bt.focus();\n                                    makeSortable(tbody);\n                                }\n                            });\n                        }\n                        break;\n                }\n            });\n\n            const select = tr.querySelector('td:first-child select');\n\n            if (!select) {\n                return;\n            }\n\n            const link = tr.querySelector('a.module_link');\n            const images = tr.querySelectorAll('img.module_image');\n\n            const updateLink = () => {\n                link.href = link.href.replace(/id=[0-9]+/, 'id=' + select.value);\n\n                if (select.value > 0) {\n                    link.classList.remove('hidden');\n\n                    images.forEach((image) => {\n                        image.classList.add('hidden');\n                    });\n                } else {\n                    link.classList.add('hidden');\n\n                    images.forEach((image) => {\n                        image.classList.remove('hidden');\n                    });\n                }\n            };\n\n            select.addEventListener('change', updateLink);\n\n            // Backwards compatibility with MooTools \"Chosen\" script that fires non-native change event\n            select.addEvent('change', updateLink);\n        };\n\n        makeSortable(tbody);\n        addEventsTo(row);\n    };\n\n    document.querySelectorAll('.tl_modulewizard tr').forEach(init);\n\n    new MutationObserver(function(mutationsList) {\n        for (const mutation of mutationsList) {\n            if (mutation.type === 'childList') {\n                mutation.addedNodes.forEach(function(element) {\n                    if (element.matches && element.matches('.tl_modulewizard tr, .tl_modulewizard tr *')) {\n                        init(element.closest('tr'));\n                    }\n                })\n            }\n        }\n    }).observe(document, {\n        attributes: false,\n        childList: true,\n        subtree: true\n    });\n})();\n","/*\n---\n\nname: Request.Contao\n\ndescription: Extends the MooTools Request.JSON class with Contao-specific routines.\n\nlicense: LGPLv3\n\nauthors:\n - Leo Feyer\n\nrequires: [Request, JSON]\n\nprovides: Request.Contao\n\n...\n*/\n\nRequest.Contao = new Class(\n{\n\tExtends: Request.JSON,\n\n\toptions: {\n\t\tfollowRedirects: true,\n\t\turl: window.location.href\n\t},\n\n\tinitialize: function(options) {\n\t\tif (options && !options.url && options.field && options.field.form && options.field.form.action) {\n\t\t\tthis.options.url = options.field.form.action;\n\t\t}\n\t\tthis.parent(options);\n\t},\n\n\tsuccess: function(text) {\n\t\tvar url = this.getHeader('X-Ajax-Location'),\n\t\t\tjson;\n\n\t\tif (url && this.options.followRedirects) {\n\t\t\tlocation.replace(url);\n\t\t\treturn;\n\t\t}\n\n\t\t// Support both plain text and JSON responses\n\t\ttry {\n\t\t\tjson = this.response.json = JSON.decode(text, this.options.secure);\n\t\t} catch(e) {\n\t\t\tjson = {'content':text};\n\t\t}\n\n\t\t// Empty response\n\t\tif (json === null) {\n\t\t\tjson = {'content':''};\n\t\t} else if (typeof(json) != 'object') {\n\t\t\tjson = {'content':text};\n\t\t}\n\n\t\t// Isolate scripts and execute them\n\t\tif (json.content != '') {\n\t\t\tjson.content = json.content.stripScripts(function(script) {\n\t\t\t\tjson.javascript = script.replace(/<!--|\\/\\/-->|<!\\[CDATA\\[\\/\\/>|<!]]>/g, '');\n\t\t\t});\n\t\t\tif (json.javascript && this.options.evalScripts) {\n\t\t\t\tBrowser.exec(json.javascript);\n\t\t\t}\n\t\t}\n\n\t\tthis.onSuccess(json.content, json);\n\t},\n\n\tfailure: function() {\n\t\tvar url = this.getHeader('X-Ajax-Location');\n\n\t\tif (url && 401 === this.status) {\n\t\t\tlocation.replace(url);\n\t\t\treturn;\n\t\t}\n\n\t\tif (url && this.options.followRedirects && this.status >= 300 && this.status < 400) {\n\t\t\tlocation.replace(url);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.onFailure();\n\t}\n});\n\n\n/*\n---\n\nname: Drag\n\ndescription: Extends the base Drag class with touch support.\n\nlicense: LGPLv3\n\nauthors:\n - Andreas Schempp\n\nrequires: [Drag]\n\nprovides: Drag\n\n...\n*/\n\nClass.refactor(Drag,\n{\n\tattach: function() {\n\t\tthis.handles.addEvent('touchstart', this.bound.start);\n\t\treturn this.previous.apply(this, arguments);\n\t},\n\n\tdetach: function() {\n\t\tthis.handles.removeEvent('touchstart', this.bound.start);\n\t\treturn this.previous.apply(this, arguments);\n\t},\n\n\tstart: function() {\n\t\tdocument.addEvents({\n\t\t\ttouchmove: this.bound.check,\n\t\t\ttouchend: this.bound.cancel\n\t\t});\n\t\tthis.previous.apply(this, arguments);\n\t},\n\n\tcheck: function(event) {\n\t\tif (this.options.preventDefault) event.preventDefault();\n\t\tvar distance = Math.round(Math.sqrt(Math.pow(event.page.x - this.mouse.start.x, 2) + Math.pow(event.page.y - this.mouse.start.y, 2)));\n\t\tif (distance > this.options.snap) {\n\t\t\tthis.cancel();\n\t\t\tthis.document.addEvents({\n\t\t\t\tmousemove: this.bound.drag,\n\t\t\t\tmouseup: this.bound.stop\n\t\t\t});\n\t\t\tdocument.addEvents({\n\t\t\t\ttouchmove: this.bound.drag,\n\t\t\t\ttouchend: this.bound.stop\n\t\t\t});\n\t\t\tthis.fireEvent('start', [this.element, event]).fireEvent('snap', this.element);\n\t\t}\n\t},\n\n\tcancel: function() {\n\t\tdocument.removeEvents({\n\t\t\ttouchmove: this.bound.check,\n\t\t\ttouchend: this.bound.cancel\n\t\t});\n\t\treturn this.previous.apply(this, arguments);\n\t},\n\n\tstop: function() {\n\t\tdocument.removeEvents({\n\t\t\ttouchmove: this.bound.drag,\n\t\t\ttouchend: this.bound.stop\n\t\t});\n\t\treturn this.previous.apply(this, arguments);\n\t}\n});\n\n/*\n---\n\nname: Sortables\n\ndescription: Extends the base Sortables class with touch support.\n\nlicense: LGPLv3\n\nauthors:\n - Andreas Schempp\n\nrequires: [Sortables]\n\nprovides: Sortables\n\n...\n*/\n\nClass.refactor(Sortables,\n{\n\tinitialize: function(lists, options) {\n\t\toptions.dragOptions = Object.merge(options.dragOptions || {}, { preventDefault: (options.dragOptions && options.dragOptions.preventDefault) || Browser.Features.Touch });\n\t\tif (options.dragOptions.unDraggableTags === undefined) {\n\t\t\toptions.dragOptions.unDraggableTags = this.options.unDraggableTags.filter(function(tag) {\n\t\t\t\treturn tag != 'button';\n\t\t\t});\n\t\t}\n\t\treturn this.previous.apply(this, arguments);\n\t},\n\n\taddItems: function() {\n\t\tArray.flatten(arguments).each(function(element) {\n\t\t\tthis.elements.push(element);\n\t\t\tvar start = element.retrieve('sortables:start', function(event) {\n\t\t\t\tthis.start.call(this, event, element);\n\t\t\t}.bind(this));\n\t\t\t(this.options.handle ? element.getElement(this.options.handle) || element : element).addEvents({\n\t\t\t\tmousedown: start,\n\t\t\t\ttouchstart: start\n\t\t\t});\n\t\t}, this);\n\t\treturn this;\n\t},\n\n\tremoveItems: function() {\n\t\treturn $$(Array.flatten(arguments).map(function(element) {\n\t\t\tthis.elements.erase(element);\n\t\t\tvar start = element.retrieve('sortables:start');\n\t\t\t(this.options.handle ? element.getElement(this.options.handle) || element : element).removeEvents({\n\t\t\t\tmousedown: start,\n\t\t\t\ttouchend: start\n\t\t\t});\n\t\t\treturn element;\n\t\t}, this));\n\t},\n\n\tgetClone: function(event, element) {\n\t\tif (!this.options.clone) return new Element(element.tagName).inject(document.body);\n\t\tif (typeOf(this.options.clone) == 'function') return this.options.clone.call(this, event, element, this.list);\n\t\tvar clone = this.previous.apply(this, arguments);\n\t\tclone.addEvent('touchstart', function(event) {\n\t\t\telement.fireEvent('touchstart', event);\n\t\t});\n\t\treturn clone;\n\t}\n});\n\n/*\n---\n\nscript: Request.Queue.js\n\nname: Request.Queue\n\ndescription: Extends the base Request.Queue class and attempts to fix some issues.\n\nlicense: MIT-style license\n\nauthors:\n - Leo Feyer\n\nrequires:\n\t- Core/Element\n\t- Core/Request\n\t- Class.Binds\n\nprovides: [Request.Queue]\n\n...\n*/\n\nClass.refactor(Request.Queue,\n{\n\t// Do not fire the \"end\" event here\n\tonComplete: function(){\n\t\tthis.fireEvent('complete', arguments);\n\t},\n\n\t// Call resume() instead of runNext()\n\tonCancel: function(){\n\t\tif (this.options.autoAdvance && !this.error) this.resume();\n\t\tthis.fireEvent('cancel', arguments);\n\t},\n\n\t// Call resume() instead of runNext() and fire the \"end\" event\n\tonSuccess: function(){\n\t\tif (this.options.autoAdvance && !this.error) this.resume();\n\t\tthis.fireEvent('success', arguments);\n\t\tif (!this.queue.length && !this.isRunning()) this.fireEvent('end');\n\t},\n\n\t// Call resume() instead of runNext() and fire the \"end\" event\n\tonFailure: function(){\n\t\tthis.error = true;\n\t\tif (!this.options.stopOnFailure && this.options.autoAdvance) this.resume();\n\t\tthis.fireEvent('failure', arguments);\n\t\tif (!this.queue.length && !this.isRunning()) this.fireEvent('end');\n\t},\n\n\t// Call resume() instead of runNext()\n\tonException: function(){\n\t\tthis.error = true;\n\t\tif (!this.options.stopOnFailure && this.options.autoAdvance) this.resume();\n\t\tthis.fireEvent('exception', arguments);\n\t}\n});\n\n/*\n---\n\nname: Contao.SerpPreview\n\ndescription: Generates a SERP preview\n\nlicense: LGPLv3\n\nauthors:\n - Leo Feyer\n\nrequires: [Request, JSON]\n\nprovides: Contao.SerpPreview\n\n...\n*/\n\nContao.SerpPreview = new Class(\n{\n\toptions: {\n\t\tid: 0,\n\t\ttrail: null,\n\t\ttitleField: null,\n\t\ttitleFallbackField: null,\n\t\taliasField: null,\n\t\tdescriptionField: null,\n\t\tdescriptionFallbackField: null,\n\t\ttitleTag: null\n\t},\n\n\tshorten: function(str, max) {\n\t\tif (str.length <= max) {\n\t\t\treturn str;\n\t\t}\n\t\treturn str.substr(0, str.lastIndexOf(' ', max)) + ' …';\n\t},\n\n\thtml2string: function(html) {\n\t\treturn new DOMParser().parseFromString(html, 'text/html').body.textContent.replace(/\\[-]/g, '\\xAD').replace(/\\[nbsp]/g, '\\xA0');\n\t},\n\n\tgetTinymce: function() {\n\t\tif (window.tinyMCE && this.options.descriptionFallbackField) {\n\t\t\treturn window.tinyMCE.get(this.options.descriptionFallbackField);\n\t\t}\n\t},\n\n\tinitialize: function() {\n\t\tthis.options = Object.merge.apply(null, [{}, this.options].append(arguments));\n\n\t\tvar serpTitle = $('serp_title_' + this.options.id),\n\t\t\tserpUrl = $('serp_url_' + this.options.id),\n\t\t\tserpDescription = $('serp_description_' + this.options.id),\n\t\t\ttitleField = $(this.options.titleField),\n\t\t\ttitleFallbackField = $(this.options.titleFallbackField),\n\t\t\taliasField = $(this.options.aliasField),\n\t\t\tdescriptionField = $(this.options.descriptionField),\n\t\t\tdescriptionFallbackField = $(this.options.descriptionFallbackField),\n\t\t\tindexEmpty = this.options.trail.indexOf('›') === -1,\n\t\t\ttitleTag = this.options.titleTag || '%s';\n\n\t\ttitleField && titleField.addEvent('input', function() {\n\t\t\tif (titleField.value) {\n\t\t\t\tserpTitle.set('text', this.shorten(this.html2string(titleTag.replace(/%s/, titleField.value)).replace(/%%/g, '%'), 64));\n\t\t\t} else if (titleFallbackField && titleFallbackField.value) {\n\t\t\t\tserpTitle.set('text', this.shorten(this.html2string(titleTag.replace(/%s/, titleFallbackField.value)).replace(/%%/g, '%'), 64));\n\t\t\t} else {\n\t\t\t\tserpTitle.set('text', '');\n\t\t\t}\n\t\t}.bind(this));\n\n\t\ttitleFallbackField && titleFallbackField.addEvent('input', function() {\n\t\t\tif (titleField && titleField.value) return;\n\t\t\tserpTitle.set('text', this.shorten(this.html2string(titleTag.replace(/%s/, titleFallbackField.value)).replace(/%%/g, '%'), 64));\n\t\t}.bind(this));\n\n\t\taliasField && aliasField.addEvent('input', function() {\n\t\t\tif (aliasField.value == 'index' && indexEmpty) {\n\t\t\t\tserpUrl.set('text', this.options.trail);\n\t\t\t} else {\n\t\t\t\tserpUrl.set('text', this.options.trail + ' › ' + (aliasField.value || this.options.id).replace(/\\//g, ' › '));\n\t\t\t}\n\t\t}.bind(this));\n\n\t\tdescriptionField && descriptionField.addEvent('input', function() {\n\t\t\tif (descriptionField.value) {\n\t\t\t\tserpDescription.set('text', this.shorten(descriptionField.value, 160));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar editor = this.getTinymce();\n\t\t\tif (editor) {\n\t\t\t\tserpDescription.set('text', this.shorten(this.html2string(editor.getContent()), 160));\n\t\t\t} else if (descriptionFallbackField && descriptionFallbackField.value) {\n\t\t\t\tserpDescription.set('text', this.shorten(this.html2string(descriptionFallbackField.value), 160));\n\t\t\t} else {\n\t\t\t\tserpDescription.set('text', '');\n\t\t\t}\n\t\t}.bind(this));\n\n\t\tdescriptionFallbackField && descriptionFallbackField.addEvent('input', function() {\n\t\t\tif (descriptionField && descriptionField.value) return;\n\t\t\tserpDescription.set('text', this.shorten(this.html2string(descriptionFallbackField.value), 160));\n\t\t}.bind(this));\n\n\t\tsetTimeout(function() {\n\t\t\tvar editor = this.getTinymce();\n\t\t\teditor && editor.on('keyup', function() {\n\t\t\t\tif (descriptionField && descriptionField.value) return;\n\t\t\t\tserpDescription.set('text', this.shorten(this.html2string(window.tinyMCE.activeEditor.getContent()), 160));\n\t\t\t}.bind(this));\n\t\t}.bind(this), 4);\n\t}\n});\n","(function(){\n    'use strict';\n\n    const initializedRows = new WeakMap();\n    const saveScrollOffsetEvent = new Event('store-scroll-offset');\n\n    const init = (row) => {\n        // Check if this row has already been initialized\n        if (initializedRows.has(row)) {\n            return;\n        }\n\n        // Check if this row has all necessary elements\n        if (7 !== row.querySelectorAll('input, select, button').length) {\n            return;\n        }\n\n        initializedRows.set(row, true);\n\n        const tbody = row.closest('tbody');\n\n        const makeSortable = (tbody) => {\n            Array.from(tbody.children).forEach((tr, i) => {\n                tr.querySelectorAll('input, select').forEach((el) => {\n                    el.name = el.name.replace(/\\[[0-9]+]/g, '[' + i + ']');\n                });\n            });\n\n            // TODO: replace this with a vanilla JS solution\n            new Sortables(tbody, {\n                constrain: true,\n                opacity: 0.6,\n                handle: '.drag-handle',\n                onComplete: function() {\n                    makeSortable(tbody);\n                }\n            });\n        };\n\n        const addEventsTo = (tr) => {\n            tr.querySelectorAll('button').forEach((bt) => {\n                const command = bt.dataset.command;\n\n                switch (command) {\n                    case 'copy':\n                        bt.addEventListener('click', () => {\n                            window.dispatchEvent(saveScrollOffsetEvent);\n                            const ntr = tr.cloneNode(true);\n                            const selects = tr.querySelectorAll('select');\n                            const nselects = ntr.querySelectorAll('select');\n                            for (let j=0; j<selects.length; j++) {\n                                nselects[j].value = selects[j].value;\n                            }\n                            tr.parentNode.insertBefore(ntr, tr.nextSibling);\n                            addEventsTo(ntr);\n                            makeSortable(tbody);\n                        });\n                        break;\n\n                    case 'delete':\n                        bt.addEventListener('click', () => {\n                            window.dispatchEvent(saveScrollOffsetEvent);\n                            if (tbody.children.length > 1) {\n                                tr.remove();\n                            } else {\n                                // Reset values for last element (#689)\n                                tr.querySelectorAll('input').forEach((input) => {\n                                    input.value = '';\n                                });\n\n                                tr.querySelectorAll('select').forEach((select) => {\n                                    select.value = select.children[0].value;\n                                });\n                            }\n                            makeSortable(tbody);\n                        });\n                        break;\n\n                    default:\n                        if (bt.classList.contains('drag-handle')) {\n                            bt.addEventListener('keydown', (event) => {\n                                if (event.code === 'ArrowUp' || event.keyCode === 38) {\n                                    event.preventDefault();\n                                    if (tr.previousElementSibling) {\n                                        tr.previousElementSibling.insertAdjacentElement('beforebegin', tr);\n                                    } else {\n                                        tbody.insertAdjacentElement('beforeend', tr);\n                                    }\n                                    bt.focus();\n                                    makeSortable(tbody);\n                                } else if (event.code === 'ArrowDown' || event.keyCode === 40) {\n                                    event.preventDefault();\n                                    if (tr.nextElementSibling) {\n                                        tr.nextElementSibling.insertAdjacentElement('afterend', tr);\n                                    } else {\n                                        tbody.insertAdjacentElement('afterbegin', tr);\n                                    }\n                                    bt.focus();\n                                    makeSortable(tbody);\n                                }\n                            });\n                        }\n                        break;\n                }\n            });\n        };\n\n        makeSortable(tbody);\n        addEventsTo(row);\n    };\n\n    document.querySelectorAll('.tl_sectionwizard tr').forEach(init);\n\n    new MutationObserver(function(mutationsList) {\n        for (const mutation of mutationsList) {\n            if (mutation.type === 'childList') {\n                mutation.addedNodes.forEach(function(element) {\n                    if (element.matches && element.matches('.tl_sectionwizard tr, .tl_sectionwizard tr *')) {\n                        init(element.closest('tr'));\n                    }\n                })\n            }\n        }\n    }).observe(document, {\n        attributes: false,\n        childList: true,\n        subtree: true\n    });\n})();\n","(function() {\n    const initialized = [];\n\n    const tip = document.createElement('div');\n    tip.setAttribute('role', 'tooltip');\n    tip.classList.add('tip')\n    tip.style.position = 'absolute';\n    tip.style.display = 'none';\n\n    const init = function(el, x, y, useContent) {\n        if (initialized.includes(el)) {\n            return;\n        }\n\n        initialized.push(el);\n\n        let text, timer;\n\n        el.addEventListener('mouseenter', function() {\n            if (useContent) {\n                text = el.innerHTML;\n            } else {\n                text = el.getAttribute('title');\n                el.setAttribute('data-original-title', text);\n                el.removeAttribute('title');\n                text = text?.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\"/g, '&quot;').replace(/'/g, '&apos;');\n            }\n\n            if (!text) {\n                return;\n            }\n\n            clearTimeout(timer);\n            tip.style.willChange = 'display,contents';\n\n            timer = setTimeout(function() {\n                const position = el.getBoundingClientRect();\n                const rtl = getComputedStyle(el).direction === 'rtl';\n                const clientWidth = document.html.clientWidth;\n\n                if ((rtl && position.x < 200) || (!rtl && position.x < (clientWidth - 200))) {\n                    tip.style.left = `${(window.scrollX + position.left + x)}px`;\n                    tip.style.right = 'auto';\n                    tip.classList.remove('tip--rtl')\n                } else {\n                    tip.style.left = 'auto';\n                    tip.style.right = `${(clientWidth - window.scrollX - position.right + x)}px`;\n                    tip.classList.add('tip--rtl')\n                }\n\n                tip.innerHTML = `<div>${text}</div>`;\n                tip.style.top = `${(window.scrollY + position.top + y)}px`;\n                tip.style.display = 'block';\n                tip.style.willChange = 'auto';\n\n                if (!tip.parentNode && document.body) {\n                    document.body.append(tip);\n                }\n            }, 1000)\n        })\n\n        el.addEventListener('mouseleave', function() {\n            if (el.hasAttribute('data-original-title')) {\n                if (!el.hasAttribute('title')) {\n                    el.setAttribute('title', el.getAttribute('data-original-title'));\n                }\n\n                el.removeAttribute('data-original-title')\n            }\n\n            clearTimeout(timer)\n            tip.style.willChange = 'auto';\n\n            if (tip.style.display === 'block') {\n                tip.style.willChange = 'display';\n                timer = setTimeout(function() {\n                    tip.style.display = 'none';\n                    tip.style.willChange = 'auto';\n                }, 100)\n            }\n        })\n\n        const action = el.closest('button, a');\n\n        // Hide tooltip when clicking a button (usually an operation icon in a wizard widget)\n        if (action) {\n            action.addEventListener('click', function() {\n                clearTimeout(timer);\n                tip.style.display = 'none';\n                tip.style.willChange = 'auto';\n            })\n        }\n    }\n\n    function select(node, selector) {\n        if (node.matches(selector)) {\n            return [node, ...node.querySelectorAll(selector)];\n        }\n\n        return node.querySelectorAll(selector);\n    }\n\n    function setup(node) {\n        select(node, 'p.tl_tip').forEach(function(el) {\n            init(el, 0, 23, true);\n        });\n\n        select(node, '#home').forEach(function(el) {\n            init(el, 6, 42);\n        });\n\n        select(node, '#tmenu a[title]').forEach(function(el) {\n            init(el, 0, 42);\n        });\n\n        select(node, 'a[title][class^=\"group-\"]').forEach(function(el) {\n            init(el, -6, 27);\n        });\n\n        select(node, 'a[title].navigation').forEach(function(el) {\n            init(el, 25, 32);\n        });\n\n        select(node, 'img[title]').forEach(function(el) {\n            init(el, -9, el.classList.contains('gimage') ? 60 : 30);\n        });\n\n        select(node, 'a[title]').forEach(function(el) {\n            if (el.classList.contains('picker-wizard')) {\n                init(el, -4, 30);\n            } else {\n                init(el, -9, 30);\n            }\n        });\n\n        select(node, 'button[title]').forEach(function(el) {\n            if (el.classList.contains('unselectable')) {\n                init(el, -4, 20);\n            } else {\n                init(el, -9, 30);\n            }\n        });\n\n        ['input[title]', 'time[title]', 'span[title]'].forEach(function(selector) {\n            select(node, selector).forEach(function(el) {\n                init(el, -9, ((selector === 'time[title]' || selector === 'span[title]') ? 26 : 30));\n            });\n        });\n    }\n\n    setup(document.documentElement);\n\n    new MutationObserver(function(mutationsList) {\n        for (const mutation of mutationsList) {\n            if (mutation.type === 'childList') {\n                mutation.addedNodes.forEach(function(element) {\n                    if (element.matches && element.querySelectorAll) {\n                        setup(element);\n                    }\n                })\n            }\n        }\n    }).observe(document, {\n        attributes: false,\n        childList: true,\n        subtree: true\n    });\n})();\n","var map = {\n\t\"./clipboard-controller.js\": 424,\n\t\"./color-scheme-controller.js\": 1,\n\t\"./image-size-controller.js\": 572,\n\t\"./jump-targets-controller.js\": 395,\n\t\"./limit-height-controller.js\": 780,\n\t\"./metawizard-controller.js\": 208,\n\t\"./scroll-offset-controller.js\": 423,\n\t\"./toggle-fieldset-controller.js\": 991,\n\t\"./toggle-navigation-controller.js\": 441,\n\t\"./toggle-nodes-controller.js\": 577\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 483;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/*\nStimulus Webpack Helpers 1.0.0\nCopyright © 2021 Basecamp, LLC\n */\nfunction definitionsFromContext(context) {\n    return context.keys()\n        .map((key) => definitionForModuleWithContextAndKey(context, key))\n        .filter((value) => value);\n}\nfunction definitionForModuleWithContextAndKey(context, key) {\n    const identifier = identifierForContextKey(key);\n    if (identifier) {\n        return definitionForModuleAndIdentifier(context(key), identifier);\n    }\n}\nfunction definitionForModuleAndIdentifier(module, identifier) {\n    const controllerConstructor = module.default;\n    if (typeof controllerConstructor == \"function\") {\n        return { identifier, controllerConstructor };\n    }\n}\nfunction identifierForContextKey(key) {\n    const logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n    if (logicalName) {\n        return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n    }\n}\n\nexport { definitionForModuleAndIdentifier, definitionForModuleWithContextAndKey, definitionsFromContext, identifierForContextKey };\n","import { Application } from '@hotwired/stimulus'\nimport { definitionForModuleAndIdentifier, identifierForContextKey } from '@hotwired/stimulus-webpack-helpers'\n\nimport './scripts/mootao.js'\nimport './scripts/core.js'\nimport './scripts/limit-height.js'\nimport './scripts/modulewizard.js'\nimport './scripts/sectionwizard.js'\nimport './scripts/tips.js'\n\n// Start Stimulus application and register all controllers with `contao--` prefix.\nconst application = Application.start()\napplication.debug = process.env.NODE_ENV === 'development'\n\nconst context = require.context('./controllers', true, /\\.js$/)\napplication.load(context.keys().map((key) => {\n    const identifier = identifierForContextKey(key);\n    if (identifier) {\n        return definitionForModuleAndIdentifier(context(key), `contao--${ identifier }`);\n    }\n}).filter((value) => value));\n"],"names":["EventListener","constructor","eventTarget","eventName","eventOptions","this","unorderedBindings","Set","connect","addEventListener","disconnect","removeEventListener","bindingConnected","binding","add","bindingDisconnected","delete","handleEvent","event","extendedEvent","stopImmediatePropagation","Object","assign","immediatePropagationStopped","call","extendEvent","bindings","hasBindings","size","Array","from","sort","left","right","leftIndex","index","rightIndex","Dispatcher","application","eventListenerMaps","Map","started","start","eventListeners","forEach","eventListener","stop","values","reduce","listeners","map","concat","fetchEventListenerForBinding","clearEventListeners","clearEventListenersForBinding","handleError","error","message","detail","removeMappedEventListenerFor","eventListenerMap","fetchEventListenerMapForEventTarget","cacheKey","fetchEventListener","get","createEventListener","set","parts","keys","key","push","join","defaultActionDescriptorFilters","value","stopPropagation","prevent","preventDefault","self","element","target","descriptorPattern","parseEventTarget","eventTargetName","window","document","camelize","replace","_","char","toUpperCase","namespaceCamelize","capitalize","charAt","slice","dasherize","toLowerCase","isSomething","object","hasProperty","property","prototype","hasOwnProperty","allModifiers","Action","descriptor","schema","tagName","defaultEventNames","getDefaultEventNameForElement","identifier","methodName","keyFilter","forToken","token","descriptorString","matches","trim","match","includes","split","options","test","parseActionDescriptorString","content","toString","eventFilter","shouldIgnoreKeyboardEvent","filters","keyFilterDissatisfied","standardFilter","filter","keyMappings","shouldIgnoreMouseEvent","params","pattern","RegExp","name","attributes","typecast","meta","ctrl","alt","shift","modifier","metaKey","ctrlKey","altKey","shiftKey","a","button","form","details","input","e","getAttribute","select","textarea","Error","JSON","parse","o_O","Binding","context","action","actionEvent","prepareActionEvent","willBeInvokedByEvent","applyEventModifiers","invokeWithEvent","method","controller","actionDescriptorFilters","passes","entries","currentTarget","logDebugActivity","KeyboardEvent","MouseEvent","Element","contains","scope","containsElement","ElementObserver","delegate","mutationObserverInit","childList","subtree","elements","mutationObserver","MutationObserver","mutations","processMutations","observe","refresh","pause","callback","takeRecords","matchElementsInTree","has","removeElement","addElement","mutation","processMutation","type","processAttributeChange","attributeName","processRemovedNodes","removedNodes","processAddedNodes","addedNodes","elementAttributeChanged","matchElement","nodes","node","elementFromNode","processTree","elementIsActive","tree","processor","nodeType","Node","ELEMENT_NODE","isConnected","elementMatched","elementUnmatched","AttributeObserver","elementObserver","selector","hasAttribute","querySelectorAll","elementMatchedAttribute","elementUnmatchedAttribute","elementAttributeValueChanged","fetch","del","prune","Multimap","valuesByKey","hasKey","hasValue","some","getValuesForKey","getKeysForValue","_key","_values","SelectorObserver","_selector","matchesByElement","selectorMatchElement","selectorMatched","selectors","selectorUnmatched","_attributeName","matchedBefore","StringMapObserver","stringMap","attributeOldValue","knownAttributeNames","refreshAttribute","oldValue","getStringMapKeyForAttribute","stringMapKeyAdded","stringMapValueChanged","stringMapKeyRemoved","currentAttributeNames","recordedAttributeNames","attribute","TokenListObserver","attributeObserver","tokensByElement","tokensMatched","readTokensForElement","unmatchedTokens","matchedTokens","refreshTokensForElement","tokensUnmatched","tokens","tokenMatched","tokenUnmatched","previousTokens","currentTokens","firstDifferingIndex","length","Math","max","zip","findIndex","previousToken","currentToken","tokenString","parseTokenString","ValueListObserver","tokenListObserver","parseResultsByToken","WeakMap","valuesByTokenByElement","fetchParseResultForToken","fetchValuesByTokenForElement","elementMatchedValue","elementUnmatchedValue","parseResult","parseToken","valuesByToken","parseValueForToken","BindingObserver","bindingsByAction","valueListObserver","actionAttribute","disconnectAllActions","connectAction","disconnectAction","clear","ValueObserver","receiver","stringMapObserver","valueDescriptorMap","invokeChangedCallbacksForDefaultValues","invokeChangedCallback","writer","defaultValue","valueDescriptorNameMap","valueDescriptors","undefined","data","rawValue","rawOldValue","changedMethodName","changedMethod","reader","TypeError","descriptors","hasMethodName","TargetObserver","targetsByName","disconnectAllTargets","connectTarget","disconnectTarget","_a","targetConnected","targetDisconnected","readInheritableStaticArrayValues","propertyName","ancestors","getAncestorsForConstructor","definition","isArray","getOwnStaticArrayValues","readInheritableStaticObjectPairs","pairs","getOwnStaticObjectPairs","getPrototypeOf","reverse","OutletObserver","outletsByName","outletElementsByName","selectorObserverMap","attributeObserverMap","outletDefinitions","outletName","setupSelectorObserverForOutlet","setupAttributeObserverForOutlet","dependentContexts","observer","disconnectAllOutlets","stopSelectorObservers","stopAttributeObservers","outlet","getOutlet","connectOutlet","getOutletFromMap","disconnectOutlet","hasOutlet","hasOutletController","controllerAttribute","_element","getOutletNameFromOutletAttributeName","updateSelectorObserverForOutlet","outletConnected","outletDisconnected","selectorObserver","body","attributeNameForOutletName","outlets","getSelectorForOutletName","outletAttributeForScope","find","outletDependencies","dependencies","router","modules","module","controllerConstructor","dependentControllerIdentifiers","identifiers","contexts","getControllerForElementAndIdentifier","Context","functionName","bindingObserver","dispatcher","valueObserver","targetObserver","outletObserver","initialize","parentElement","invokeControllerMethod","args","bless","properties","shadowConstructor","extend","shadowProperties","getOwnKeys","shadowingDescriptor","getOwnPropertyDescriptor","getShadowedDescriptor","getShadowProperties","defineProperties","shadow","blessings","blessedProperties","blessing","getBlessedProperties","getOwnPropertySymbols","getOwnPropertyNames","extendWithReflect","extended","Reflect","construct","arguments","create","setPrototypeOf","b","testReflectExtension","Module","blessDefinition","contextsByScope","connectedContexts","connectContextForScope","fetchContextForScope","disconnectContextForScope","ClassMap","getDataKey","getAll","getAttributeName","getAttributeNameForKey","DataMap","setAttribute","removeAttribute","Guide","logger","warnedKeysByObject","warn","warnedKeys","attributeValueContainsToken","TargetSet","targetName","targetNames","findTarget","findLegacyTarget","findAll","targets","findAllTargets","findAllLegacyTargets","getSelectorForTargetName","findElement","findAllElements","targetAttributeForScope","getLegacySelectorForTargetName","deprecate","targetDescriptor","targetAttribute","revisedAttributeName","guide","OutletSet","controllerElement","outletNames","findOutlet","findAllOutlets","queryElements","matchesElement","Scope","classes","closest","controllerSelector","documentScope","isDocumentScope","documentElement","ScopeObserver","scopesByIdentifierByElement","scopeReferenceCounts","parseValueForElementAndIdentifier","scopesByIdentifier","fetchScopesByIdentifierForElement","createScopeForElementAndIdentifier","referenceCount","scopeConnected","scopeDisconnected","Router","scopeObserver","modulesByIdentifier","loadDefinition","unloadIdentifier","connectModule","afterLoad","disconnectModule","getContextForElementAndIdentifier","proposeToConnectScopeForElementAndIdentifier","console","defaultSchema","enter","tab","esc","space","up","down","home","end","page_up","page_down","objectFromEntries","c","n","array","memo","k","v","Application","debug","logFormattedMessage","Promise","resolve","readyState","register","load","registerActionOption","head","rest","shouldLoad","unload","controllers","onerror","groupCollapsed","log","groupEnd","getOutletController","getControllerAndEnsureConnectedScope","outletController","parseValueDefinitionPair","typeDefinition","payload","typeObject","typeFromObject","hasType","hasDefault","default","fullObject","onlyType","onlyDefault","parseValueTypeConstant","typeFromDefaultValue","parseValueTypeDefault","parseValueTypeObject","typeFromConstant","propertyPath","parseValueTypeDefinition","constant","defaultValuesByType","constantFromType","defaultValueForDefinition","hasCustomDefaultValue","readers","writers","valueDescriptorForTokenAndTypeDefinition","Boolean","Number","String","boolean","number","string","writeJSON","stringify","Controller","_identifier","_application","dispatch","prefix","bubbles","cancelable","CustomEvent","dispatchEvent","classDefinition","targetDefinition","valueDefinitionPairs","propertyDescriptorMap","result","valueDefinitionPair","valueDescriptor","read","write","propertiesForValueDefinitionPair","outletDefinition","camelizedName","outletElement","propertiesForOutletDefinition","static","navigator","clipboard","writeText","contentValue","catch","clipboardFallback","bind","createElement","appendChild","setSelectionRange","execCommand","removeChild","prefersDark","localStorage","getItem","matchMedia","setColorScheme","dataset","colorScheme","i18n","light","dark","toggle","setLabel","isDark","removeItem","setItem","setTimeout","hasLabelTarget","label","i18nValue","labelTarget","title","innerText","config","updateWizard","openModal","querySelector","buttonImage","append","parentNode","classList","after","remove","canEdit","configValue","disabled","src","icon","iconDisabled","Backend","openModalIframe","url","href","ids","rebuildNavigation","connected","sectionTargetConnected","hasNavigationTarget","links","sectionTargets","el","scrollIntoView","li","navigationTarget","replaceChildren","expand","collapse","expandAll","expandAllTitle","collapseAll","collapseAllTitle","super","togglerMap","nextId","operationTargetConnected","updateOperation","nodeTargetConnected","style","getComputedStyle","padding","parseFloat","paddingTop","paddingBottom","height","clientHeight","maxValue","id","overflow","maxHeight","expandValue","innerHTML","toggler","nodeTargetDisconnected","collapseValue","toggleAll","isExpanded","hasExpanded","nodeTargets","keypress","hasOperationTarget","hasTogglers","expanded","operationTarget","display","collapseAllValue","collapseAllTitleValue","expandAllValue","expandAllTitleValue","inputTargets","sessionKey","behavior","block","loadFallback","reject","initScrollOffset","getScrollOffset","then","discard","store","offset","scrollTo","top","behaviorValue","blockValue","scrollToTargetConnected","scrollToTarget","autoFocusTargetConnected","autoFocus","autoFocusTarget","readonly","offsetWidth","offsetHeight","autocomplete","focus","scrollTop","sessionStorage","sessionKeyValue","parseInt","table","addController","fs","migrateLegacy","AjaxRequest","toggleFieldset","collapsedClass","open","close","storeState","i","checkValidity","click","state","hasIdValue","hasTableValue","location","headers","URLSearchParams","idValue","tableValue","requestToken","expandTitle","collapseTitle","_ref","category","collapsed","expandTitleValue","collapseTitleValue","sendRequest","urlValue","REQUEST_TOKEN","requestTokenValue","mode","toggleAction","loadAction","refererId","childTargetConnected","blur","toggleToggler","level","folder","item","showChild","expandToggler","updateState","hideChild","collapseToggler","fetchChild","loadToggler","enabled","URL","search","searchParams","refererIdValue","response","loadActionValue","ok","txt","text","ul","modeValue","next","isFolder","parent","typeOf","nextElementSibling","before","fireEvent","hasExpandedRoot","updateAllState","toggleTargets","childTargets","promises","all","toggleActionValue","rootChildTargets","toggleNavigation","$","getParent","hasClass","removeClass","Contao","lang","Request","post","request_token","addClass","toggleStructure","getStyle","setStyle","field","evalScripts","onRequest","displayBox","loading","onSuccess","inject","getNext","getElements","each","referer_id","hideBox","toggleFileManager","toggleSubpalette","updateVersionNumber","html","fields","VERSION_NUMBER","exec","checked","json","div","javascript","str","Asset","onLoad","Browser","toggleField","rowIcon","pa","img","images","published","getPrevious","getFirst","getElement","HTMLElement","nodeName","indexOf","newSrc","lastIndexOf","image","toggleCheckboxGroup","box","overlay","scroll","getScroll","y","currentId","popupWindow","themePath","script_url","theme","openModalWindow","width","SimpleModal","show","openModalImage","opt","maxWidth","getSize","x","toInt","min","openModalSelector","M","addButton","cancel","buttons","hide","apply","inp","pickerValue","sIndex","frm","frames","val","getElementById","getElementsByTagName","splice","alert","openModalBrowser","field_name","win","source","routes","backend_picker","autoSubmit","Event","hidden","submit","vScrollTo","addEvent","toggleCheckboxes","items","$$","status","substr","cls","className","checkbox","toggleCheckboxElements","makeParentViewSortable","ds","Scroller","onChange","list","Sortables","constrain","opacity","onStart","onComplete","onSort","divs","wrapLevel","getChildren","handle","active","pid","req","makeMultiSrcSortable","oid","els","lis","j","did","dispose","enableFileTreeDragAndDrop","fixDroppable","droppable","dragHandle","dragElement","rightClick","currentHover","currentHoverTime","expandLink","cloneBase","clone","setPosition","page","getOffsetParent","getPosition","move","Drag","Move","droppables","unDraggableTags","modifiers","onEnter","Date","getTime","createEvent","initEvent","onAjax","removeEvent","onCancel","destroy","onKeyup","onDrop","decodeURIComponent","encodeURIComponent","onLeave","listWizard","addEventsTo","previous","bt","hasEvent","getProperty","keyCode","makeSortable","tableWizard","thead","tbody","children","rows","tr","current","ntr","getIndex","headFirst","getLast","td","cols","tableWizardResize","factor","round","limit","chunks","tableWizardSetWidth","wrap","getComputedSize","optionsWizard","keyValueWizard","checkboxWizard","container","span","nspan","enableImageSizeWidgets","widthInput","heightInput","update","readOnly","dimensions","getSelected","enableToggleSelect","thisIndex","startIndex","to","shiftToggle","checkboxes","clickEvent","limitToggler","boundEvent","retrieve","editPreviewWizard","partElement","startPos","imageElement","inputElements","isDrawing","getScale","updateImage","scale","imageSize","setStyles","computedTop","computedLeft","toFloat","rect","abs","styles","getStyles","toFixed","updateValues","getLength","addEvents","mousedown","touchstart","mousemove","touchmove","mouseup","touchend","touchcancel","resize","enableFileTreeUpload","fallbackUrl","dzElement","previewsContainer","clickable","dz","Dropzone","on","reload","dataTransfer","types","link","crawl","progressBar","progressCount","results","debugLog","execRequest","onlyStatusUpdate","responseText","decode","total","done","pending","percentage","hasDebugLog","finished","summary","warning","subscriberResults","subscriberSummary","hasLog","wasSuccessful","updateData","send","Theme","isWebkit","chrome","safari","userAgent","stopClickPropagation","setupCtrlClick","Features","Touch","Platform","mac","setupTextareaResizing","ie6","ie7","ie8","dummy","line","tween","setupMenuToggle","burger","toggleClass","setAriaControls","setupProfileToggle","tmenu","menu","setupSplitButtonToggle","timer","clearTimeout","Elements","chosen","hgt","initializedRows","saveScrollOffsetEvent","init","row","command","cloneNode","selects","nselects","insertBefore","nextSibling","Chosen","cbx","previousElementSibling","code","insertAdjacentElement","updateLink","mutationsList","Class","Extends","followRedirects","success","getHeader","secure","stripScripts","script","failure","onFailure","refactor","attach","handles","bound","detach","check","sqrt","pow","mouse","snap","drag","removeEvents","lists","dragOptions","merge","tag","addItems","flatten","removeItems","erase","getClone","Queue","autoAdvance","resume","queue","isRunning","stopOnFailure","onException","SerpPreview","trail","titleField","titleFallbackField","aliasField","descriptionField","descriptionFallbackField","titleTag","shorten","html2string","DOMParser","parseFromString","textContent","getTinymce","tinyMCE","serpTitle","serpUrl","serpDescription","indexEmpty","editor","getContent","activeEditor","initialized","tip","position","useContent","willChange","getBoundingClientRect","rtl","direction","clientWidth","scrollX","scrollY","setup","webpackContext","webpackContextResolve","__webpack_require__","o","exports","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","d","defineProperty","enumerable","obj","prop","r","Symbol","toStringTag","definitionForModuleAndIdentifier","identifierForContextKey","logicalName","process","require"],"sourceRoot":""}
        "/bundles/contaocore/backend.7d12ce36.js"
  "backend.js": "/bundles/contaocore/backend.7d12ce36.js",
  "backend.7d12ce36.js.map": "/bundles/contaocore/backend.7d12ce36.js.map"