\" +\n `
})
` +\n `
${Thredded.escapeHtml(name)}` +\n (name !== display_name && display_name ?\n `
${Thredded.escapeHtml(display_name)}` :\n '') +\n '
';\n },\n\n searchFn({url, autocompleteMinLength}) {\n return function search(term, callback, match) {\n if (term.length < autocompleteMinLength) {\n callback([]);\n return;\n }\n const request = new XMLHttpRequest();\n request.open('GET', `${url}?q=${term}`, /* async */ true);\n request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n request.onload = () => {\n // Ignore errors\n if (request.status < 200 || request.status >= 400) {\n callback([]);\n return;\n }\n callback(JSON.parse(request.responseText).results.map(({avatar_url, id, display_name, name}) => {\n return {avatar_url, id, name, display_name, match};\n }));\n };\n request.send();\n }\n }\n };\n\n document.addEventListener('turbolinks:before-cache', () => {\n Array.prototype.forEach.call(\n document.getElementsByClassName(Thredded.UserTextcomplete.DROPDOWN_CLASS_NAME), (node) => {\n node.parentNode.removeChild(node);\n });\n });\n})();\n","//= require thredded/core/thredded\n(() => {\n const COMPONENT_SELECTOR = '#thredded--container [data-time-ago]';\n const Thredded = window.Thredded;\n if ('timeago' in window) {\n const timeago = window.timeago;\n Thredded.onPageLoad(() => {\n const threddedContainer = document.querySelector('#thredded--container');\n if (!threddedContainer) return;\n timeago().render(\n document.querySelectorAll(COMPONENT_SELECTOR),\n threddedContainer.getAttribute('data-thredded-locale').replace('-', '_'));\n });\n document.addEventListener('turbolinks:before-cache', () => {\n timeago.cancel();\n });\n } else if ('jQuery' in window && 'timeago' in jQuery.fn) {\n const $ = window.jQuery;\n Thredded.onPageLoad(() => {\n const allowFutureWas = $.timeago.settings.allowFuture;\n $.timeago.settings.allowFuture = true;\n $(COMPONENT_SELECTOR).timeago();\n $.timeago.settings.allowFuture = allowFutureWas;\n });\n }\n})();\n","//= require thredded/core/thredded\n\n(() => {\n const isTurbolinks = 'Turbolinks' in window && window.Turbolinks.supported;\n const isTurbolinks5 = isTurbolinks && 'clearCache' in window.Turbolinks;\n\n let onPageLoadFiredOnce = false;\n const pageLoadCallbacks = [];\n const triggerOnPageLoad = () => {\n pageLoadCallbacks.forEach((callback) => {\n callback();\n });\n onPageLoadFiredOnce = true;\n };\n\n // Fires the callback on DOMContentLoaded or a Turbolinks page load.\n // If called from an async script on the first page load, and the DOMContentLoad event\n // has already fired, will execute the callback immediately.\n window.Thredded.onPageLoad = (callback) => {\n pageLoadCallbacks.push(callback);\n // With async script loading, a callback may be added after the DOMContentLoaded event has already triggered.\n // This means we will receive neither a DOMContentLoaded event, nor a turbolinks:load event on Turbolinks 5.\n if (!onPageLoadFiredOnce && window.Thredded.DOMContentLoadedFired) {\n callback();\n }\n };\n\n if (isTurbolinks5) {\n // In Turbolinks 5.0.1, turbolinks:load may have already fired (before DOMContentLoaded).\n // If so, add our own DOMContentLoaded listener:\n // See: https://github.com/turbolinks/turbolinks/commit/69d353ea73d10ee6b25c2866fc5706879ba403e3\n if (window.Turbolinks.controller.lastRenderedLocation) {\n document.addEventListener('DOMContentLoaded', () => {\n triggerOnPageLoad();\n });\n }\n document.addEventListener('turbolinks:load', () => {\n triggerOnPageLoad();\n });\n } else {\n // Turbolinks Classic (with or without jQuery.Turbolinks), or no Turbolinks:\n if (!window.Thredded.DOMContentLoadedFired) {\n document.addEventListener('DOMContentLoaded', () => {\n triggerOnPageLoad();\n });\n }\n if (isTurbolinks) {\n document.addEventListener('page:load', () => {\n triggerOnPageLoad();\n })\n }\n }\n})();\n\n","//= require thredded/core/thredded\n//= require thredded/core/on_page_load\n\n(() => {\n const Thredded = window.Thredded;\n const COMPONENT_SELECTOR = '.thredded--post--content--spoiler';\n const OPEN_CLASS = 'thredded--post--content--spoiler--is-open';\n\n Thredded.spoilers = {\n init(root) {\n Array.prototype.forEach.call(root.querySelectorAll(COMPONENT_SELECTOR), (node) => {\n node.addEventListener('mousedown', (evt) => {\n evt.stopPropagation();\n this.toggle(evt.currentTarget);\n });\n node.addEventListener('keypress', (evt) => {\n if (event.key === ' ' || event.key === 'Enter') {\n evt.preventDefault();\n evt.stopPropagation();\n this.toggle(evt.currentTarget);\n }\n });\n });\n },\n\n toggle(node) {\n const isOpen = node.classList.contains(OPEN_CLASS);\n node.classList.toggle(OPEN_CLASS);\n node.setAttribute('aria-expanded', isOpen ? 'false' : 'true');\n node.firstElementChild.setAttribute('aria-hidden', isOpen ? 'false' : 'true');\n node.lastElementChild.setAttribute('aria-hidden', isOpen ? 'true' : 'false');\n }\n };\n\n Thredded.onPageLoad(() => {\n Thredded.spoilers.init(document);\n });\n})();\n","//= require thredded/core/thredded\n\nwindow.Thredded.serializeForm = (form) => {\n // Can't use new FormData(form).entries() because it's not supported on any IE\n // The below is not a full replacement, but enough for Thredded's purposes.\n return Array.prototype.map.call(form.querySelectorAll('[name]'), (e) => {\n return `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`;\n }).join('&');\n};\n","//= require thredded/core/thredded\n\n/**\n * Return a function, that, as long as it continues to be invoked, will\n * not be triggered. The function will be called after it stops being\n * called for `wait` milliseconds. If `immediate` is passed, trigger the\n * function on the leading edge, instead of the trailing.\n * Based on https://john-dugan.com/javascript-debounce/.\n *\n * @param {Function} func\n * @param {Number} wait in milliseconds\n * @param {Boolean} immediate\n * @returns {Function}\n */\nwindow.Thredded.debounce = function(func, wait, immediate) {\n let timeoutId = null;\n return function() {\n const context = this, args = arguments;\n const later = function() {\n timeoutId = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeoutId;\n clearTimeout(timeoutId);\n timeoutId = setTimeout(later, wait || 200);\n if (callNow) {\n func.apply(context, args);\n }\n };\n};\n","//= require thredded/core/thredded\n//= require thredded/core/debounce\n//= require thredded/core/serialize_form\n//= require thredded/components/spoilers\n\n(() => {\n const Thredded = window.Thredded;\n const PREVIEW_AREA_SELECTOR = '[data-thredded-preview-area]';\n const PREVIEW_AREA_POST_SELECTOR = '[data-thredded-preview-area-post]';\n\n class ThreddedPreviewArea {\n\n constructor(form, textarea) {\n const preview = form.querySelector(PREVIEW_AREA_SELECTOR);\n if (!preview || !textarea) return;\n this.form = form;\n this.preview = preview;\n this.previewPost = form.querySelector(PREVIEW_AREA_POST_SELECTOR);\n this.previewUrl = this.preview.getAttribute('data-thredded-preview-url');\n\n let prevValue = null;\n const onChange = Thredded.debounce(() => {\n if (prevValue !== textarea.value) {\n this.updatePreview();\n prevValue = textarea.value;\n }\n }, 200, false);\n\n textarea.addEventListener('input', onChange, false);\n\n this.requestId = 0;\n }\n\n updatePreview() {\n this.requestId++;\n const requestId = this.requestId;\n const request = new XMLHttpRequest();\n request.open(this.form.method, this.previewUrl, /* async */ true);\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n request.onload = () => {\n if (\n // Ignore server errors\n request.status >= 200 && request.status < 400 &&\n // Ignore older responses received out-of-order\n requestId === this.requestId) {\n this.onPreviewResponse(request.responseText);\n }\n };\n request.send(Thredded.serializeForm(this.form));\n }\n\n onPreviewResponse(data) {\n this.preview.style.display = 'block';\n this.previewPost.innerHTML = data;\n Thredded.spoilers.init(this.previewPost);\n }\n }\n\n window.ThreddedPreviewArea = ThreddedPreviewArea;\n})();\n","//= require thredded/core/thredded\n//= require thredded/core/on_page_load\n\n(function() {\n const Thredded = window.Thredded;\n\n Thredded.onPageLoad(() => {\n Array.prototype.forEach.call(document.querySelectorAll('[data-thredded-quote-post]'), (el) => {\n el.addEventListener('click', onClick);\n });\n });\n\n function onClick(evt) {\n // Handle only left clicks with no modifier keys\n if (evt.button !== 0 || evt.ctrlKey || evt.altKey || evt.metaKey || evt.shiftKey) return;\n evt.preventDefault();\n const target = document.getElementById('post_content');\n target.scrollIntoView();\n target.value = '...';\n fetchReply(evt.target.getAttribute('data-thredded-quote-post'), (replyText) => {\n if (!target.ownerDocument.body.contains(target)) return;\n target.focus();\n target.value = replyText;\n\n const autosizeUpdateEvent = document.createEvent('Event');\n autosizeUpdateEvent.initEvent('autosize:update', true, false);\n target.dispatchEvent(autosizeUpdateEvent);\n // Scroll into view again as the size might have changed.\n target.scrollIntoView();\n }, (errorMessage) => {\n target.value = errorMessage;\n });\n }\n\n function fetchReply(url, onSuccess, onError) {\n const request = new XMLHttpRequest();\n request.open('GET', url, /* async */ true);\n request.onload = () => {\n if (request.status >= 200 && request.status < 400) {\n onSuccess(request.responseText);\n } else {\n onError(`Error (${request.status}): ${request.statusText} ${request.responseText}`);\n }\n };\n request.onerror = () => {\n onError('Network Error');\n };\n request.send();\n }\n})();\n","//= require thredded/components/user_textcomplete\n\nconst ThreddedMentionAutocompletion = {\n MATCH_RE: /(^@|\\s@)\"?([\\w., \\-()]+[\\w.,\\-()])$/,\n // the last letter has to not be a space so it doesn't match after replacement\n DROPDOWN_MAX_COUNT: 6,\n\n init(form, textarea) {\n const editor = new Textcomplete.editors.Textarea(textarea);\n const textcomplete = new Textcomplete(editor, {\n dropdown: {\n className: Thredded.UserTextcomplete.DROPDOWN_CLASS_NAME,\n maxCount: ThreddedMentionAutocompletion.DROPDOWN_MAX_COUNT\n },\n });\n textcomplete.on('rendered', function() {\n if (textcomplete.dropdown.items.length) {\n textcomplete.dropdown.items[0].activate();\n }\n });\n textcomplete.register([{\n match: ThreddedMentionAutocompletion.MATCH_RE,\n search: Thredded.UserTextcomplete.searchFn({\n url: form.getAttribute('data-autocomplete-url'),\n autocompleteMinLength: parseInt(form.getAttribute('data-autocomplete-min-length'), 10)\n }),\n template: Thredded.UserTextcomplete.formatUser,\n replace ({name, match}) {\n let prefix = match[1];\n if (/[., ()]/.test(name)) {\n return `${prefix}\"${name}\" `\n } else {\n return `${prefix}${name} `\n }\n }\n }]);\n }\n};\n\nwindow.ThreddedMentionAutocompletion = ThreddedMentionAutocompletion;\n","/** https://unpkg.com/autosize@4.0.2/dist/autosize.js **/\n// Modified to always define the autosize global.\n// This allows Thredded code to be compatible with both Webpack and Sprockets.\n(function (global, factory) {\n var mod = {\n exports: {}\n };\n factory(mod, mod.exports);\n global.autosize = mod.exports;\n})(window, function (module, exports) {\n 'use strict';\n\n var map = typeof Map === \"function\" ? new Map() : function () {\n var keys = [];\n var values = [];\n\n return {\n has: function has(key) {\n return keys.indexOf(key) > -1;\n },\n get: function get(key) {\n return values[keys.indexOf(key)];\n },\n set: function set(key, value) {\n if (keys.indexOf(key) === -1) {\n keys.push(key);\n values.push(value);\n }\n },\n delete: function _delete(key) {\n var index = keys.indexOf(key);\n if (index > -1) {\n keys.splice(index, 1);\n values.splice(index, 1);\n }\n }\n };\n }();\n\n var createEvent = function createEvent(name) {\n return new Event(name, { bubbles: true });\n };\n try {\n new Event('test');\n } catch (e) {\n // IE does not support `new Event()`\n createEvent = function createEvent(name) {\n var evt = document.createEvent('Event');\n evt.initEvent(name, true, false);\n return evt;\n };\n }\n\n function assign(ta) {\n if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;\n\n var heightOffset = null;\n var clientWidth = null;\n var cachedHeight = null;\n\n function init() {\n var style = window.getComputedStyle(ta, null);\n\n if (style.resize === 'vertical') {\n ta.style.resize = 'none';\n } else if (style.resize === 'both') {\n ta.style.resize = 'horizontal';\n }\n\n if (style.boxSizing === 'content-box') {\n heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));\n } else {\n heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n }\n // Fix when a textarea is not on document body and heightOffset is Not a Number\n if (isNaN(heightOffset)) {\n heightOffset = 0;\n }\n\n update();\n }\n\n function changeOverflow(value) {\n {\n // Chrome/Safari-specific fix:\n // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space\n // made available by removing the scrollbar. The following forces the necessary text reflow.\n var width = ta.style.width;\n ta.style.width = '0px';\n // Force reflow:\n /* jshint ignore:start */\n ta.offsetWidth;\n /* jshint ignore:end */\n ta.style.width = width;\n }\n\n ta.style.overflowY = value;\n }\n\n function getParentOverflows(el) {\n var arr = [];\n\n while (el && el.parentNode && el.parentNode instanceof Element) {\n if (el.parentNode.scrollTop) {\n arr.push({\n node: el.parentNode,\n scrollTop: el.parentNode.scrollTop\n });\n }\n el = el.parentNode;\n }\n\n return arr;\n }\n\n function resize() {\n if (ta.scrollHeight === 0) {\n // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.\n return;\n }\n\n var overflows = getParentOverflows(ta);\n var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)\n\n ta.style.height = '';\n ta.style.height = ta.scrollHeight + heightOffset + 'px';\n\n // used to check if an update is actually necessary on window.resize\n clientWidth = ta.clientWidth;\n\n // prevents scroll-position jumping\n overflows.forEach(function (el) {\n el.node.scrollTop = el.scrollTop;\n });\n\n if (docTop) {\n document.documentElement.scrollTop = docTop;\n }\n }\n\n function update() {\n resize();\n\n var styleHeight = Math.round(parseFloat(ta.style.height));\n var computed = window.getComputedStyle(ta, null);\n\n // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box\n var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;\n\n // The actual height not matching the style height (set via the resize method) indicates that\n // the max-height has been exceeded, in which case the overflow should be allowed.\n if (actualHeight < styleHeight) {\n if (computed.overflowY === 'hidden') {\n changeOverflow('scroll');\n resize();\n actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;\n }\n } else {\n // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.\n if (computed.overflowY !== 'hidden') {\n changeOverflow('hidden');\n resize();\n actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;\n }\n }\n\n if (cachedHeight !== actualHeight) {\n cachedHeight = actualHeight;\n var evt = createEvent('autosize:resized');\n try {\n ta.dispatchEvent(evt);\n } catch (err) {\n // Firefox will throw an error on dispatchEvent for a detached element\n // https://bugzilla.mozilla.org/show_bug.cgi?id=889376\n }\n }\n }\n\n var pageResize = function pageResize() {\n if (ta.clientWidth !== clientWidth) {\n update();\n }\n };\n\n var destroy = function (style) {\n window.removeEventListener('resize', pageResize, false);\n ta.removeEventListener('input', update, false);\n ta.removeEventListener('keyup', update, false);\n ta.removeEventListener('autosize:destroy', destroy, false);\n ta.removeEventListener('autosize:update', update, false);\n\n Object.keys(style).forEach(function (key) {\n ta.style[key] = style[key];\n });\n\n map.delete(ta);\n }.bind(ta, {\n height: ta.style.height,\n resize: ta.style.resize,\n overflowY: ta.style.overflowY,\n overflowX: ta.style.overflowX,\n wordWrap: ta.style.wordWrap\n });\n\n ta.addEventListener('autosize:destroy', destroy, false);\n\n // IE9 does not fire onpropertychange or oninput for deletions,\n // so binding to onkeyup to catch most of those events.\n // There is no way that I know of to detect something like 'cut' in IE9.\n if ('onpropertychange' in ta && 'oninput' in ta) {\n ta.addEventListener('keyup', update, false);\n }\n\n window.addEventListener('resize', pageResize, false);\n ta.addEventListener('input', update, false);\n ta.addEventListener('autosize:update', update, false);\n ta.style.overflowX = 'hidden';\n ta.style.wordWrap = 'break-word';\n\n map.set(ta, {\n destroy: destroy,\n update: update\n });\n\n init();\n }\n\n function destroy(ta) {\n var methods = map.get(ta);\n if (methods) {\n methods.destroy();\n }\n }\n\n function update(ta) {\n var methods = map.get(ta);\n if (methods) {\n methods.update();\n }\n }\n\n var autosize = null;\n\n // Do nothing in Node.js environment and IE8 (or lower)\n if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {\n autosize = function autosize(el) {\n return el;\n };\n autosize.destroy = function (el) {\n return el;\n };\n autosize.update = function (el) {\n return el;\n };\n } else {\n autosize = function autosize(el, options) {\n if (el) {\n Array.prototype.forEach.call(el.length ? el : [el], function (x) {\n return assign(x, options);\n });\n }\n return el;\n };\n autosize.destroy = function (el) {\n if (el) {\n Array.prototype.forEach.call(el.length ? el : [el], destroy);\n }\n return el;\n };\n autosize.update = function (el) {\n if (el) {\n Array.prototype.forEach.call(el.length ? el : [el], update);\n }\n return el;\n };\n }\n\n exports.default = autosize;\n module.exports = exports['default'];\n});\n","//= require thredded/core/thredded\n//= require thredded/dependencies/autosize\n//= require thredded/core/on_page_load\n//= require thredded/components/mention_autocompletion\n//= require thredded/components/preview_area\n\n(() => {\n const Thredded = window.Thredded;\n const ThreddedMentionAutocompletion = window.ThreddedMentionAutocompletion;\n const ThreddedPreviewArea = window.ThreddedPreviewArea;\n const autosize = window.autosize;\n\n const COMPONENT_SELECTOR = '[data-thredded-topic-form]';\n const TITLE_SELECTOR = '[name$=\"topic[title]\"]';\n const CONTENT_TEXTAREA_SELECTOR = 'textarea[name$=\"[content]\"]';\n const COMPACT_CLASS = 'thredded--is-compact';\n const EXPANDED_CLASS = 'thredded--is-expanded';\n const ESCAPE_KEY_CODE = 27;\n\n const initTopicForm = (form) => {\n const textarea = form.querySelector(CONTENT_TEXTAREA_SELECTOR);\n if (!textarea) {\n return;\n }\n autosize(textarea);\n new ThreddedPreviewArea(form, textarea);\n ThreddedMentionAutocompletion.init(form, textarea);\n\n if (!form.classList.contains(COMPACT_CLASS)) {\n return;\n }\n\n const title = form.querySelector(TITLE_SELECTOR);\n title.addEventListener('focus', () => {\n toggleExpanded(form, true);\n });\n\n [title, textarea].forEach((node) => {\n // Un-expand on Escape key.\n node.addEventListener('keydown', (evt) => {\n if (evt.keyCode === ESCAPE_KEY_CODE) {\n evt.target.blur();\n toggleExpanded(form, false);\n }\n });\n\n // Un-expand on blur if the new focus element is outside of the same form and\n // all the form inputs are empty.\n node.addEventListener('blur', () => {\n // This listener will be fired right after the blur event has finished.\n const listener = (evt) => {\n if (!form.contains(evt.target) && !title.value && !textarea.value) {\n toggleExpanded(form, false);\n }\n document.body.removeEventListener('touchend', listener);\n document.body.removeEventListener('mouseup', listener);\n };\n document.body.addEventListener('mouseup', listener);\n document.body.addEventListener('touchend', listener);\n })\n });\n };\n\n const toggleExpanded = (form, expand) => {\n if (expand) {\n form.classList.remove(COMPACT_CLASS);\n form.classList.add(EXPANDED_CLASS);\n } else {\n form.classList.remove(EXPANDED_CLASS);\n form.classList.add(COMPACT_CLASS);\n }\n };\n\n const destroyTopicForm = (form) => {\n const textarea = form.querySelector(CONTENT_TEXTAREA_SELECTOR);\n if (!textarea) {\n return;\n }\n autosize.destroy(textarea);\n };\n\n Thredded.onPageLoad(() => {\n Array.prototype.forEach.call(document.querySelectorAll(COMPONENT_SELECTOR), (node) => {\n initTopicForm(node);\n });\n });\n\n document.addEventListener('turbolinks:before-cache', () => {\n Array.prototype.forEach.call(document.querySelectorAll(COMPONENT_SELECTOR), (node) => {\n destroyTopicForm(node);\n });\n });\n})();\n\n\n","//= require thredded/core/thredded\n//= require thredded/core/on_page_load\n\n(() => {\n const Thredded = window.Thredded;\n\n const COMPONENT_SELECTOR = '[data-thredded-currently-online]';\n const EXPANDED_CLASS = 'thredded--is-expanded';\n\n const handleMouseEnter = (evt) => {\n evt.target.classList.add(EXPANDED_CLASS);\n };\n\n const handleMouseLeave = (evt) => {\n evt.target.classList.remove(EXPANDED_CLASS);\n };\n\n const handleTouchStart = (evt) => {\n evt.target.classList.toggle(EXPANDED_CLASS);\n };\n\n const initCurrentlyOnline = (node) => {\n node.addEventListener('mouseenter', handleMouseEnter);\n node.addEventListener('mouseleave', handleMouseLeave);\n node.addEventListener('touchstart', handleTouchStart);\n };\n\n Thredded.onPageLoad(() => {\n Array.prototype.forEach.call(document.querySelectorAll(COMPONENT_SELECTOR), (node) => {\n initCurrentlyOnline(node);\n });\n });\n})();\n","//= require thredded/core/thredded\n//= require thredded/core/on_page_load\n\n// Reflects the logic of user preference settings by enabling/disabling certain inputs.\n(() => {\n const Thredded = window.Thredded;\n\n const COMPONENT_SELECTOR = '[data-thredded-user-preferences-form]';\n const BOUND_MESSAGEBOARD_NAME = 'data-thredded-bound-messageboard-pref';\n const UPDATE_ON_CHANGE_NAME = 'data-thredded-update-checkbox-on-change';\n\n class MessageboardPreferenceBinding {\n constructor(form, genericCheckboxName, messageboardCheckboxName) {\n this.messageboardCheckbox = form.querySelector(`[type=\"checkbox\"][name=\"${messageboardCheckboxName}\"]`);\n if (!this.messageboardCheckbox) {\n return;\n }\n this.messageboardCheckbox.addEventListener('change', () => {\n this.rememberMessageboardChecked();\n });\n this.rememberMessageboardChecked();\n\n this.genericCheckbox = form.querySelector(`[type=\"checkbox\"][name=\"${genericCheckboxName}\"]`);\n this.genericCheckbox.addEventListener('change', () => {\n this.updateMessageboardCheckbox();\n });\n this.updateMessageboardCheckbox();\n }\n\n rememberMessageboardChecked() {\n this.messageboardCheckedWas = this.messageboardCheckbox.checked;\n }\n\n updateMessageboardCheckbox() {\n const enabled = this.genericCheckbox.checked;\n this.messageboardCheckbox.disabled = !enabled;\n this.messageboardCheckbox.checked = enabled ? this.messageboardCheckedWas : false;\n }\n }\n\n class UpdateOnChange {\n constructor(form, sourceElement, targetName) {\n const target = form.querySelector(`[type=\"checkbox\"][name=\"${targetName}\"]`);\n if (!target) return;\n sourceElement.addEventListener('change', () => {\n target.checked = sourceElement.checked;\n });\n }\n }\n\n class UserPreferencesForm {\n constructor(form) {\n Array.prototype.forEach.call(form.querySelectorAll(`input[${BOUND_MESSAGEBOARD_NAME}]`), (element) => {\n new MessageboardPreferenceBinding(form, element.name, element.getAttribute(BOUND_MESSAGEBOARD_NAME));\n });\n Array.prototype.forEach.call(form.querySelectorAll(`input[${UPDATE_ON_CHANGE_NAME}]`), (element) => {\n new UpdateOnChange(form, element, element.getAttribute(UPDATE_ON_CHANGE_NAME));\n });\n }\n }\n\n Thredded.onPageLoad(() => {\n Array.prototype.forEach.call(document.querySelectorAll(COMPONENT_SELECTOR), (form) => {\n new UserPreferencesForm(form);\n });\n });\n})();\n","//= require thredded/core/thredded\n//= require thredded/core/on_page_load\n//= require thredded/core/serialize_form\n\n// Submit GET forms with turbolinks\n(() => {\n const Thredded = window.Thredded;\n const Turbolinks = window.Turbolinks;\n\n const handleSubmit = (evt) => {\n evt.preventDefault();\n const form = evt.currentTarget;\n Turbolinks.visit(form.action + (form.action.indexOf('?') === -1 ? '?' : '&') + Thredded.serializeForm(form));\n\n // On mobile the soft keyboard doesn't won't go away after the submit since we're submitting with\n // Turbolinks. Hide it:\n Thredded.hideSoftKeyboard();\n };\n\n Thredded.onPageLoad(() => {\n if (!Turbolinks || !Turbolinks.supported) return;\n Array.prototype.forEach.call(document.querySelectorAll('[data-thredded-turboform]'), (form) => {\n form.addEventListener('submit', handleSubmit);\n });\n });\n})();\n","//= require thredded/core/thredded\n(function() {\n const Thredded = window.Thredded;\n Thredded.isSubmitHotkey = (evt) => {\n // Ctrl+Enter.\n return evt.ctrlKey && (evt.keyCode === 13 || evt.keyCode === 10 /* http://crbug.com/79407 */);\n };\n\n document.addEventListener('keypress', (evt) => {\n if (Thredded.isSubmitHotkey(evt)) {\n const submitButton = document.querySelector('[data-thredded-submit-hotkey] [type=\"submit\"]');\n if (!submitButton) return;\n evt.preventDefault();\n // Focus first for better visual feedback.\n submitButton.focus();\n submitButton.click();\n }\n });\n})();\n","//= require thredded/core/thredded\n//= require thredded/core/on_page_load\n//= require thredded/components/user_textcomplete\n//= require thredded/dependencies/autosize\n\n(() => {\n const Thredded = window.Thredded;\n const autosize = window.autosize;\n\n const COMPONENT_SELECTOR = '[data-thredded-users-select]';\n\n Thredded.UsersSelect = {\n DROPDOWN_MAX_COUNT: 6,\n };\n\n function parseNames(text) {\n const result = [];\n let current = [];\n let currentIndex = 0;\n let inQuoted = false;\n let inName = false;\n for (let i = 0; i < text.length; ++i) {\n const char = text.charAt(i);\n switch (char) {\n case '\"':\n inQuoted = !inQuoted;\n break;\n case ' ':\n if (inName) current.push(char);\n break;\n case ',':\n if (inQuoted) {\n current.push(char);\n } else {\n inName = false;\n if (current.length) {\n result.push({name: current.join(''), index: currentIndex});\n current.length = 0;\n }\n }\n break;\n default:\n if (!inName) currentIndex = i;\n inName = true;\n current.push(char);\n }\n }\n if (current.length) result.current = {name: current.join(''), index: currentIndex};\n return result;\n }\n\n const initUsersSelect = (textarea) => {\n autosize(textarea);\n // Prevent multiple lines\n textarea.addEventListener('keypress', (evt) => {\n if (evt.keyCode === 13 || evt.keyCode === 10) {\n evt.preventDefault()\n }\n });\n const editor = new Textcomplete.editors.Textarea(textarea);\n const textcomplete = new Textcomplete(editor, {\n dropdown: {\n className: Thredded.UserTextcomplete.DROPDOWN_CLASS_NAME,\n maxCount: Thredded.UsersSelect.DROPDOWN_MAX_COUNT,\n },\n });\n textarea.addEventListener('blur', (evt) => {\n textcomplete.hide();\n });\n\n const searchFn = Thredded.UserTextcomplete.searchFn({\n url: textarea.getAttribute('data-autocomplete-url'),\n autocompleteMinLength: parseInt(textarea.getAttribute('data-autocomplete-min-length'), 10)\n });\n textcomplete.on('rendered', function() {\n if (textcomplete.dropdown.items.length) {\n textcomplete.dropdown.items[0].activate();\n }\n });\n textcomplete.register([{\n index: 0,\n match: (text) => {\n const names = parseNames(text);\n if (names.current) {\n const {name, index} = names.current;\n const matchData = [name];\n matchData.index = index;\n return matchData;\n } else {\n return null;\n }\n },\n search (term, callback, match) {\n searchFn(term, function(results) {\n const names = parseNames(textarea.value).map(({name}) => name);\n callback(results.filter((result) => names.indexOf(result.name) === -1));\n }, match);\n },\n template: Thredded.UserTextcomplete.formatUser,\n replace ({name}) {\n if (/,/.test(name)) {\n return `\"${name}\", `\n } else {\n return `${name}, `\n }\n }\n }]);\n };\n\n function destroyUsersSelect(textarea) {\n autosize.destroy(textarea);\n }\n\n window.Thredded.onPageLoad(() => {\n Array.prototype.forEach.call(document.querySelectorAll(COMPONENT_SELECTOR), (node) => {\n initUsersSelect(node);\n });\n });\n\n document.addEventListener('turbolinks:before-cache', () => {\n Array.prototype.forEach.call(document.querySelectorAll(COMPONENT_SELECTOR), (node) => {\n destroyUsersSelect(node);\n });\n });\n\n})();\n","//= require thredded/core/thredded\n//= require thredded/core/on_page_load\n//= require thredded/core/serialize_form\n\n// Makes topics in the list appear read as soon as the topic link is clicked,\n// iff the topic link leads to the last page of the topic.\n(() => {\n const Thredded = window.Thredded;\n\n const COMPONENT_SELECTOR = '[data-thredded-topics]';\n const TOPIC_UNREAD_CLASS = 'thredded--topic-unread';\n const TOPIC_READ_CLASS = 'thredded--topic-read';\n const POSTS_COUNT_SELECTOR = '.thredded--topics--posts-count';\n\n function pageNumber(url) {\n const match = url.match(/\\/page-(\\d)$/);\n return match ? +match[1] : 1;\n }\n\n function totalPages(numPosts, postsPerPage) {\n return Math.ceil(numPosts / postsPerPage);\n }\n\n function getAncestorTag(node, ancestorTagName) {\n do {\n node = node.parentNode;\n } while (node && node.tagName !== ancestorTagName);\n return node;\n }\n\n function getTopicNode(node) {\n return getAncestorTag(node, 'ARTICLE');\n }\n\n function getUnreadNavItem(unreadFollowedCountElement) {\n return getAncestorTag(unreadFollowedCountElement, 'LI');\n }\n\n function initTopicsList(topicsList) {\n const postsPerPage = +topicsList.getAttribute('data-thredded-topic-posts-per-page') || 25;\n const isPrivateTopics = topicsList.getAttribute('data-thredded-topics') === 'private';\n const unreadFollowedCountElement = document.querySelector('[data-unread-followed-count]');\n topicsList.addEventListener('click', (evt) => {\n const link = evt.target;\n if (link.tagName !== 'A' || link.parentNode.tagName !== 'H1') return;\n const topic = getTopicNode(link);\n if (pageNumber(link.href) === totalPages(+topic.querySelector(POSTS_COUNT_SELECTOR).textContent, postsPerPage)) {\n if (!isPrivateTopics && unreadFollowedCountElement &&\n topic.hasAttribute('data-followed') && topic.hasAttribute('data-unread')) {\n const count = (+unreadFollowedCountElement.textContent) - 1;\n if (count === 0) {\n const navItem = getUnreadNavItem(unreadFollowedCountElement);\n navItem.parentElement.removeChild(navItem);\n } else {\n unreadFollowedCountElement.textContent = count.toLocaleString();\n }\n }\n topic.classList.add(TOPIC_READ_CLASS);\n topic.classList.remove(TOPIC_UNREAD_CLASS);\n topic.removeAttribute('data-unread');\n }\n });\n }\n\n Thredded.onPageLoad(() => {\n Array.prototype.forEach.call(document.querySelectorAll(COMPONENT_SELECTOR), initTopicsList);\n });\n})();\n","//= require thredded/core/thredded\n//= require thredded/dependencies/autosize\n//= require thredded/core/on_page_load\n//= require thredded/components/mention_autocompletion\n//= require thredded/components/preview_area\n\n(() => {\n const Thredded = window.Thredded;\n const ThreddedMentionAutocompletion = window.ThreddedMentionAutocompletion;\n const ThreddedPreviewArea = window.ThreddedPreviewArea;\n const autosize = window.autosize;\n\n const COMPONENT_SELECTOR = '[data-thredded-post-form]';\n const CONTENT_TEXTAREA_SELECTOR = 'textarea[name$=\"[content]\"]';\n\n const initPostForm = (form) => {\n const textarea = form.querySelector(CONTENT_TEXTAREA_SELECTOR);\n autosize(textarea);\n new ThreddedPreviewArea(form, textarea);\n ThreddedMentionAutocompletion.init(form, textarea);\n };\n\n const destroyPostForm = (form) => {\n autosize.destroy(form.querySelector(CONTENT_TEXTAREA_SELECTOR));\n };\n\n Thredded.onPageLoad(() => {\n Array.prototype.forEach.call(document.querySelectorAll(COMPONENT_SELECTOR), (node) => {\n initPostForm(node);\n });\n });\n\n document.addEventListener('turbolinks:before-cache', () => {\n Array.prototype.forEach.call(document.querySelectorAll(COMPONENT_SELECTOR), (node) => {\n destroyPostForm(node);\n });\n });\n})();\n","(() => {\n const COMPONENT_SELECTOR = '[data-thredded-flash-message]';\n\n document.addEventListener('turbolinks:before-cache', () => {\n Array.prototype.forEach.call(document.querySelectorAll(COMPONENT_SELECTOR), (node) => {\n node.parentNode.removeChild(node);\n });\n });\n})();\n","//= require thredded/core/thredded\n\nwindow.Thredded.hideSoftKeyboard = () => {\n const activeElement = document.activeElement;\n if (!activeElement || !activeElement.blur) return;\n activeElement.blur();\n};\n","//= require thredded/core/on_page_load\n\nwindow.Thredded.onPageLoad(() => {\n if ('Rails' in window) {\n window.Rails.refreshCSRFTokens();\n } else if ('jQuery' in window && 'rails' in window.jQuery) {\n window.jQuery.rails.refreshCSRFTokens();\n }\n});\n","/**\n * Copyright (c) 2016 hustcc\n * License: MIT\n * Version: v3.0.2\n * https://github.com/hustcc/timeago.js\n**/\n/* jshint expr: true */\n!function (root, factory) {\n root.timeago = factory(root);\n}(window,\nfunction () {\n var indexMapEn = 'second_minute_hour_day_week_month_year'.split('_'),\n indexMapZh = '秒_分钟_小时_天_周_月_年'.split('_'),\n // build-in locales: en & zh_CN\n locales = {\n 'en': function(number, index) {\n if (index === 0) return ['just now', 'right now'];\n var unit = indexMapEn[parseInt(index / 2)];\n if (number > 1) unit += 's';\n return [number + ' ' + unit + ' ago', 'in ' + number + ' ' + unit];\n },\n 'zh_CN': function(number, index) {\n if (index === 0) return ['刚刚', '片刻后'];\n var unit = indexMapZh[parseInt(index / 2)];\n return [number + unit + '前', number + unit + '后'];\n }\n },\n // second, minute, hour, day, week, month, year(365 days)\n SEC_ARRAY = [60, 60, 24, 7, 365/7/12, 12],\n SEC_ARRAY_LEN = 6,\n // ATTR_DATETIME = 'datetime',\n ATTR_DATA_TID = 'data-tid',\n timers = {}; // real-time render timers\n\n // format Date / string / timestamp to Date instance.\n function toDate(input) {\n if (input instanceof Date) return input;\n if (!isNaN(input)) return new Date(toInt(input));\n if (/^\\d+$/.test(input)) return new Date(toInt(input));\n input = (input || '').trim().replace(/\\.\\d+/, '') // remove milliseconds\n .replace(/-/, '/').replace(/-/, '/')\n .replace(/(\\d)T(\\d)/, '$1 $2').replace(/Z/, ' UTC') // 2017-2-5T3:57:52Z -> 2017-2-5 3:57:52UTC\n .replace(/([\\+\\-]\\d\\d)\\:?(\\d\\d)/, ' $1$2'); // -04:00 -> -0400\n return new Date(input);\n }\n // change f into int, remove decimal. Just for code compression\n function toInt(f) {\n return parseInt(f);\n }\n // format the diff second to *** time ago, with setting locale\n function formatDiff(diff, locale, defaultLocale) {\n // if locale is not exist, use defaultLocale.\n // if defaultLocale is not exist, use build-in `en`.\n // be sure of no error when locale is not exist.\n locale = locales[locale] ? locale : (locales[defaultLocale] ? defaultLocale : 'en');\n // if (! locales[locale]) locale = defaultLocale;\n var i = 0,\n agoin = diff < 0 ? 1 : 0, // timein or timeago\n total_sec = diff = Math.abs(diff);\n\n for (; diff >= SEC_ARRAY[i] && i < SEC_ARRAY_LEN; i++) {\n diff /= SEC_ARRAY[i];\n }\n diff = toInt(diff);\n i *= 2;\n\n if (diff > (i === 0 ? 9 : 1)) i += 1;\n return locales[locale](diff, i, total_sec)[agoin].replace('%s', diff);\n }\n // calculate the diff second between date to be formated an now date.\n function diffSec(date, nowDate) {\n nowDate = nowDate ? toDate(nowDate) : new Date();\n return (nowDate - toDate(date)) / 1000;\n }\n /**\n * nextInterval: calculate the next interval time.\n * - diff: the diff sec between now and date to be formated.\n *\n * What's the meaning?\n * diff = 61 then return 59\n * diff = 3601 (an hour + 1 second), then return 3599\n * make the interval with high performace.\n **/\n function nextInterval(diff) {\n var rst = 1, i = 0, d = Math.abs(diff);\n for (; diff >= SEC_ARRAY[i] && i < SEC_ARRAY_LEN; i++) {\n diff /= SEC_ARRAY[i];\n rst *= SEC_ARRAY[i];\n }\n // return leftSec(d, rst);\n d = d % rst;\n d = d ? rst - d : rst;\n return Math.ceil(d);\n }\n // get the datetime attribute, `data-timeagp` / `datetime` are supported.\n function getDateAttr(node) {\n return getAttr(node, 'data-timeago') || getAttr(node, 'datetime');\n }\n // get the node attribute, native DOM and jquery supported.\n function getAttr(node, name) {\n if(node.getAttribute) return node.getAttribute(name); // native\n if(node.attr) return node.attr(name); // jquery\n }\n // set the node attribute, native DOM and jquery supported.\n function setTidAttr(node, val) {\n if(node.setAttribute) return node.setAttribute(ATTR_DATA_TID, val); // native\n if(node.attr) return node.attr(ATTR_DATA_TID, val); // jquery\n }\n // get the timer id of node.\n // remove the function, can save some bytes.\n // function getTidFromNode(node) {\n // return getAttr(node, ATTR_DATA_TID);\n // }\n /**\n * timeago: the function to get `timeago` instance.\n * - nowDate: the relative date, default is new Date().\n * - defaultLocale: the default locale, default is en. if your set it, then the `locale` parameter of format is not needed of you.\n *\n * How to use it?\n * var timeagoLib = require('timeago.js');\n * var timeago = timeagoLib(); // all use default.\n * var timeago = timeagoLib('2016-09-10'); // the relative date is 2016-09-10, so the 2016-09-11 will be 1 day ago.\n * var timeago = timeagoLib(null, 'zh_CN'); // set default locale is `zh_CN`.\n * var timeago = timeagoLib('2016-09-10', 'zh_CN'); // the relative date is 2016-09-10, and locale is zh_CN, so the 2016-09-11 will be 1天前.\n **/\n function Timeago(nowDate, defaultLocale) {\n this.nowDate = nowDate;\n // if do not set the defaultLocale, set it with `en`\n this.defaultLocale = defaultLocale || 'en'; // use default build-in locale\n // for dev test\n // this.nextInterval = nextInterval;\n }\n // what the timer will do\n Timeago.prototype.doRender = function(node, date, locale) {\n var diff = diffSec(date, this.nowDate),\n self = this,\n tid;\n // delete previously assigned timeout's id to node\n node.innerHTML = formatDiff(diff, locale, this.defaultLocale);\n // waiting %s seconds, do the next render\n timers[tid = setTimeout(function() {\n self.doRender(node, date, locale);\n delete timers[tid];\n }, Math.min(nextInterval(diff) * 1000, 0x7FFFFFFF))] = 0; // there is no need to save node in object.\n // set attribute date-tid\n setTidAttr(node, tid);\n };\n /**\n * format: format the date to *** time ago, with setting or default locale\n * - date: the date / string / timestamp to be formated\n * - locale: the formated string's locale name, e.g. en / zh_CN\n *\n * How to use it?\n * var timeago = require('timeago.js')();\n * timeago.format(new Date(), 'pl'); // Date instance\n * timeago.format('2016-09-10', 'fr'); // formated date string\n * timeago.format(1473473400269); // timestamp with ms\n **/\n Timeago.prototype.format = function(date, locale) {\n return formatDiff(diffSec(date, this.nowDate), locale, this.defaultLocale);\n };\n /**\n * render: render the DOM real-time.\n * - nodes: which nodes will be rendered.\n * - locale: the locale name used to format date.\n *\n * How to use it?\n * var timeago = require('timeago.js')();\n * // 1. javascript selector\n * timeago.render(document.querySelectorAll('.need_to_be_rendered'));\n * // 2. use jQuery selector\n * timeago.render($('.need_to_be_rendered'), 'pl');\n *\n * Notice: please be sure the dom has attribute `datetime`.\n **/\n Timeago.prototype.render = function(nodes, locale) {\n if (nodes.length === undefined) nodes = [nodes];\n for (var i = 0, len = nodes.length; i < len; i++) {\n this.doRender(nodes[i], getDateAttr(nodes[i]), locale); // render item\n }\n };\n /**\n * setLocale: set the default locale name.\n *\n * How to use it?\n * var timeago = require('timeago.js')();\n * timeago.setLocale('fr');\n **/\n Timeago.prototype.setLocale = function(locale) {\n this.defaultLocale = locale;\n };\n /**\n * timeago: the function to get `timeago` instance.\n * - nowDate: the relative date, default is new Date().\n * - defaultLocale: the default locale, default is en. if your set it, then the `locale` parameter of format is not needed of you.\n *\n * How to use it?\n * var timeagoFactory = require('timeago.js');\n * var timeago = timeagoFactory(); // all use default.\n * var timeago = timeagoFactory('2016-09-10'); // the relative date is 2016-09-10, so the 2016-09-11 will be 1 day ago.\n * var timeago = timeagoFactory(null, 'zh_CN'); // set default locale is `zh_CN`.\n * var timeago = timeagoFactory('2016-09-10', 'zh_CN'); // the relative date is 2016-09-10, and locale is zh_CN, so the 2016-09-11 will be 1天前.\n **/\n function timeagoFactory(nowDate, defaultLocale) {\n return new Timeago(nowDate, defaultLocale);\n }\n /**\n * register: register a new language locale\n * - locale: locale name, e.g. en / zh_CN, notice the standard.\n * - localeFunc: the locale process function\n *\n * How to use it?\n * var timeagoFactory = require('timeago.js');\n *\n * timeagoFactory.register('the locale name', the_locale_func);\n * // or\n * timeagoFactory.register('pl', require('timeago.js/locales/pl'));\n **/\n timeagoFactory.register = function(locale, localeFunc) {\n locales[locale] = localeFunc;\n };\n\n /**\n * cancel: cancels one or all the timers which are doing real-time render.\n *\n * How to use it?\n * For canceling all the timers:\n * var timeagoFactory = require('timeago.js');\n * var timeago = timeagoFactory();\n * timeago.render(document.querySelectorAll('.need_to_be_rendered'));\n * timeagoFactory.cancel(); // will stop all the timers, stop render in real time.\n *\n * For canceling single timer on specific node:\n * var timeagoFactory = require('timeago.js');\n * var timeago = timeagoFactory();\n * var nodes = document.querySelectorAll('.need_to_be_rendered');\n * timeago.render(nodes);\n * timeagoFactory.cancel(nodes[0]); // will clear a timer attached to the first node, stop render in real time.\n **/\n timeagoFactory.cancel = function(node) {\n var tid;\n // assigning in if statement to save space\n if (node) {\n tid = getAttr(node, ATTR_DATA_TID); // get the timer of DOM node(native / jq).\n if (tid) {\n clearTimeout(tid);\n delete timers[tid];\n }\n } else {\n for (tid in timers) clearTimeout(tid);\n timers = {};\n }\n };\n\n return timeagoFactory;\n});\n","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*\nTrix 1.1.1\nCopyright © 2019 Basecamp, LLC\nhttp://trix-editor.org/\n */\n(function () {}).call(this), function () {\n var t;\n null == window.Set && (window.Set = t = function () {\n function t() {\n this.clear();\n }\n\n return t.prototype.clear = function () {\n return this.values = [];\n }, t.prototype.has = function (t) {\n return -1 !== this.values.indexOf(t);\n }, t.prototype.add = function (t) {\n return this.has(t) || this.values.push(t), this;\n }, t.prototype[\"delete\"] = function (t) {\n var e;\n return -1 === (e = this.values.indexOf(t)) ? !1 : (this.values.splice(e, 1), !0);\n }, t.prototype.forEach = function () {\n var t;\n return (t = this.values).forEach.apply(t, arguments);\n }, t;\n }());\n}.call(this), function (t) {\n function e() {}\n\n function n(t, e) {\n return function () {\n t.apply(e, arguments);\n };\n }\n\n function i(t) {\n if (\"object\" != _typeof(this)) throw new TypeError(\"Promises must be constructed via new\");\n if (\"function\" != typeof t) throw new TypeError(\"not a function\");\n this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], c(t, this);\n }\n\n function o(t, e) {\n for (; 3 === t._state;) {\n t = t._value;\n }\n\n return 0 === t._state ? void t._deferreds.push(e) : (t._handled = !0, void h(function () {\n var n = 1 === t._state ? e.onFulfilled : e.onRejected;\n if (null === n) return void (1 === t._state ? r : s)(e.promise, t._value);\n var i;\n\n try {\n i = n(t._value);\n } catch (o) {\n return void s(e.promise, o);\n }\n\n r(e.promise, i);\n }));\n }\n\n function r(t, e) {\n try {\n if (e === t) throw new TypeError(\"A promise cannot be resolved with itself.\");\n\n if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) {\n var o = e.then;\n if (e instanceof i) return t._state = 3, t._value = e, void a(t);\n if (\"function\" == typeof o) return void c(n(o, e), t);\n }\n\n t._state = 1, t._value = e, a(t);\n } catch (r) {\n s(t, r);\n }\n }\n\n function s(t, e) {\n t._state = 2, t._value = e, a(t);\n }\n\n function a(t) {\n 2 === t._state && 0 === t._deferreds.length && setTimeout(function () {\n t._handled || p(t._value);\n }, 1);\n\n for (var e = 0, n = t._deferreds.length; n > e; e++) {\n o(t, t._deferreds[e]);\n }\n\n t._deferreds = null;\n }\n\n function u(t, e, n) {\n this.onFulfilled = \"function\" == typeof t ? t : null, this.onRejected = \"function\" == typeof e ? e : null, this.promise = n;\n }\n\n function c(t, e) {\n var n = !1;\n\n try {\n t(function (t) {\n n || (n = !0, r(e, t));\n }, function (t) {\n n || (n = !0, s(e, t));\n });\n } catch (i) {\n if (n) return;\n n = !0, s(e, i);\n }\n }\n\n var l = setTimeout,\n h = \"function\" == typeof setImmediate && setImmediate || function (t) {\n l(t, 1);\n },\n p = function p(t) {\n \"undefined\" != typeof console && console && console.warn(\"Possible Unhandled Promise Rejection:\", t);\n };\n\n i.prototype[\"catch\"] = function (t) {\n return this.then(null, t);\n }, i.prototype.then = function (t, n) {\n var r = new i(e);\n return o(this, new u(t, n, r)), r;\n }, i.all = function (t) {\n var e = Array.prototype.slice.call(t);\n return new i(function (t, n) {\n function i(r, s) {\n try {\n if (s && (\"object\" == _typeof(s) || \"function\" == typeof s)) {\n var a = s.then;\n if (\"function\" == typeof a) return void a.call(s, function (t) {\n i(r, t);\n }, n);\n }\n\n e[r] = s, 0 === --o && t(e);\n } catch (u) {\n n(u);\n }\n }\n\n if (0 === e.length) return t([]);\n\n for (var o = e.length, r = 0; r < e.length; r++) {\n i(r, e[r]);\n }\n });\n }, i.resolve = function (t) {\n return t && \"object\" == _typeof(t) && t.constructor === i ? t : new i(function (e) {\n e(t);\n });\n }, i.reject = function (t) {\n return new i(function (e, n) {\n n(t);\n });\n }, i.race = function (t) {\n return new i(function (e, n) {\n for (var i = 0, o = t.length; o > i; i++) {\n t[i].then(e, n);\n }\n });\n }, i._setImmediateFn = function (t) {\n h = t;\n }, i._setUnhandledRejectionFn = function (t) {\n p = t;\n }, \"undefined\" != typeof module && module.exports ? module.exports = i : t.Promise || (t.Promise = i);\n}(this), function () {\n var t = \"object\" == _typeof(window.customElements),\n e = \"function\" == typeof document.registerElement,\n n = t || e;\n\n n || (\n /**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n \"undefined\" == typeof WeakMap && !function () {\n var t = Object.defineProperty,\n e = Date.now() % 1e9,\n n = function n() {\n this.name = \"__st\" + (1e9 * Math.random() >>> 0) + (e++ + \"__\");\n };\n\n n.prototype = {\n set: function set(e, n) {\n var i = e[this.name];\n return i && i[0] === e ? i[1] = n : t(e, this.name, {\n value: [e, n],\n writable: !0\n }), this;\n },\n get: function get(t) {\n var e;\n return (e = t[this.name]) && e[0] === t ? e[1] : void 0;\n },\n \"delete\": function _delete(t) {\n var e = t[this.name];\n return e && e[0] === t ? (e[0] = e[1] = void 0, !0) : !1;\n },\n has: function has(t) {\n var e = t[this.name];\n return e ? e[0] === t : !1;\n }\n }, window.WeakMap = n;\n }(), function (t) {\n function e(t) {\n A.push(t), b || (b = !0, g(i));\n }\n\n function n(t) {\n return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(t) || t;\n }\n\n function i() {\n b = !1;\n var t = A;\n A = [], t.sort(function (t, e) {\n return t.uid_ - e.uid_;\n });\n var e = !1;\n t.forEach(function (t) {\n var n = t.takeRecords();\n o(t), n.length && (t.callback_(n, t), e = !0);\n }), e && i();\n }\n\n function o(t) {\n t.nodes_.forEach(function (e) {\n var n = m.get(e);\n n && n.forEach(function (e) {\n e.observer === t && e.removeTransientObservers();\n });\n });\n }\n\n function r(t, e) {\n for (var n = t; n; n = n.parentNode) {\n var i = m.get(n);\n if (i) for (var o = 0; o < i.length; o++) {\n var r = i[o],\n s = r.options;\n\n if (n === t || s.subtree) {\n var a = e(s);\n a && r.enqueue(a);\n }\n }\n }\n }\n\n function s(t) {\n this.callback_ = t, this.nodes_ = [], this.records_ = [], this.uid_ = ++C;\n }\n\n function a(t, e) {\n this.type = t, this.target = e, this.addedNodes = [], this.removedNodes = [], this.previousSibling = null, this.nextSibling = null, this.attributeName = null, this.attributeNamespace = null, this.oldValue = null;\n }\n\n function u(t) {\n var e = new a(t.type, t.target);\n return e.addedNodes = t.addedNodes.slice(), e.removedNodes = t.removedNodes.slice(), e.previousSibling = t.previousSibling, e.nextSibling = t.nextSibling, e.attributeName = t.attributeName, e.attributeNamespace = t.attributeNamespace, e.oldValue = t.oldValue, e;\n }\n\n function c(t, e) {\n return x = new a(t, e);\n }\n\n function l(t) {\n return w ? w : (w = u(x), w.oldValue = t, w);\n }\n\n function h() {\n x = w = void 0;\n }\n\n function p(t) {\n return t === w || t === x;\n }\n\n function d(t, e) {\n return t === e ? t : w && p(t) ? w : null;\n }\n\n function f(t, e, n) {\n this.observer = t, this.target = e, this.options = n, this.transientObservedNodes = [];\n }\n\n if (!t.JsMutationObserver) {\n var g,\n m = new WeakMap();\n if (/Trident|Edge/.test(navigator.userAgent)) g = setTimeout;else if (window.setImmediate) g = window.setImmediate;else {\n var v = [],\n y = String(Math.random());\n window.addEventListener(\"message\", function (t) {\n if (t.data === y) {\n var e = v;\n v = [], e.forEach(function (t) {\n t();\n });\n }\n }), g = function g(t) {\n v.push(t), window.postMessage(y, \"*\");\n };\n }\n var b = !1,\n A = [],\n C = 0;\n s.prototype = {\n observe: function observe(t, e) {\n if (t = n(t), !e.childList && !e.attributes && !e.characterData || e.attributeOldValue && !e.attributes || e.attributeFilter && e.attributeFilter.length && !e.attributes || e.characterDataOldValue && !e.characterData) throw new SyntaxError();\n var i = m.get(t);\n i || m.set(t, i = []);\n\n for (var o, r = 0; r < i.length; r++) {\n if (i[r].observer === this) {\n o = i[r], o.removeListeners(), o.options = e;\n break;\n }\n }\n\n o || (o = new f(this, t, e), i.push(o), this.nodes_.push(t)), o.addListeners();\n },\n disconnect: function disconnect() {\n this.nodes_.forEach(function (t) {\n for (var e = m.get(t), n = 0; n < e.length; n++) {\n var i = e[n];\n\n if (i.observer === this) {\n i.removeListeners(), e.splice(n, 1);\n break;\n }\n }\n }, this), this.records_ = [];\n },\n takeRecords: function takeRecords() {\n var t = this.records_;\n return this.records_ = [], t;\n }\n };\n var x, w;\n f.prototype = {\n enqueue: function enqueue(t) {\n var n = this.observer.records_,\n i = n.length;\n\n if (n.length > 0) {\n var o = n[i - 1],\n r = d(o, t);\n if (r) return void (n[i - 1] = r);\n } else e(this.observer);\n\n n[i] = t;\n },\n addListeners: function addListeners() {\n this.addListeners_(this.target);\n },\n addListeners_: function addListeners_(t) {\n var e = this.options;\n e.attributes && t.addEventListener(\"DOMAttrModified\", this, !0), e.characterData && t.addEventListener(\"DOMCharacterDataModified\", this, !0), e.childList && t.addEventListener(\"DOMNodeInserted\", this, !0), (e.childList || e.subtree) && t.addEventListener(\"DOMNodeRemoved\", this, !0);\n },\n removeListeners: function removeListeners() {\n this.removeListeners_(this.target);\n },\n removeListeners_: function removeListeners_(t) {\n var e = this.options;\n e.attributes && t.removeEventListener(\"DOMAttrModified\", this, !0), e.characterData && t.removeEventListener(\"DOMCharacterDataModified\", this, !0), e.childList && t.removeEventListener(\"DOMNodeInserted\", this, !0), (e.childList || e.subtree) && t.removeEventListener(\"DOMNodeRemoved\", this, !0);\n },\n addTransientObserver: function addTransientObserver(t) {\n if (t !== this.target) {\n this.addListeners_(t), this.transientObservedNodes.push(t);\n var e = m.get(t);\n e || m.set(t, e = []), e.push(this);\n }\n },\n removeTransientObservers: function removeTransientObservers() {\n var t = this.transientObservedNodes;\n this.transientObservedNodes = [], t.forEach(function (t) {\n this.removeListeners_(t);\n\n for (var e = m.get(t), n = 0; n < e.length; n++) {\n if (e[n] === this) {\n e.splice(n, 1);\n break;\n }\n }\n }, this);\n },\n handleEvent: function handleEvent(t) {\n switch (t.stopImmediatePropagation(), t.type) {\n case \"DOMAttrModified\":\n var e = t.attrName,\n n = t.relatedNode.namespaceURI,\n i = t.target,\n o = new c(\"attributes\", i);\n o.attributeName = e, o.attributeNamespace = n;\n var s = t.attrChange === MutationEvent.ADDITION ? null : t.prevValue;\n r(i, function (t) {\n return !t.attributes || t.attributeFilter && t.attributeFilter.length && -1 === t.attributeFilter.indexOf(e) && -1 === t.attributeFilter.indexOf(n) ? void 0 : t.attributeOldValue ? l(s) : o;\n });\n break;\n\n case \"DOMCharacterDataModified\":\n var i = t.target,\n o = c(\"characterData\", i),\n s = t.prevValue;\n r(i, function (t) {\n return t.characterData ? t.characterDataOldValue ? l(s) : o : void 0;\n });\n break;\n\n case \"DOMNodeRemoved\":\n this.addTransientObserver(t.target);\n\n case \"DOMNodeInserted\":\n var a,\n u,\n p = t.target;\n \"DOMNodeInserted\" === t.type ? (a = [p], u = []) : (a = [], u = [p]);\n var d = p.previousSibling,\n f = p.nextSibling,\n o = c(\"childList\", t.target.parentNode);\n o.addedNodes = a, o.removedNodes = u, o.previousSibling = d, o.nextSibling = f, r(t.relatedNode, function (t) {\n return t.childList ? o : void 0;\n });\n }\n\n h();\n }\n }, t.JsMutationObserver = s, t.MutationObserver || (t.MutationObserver = s, s._isPolyfilled = !0);\n }\n }(self), function () {\n \"use strict\";\n\n if (!window.performance || !window.performance.now) {\n var t = Date.now();\n window.performance = {\n now: function now() {\n return Date.now() - t;\n }\n };\n }\n\n window.requestAnimationFrame || (window.requestAnimationFrame = function () {\n var t = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;\n return t ? function (e) {\n return t(function () {\n e(performance.now());\n });\n } : function (t) {\n return window.setTimeout(t, 1e3 / 60);\n };\n }()), window.cancelAnimationFrame || (window.cancelAnimationFrame = function () {\n return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function (t) {\n clearTimeout(t);\n };\n }());\n\n var e = function () {\n var t = document.createEvent(\"Event\");\n return t.initEvent(\"foo\", !0, !0), t.preventDefault(), t.defaultPrevented;\n }();\n\n if (!e) {\n var n = Event.prototype.preventDefault;\n\n Event.prototype.preventDefault = function () {\n this.cancelable && (n.call(this), Object.defineProperty(this, \"defaultPrevented\", {\n get: function get() {\n return !0;\n },\n configurable: !0\n }));\n };\n }\n\n var i = /Trident/.test(navigator.userAgent);\n\n if ((!window.CustomEvent || i && \"function\" != typeof window.CustomEvent) && (window.CustomEvent = function (t, e) {\n e = e || {};\n var n = document.createEvent(\"CustomEvent\");\n return n.initCustomEvent(t, Boolean(e.bubbles), Boolean(e.cancelable), e.detail), n;\n }, window.CustomEvent.prototype = window.Event.prototype), !window.Event || i && \"function\" != typeof window.Event) {\n var o = window.Event;\n window.Event = function (t, e) {\n e = e || {};\n var n = document.createEvent(\"Event\");\n return n.initEvent(t, Boolean(e.bubbles), Boolean(e.cancelable)), n;\n }, window.Event.prototype = o.prototype;\n }\n }(window.WebComponents), window.CustomElements = window.CustomElements || {\n flags: {}\n }, function (t) {\n var e = t.flags,\n n = [],\n i = function i(t) {\n n.push(t);\n },\n o = function o() {\n n.forEach(function (e) {\n e(t);\n });\n };\n\n t.addModule = i, t.initializeModules = o, t.hasNative = Boolean(document.registerElement), t.isIE = /Trident/.test(navigator.userAgent), t.useNative = !e.register && t.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);\n }(window.CustomElements), window.CustomElements.addModule(function (t) {\n function e(t, e) {\n n(t, function (t) {\n return e(t) ? !0 : void i(t, e);\n }), i(t, e);\n }\n\n function n(t, e, i) {\n var o = t.firstElementChild;\n if (!o) for (o = t.firstChild; o && o.nodeType !== Node.ELEMENT_NODE;) {\n o = o.nextSibling;\n }\n\n for (; o;) {\n e(o, i) !== !0 && n(o, e, i), o = o.nextElementSibling;\n }\n\n return null;\n }\n\n function i(t, n) {\n for (var i = t.shadowRoot; i;) {\n e(i, n), i = i.olderShadowRoot;\n }\n }\n\n function o(t, e) {\n r(t, e, []);\n }\n\n function r(t, e, n) {\n if (t = window.wrap(t), !(n.indexOf(t) >= 0)) {\n n.push(t);\n\n for (var i, o = t.querySelectorAll(\"link[rel=\" + s + \"]\"), a = 0, u = o.length; u > a && (i = o[a]); a++) {\n i[\"import\"] && r(i[\"import\"], e, n);\n }\n\n e(t);\n }\n }\n\n var s = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : \"none\";\n t.forDocumentTree = o, t.forSubtree = e;\n }), window.CustomElements.addModule(function (t) {\n function e(t, e) {\n return n(t, e) || i(t, e);\n }\n\n function n(e, n) {\n return t.upgrade(e, n) ? !0 : void (n && s(e));\n }\n\n function i(t, e) {\n b(t, function (t) {\n return n(t, e) ? !0 : void 0;\n });\n }\n\n function o(t) {\n w.push(t), x || (x = !0, setTimeout(r));\n }\n\n function r() {\n x = !1;\n\n for (var t, e = w, n = 0, i = e.length; i > n && (t = e[n]); n++) {\n t();\n }\n\n w = [];\n }\n\n function s(t) {\n C ? o(function () {\n a(t);\n }) : a(t);\n }\n\n function a(t) {\n t.__upgraded__ && !t.__attached && (t.__attached = !0, t.attachedCallback && t.attachedCallback());\n }\n\n function u(t) {\n c(t), b(t, function (t) {\n c(t);\n });\n }\n\n function c(t) {\n C ? o(function () {\n l(t);\n }) : l(t);\n }\n\n function l(t) {\n t.__upgraded__ && t.__attached && (t.__attached = !1, t.detachedCallback && t.detachedCallback());\n }\n\n function h(t) {\n for (var e = t, n = window.wrap(document); e;) {\n if (e == n) return !0;\n e = e.parentNode || e.nodeType === Node.DOCUMENT_FRAGMENT_NODE && e.host;\n }\n }\n\n function p(t) {\n if (t.shadowRoot && !t.shadowRoot.__watched) {\n y.dom && console.log(\"watching shadow-root for: \", t.localName);\n\n for (var e = t.shadowRoot; e;) {\n g(e), e = e.olderShadowRoot;\n }\n }\n }\n\n function d(t, n) {\n if (y.dom) {\n var i = n[0];\n\n if (i && \"childList\" === i.type && i.addedNodes && i.addedNodes) {\n for (var o = i.addedNodes[0]; o && o !== document && !o.host;) {\n o = o.parentNode;\n }\n\n var r = o && (o.URL || o._URL || o.host && o.host.localName) || \"\";\n r = r.split(\"/?\").shift().split(\"/\").pop();\n }\n\n console.group(\"mutations (%d) [%s]\", n.length, r || \"\");\n }\n\n var s = h(t);\n n.forEach(function (t) {\n \"childList\" === t.type && (E(t.addedNodes, function (t) {\n t.localName && e(t, s);\n }), E(t.removedNodes, function (t) {\n t.localName && u(t);\n }));\n }), y.dom && console.groupEnd();\n }\n\n function f(t) {\n for (t = window.wrap(t), t || (t = window.wrap(document)); t.parentNode;) {\n t = t.parentNode;\n }\n\n var e = t.__observer;\n e && (d(t, e.takeRecords()), r());\n }\n\n function g(t) {\n if (!t.__observer) {\n var e = new MutationObserver(d.bind(this, t));\n e.observe(t, {\n childList: !0,\n subtree: !0\n }), t.__observer = e;\n }\n }\n\n function m(t) {\n t = window.wrap(t), y.dom && console.group(\"upgradeDocument: \", t.baseURI.split(\"/\").pop());\n var n = t === window.wrap(document);\n e(t, n), g(t), y.dom && console.groupEnd();\n }\n\n function v(t) {\n A(t, m);\n }\n\n var y = t.flags,\n b = t.forSubtree,\n A = t.forDocumentTree,\n C = window.MutationObserver._isPolyfilled && y[\"throttle-attached\"];\n t.hasPolyfillMutations = C, t.hasThrottledAttached = C;\n var x = !1,\n w = [],\n E = Array.prototype.forEach.call.bind(Array.prototype.forEach),\n S = Element.prototype.createShadowRoot;\n S && (Element.prototype.createShadowRoot = function () {\n var t = S.call(this);\n return window.CustomElements.watchShadow(this), t;\n }), t.watchShadow = p, t.upgradeDocumentTree = v, t.upgradeDocument = m, t.upgradeSubtree = i, t.upgradeAll = e, t.attached = s, t.takeRecords = f;\n }), window.CustomElements.addModule(function (t) {\n function e(e, i) {\n if (\"template\" === e.localName && window.HTMLTemplateElement && HTMLTemplateElement.decorate && HTMLTemplateElement.decorate(e), !e.__upgraded__ && e.nodeType === Node.ELEMENT_NODE) {\n var o = e.getAttribute(\"is\"),\n r = t.getRegisteredDefinition(e.localName) || t.getRegisteredDefinition(o);\n if (r && (o && r.tag == e.localName || !o && !r[\"extends\"])) return n(e, r, i);\n }\n }\n\n function n(e, n, o) {\n return s.upgrade && console.group(\"upgrade:\", e.localName), n.is && e.setAttribute(\"is\", n.is), i(e, n), e.__upgraded__ = !0, r(e), o && t.attached(e), t.upgradeSubtree(e, o), s.upgrade && console.groupEnd(), e;\n }\n\n function i(t, e) {\n Object.__proto__ ? t.__proto__ = e.prototype : (o(t, e.prototype, e[\"native\"]), t.__proto__ = e.prototype);\n }\n\n function o(t, e, n) {\n for (var i = {}, o = e; o !== n && o !== HTMLElement.prototype;) {\n for (var r, s = Object.getOwnPropertyNames(o), a = 0; r = s[a]; a++) {\n i[r] || (Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(o, r)), i[r] = 1);\n }\n\n o = Object.getPrototypeOf(o);\n }\n }\n\n function r(t) {\n t.createdCallback && t.createdCallback();\n }\n\n var s = t.flags;\n t.upgrade = e, t.upgradeWithDefinition = n, t.implementPrototype = i;\n }), window.CustomElements.addModule(function (t) {\n function e(e, i) {\n var u = i || {};\n if (!e) throw new Error(\"document.registerElement: first argument `name` must not be empty\");\n if (e.indexOf(\"-\") < 0) throw new Error(\"document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '\" + String(e) + \"'.\");\n if (o(e)) throw new Error(\"Failed to execute 'registerElement' on 'Document': Registration failed for type '\" + String(e) + \"'. The type name is invalid.\");\n if (c(e)) throw new Error(\"DuplicateDefinitionError: a type with name '\" + String(e) + \"' is already registered\");\n return u.prototype || (u.prototype = Object.create(HTMLElement.prototype)), u.__name = e.toLowerCase(), u[\"extends\"] && (u[\"extends\"] = u[\"extends\"].toLowerCase()), u.lifecycle = u.lifecycle || {}, u.ancestry = r(u[\"extends\"]), s(u), a(u), n(u.prototype), l(u.__name, u), u.ctor = h(u), u.ctor.prototype = u.prototype, u.prototype.constructor = u.ctor, t.ready && m(document), u.ctor;\n }\n\n function n(t) {\n if (!t.setAttribute._polyfilled) {\n var e = t.setAttribute;\n\n t.setAttribute = function (t, n) {\n i.call(this, t, n, e);\n };\n\n var n = t.removeAttribute;\n t.removeAttribute = function (t) {\n i.call(this, t, null, n);\n }, t.setAttribute._polyfilled = !0;\n }\n }\n\n function i(t, e, n) {\n t = t.toLowerCase();\n var i = this.getAttribute(t);\n n.apply(this, arguments);\n var o = this.getAttribute(t);\n this.attributeChangedCallback && o !== i && this.attributeChangedCallback(t, i, o);\n }\n\n function o(t) {\n for (var e = 0; e < C.length; e++) {\n if (t === C[e]) return !0;\n }\n }\n\n function r(t) {\n var e = c(t);\n return e ? r(e[\"extends\"]).concat([e]) : [];\n }\n\n function s(t) {\n for (var e, n = t[\"extends\"], i = 0; e = t.ancestry[i]; i++) {\n n = e.is && e.tag;\n }\n\n t.tag = n || t.__name, n && (t.is = t.__name);\n }\n\n function a(t) {\n if (!Object.__proto__) {\n var e = HTMLElement.prototype;\n\n if (t.is) {\n var n = document.createElement(t.tag);\n e = Object.getPrototypeOf(n);\n }\n\n for (var i, o = t.prototype, r = !1; o;) {\n o == e && (r = !0), i = Object.getPrototypeOf(o), i && (o.__proto__ = i), o = i;\n }\n\n r || console.warn(t.tag + \" prototype not found in prototype chain for \" + t.is), t[\"native\"] = e;\n }\n }\n\n function u(t) {\n return y(E(t.tag), t);\n }\n\n function c(t) {\n return t ? x[t.toLowerCase()] : void 0;\n }\n\n function l(t, e) {\n x[t] = e;\n }\n\n function h(t) {\n return function () {\n return u(t);\n };\n }\n\n function p(t, e, n) {\n return t === w ? d(e, n) : S(t, e);\n }\n\n function d(t, e) {\n t && (t = t.toLowerCase()), e && (e = e.toLowerCase());\n var n = c(e || t);\n\n if (n) {\n if (t == n.tag && e == n.is) return new n.ctor();\n if (!e && !n.is) return new n.ctor();\n }\n\n var i;\n return e ? (i = d(t), i.setAttribute(\"is\", e), i) : (i = E(t), t.indexOf(\"-\") >= 0 && b(i, HTMLElement), i);\n }\n\n function f(t, e) {\n var n = t[e];\n\n t[e] = function () {\n var t = n.apply(this, arguments);\n return v(t), t;\n };\n }\n\n var g,\n m = (t.isIE, t.upgradeDocumentTree),\n v = t.upgradeAll,\n y = t.upgradeWithDefinition,\n b = t.implementPrototype,\n A = t.useNative,\n C = [\"annotation-xml\", \"color-profile\", \"font-face\", \"font-face-src\", \"font-face-uri\", \"font-face-format\", \"font-face-name\", \"missing-glyph\"],\n x = {},\n w = \"http://www.w3.org/1999/xhtml\",\n E = document.createElement.bind(document),\n S = document.createElementNS.bind(document);\n g = Object.__proto__ || A ? function (t, e) {\n return t instanceof e;\n } : function (t, e) {\n if (t instanceof e) return !0;\n\n for (var n = t; n;) {\n if (n === e.prototype) return !0;\n n = n.__proto__;\n }\n\n return !1;\n }, f(Node.prototype, \"cloneNode\"), f(document, \"importNode\"), document.registerElement = e, document.createElement = d, document.createElementNS = p, t.registry = x, t[\"instanceof\"] = g, t.reservedTagList = C, t.getRegisteredDefinition = c, document.register = document.registerElement;\n }), function (t) {\n function e() {\n r(window.wrap(document)), window.CustomElements.ready = !0;\n\n var t = window.requestAnimationFrame || function (t) {\n setTimeout(t, 16);\n };\n\n t(function () {\n setTimeout(function () {\n window.CustomElements.readyTime = Date.now(), window.HTMLImports && (window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime), document.dispatchEvent(new CustomEvent(\"WebComponentsReady\", {\n bubbles: !0\n }));\n });\n });\n }\n\n var n = t.useNative,\n i = t.initializeModules;\n\n if (t.isIE, n) {\n var o = function o() {};\n\n t.watchShadow = o, t.upgrade = o, t.upgradeAll = o, t.upgradeDocumentTree = o, t.upgradeSubtree = o, t.takeRecords = o, t[\"instanceof\"] = function (t, e) {\n return t instanceof e;\n };\n } else i();\n\n var r = t.upgradeDocumentTree,\n s = t.upgradeDocument;\n if (window.wrap || (window.ShadowDOMPolyfill ? (window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded, window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded) : window.wrap = window.unwrap = function (t) {\n return t;\n }), window.HTMLImports && (window.HTMLImports.__importsParsingHook = function (t) {\n t[\"import\"] && s(wrap(t[\"import\"]));\n }), \"complete\" === document.readyState || t.flags.eager) e();else if (\"interactive\" !== document.readyState || window.attachEvent || window.HTMLImports && !window.HTMLImports.ready) {\n var a = window.HTMLImports && !window.HTMLImports.ready ? \"HTMLImportsLoaded\" : \"DOMContentLoaded\";\n window.addEventListener(a, e);\n } else e();\n }(window.CustomElements));\n}.call(this), function () {}.call(this), function () {\n var t = this;\n (function () {\n (function () {\n this.Trix = {\n VERSION: \"1.1.1\",\n ZERO_WIDTH_SPACE: \"\\uFEFF\",\n NON_BREAKING_SPACE: \"\\xa0\",\n OBJECT_REPLACEMENT_CHARACTER: \"\\uFFFC\",\n browser: {\n composesExistingText: /Android.*Chrome/.test(navigator.userAgent),\n forcesObjectResizing: /Trident.*rv:11/.test(navigator.userAgent),\n supportsInputEvents: function () {\n var t, e, n, i;\n if (\"undefined\" == typeof InputEvent) return !1;\n\n for (i = [\"data\", \"getTargetRanges\", \"inputType\"], t = 0, e = i.length; e > t; t++) {\n if (n = i[t], !(n in InputEvent.prototype)) return !1;\n }\n\n return !0;\n }()\n },\n config: {}\n };\n }).call(this);\n }).call(t);\n var e = t.Trix;\n (function () {\n (function () {\n e.BasicObject = function () {\n function t() {}\n\n var e, n, i;\n return t.proxyMethod = function (t) {\n var i, o, r, s, a;\n return r = n(t), i = r.name, s = r.toMethod, a = r.toProperty, o = r.optional, this.prototype[i] = function () {\n var t, n;\n return t = null != s ? o ? \"function\" == typeof this[s] ? this[s]() : void 0 : this[s]() : null != a ? this[a] : void 0, o ? (n = null != t ? t[i] : void 0, null != n ? e.call(n, t, arguments) : void 0) : (n = t[i], e.call(n, t, arguments));\n };\n }, n = function n(t) {\n var e, n;\n if (!(n = t.match(i))) throw new Error(\"can't parse @proxyMethod expression: \" + t);\n return e = {\n name: n[4]\n }, null != n[2] ? e.toMethod = n[1] : e.toProperty = n[1], null != n[3] && (e.optional = !0), e;\n }, e = Function.prototype.apply, i = /^(.+?)(\\(\\))?(\\?)?\\.(.+?)$/, t;\n }();\n }).call(this), function () {\n var t = function t(_t, e) {\n function i() {\n this.constructor = _t;\n }\n\n for (var o in e) {\n n.call(e, o) && (_t[o] = e[o]);\n }\n\n return i.prototype = e.prototype, _t.prototype = new i(), _t.__super__ = e.prototype, _t;\n },\n n = {}.hasOwnProperty;\n\n e.Object = function (n) {\n function i() {\n this.id = ++o;\n }\n\n var o;\n return t(i, n), o = 0, i.fromJSONString = function (t) {\n return this.fromJSON(JSON.parse(t));\n }, i.prototype.hasSameConstructorAs = function (t) {\n return this.constructor === (null != t ? t.constructor : void 0);\n }, i.prototype.isEqualTo = function (t) {\n return this === t;\n }, i.prototype.inspect = function () {\n var t, e, n;\n return t = function () {\n var t, i, o;\n i = null != (t = this.contentsForInspection()) ? t : {}, o = [];\n\n for (e in i) {\n n = i[e], o.push(e + \"=\" + n);\n }\n\n return o;\n }.call(this), \"#<\" + this.constructor.name + \":\" + this.id + (t.length ? \" \" + t.join(\", \") : \"\") + \">\";\n }, i.prototype.contentsForInspection = function () {}, i.prototype.toJSONString = function () {\n return JSON.stringify(this);\n }, i.prototype.toUTF16String = function () {\n return e.UTF16String.box(this);\n }, i.prototype.getCacheKey = function () {\n return this.id.toString();\n }, i;\n }(e.BasicObject);\n }.call(this), function () {\n e.extend = function (t) {\n var e, n;\n\n for (e in t) {\n n = t[e], this[e] = n;\n }\n\n return this;\n };\n }.call(this), function () {\n e.extend({\n defer: function defer(t) {\n return setTimeout(t, 1);\n }\n });\n }.call(this), function () {\n var t, n;\n e.extend({\n normalizeSpaces: function normalizeSpaces(t) {\n return t.replace(RegExp(\"\" + e.ZERO_WIDTH_SPACE, \"g\"), \"\").replace(RegExp(\"\" + e.NON_BREAKING_SPACE, \"g\"), \" \");\n },\n normalizeNewlines: function normalizeNewlines(t) {\n return t.replace(/\\r\\n/g, \"\\n\");\n },\n breakableWhitespacePattern: RegExp(\"[^\\\\S\" + e.NON_BREAKING_SPACE + \"]\"),\n squishBreakableWhitespace: function squishBreakableWhitespace(t) {\n return t.replace(RegExp(\"\" + e.breakableWhitespacePattern.source, \"g\"), \" \").replace(/\\ {2,}/g, \" \");\n },\n escapeHTML: function escapeHTML(t) {\n var e;\n return e = document.createElement(\"div\"), e.textContent = t, e.innerHTML;\n },\n summarizeStringChange: function summarizeStringChange(t, i) {\n var o, r, s, a;\n return t = e.UTF16String.box(t), i = e.UTF16String.box(i), i.length < t.length ? (r = n(t, i), a = r[0], o = r[1]) : (s = n(i, t), o = s[0], a = s[1]), {\n added: o,\n removed: a\n };\n }\n }), n = function n(_n, i) {\n var o, r, s, a, u;\n return _n.isEqualTo(i) ? [\"\", \"\"] : (r = t(_n, i), a = r.utf16String.length, s = a ? (u = r.offset, r, o = _n.codepoints.slice(0, u).concat(_n.codepoints.slice(u + a)), t(i, e.UTF16String.fromCodepoints(o))) : t(i, _n), [r.utf16String.toString(), s.utf16String.toString()]);\n }, t = function t(_t2, e) {\n var n, i, o;\n\n for (n = 0, i = _t2.length, o = e.length; i > n && _t2.charAt(n).isEqualTo(e.charAt(n));) {\n n++;\n }\n\n for (; i > n + 1 && _t2.charAt(i - 1).isEqualTo(e.charAt(o - 1));) {\n i--, o--;\n }\n\n return {\n utf16String: _t2.slice(n, i),\n offset: n\n };\n };\n }.call(this), function () {\n e.extend({\n copyObject: function copyObject(t) {\n var e, n, i;\n null == t && (t = {}), n = {};\n\n for (e in t) {\n i = t[e], n[e] = i;\n }\n\n return n;\n },\n objectsAreEqual: function objectsAreEqual(t, e) {\n var n, i;\n if (null == t && (t = {}), null == e && (e = {}), Object.keys(t).length !== Object.keys(e).length) return !1;\n\n for (n in t) {\n if (i = t[n], i !== e[n]) return !1;\n }\n\n return !0;\n }\n });\n }.call(this), function () {\n var t = [].slice;\n e.extend({\n arraysAreEqual: function arraysAreEqual(t, e) {\n var n, i, o, r;\n if (null == t && (t = []), null == e && (e = []), t.length !== e.length) return !1;\n\n for (i = n = 0, o = t.length; o > n; i = ++n) {\n if (r = t[i], r !== e[i]) return !1;\n }\n\n return !0;\n },\n arrayStartsWith: function arrayStartsWith(t, n) {\n return null == t && (t = []), null == n && (n = []), e.arraysAreEqual(t.slice(0, n.length), n);\n },\n spliceArray: function spliceArray() {\n var e, n, i;\n return n = arguments[0], e = 2 <= arguments.length ? t.call(arguments, 1) : [], i = n.slice(0), i.splice.apply(i, e), i;\n },\n summarizeArrayChange: function summarizeArrayChange(t, e) {\n var n, i, o, r, s, a, u, c, l, h, p;\n\n for (null == t && (t = []), null == e && (e = []), n = [], h = [], o = new Set(), r = 0, u = t.length; u > r; r++) {\n p = t[r], o.add(p);\n }\n\n for (i = new Set(), s = 0, c = e.length; c > s; s++) {\n p = e[s], i.add(p), o.has(p) || n.push(p);\n }\n\n for (a = 0, l = t.length; l > a; a++) {\n p = t[a], i.has(p) || h.push(p);\n }\n\n return {\n added: n,\n removed: h\n };\n }\n });\n }.call(this), function () {\n var t, n, i, o;\n t = null, n = null, o = null, i = null, e.extend({\n getAllAttributeNames: function getAllAttributeNames() {\n return null != t ? t : t = e.getTextAttributeNames().concat(e.getBlockAttributeNames());\n },\n getBlockConfig: function getBlockConfig(t) {\n return e.config.blockAttributes[t];\n },\n getBlockAttributeNames: function getBlockAttributeNames() {\n return null != n ? n : n = Object.keys(e.config.blockAttributes);\n },\n getTextConfig: function getTextConfig(t) {\n return e.config.textAttributes[t];\n },\n getTextAttributeNames: function getTextAttributeNames() {\n return null != o ? o : o = Object.keys(e.config.textAttributes);\n },\n getListAttributeNames: function getListAttributeNames() {\n var t, n;\n return null != i ? i : i = function () {\n var i, o;\n i = e.config.blockAttributes, o = [];\n\n for (t in i) {\n n = i[t].listAttribute, null != n && o.push(n);\n }\n\n return o;\n }();\n }\n });\n }.call(this), function () {\n var t,\n n,\n i,\n o,\n r,\n s = [].indexOf || function (t) {\n for (var e = 0, n = this.length; n > e; e++) {\n if (e in this && this[e] === t) return e;\n }\n\n return -1;\n };\n\n t = document.documentElement, n = null != (i = null != (o = null != (r = t.matchesSelector) ? r : t.webkitMatchesSelector) ? o : t.msMatchesSelector) ? i : t.mozMatchesSelector, e.extend({\n handleEvent: function handleEvent(n, i) {\n var o, r, _s, a, u, c, l, h, p, d, f, g;\n\n return h = null != i ? i : {}, c = h.onElement, u = h.matchingSelector, g = h.withCallback, a = h.inPhase, l = h.preventDefault, d = h.times, r = null != c ? c : t, p = u, o = g, f = \"capturing\" === a, _s = function s(t) {\n var n;\n return null != d && 0 === --d && _s.destroy(), n = e.findClosestElementFromNode(t.target, {\n matchingSelector: p\n }), null != n && (null != g && g.call(n, t, n), l) ? t.preventDefault() : void 0;\n }, _s.destroy = function () {\n return r.removeEventListener(n, _s, f);\n }, r.addEventListener(n, _s, f), _s;\n },\n handleEventOnce: function handleEventOnce(t, n) {\n return null == n && (n = {}), n.times = 1, e.handleEvent(t, n);\n },\n triggerEvent: function triggerEvent(n, i) {\n var o, r, s, a, u, c, l;\n return l = null != i ? i : {}, c = l.onElement, r = l.bubbles, s = l.cancelable, o = l.attributes, a = null != c ? c : t, r = r !== !1, s = s !== !1, u = document.createEvent(\"Events\"), u.initEvent(n, r, s), null != o && e.extend.call(u, o), a.dispatchEvent(u);\n },\n elementMatchesSelector: function elementMatchesSelector(t, e) {\n return 1 === (null != t ? t.nodeType : void 0) ? n.call(t, e) : void 0;\n },\n findClosestElementFromNode: function findClosestElementFromNode(t, n) {\n var i, o, r;\n\n for (o = null != n ? n : {}, i = o.matchingSelector, r = o.untilNode; null != t && t.nodeType !== Node.ELEMENT_NODE;) {\n t = t.parentNode;\n }\n\n if (null != t) {\n if (null == i) return t;\n if (t.closest && null == r) return t.closest(i);\n\n for (; t && t !== r;) {\n if (e.elementMatchesSelector(t, i)) return t;\n t = t.parentNode;\n }\n }\n },\n findInnerElement: function findInnerElement(t) {\n for (; null != t ? t.firstElementChild : void 0;) {\n t = t.firstElementChild;\n }\n\n return t;\n },\n innerElementIsActive: function innerElementIsActive(t) {\n return document.activeElement !== t && e.elementContainsNode(t, document.activeElement);\n },\n elementContainsNode: function elementContainsNode(t, e) {\n if (t && e) for (; e;) {\n if (e === t) return !0;\n e = e.parentNode;\n }\n },\n findNodeFromContainerAndOffset: function findNodeFromContainerAndOffset(t, e) {\n var n;\n if (t) return t.nodeType === Node.TEXT_NODE ? t : 0 === e ? null != (n = t.firstChild) ? n : t : t.childNodes.item(e - 1);\n },\n findElementFromContainerAndOffset: function findElementFromContainerAndOffset(t, n) {\n var i;\n return i = e.findNodeFromContainerAndOffset(t, n), e.findClosestElementFromNode(i);\n },\n findChildIndexOfNode: function findChildIndexOfNode(t) {\n var e;\n\n if (null != t ? t.parentNode : void 0) {\n for (e = 0; t = t.previousSibling;) {\n e++;\n }\n\n return e;\n }\n },\n removeNode: function removeNode(t) {\n var e;\n return null != t && null != (e = t.parentNode) ? e.removeChild(t) : void 0;\n },\n walkTree: function walkTree(t, e) {\n var n, i, o, r, s;\n return o = null != e ? e : {}, i = o.onlyNodesOfType, r = o.usingFilter, n = o.expandEntityReferences, s = function () {\n switch (i) {\n case \"element\":\n return NodeFilter.SHOW_ELEMENT;\n\n case \"text\":\n return NodeFilter.SHOW_TEXT;\n\n case \"comment\":\n return NodeFilter.SHOW_COMMENT;\n\n default:\n return NodeFilter.SHOW_ALL;\n }\n }(), document.createTreeWalker(t, s, null != r ? r : null, n === !0);\n },\n tagName: function tagName(t) {\n var e;\n return null != t && null != (e = t.tagName) ? e.toLowerCase() : void 0;\n },\n makeElement: function makeElement(t, e) {\n var n, i, o, r, s, a, u, c, l, h;\n\n if (null == e && (e = {}), \"object\" == _typeof(t) ? (e = t, t = e.tagName) : e = {\n attributes: e\n }, i = document.createElement(t), null != e.editable && (null == e.attributes && (e.attributes = {}), e.attributes.contenteditable = e.editable), e.attributes) {\n a = e.attributes;\n\n for (r in a) {\n h = a[r], i.setAttribute(r, h);\n }\n }\n\n if (e.style) {\n u = e.style;\n\n for (r in u) {\n h = u[r], i.style[r] = h;\n }\n }\n\n if (e.data) {\n c = e.data;\n\n for (r in c) {\n h = c[r], i.dataset[r] = h;\n }\n }\n\n if (e.className) for (l = e.className.split(\" \"), o = 0, s = l.length; s > o; o++) {\n n = l[o], i.classList.add(n);\n }\n return e.textContent && (i.textContent = e.textContent), i;\n },\n getBlockTagNames: function getBlockTagNames() {\n var t, n;\n return null != e.blockTagNames ? e.blockTagNames : e.blockTagNames = function () {\n var i, o;\n i = e.config.blockAttributes, o = [];\n\n for (t in i) {\n n = i[t].tagName, n && o.push(n);\n }\n\n return o;\n }();\n },\n nodeIsBlockContainer: function nodeIsBlockContainer(t) {\n return e.nodeIsBlockStartComment(null != t ? t.firstChild : void 0);\n },\n nodeProbablyIsBlockContainer: function nodeProbablyIsBlockContainer(t) {\n var n, i;\n return n = e.tagName(t), s.call(e.getBlockTagNames(), n) >= 0 && (i = e.tagName(t.firstChild), s.call(e.getBlockTagNames(), i) < 0);\n },\n nodeIsBlockStart: function nodeIsBlockStart(t, n) {\n var i;\n return i = (null != n ? n : {\n strict: !0\n }).strict, i ? e.nodeIsBlockStartComment(t) : e.nodeIsBlockStartComment(t) || !e.nodeIsBlockStartComment(t.firstChild) && e.nodeProbablyIsBlockContainer(t);\n },\n nodeIsBlockStartComment: function nodeIsBlockStartComment(t) {\n return e.nodeIsCommentNode(t) && \"block\" === (null != t ? t.data : void 0);\n },\n nodeIsCommentNode: function nodeIsCommentNode(t) {\n return (null != t ? t.nodeType : void 0) === Node.COMMENT_NODE;\n },\n nodeIsCursorTarget: function nodeIsCursorTarget(t, n) {\n var i;\n return i = (null != n ? n : {}).name, t ? e.nodeIsTextNode(t) ? t.data === e.ZERO_WIDTH_SPACE ? i ? t.parentNode.dataset.trixCursorTarget === i : !0 : void 0 : e.nodeIsCursorTarget(t.firstChild) : void 0;\n },\n nodeIsAttachmentElement: function nodeIsAttachmentElement(t) {\n return e.elementMatchesSelector(t, e.AttachmentView.attachmentSelector);\n },\n nodeIsEmptyTextNode: function nodeIsEmptyTextNode(t) {\n return e.nodeIsTextNode(t) && \"\" === (null != t ? t.data : void 0);\n },\n nodeIsTextNode: function nodeIsTextNode(t) {\n return (null != t ? t.nodeType : void 0) === Node.TEXT_NODE;\n }\n });\n }.call(this), function () {\n var t, n, i, o, r;\n t = e.copyObject, o = e.objectsAreEqual, e.extend({\n normalizeRange: i = function i(t) {\n var e;\n if (null != t) return Array.isArray(t) || (t = [t, t]), [n(t[0]), n(null != (e = t[1]) ? e : t[0])];\n },\n rangeIsCollapsed: function rangeIsCollapsed(t) {\n var e, n, o;\n if (null != t) return n = i(t), o = n[0], e = n[1], r(o, e);\n },\n rangesAreEqual: function rangesAreEqual(t, e) {\n var n, o, s, a, u, c;\n if (null != t && null != e) return s = i(t), o = s[0], n = s[1], a = i(e), c = a[0], u = a[1], r(o, c) && r(n, u);\n }\n }), n = function n(e) {\n return \"number\" == typeof e ? e : t(e);\n }, r = function r(t, e) {\n return \"number\" == typeof t ? t === e : o(t, e);\n };\n }.call(this), function () {\n var t, n, i, o, r;\n e.registerElement = function (t, e) {\n var s, a;\n return null == e && (e = {}), t = t.toLowerCase(), e = r(e), a = o(e), (s = a.defaultCSS) && (delete a.defaultCSS, n(s, t)), i(t, a);\n }, n = function n(e, _n2) {\n var i;\n return i = t(_n2), i.textContent = e.replace(/%t/g, _n2);\n }, t = function t(_t3) {\n var e;\n return e = document.createElement(\"style\"), e.setAttribute(\"type\", \"text/css\"), e.setAttribute(\"data-tag-name\", _t3.toLowerCase()), document.head.insertBefore(e, document.head.firstChild), e;\n }, o = function o(t) {\n var e, n, i;\n n = {};\n\n for (e in t) {\n i = t[e], n[e] = \"function\" == typeof i ? {\n value: i\n } : i;\n }\n\n return n;\n }, r = function () {\n var t;\n return t = function t(_t4) {\n var e, n, i, o, r;\n\n for (e = {}, r = [\"initialize\", \"connect\", \"disconnect\"], n = 0, o = r.length; o > n; n++) {\n i = r[n], e[i] = _t4[i], delete _t4[i];\n }\n\n return e;\n }, window.customElements ? function (e) {\n var n, i, o, r, s;\n return s = t(e), o = s.initialize, n = s.connect, i = s.disconnect, o && (r = n, n = function n() {\n return this.initialized || (this.initialized = !0, o.call(this)), null != r ? r.call(this) : void 0;\n }), n && (e.connectedCallback = n), i && (e.disconnectedCallback = i), e;\n } : function (e) {\n var n, i, o, r;\n return r = t(e), o = r.initialize, n = r.connect, i = r.disconnect, o && (e.createdCallback = o), n && (e.attachedCallback = n), i && (e.detachedCallback = i), e;\n };\n }(), i = function () {\n return window.customElements ? function (t, e) {\n var _n3;\n\n return _n3 = function n() {\n return Reflect.construct(HTMLElement, [], _n3);\n }, _n3.prototype = Object.create(HTMLElement.prototype, e), window.customElements.define(t, _n3), _n3;\n } : function (t, e) {\n var n, i;\n return i = Object.create(HTMLElement.prototype, e), n = document.registerElement(t, {\n prototype: i\n }), Object.defineProperty(i, \"constructor\", {\n value: n\n }), n;\n };\n }();\n }.call(this), function () {\n var t, n;\n e.extend({\n getDOMSelection: function getDOMSelection() {\n var t;\n return t = window.getSelection(), t.rangeCount > 0 ? t : void 0;\n },\n getDOMRange: function getDOMRange() {\n var n, i;\n return (n = null != (i = e.getDOMSelection()) ? i.getRangeAt(0) : void 0) && !t(n) ? n : void 0;\n },\n setDOMRange: function setDOMRange(t) {\n var n;\n return n = window.getSelection(), n.removeAllRanges(), n.addRange(t), e.selectionChangeObserver.update();\n }\n }), t = function t(_t5) {\n return n(_t5.startContainer) || n(_t5.endContainer);\n }, n = function n(t) {\n return !Object.getPrototypeOf(t);\n };\n }.call(this), function () {\n var t;\n t = {\n \"application/x-trix-feature-detection\": \"test\"\n }, e.extend({\n dataTransferIsPlainText: function dataTransferIsPlainText(t) {\n var e, n, i;\n return i = t.getData(\"text/plain\"), n = t.getData(\"text/html\"), i && n ? (e = document.createElement(\"div\"), e.innerHTML = n, e.textContent === i ? !e.querySelector(\":not(meta)\") : void 0) : null != i ? i.length : void 0;\n },\n dataTransferIsWritable: function dataTransferIsWritable(e) {\n var n, i;\n\n if (null != (null != e ? e.setData : void 0)) {\n for (n in t) {\n if (i = t[n], !function () {\n try {\n return e.setData(n, i), e.getData(n) === i;\n } catch (t) {}\n }()) return;\n }\n\n return !0;\n }\n },\n keyEventIsKeyboardCommand: function () {\n return /Mac|^iP/.test(navigator.platform) ? function (t) {\n return t.metaKey;\n } : function (t) {\n return t.ctrlKey;\n };\n }()\n });\n }.call(this), function () {}.call(this), function () {\n var t,\n n = function n(t, e) {\n function n() {\n this.constructor = t;\n }\n\n for (var o in e) {\n i.call(e, o) && (t[o] = e[o]);\n }\n\n return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;\n },\n i = {}.hasOwnProperty;\n\n t = e.arraysAreEqual, e.Hash = function (i) {\n function o(t) {\n null == t && (t = {}), this.values = s(t), o.__super__.constructor.apply(this, arguments);\n }\n\n var r, s, a, u, c;\n return n(o, i), o.fromCommonAttributesOfObjects = function (t) {\n var e, n, i, o, s, a;\n if (null == t && (t = []), !t.length) return new this();\n\n for (e = r(t[0]), i = e.getKeys(), a = t.slice(1), n = 0, o = a.length; o > n; n++) {\n s = a[n], i = e.getKeysCommonToHash(r(s)), e = e.slice(i);\n }\n\n return e;\n }, o.box = function (t) {\n return r(t);\n }, o.prototype.add = function (t, e) {\n return this.merge(u(t, e));\n }, o.prototype.remove = function (t) {\n return new e.Hash(s(this.values, t));\n }, o.prototype.get = function (t) {\n return this.values[t];\n }, o.prototype.has = function (t) {\n return t in this.values;\n }, o.prototype.merge = function (t) {\n return new e.Hash(a(this.values, c(t)));\n }, o.prototype.slice = function (t) {\n var n, i, o, r;\n\n for (r = {}, n = 0, o = t.length; o > n; n++) {\n i = t[n], this.has(i) && (r[i] = this.values[i]);\n }\n\n return new e.Hash(r);\n }, o.prototype.getKeys = function () {\n return Object.keys(this.values);\n }, o.prototype.getKeysCommonToHash = function (t) {\n var e, n, i, o, s;\n\n for (t = r(t), o = this.getKeys(), s = [], e = 0, i = o.length; i > e; e++) {\n n = o[e], this.values[n] === t.values[n] && s.push(n);\n }\n\n return s;\n }, o.prototype.isEqualTo = function (e) {\n return t(this.toArray(), r(e).toArray());\n }, o.prototype.isEmpty = function () {\n return 0 === this.getKeys().length;\n }, o.prototype.toArray = function () {\n var t, e, n;\n return (null != this.array ? this.array : this.array = function () {\n var i;\n e = [], i = this.values;\n\n for (t in i) {\n n = i[t], e.push(t, n);\n }\n\n return e;\n }.call(this)).slice(0);\n }, o.prototype.toObject = function () {\n return s(this.values);\n }, o.prototype.toJSON = function () {\n return this.toObject();\n }, o.prototype.contentsForInspection = function () {\n return {\n values: JSON.stringify(this.values)\n };\n }, u = function u(t, e) {\n var n;\n return n = {}, n[t] = e, n;\n }, a = function a(t, e) {\n var n, i, o;\n i = s(t);\n\n for (n in e) {\n o = e[n], i[n] = o;\n }\n\n return i;\n }, s = function s(t, e) {\n var n, i, o, r, s;\n\n for (r = {}, s = Object.keys(t).sort(), n = 0, o = s.length; o > n; n++) {\n i = s[n], i !== e && (r[i] = t[i]);\n }\n\n return r;\n }, r = function r(t) {\n return t instanceof e.Hash ? t : new e.Hash(t);\n }, c = function c(t) {\n return t instanceof e.Hash ? t.values : t;\n }, o;\n }(e.Object);\n }.call(this), function () {\n e.ObjectGroup = function () {\n function t(t, e) {\n var n, i;\n this.objects = null != t ? t : [], i = e.depth, n = e.asTree, n && (this.depth = i, this.objects = this.constructor.groupObjects(this.objects, {\n asTree: n,\n depth: this.depth + 1\n }));\n }\n\n return t.groupObjects = function (t, e) {\n var n, i, o, r, s, a, u, c, l;\n\n for (null == t && (t = []), l = null != e ? e : {}, o = l.depth, n = l.asTree, n && null == o && (o = 0), c = [], s = 0, a = t.length; a > s; s++) {\n if (u = t[s], r) {\n if ((\"function\" == typeof u.canBeGrouped ? u.canBeGrouped(o) : void 0) && (\"function\" == typeof (i = r[r.length - 1]).canBeGroupedWith ? i.canBeGroupedWith(u, o) : void 0)) {\n r.push(u);\n continue;\n }\n\n c.push(new this(r, {\n depth: o,\n asTree: n\n })), r = null;\n }\n\n (\"function\" == typeof u.canBeGrouped ? u.canBeGrouped(o) : void 0) ? r = [u] : c.push(u);\n }\n\n return r && c.push(new this(r, {\n depth: o,\n asTree: n\n })), c;\n }, t.prototype.getObjects = function () {\n return this.objects;\n }, t.prototype.getDepth = function () {\n return this.depth;\n }, t.prototype.getCacheKey = function () {\n var t, e, n, i, o;\n\n for (e = [\"objectGroup\"], o = this.getObjects(), t = 0, n = o.length; n > t; t++) {\n i = o[t], e.push(i.getCacheKey());\n }\n\n return e.join(\"/\");\n }, t;\n }();\n }.call(this), function () {\n var t = function t(_t6, e) {\n function i() {\n this.constructor = _t6;\n }\n\n for (var o in e) {\n n.call(e, o) && (_t6[o] = e[o]);\n }\n\n return i.prototype = e.prototype, _t6.prototype = new i(), _t6.__super__ = e.prototype, _t6;\n },\n n = {}.hasOwnProperty;\n\n e.ObjectMap = function (e) {\n function n(t) {\n var e, n, i, o, r;\n\n for (null == t && (t = []), this.objects = {}, i = 0, o = t.length; o > i; i++) {\n r = t[i], n = JSON.stringify(r), null == (e = this.objects)[n] && (e[n] = r);\n }\n }\n\n return t(n, e), n.prototype.find = function (t) {\n var e;\n return e = JSON.stringify(t), this.objects[e];\n }, n;\n }(e.BasicObject);\n }.call(this), function () {\n e.ElementStore = function () {\n function t(t) {\n this.reset(t);\n }\n\n var e;\n return t.prototype.add = function (t) {\n var n;\n return n = e(t), this.elements[n] = t;\n }, t.prototype.remove = function (t) {\n var n, i;\n return n = e(t), (i = this.elements[n]) ? (delete this.elements[n], i) : void 0;\n }, t.prototype.reset = function (t) {\n var e, n, i;\n\n for (null == t && (t = []), this.elements = {}, n = 0, i = t.length; i > n; n++) {\n e = t[n], this.add(e);\n }\n\n return t;\n }, e = function e(t) {\n return t.dataset.trixStoreKey;\n }, t;\n }();\n }.call(this), function () {}.call(this), function () {\n var t = function t(_t7, e) {\n function i() {\n this.constructor = _t7;\n }\n\n for (var o in e) {\n n.call(e, o) && (_t7[o] = e[o]);\n }\n\n return i.prototype = e.prototype, _t7.prototype = new i(), _t7.__super__ = e.prototype, _t7;\n },\n n = {}.hasOwnProperty;\n\n e.Operation = function (e) {\n function n() {\n return n.__super__.constructor.apply(this, arguments);\n }\n\n return t(n, e), n.prototype.isPerforming = function () {\n return this.performing === !0;\n }, n.prototype.hasPerformed = function () {\n return this.performed === !0;\n }, n.prototype.hasSucceeded = function () {\n return this.performed && this.succeeded;\n }, n.prototype.hasFailed = function () {\n return this.performed && !this.succeeded;\n }, n.prototype.getPromise = function () {\n return null != this.promise ? this.promise : this.promise = new Promise(function (t) {\n return function (e, n) {\n return t.performing = !0, t.perform(function (i, o) {\n return t.succeeded = i, t.performing = !1, t.performed = !0, t.succeeded ? e(o) : n(o);\n });\n };\n }(this));\n }, n.prototype.perform = function (t) {\n return t(!1);\n }, n.prototype.release = function () {\n var t;\n return null != (t = this.promise) && \"function\" == typeof t.cancel && t.cancel(), this.promise = null, this.performing = null, this.performed = null, this.succeeded = null;\n }, n.proxyMethod(\"getPromise().then\"), n.proxyMethod(\"getPromise().catch\"), n;\n }(e.BasicObject);\n }.call(this), function () {\n var t,\n n,\n i,\n o,\n r,\n s = function s(t, e) {\n function n() {\n this.constructor = t;\n }\n\n for (var i in e) {\n a.call(e, i) && (t[i] = e[i]);\n }\n\n return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;\n },\n a = {}.hasOwnProperty;\n\n e.UTF16String = function (t) {\n function e(t, e) {\n this.ucs2String = t, this.codepoints = e, this.length = this.codepoints.length, this.ucs2Length = this.ucs2String.length;\n }\n\n return s(e, t), e.box = function (t) {\n return null == t && (t = \"\"), t instanceof this ? t : this.fromUCS2String(null != t ? t.toString() : void 0);\n }, e.fromUCS2String = function (t) {\n return new this(t, o(t));\n }, e.fromCodepoints = function (t) {\n return new this(r(t), t);\n }, e.prototype.offsetToUCS2Offset = function (t) {\n return r(this.codepoints.slice(0, Math.max(0, t))).length;\n }, e.prototype.offsetFromUCS2Offset = function (t) {\n return o(this.ucs2String.slice(0, Math.max(0, t))).length;\n }, e.prototype.slice = function () {\n var t;\n return this.constructor.fromCodepoints((t = this.codepoints).slice.apply(t, arguments));\n }, e.prototype.charAt = function (t) {\n return this.slice(t, t + 1);\n }, e.prototype.isEqualTo = function (t) {\n return this.constructor.box(t).ucs2String === this.ucs2String;\n }, e.prototype.toJSON = function () {\n return this.ucs2String;\n }, e.prototype.getCacheKey = function () {\n return this.ucs2String;\n }, e.prototype.toString = function () {\n return this.ucs2String;\n }, e;\n }(e.BasicObject), t = 1 === (\"function\" == typeof Array.from ? Array.from(\"\\uD83D\\uDC7C\").length : void 0), n = null != (\"function\" == typeof \" \".codePointAt ? \" \".codePointAt(0) : void 0), i = \" \\uD83D\\uDC7C\" === (\"function\" == typeof String.fromCodePoint ? String.fromCodePoint(32, 128124) : void 0), o = t && n ? function (t) {\n return Array.from(t).map(function (t) {\n return t.codePointAt(0);\n });\n } : function (t) {\n var e, n, i, o, r;\n\n for (o = [], e = 0, i = t.length; i > e;) {\n r = t.charCodeAt(e++), r >= 55296 && 56319 >= r && i > e && (n = t.charCodeAt(e++), 56320 === (64512 & n) ? r = ((1023 & r) << 10) + (1023 & n) + 65536 : e--), o.push(r);\n }\n\n return o;\n }, r = i ? function (t) {\n return String.fromCodePoint.apply(String, t);\n } : function (t) {\n var e, n, i;\n return e = function () {\n var e, o, r;\n\n for (r = [], e = 0, o = t.length; o > e; e++) {\n i = t[e], n = \"\", i > 65535 && (i -= 65536, n += String.fromCharCode(i >>> 10 & 1023 | 55296), i = 56320 | 1023 & i), r.push(n + String.fromCharCode(i));\n }\n\n return r;\n }(), e.join(\"\");\n };\n }.call(this), function () {}.call(this), function () {}.call(this), function () {\n e.config.lang = {\n bold: \"Bold\",\n bullets: \"Bullets\",\n \"byte\": \"Byte\",\n bytes: \"Bytes\",\n captionPlaceholder: \"Add a caption\\u2026\",\n code: \"Code\",\n heading1: \"Heading\",\n indent: \"Increase Level\",\n italic: \"Italic\",\n link: \"Link\",\n numbers: \"Numbers\",\n outdent: \"Decrease Level\",\n quote: \"Quote\",\n redo: \"Redo\",\n remove: \"Remove\",\n strike: \"Strikethrough\",\n undo: \"Undo\",\n unlink: \"Unlink\",\n url: \"URL\",\n urlPlaceholder: \"Enter a URL\\u2026\",\n GB: \"GB\",\n KB: \"KB\",\n MB: \"MB\",\n PB: \"PB\",\n TB: \"TB\"\n };\n }.call(this), function () {\n e.config.css = {\n attachment: \"attachment\",\n attachmentCaption: \"attachment__caption\",\n attachmentCaptionEditor: \"attachment__caption-editor\",\n attachmentMetadata: \"attachment__metadata\",\n attachmentMetadataContainer: \"attachment__metadata-container\",\n attachmentName: \"attachment__name\",\n attachmentProgress: \"attachment__progress\",\n attachmentSize: \"attachment__size\",\n attachmentToolbar: \"attachment__toolbar\",\n attachmentGallery: \"attachment-gallery\"\n };\n }.call(this), function () {\n var t;\n e.config.blockAttributes = t = {\n \"default\": {\n tagName: \"div\",\n parse: !1\n },\n quote: {\n tagName: \"blockquote\",\n nestable: !0\n },\n heading1: {\n tagName: \"h1\",\n terminal: !0,\n breakOnReturn: !0,\n group: !1\n },\n code: {\n tagName: \"pre\",\n terminal: !0,\n text: {\n plaintext: !0\n }\n },\n bulletList: {\n tagName: \"ul\",\n parse: !1\n },\n bullet: {\n tagName: \"li\",\n listAttribute: \"bulletList\",\n group: !1,\n nestable: !0,\n test: function test(n) {\n return e.tagName(n.parentNode) === t[this.listAttribute].tagName;\n }\n },\n numberList: {\n tagName: \"ol\",\n parse: !1\n },\n number: {\n tagName: \"li\",\n listAttribute: \"numberList\",\n group: !1,\n nestable: !0,\n test: function test(n) {\n return e.tagName(n.parentNode) === t[this.listAttribute].tagName;\n }\n },\n attachmentGallery: {\n tagName: \"div\",\n exclusive: !0,\n terminal: !0,\n parse: !1,\n group: !1\n }\n };\n }.call(this), function () {\n var t, n;\n t = e.config.lang, n = [t.bytes, t.KB, t.MB, t.GB, t.TB, t.PB], e.config.fileSize = {\n prefix: \"IEC\",\n precision: 2,\n formatter: function formatter(e) {\n var i, o, r, s, a;\n\n switch (e) {\n case 0:\n return \"0 \" + t.bytes;\n\n case 1:\n return \"1 \" + t[\"byte\"];\n\n default:\n return i = function () {\n switch (this.prefix) {\n case \"SI\":\n return 1e3;\n\n case \"IEC\":\n return 1024;\n }\n }.call(this), o = Math.floor(Math.log(e) / Math.log(i)), r = e / Math.pow(i, o), s = r.toFixed(this.precision), a = s.replace(/0*$/, \"\").replace(/\\.$/, \"\"), a + \" \" + n[o];\n }\n }\n };\n }.call(this), function () {\n e.config.textAttributes = {\n bold: {\n tagName: \"strong\",\n inheritable: !0,\n parser: function parser(t) {\n var e;\n return e = window.getComputedStyle(t), \"bold\" === e.fontWeight || e.fontWeight >= 600;\n }\n },\n italic: {\n tagName: \"em\",\n inheritable: !0,\n parser: function parser(t) {\n var e;\n return e = window.getComputedStyle(t), \"italic\" === e.fontStyle;\n }\n },\n href: {\n groupTagName: \"a\",\n parser: function parser(t) {\n var n, i, o;\n return n = e.AttachmentView.attachmentSelector, o = \"a:not(\" + n + \")\", (i = e.findClosestElementFromNode(t, {\n matchingSelector: o\n })) ? i.getAttribute(\"href\") : void 0;\n }\n },\n strike: {\n tagName: \"del\",\n inheritable: !0\n },\n frozen: {\n style: {\n backgroundColor: \"highlight\"\n }\n }\n };\n }.call(this), function () {\n var t, n, i, o, r;\n r = \"[data-trix-serialize=false]\", o = [\"contenteditable\", \"data-trix-id\", \"data-trix-store-key\", \"data-trix-mutable\", \"data-trix-placeholder\", \"tabindex\"], n = \"data-trix-serialized-attributes\", i = \"[\" + n + \"]\", t = new RegExp(\"\", \"g\"), e.extend({\n serializers: {\n \"application/json\": function applicationJson(t) {\n var n;\n if (t instanceof e.Document) n = t;else {\n if (!(t instanceof HTMLElement)) throw new Error(\"unserializable object\");\n n = e.Document.fromHTML(t.innerHTML);\n }\n return n.toSerializableDocument().toJSONString();\n },\n \"text/html\": function textHtml(s) {\n var a, u, c, l, h, p, d, f, g, m, v, y, b, A, C, x, w;\n if (s instanceof e.Document) l = e.DocumentView.render(s);else {\n if (!(s instanceof HTMLElement)) throw new Error(\"unserializable object\");\n l = s.cloneNode(!0);\n }\n\n for (A = l.querySelectorAll(r), h = 0, g = A.length; g > h; h++) {\n c = A[h], e.removeNode(c);\n }\n\n for (p = 0, m = o.length; m > p; p++) {\n for (a = o[p], C = l.querySelectorAll(\"[\" + a + \"]\"), d = 0, v = C.length; v > d; d++) {\n c = C[d], c.removeAttribute(a);\n }\n }\n\n for (x = l.querySelectorAll(i), f = 0, y = x.length; y > f; f++) {\n c = x[f];\n\n try {\n u = JSON.parse(c.getAttribute(n)), c.removeAttribute(n);\n\n for (b in u) {\n w = u[b], c.setAttribute(b, w);\n }\n } catch (E) {}\n }\n\n return l.innerHTML.replace(t, \"\");\n }\n },\n deserializers: {\n \"application/json\": function applicationJson(t) {\n return e.Document.fromJSONString(t);\n },\n \"text/html\": function textHtml(t) {\n return e.Document.fromHTML(t);\n }\n },\n serializeToContentType: function serializeToContentType(t, n) {\n var i;\n if (i = e.serializers[n]) return i(t);\n throw new Error(\"unknown content type: \" + n);\n },\n deserializeFromContentType: function deserializeFromContentType(t, n) {\n var i;\n if (i = e.deserializers[n]) return i(t);\n throw new Error(\"unknown content type: \" + n);\n }\n });\n }.call(this), function () {\n var t;\n t = e.config.lang, e.config.toolbar = {\n getDefaultHTML: function getDefaultHTML() {\n return '