diff --git a/README.md b/README.md index 24c585d..a341989 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,6 @@ you can write in HTML file or even a markdown file. ``` - ### Scope You can customize scope by passing an object to the scope property. @@ -179,6 +178,42 @@ new Vue({ ``` +### Custom layout + +You can provide a custom layout for vuep to render the editor and preview in. +Add a div with the attribute `vuep-preview` and one with `vuep-editor` so vuep knows where to render these components. + +```html +
+ +
+

My custom preview

+
+

My custom editor

+
+
+
+
+``` + +### Code example iframe + +Vuep can render the code example inside an iframe. This is useful for testing components with elements set to `position: fixed`. + +```html +
+ +
+``` + +Vuep can fit the iframe to its content by setting `fit-iframe`. + +```html +
+ +
+``` + ## Inspired - https://facebook.github.io/react/ diff --git a/dist/vuep.common.js b/dist/vuep.common.js index 15adb71..f1fd153 100644 --- a/dist/vuep.common.js +++ b/dist/vuep.common.js @@ -59,10 +59,199 @@ var Editor = { } }; +var IframeResizer = function IframeResizer ($el) { + this.$el = $el; + this.observer = null; + this.resize = this.resizeIframe.bind(this); +}; + +IframeResizer.prototype.start = function start () { + this.resize(); +}; + +IframeResizer.prototype.stop = function stop () { + this.stopObserve(); +}; + +IframeResizer.prototype.observe = function observe () { + this.bindResizeObserver(); + this.bindLoadObserver(); + this.bindContentObserver(); +}; + +IframeResizer.prototype.stopObserve = function stopObserve () { + this.unbindResizeObserver(); + this.unbindLoadObserver(); + this.unbindContentObserver(); +}; + +IframeResizer.prototype.resizeIframe = function resizeIframe () { + if (!this.$el || !this.$el.contentWindow) { + return + } + this.stopObserve(); + var body = this.$el.contentWindow.document.body; + // Add element for height calculation + var heightEl = document.createElement('div'); + body.appendChild(heightEl); + var padding = getPadding(this.$el); + var bodyOffset = getPadding(body) + getMargin(body); + this.$el.style.height = (heightEl.offsetTop + padding + bodyOffset) + "px"; + body.removeChild(heightEl); + setTimeout(this.observe.bind(this), 100); +}; + +IframeResizer.prototype.bindResizeObserver = function bindResizeObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.addEventListener( + 'resize', + this.resize + ); + } +}; + +IframeResizer.prototype.unbindResizeObserver = function unbindResizeObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.removeEventListener( + 'resize', + this.resize + ); + } +}; + +// Listen for async loaded content (images) +IframeResizer.prototype.bindLoadObserver = function bindLoadObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.document.body.addEventListener( + 'load', + this.resize, + true + ); + } +}; + +IframeResizer.prototype.unbindLoadObserver = function unbindLoadObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.document.body.removeEventListener( + 'load', + this.resize + ); + } +}; + +IframeResizer.prototype.bindContentObserver = function bindContentObserver () { + if (!this.$el || !this.$el.contentWindow) { + return + } + var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; + if (MutationObserver) { + var target = this.$el.contentWindow.document.body; + var config = { + attributes: true, + attributeOldValue: false, + characterData: true, + characterDataOldValue: false, + childList: true, + subtree: true + }; + this.observer = new MutationObserver(this.resize); + this.observer.observe(target, config); + } +}; + +IframeResizer.prototype.unbindContentObserver = function unbindContentObserver () { + if (this.observer) { + this.observer.disconnect(); + } +}; + +function getPadding (e) { + return getProperty(e, 'padding-top') + getProperty(e, 'padding-bottom') +} + +function getMargin (e) { + return getProperty(e, 'margin-top') + getProperty(e, 'margin-bottom') +} + +function getProperty (e, p) { + return parseInt(window.getComputedStyle(e, null).getPropertyValue(p)) +} + +var IframeStyler = function IframeStyler ($el) { + this.$el = $el; + this.observer = null; + this.style = this.styleIframe.bind(this); + this.styleEl = null; + this.styleNodes = []; + this.styles = null; +}; + +IframeStyler.prototype.start = function start () { + this.observe(); + this.style(); +}; + +IframeStyler.prototype.stop = function stop () { + this.stopObserve(); +}; + +IframeStyler.prototype.setStyles = function setStyles (styles) { + this.styles = styles; + this.style(); +}; + +IframeStyler.prototype.observe = function observe () { + var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; + if (MutationObserver) { + var head = document.querySelector('head'); + var config = { attributes: true, childList: true, subtree: true }; + this.observer = new MutationObserver(this.style); + this.observer.observe(head, config); + } +}; + +IframeStyler.prototype.stopObserve = function stopObserve () { + if (this.observer) { + this.observer.disconnect(); + } +}; + +IframeStyler.prototype.styleIframe = function styleIframe () { + var this$1 = this; + + if (!this.$el || !this.$el.contentDocument) { + return + } + var head = this.$el.contentDocument.head; + // Remove old styles + if (this.styleEl) { + head.removeChild(this.styleEl); + } + for (var key in this$1.styleNodes) { + head.removeChild(this$1.styleNodes[key]); + } + // Set new styles + this.styleEl = document.createElement('style'); + this.styleEl.appendChild(document.createTextNode(this.styles)); + this.styleNodes = []; + var documentStyles = getDocumentStyle(); + for (var key$1 in documentStyles) { + this$1.styleNodes[key$1] = documentStyles[key$1].cloneNode(true); + head.appendChild(this$1.styleNodes[key$1]); + } + head.appendChild(this.styleEl); +}; + +function getDocumentStyle () { + var links = document.querySelectorAll('link[rel="stylesheet"]'); + var styles = document.querySelectorAll('style'); + return Array.from(links).concat(Array.from(styles)) +} + var Preview = { name: 'preview', - props: ['value', 'styles', 'keepData', 'iframe'], + props: ['value', 'styles', 'keepData', 'iframe', 'fitIframe', 'iframeClass'], render: function render (h) { this.className = 'vuep-scoped-' + this._uid; @@ -74,6 +263,13 @@ var Preview = { ]) }, + data: function data () { + return { + resizer: null, + styler: null + } + }, + computed: { scopedStyle: function scopedStyle () { return this.styles @@ -83,17 +279,59 @@ var Preview = { }, mounted: function mounted () { + var this$1 = this; + this.$watch('value', this.renderCode, { immediate: true }); if (this.iframe) { - this.$el.addEventListener('load', this.renderCode); + // Firefox needs the iframe to be loaded + if (this.$el.contentDocument.readyState === 'complete') { + this.initIframe(); + } else { + this.$el.addEventListener('load', this.initIframe); + } + this.$watch('fitIframe', function (fitIframe) { + fitIframe ? this$1.startResizer() : this$1.stopResizer(); + }, { immediate: true }); } }, beforeDestroy: function beforeDestroy () { if (this.iframe) { - this.$el.removeEventListener('load', this.renderCode); + this.$el.removeEventListener('load', this.initIframe); + this.cleanupIframe(); } }, methods: { + initIframe: function initIframe () { + this.resizer = new IframeResizer(this.$el); + this.styler = new IframeStyler(this.$el); + this.renderCode(); + this.startStyler(); + }, + cleanupIframe: function cleanupIframe () { + this.stopResizer(); + this.stopStyler(); + }, + startResizer: function startResizer () { + if (this.resizer) { + this.resizer.start(); + } + }, + stopResizer: function stopResizer () { + if (this.resizer) { + this.resizer.stop(); + } + }, + startStyler: function startStyler () { + if (this.styler) { + this.styler.start(); + this.styler.setStyles(this.styles); + } + }, + stopStyler: function stopStyler () { + if (this.styler) { + this.styler.stop(); + } + }, renderCode: function renderCode () { var this$1 = this; @@ -115,22 +353,10 @@ var Preview = { container.appendChild(this.codeEl); if (this.iframe) { - var head = this.$el.contentDocument.head; - if (this.styleEl) { - head.removeChild(this.styleEl); - for (var key in this$1.styleNodes) { - head.removeChild(this$1.styleNodes[key]); - } + container.classList.add(this.iframeClass); + if (this.styler) { + this.styler.setStyles(this.styles); } - this.styleEl = document.createElement('style'); - this.styleEl.appendChild(document.createTextNode(this.styles)); - this.styleNodes = []; - var documentStyles = getDocumentStyle(); - for (var key$1 in documentStyles) { - this$1.styleNodes[key$1] = documentStyles[key$1].cloneNode(true); - head.appendChild(this$1.styleNodes[key$1]); - } - head.appendChild(this.styleEl); } try { @@ -138,8 +364,8 @@ var Preview = { this.codeVM = new Vue$1(assign({}, {parent: parent}, val)).$mount(this.codeEl); if (lastData) { - for (var key$2 in lastData) { - this$1.codeVM[key$2] = lastData[key$2]; + for (var key in lastData) { + this$1.codeVM[key] = lastData[key]; } } } catch (e) { @@ -157,12 +383,6 @@ function insertScope (style, scope) { }) } -function getDocumentStyle () { - var links = document.querySelectorAll('link[rel="stylesheet"]'); - var styles = document.querySelectorAll('style'); - return Array.from(links).concat(Array.from(styles)) -} - var parser = function (input) { var html = document.createElement('div'); var content = html.innerHTML = input.trim(); @@ -290,7 +510,12 @@ var Vuep$2 = { keepData: Boolean, value: String, scope: Object, - iframe: Boolean + iframe: Boolean, + fitIframe: Boolean, + iframeClass: { + type: String, + default: 'vuep-iframe-preview' + } }, data: function data () { @@ -319,7 +544,9 @@ var Vuep$2 = { value: this.preview, styles: this.styles, keepData: this.keepData, - iframe: this.iframe + iframe: this.iframe, + fitIframe: this.fitIframe, + iframeClass: this.iframeClass }, on: { error: this.handleError @@ -327,19 +554,31 @@ var Vuep$2 = { }); } - return h('div', { class: 'vuep' }, [ - h(Editor, { - class: 'vuep-editor', - props: { - value: this.content, - options: this.options + var editor = h(Editor, { + class: 'vuep-editor', + props: { + value: this.content, + options: this.options + }, + on: { + change: [this.executeCode, function (val) { return this$1.$emit('input', val); }] + } + }); + + var children = [editor, win]; + if (this.$slots.default) { + children = this.addSlots(h, this.$slots.default, [ + { + name: 'vuep-preview', + child: win }, - on: { - change: [this.executeCode, function (val) { return this$1.$emit('input', val); }] + { + name: 'vuep-editor', + child: editor } - }), - win - ]) + ]); + } + return h('div', { class: 'vuep' }, children) }, watch: { @@ -371,6 +610,26 @@ var Vuep$2 = { }, methods: { + addSlots: function addSlots (h, vnodes, slots) { + var this$1 = this; + + return vnodes.map(function (vnode) { + var children = []; + slots.forEach(function (ref) { + var name = ref.name; + var child = ref.child; + + if (vnode.data && vnode.data.attrs && vnode.data.attrs[name] !== undefined) { + children = [child]; + } + }); + if (!children.length && vnode.children && vnode.children.length) { + children = this$1.addSlots(h, vnode.children, slots); + } + return h(vnode.tag, vnode.data, children) + }) + }, + handleError: function handleError (err) { /* istanbul ignore next */ this.error = err; diff --git a/dist/vuep.js b/dist/vuep.js index 1036ab6..c14869f 100644 --- a/dist/vuep.js +++ b/dist/vuep.js @@ -9293,10 +9293,199 @@ var Editor = { } }; +var IframeResizer = function IframeResizer ($el) { + this.$el = $el; + this.observer = null; + this.resize = this.resizeIframe.bind(this); +}; + +IframeResizer.prototype.start = function start () { + this.resize(); +}; + +IframeResizer.prototype.stop = function stop () { + this.stopObserve(); +}; + +IframeResizer.prototype.observe = function observe () { + this.bindResizeObserver(); + this.bindLoadObserver(); + this.bindContentObserver(); +}; + +IframeResizer.prototype.stopObserve = function stopObserve () { + this.unbindResizeObserver(); + this.unbindLoadObserver(); + this.unbindContentObserver(); +}; + +IframeResizer.prototype.resizeIframe = function resizeIframe () { + if (!this.$el || !this.$el.contentWindow) { + return + } + this.stopObserve(); + var body = this.$el.contentWindow.document.body; + // Add element for height calculation + var heightEl = document.createElement('div'); + body.appendChild(heightEl); + var padding = getPadding(this.$el); + var bodyOffset = getPadding(body) + getMargin(body); + this.$el.style.height = (heightEl.offsetTop + padding + bodyOffset) + "px"; + body.removeChild(heightEl); + setTimeout(this.observe.bind(this), 100); +}; + +IframeResizer.prototype.bindResizeObserver = function bindResizeObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.addEventListener( + 'resize', + this.resize + ); + } +}; + +IframeResizer.prototype.unbindResizeObserver = function unbindResizeObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.removeEventListener( + 'resize', + this.resize + ); + } +}; + +// Listen for async loaded content (images) +IframeResizer.prototype.bindLoadObserver = function bindLoadObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.document.body.addEventListener( + 'load', + this.resize, + true + ); + } +}; + +IframeResizer.prototype.unbindLoadObserver = function unbindLoadObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.document.body.removeEventListener( + 'load', + this.resize + ); + } +}; + +IframeResizer.prototype.bindContentObserver = function bindContentObserver () { + if (!this.$el || !this.$el.contentWindow) { + return + } + var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; + if (MutationObserver) { + var target = this.$el.contentWindow.document.body; + var config = { + attributes: true, + attributeOldValue: false, + characterData: true, + characterDataOldValue: false, + childList: true, + subtree: true + }; + this.observer = new MutationObserver(this.resize); + this.observer.observe(target, config); + } +}; + +IframeResizer.prototype.unbindContentObserver = function unbindContentObserver () { + if (this.observer) { + this.observer.disconnect(); + } +}; + +function getPadding (e) { + return getProperty(e, 'padding-top') + getProperty(e, 'padding-bottom') +} + +function getMargin (e) { + return getProperty(e, 'margin-top') + getProperty(e, 'margin-bottom') +} + +function getProperty (e, p) { + return parseInt(window.getComputedStyle(e, null).getPropertyValue(p)) +} + +var IframeStyler = function IframeStyler ($el) { + this.$el = $el; + this.observer = null; + this.style = this.styleIframe.bind(this); + this.styleEl = null; + this.styleNodes = []; + this.styles = null; +}; + +IframeStyler.prototype.start = function start () { + this.observe(); + this.style(); +}; + +IframeStyler.prototype.stop = function stop () { + this.stopObserve(); +}; + +IframeStyler.prototype.setStyles = function setStyles (styles) { + this.styles = styles; + this.style(); +}; + +IframeStyler.prototype.observe = function observe () { + var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; + if (MutationObserver) { + var head = document.querySelector('head'); + var config = { attributes: true, childList: true, subtree: true }; + this.observer = new MutationObserver(this.style); + this.observer.observe(head, config); + } +}; + +IframeStyler.prototype.stopObserve = function stopObserve () { + if (this.observer) { + this.observer.disconnect(); + } +}; + +IframeStyler.prototype.styleIframe = function styleIframe () { + var this$1 = this; + + if (!this.$el || !this.$el.contentDocument) { + return + } + var head = this.$el.contentDocument.head; + // Remove old styles + if (this.styleEl) { + head.removeChild(this.styleEl); + } + for (var key in this$1.styleNodes) { + head.removeChild(this$1.styleNodes[key]); + } + // Set new styles + this.styleEl = document.createElement('style'); + this.styleEl.appendChild(document.createTextNode(this.styles)); + this.styleNodes = []; + var documentStyles = getDocumentStyle(); + for (var key$1 in documentStyles) { + this$1.styleNodes[key$1] = documentStyles[key$1].cloneNode(true); + head.appendChild(this$1.styleNodes[key$1]); + } + head.appendChild(this.styleEl); +}; + +function getDocumentStyle () { + var links = document.querySelectorAll('link[rel="stylesheet"]'); + var styles = document.querySelectorAll('style'); + return Array.from(links).concat(Array.from(styles)) +} + var Preview = { name: 'preview', - props: ['value', 'styles', 'keepData', 'iframe'], + props: ['value', 'styles', 'keepData', 'iframe', 'fitIframe', 'iframeClass'], render: function render (h) { this.className = 'vuep-scoped-' + this._uid; @@ -9308,6 +9497,13 @@ var Preview = { ]) }, + data: function data () { + return { + resizer: null, + styler: null + } + }, + computed: { scopedStyle: function scopedStyle () { return this.styles @@ -9317,17 +9513,59 @@ var Preview = { }, mounted: function mounted () { + var this$1 = this; + this.$watch('value', this.renderCode, { immediate: true }); if (this.iframe) { - this.$el.addEventListener('load', this.renderCode); + // Firefox needs the iframe to be loaded + if (this.$el.contentDocument.readyState === 'complete') { + this.initIframe(); + } else { + this.$el.addEventListener('load', this.initIframe); + } + this.$watch('fitIframe', function (fitIframe) { + fitIframe ? this$1.startResizer() : this$1.stopResizer(); + }, { immediate: true }); } }, beforeDestroy: function beforeDestroy () { if (this.iframe) { - this.$el.removeEventListener('load', this.renderCode); + this.$el.removeEventListener('load', this.initIframe); + this.cleanupIframe(); } }, methods: { + initIframe: function initIframe () { + this.resizer = new IframeResizer(this.$el); + this.styler = new IframeStyler(this.$el); + this.renderCode(); + this.startStyler(); + }, + cleanupIframe: function cleanupIframe () { + this.stopResizer(); + this.stopStyler(); + }, + startResizer: function startResizer () { + if (this.resizer) { + this.resizer.start(); + } + }, + stopResizer: function stopResizer () { + if (this.resizer) { + this.resizer.stop(); + } + }, + startStyler: function startStyler () { + if (this.styler) { + this.styler.start(); + this.styler.setStyles(this.styles); + } + }, + stopStyler: function stopStyler () { + if (this.styler) { + this.styler.stop(); + } + }, renderCode: function renderCode () { var this$1 = this; @@ -9349,22 +9587,10 @@ var Preview = { container.appendChild(this.codeEl); if (this.iframe) { - var head = this.$el.contentDocument.head; - if (this.styleEl) { - head.removeChild(this.styleEl); - for (var key in this$1.styleNodes) { - head.removeChild(this$1.styleNodes[key]); - } - } - this.styleEl = document.createElement('style'); - this.styleEl.appendChild(document.createTextNode(this.styles)); - this.styleNodes = []; - var documentStyles = getDocumentStyle(); - for (var key$1 in documentStyles) { - this$1.styleNodes[key$1] = documentStyles[key$1].cloneNode(true); - head.appendChild(this$1.styleNodes[key$1]); + container.classList.add(this.iframeClass); + if (this.styler) { + this.styler.setStyles(this.styles); } - head.appendChild(this.styleEl); } try { @@ -9372,8 +9598,8 @@ var Preview = { this.codeVM = new Vue$1(assign({}, {parent: parent}, val)).$mount(this.codeEl); if (lastData) { - for (var key$2 in lastData) { - this$1.codeVM[key$2] = lastData[key$2]; + for (var key in lastData) { + this$1.codeVM[key] = lastData[key]; } } } catch (e) { @@ -9391,12 +9617,6 @@ function insertScope (style, scope) { }) } -function getDocumentStyle () { - var links = document.querySelectorAll('link[rel="stylesheet"]'); - var styles = document.querySelectorAll('style'); - return Array.from(links).concat(Array.from(styles)) -} - var parser = function (input) { var html = document.createElement('div'); var content = html.innerHTML = input.trim(); @@ -9524,7 +9744,12 @@ var Vuep$1 = { keepData: Boolean, value: String, scope: Object, - iframe: Boolean + iframe: Boolean, + fitIframe: Boolean, + iframeClass: { + type: String, + default: 'vuep-iframe-preview' + } }, data: function data () { @@ -9553,7 +9778,9 @@ var Vuep$1 = { value: this.preview, styles: this.styles, keepData: this.keepData, - iframe: this.iframe + iframe: this.iframe, + fitIframe: this.fitIframe, + iframeClass: this.iframeClass }, on: { error: this.handleError @@ -9561,19 +9788,31 @@ var Vuep$1 = { }); } - return h('div', { class: 'vuep' }, [ - h(Editor, { - class: 'vuep-editor', - props: { - value: this.content, - options: this.options + var editor = h(Editor, { + class: 'vuep-editor', + props: { + value: this.content, + options: this.options + }, + on: { + change: [this.executeCode, function (val) { return this$1.$emit('input', val); }] + } + }); + + var children = [editor, win]; + if (this.$slots.default) { + children = this.addSlots(h, this.$slots.default, [ + { + name: 'vuep-preview', + child: win }, - on: { - change: [this.executeCode, function (val) { return this$1.$emit('input', val); }] + { + name: 'vuep-editor', + child: editor } - }), - win - ]) + ]); + } + return h('div', { class: 'vuep' }, children) }, watch: { @@ -9605,6 +9844,26 @@ var Vuep$1 = { }, methods: { + addSlots: function addSlots (h, vnodes, slots) { + var this$1 = this; + + return vnodes.map(function (vnode) { + var children = []; + slots.forEach(function (ref) { + var name = ref.name; + var child = ref.child; + + if (vnode.data && vnode.data.attrs && vnode.data.attrs[name] !== undefined) { + children = [child]; + } + }); + if (!children.length && vnode.children && vnode.children.length) { + children = this$1.addSlots(h, vnode.children, slots); + } + return h(vnode.tag, vnode.data, children) + }) + }, + handleError: function handleError (err) { /* istanbul ignore next */ this.error = err; diff --git a/dist/vuep.min.js b/dist/vuep.min.js index 787b8c6..f8bba92 100644 --- a/dist/vuep.min.js +++ b/dist/vuep.min.js @@ -1,9 +1,9 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue/dist/vue.common")):"function"==typeof define&&define.amd?define(["exports","vue/dist/vue.common"],t):t(e.Vuep=e.Vuep||{},e.Vue)}(this,function(e,t){"use strict";function r(e,t){return t={exports:{}},e(t,t.exports),t.exports}function n(e,t){var r=/(^|\})\s*([^{]+)/g;return e.trim().replace(r,function(e,r,n){return r?r+" "+t+" "+n:t+" "+n})}function i(){var e=document.querySelectorAll('link[rel="stylesheet"]'),t=document.querySelectorAll("style");return Array.from(e).concat(Array.from(t))}function o(e){if(v.test(e))return a(e)}function a(e){var t=new XMLHttpRequest;if(y[e])return y[e];t.open("GET",e,!1),t.send();var r=t.responseText;return y[e]=l(r),y[e]}function l(e,t){if(void 0===t&&(t={}),"undefined"!=typeof Babel){var r=[];window["babel-plugin-transform-vue-jsx"]&&(Babel.availablePlugins["transform-vue-jsx"]||Babel.registerPlugin("transform-vue-jsx",window["babel-plugin-transform-vue-jsx"]),r.push("transform-vue-jsx")),e=Babel.transform(e,{presets:[["es2015",{loose:!0}],"stage-2"],plugins:r,comments:!1}).code}var n="";for(var i in t)t.hasOwnProperty(i)&&(n+="var "+i+" = __vuep['"+i+"'];");e="(function(exports){var module={};module.exports=exports;"+n+";"+e+";return module.exports.__esModule?module.exports.default:module.exports;})({})";var o=new Function("__vuep","return "+e)(t)||{};return o}function s(e,t){w.config(t),e.component(w.name,w)}t="default"in t?t.default:t;var c="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},u=r(function(e,t){!function(r,n){"object"==typeof t&&"undefined"!=typeof e?e.exports=n():r.CodeMirror=n()}(c,function(){function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}function d(e,t){for(var r=0;r=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function p(e){for(;Sa.length<=e;)Sa.push(h(Sa)+" ");return Sa[e]}function h(e){return e[e.length-1]}function m(e,t){for(var r=[],n=0;n"€"&&(e.toUpperCase()!=e.toLowerCase()||Ma.test(e))}function w(e,t){return t?!!(t.source.indexOf("\\w")>-1&&b(e))||t.test(e):b(e)}function x(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function k(e){return e.charCodeAt(0)>=768&&La.test(e)}function C(e,t,r){for(;(r<0?t>0:t=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&tr?P(r,L(e,r).text.length):$(t,L(e,t.line).text.length)}function $(e,t){var r=e.ch;return null==r||r>t?P(e.line,t):r<0?P(e.line,0):e}function q(e,t){for(var r=[],n=0;n=t:o.to>t);(n||(n=[])).push(new K(a,o.from,s?null:o.to))}}return n}function Z(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&l)for(var x=0;x0)){var u=[s,1],f=j(c.from,l.from),p=j(c.to,l.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}function te(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?j(c.to,r)>=0:j(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?j(c.from,n)<=0:j(c.from,n)<0)))return!0}}}function ue(e){for(var t;t=le(e);)e=t.find(-1,!0).line;return e}function de(e){for(var t;t=se(e);)e=t.find(1,!0).line;return e}function fe(e){for(var t,r;t=se(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function pe(e,t){var r=L(e,t),n=ue(r);return r==n?t:N(n)}function he(e,t){if(t>e.lastLine())return t;var r,n=L(e,t);if(!me(e,n))return t;for(;r=se(n);)n=r.find(1,!0).line;return N(n)+1}function me(e,t){var r=Aa&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function we(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;ot||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function xe(e,t,r){var n;za=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:za=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:za=i)}return null!=n?n:za}function ke(e){var t=e.order;return null==t&&(t=e.order=Na(e.text)),t}function Ce(e,t,r){var n=C(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Se(e,t,r){var n=Ce(e,t.ch,r);return null==n?null:new P(t.line,n,r<0?"after":"before")}function Me(e,t,r,n,i){if(e){var o=ke(r);if(o){var a,l=i<0?h(o):o[0],s=i<0==(1==l.level),c=s?"after":"before";if(l.level>0){var u=Xt(t,r);a=i<0?r.text.length-1:0;var d=Yt(t,u,a).top;a=S(function(e){return Yt(t,u,e).top==d},i<0==(1==l.level)?l.from:l.to-1,a),"before"==c&&(a=Ce(r,a,1,!0))}else a=i<0?l.to:l.from;return new P(n,a,c)}}return new P(n,i<0?r.text.length:0,i<0?"before":"after")}function Le(e,t,r,n){var i=ke(t);if(!i)return Se(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=xe(i,r.ch,r.sticky),a=i[o];if(a.level%2==0&&(n>0?a.to>r.ch:a.from0?d>=a.from&&d>=u.begin:d<=a.to&&d<=u.end)){var f=n<0?"before":"after";return new P(r.line,d,f)}}var p=function(e,t,n){for(var o=function(e,t){return t?new P(r.line,s(e,1),"before"):new P(r.line,e,"after")};e>=0&&e0==(1!=a.level),c=l?n.begin:s(n.end,-1);if(a.from<=c&&c0?u.end:s(u.begin,-1);return null==m||n>0&&m==t.text.length||!(h=p(n>0?0:i.length-1,n,c(m)))?null:h}function Te(e,t){return e._handlers&&e._handlers[t]||Oa}function Ae(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=d(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ze(e,t){var r=Te(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function Ee(e){e.prototype.on=function(e,t){Wa(this,e,t)},e.prototype.off=function(e,t){Ae(this,e,t)}}function Pe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function je(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function He(e){Pe(e),je(e)}function Ie(e){return e.target||e.srcElement}function Fe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),la&&e.ctrlKey&&1==t&&(t=3),t}function Be(e){if(null==va){var t=n("span","​");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(va=t.offsetWidth<=1&&t.offsetHeight>2&&!(Yo&&Zo<8))}var i=va?n("span","​"):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Re(e){if(null!=ya)return ya;var n=r(e,document.createTextNode("AخA")),i=da(n,0,1).getBoundingClientRect(),o=da(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(ya=o.right-i.right<3)}function $e(e){if(null!=Ha)return Ha;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=da(t,0,1).getBoundingClientRect();return Ha=Math.abs(i.left-o.left)>1}function qe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ia[e]=t}function Ve(e,t){Fa[e]=t}function Ue(e){if("string"==typeof e&&Fa.hasOwnProperty(e))e=Fa[e];else if(e&&"string"==typeof e.name&&Fa.hasOwnProperty(e.name)){var t=Fa[e.name];"string"==typeof t&&(t={name:t}),e=y(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ue("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ue("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ke(e,t){t=Ue(t);var r=Ia[t.name];if(!r)return Ke(e,"text/plain");var n=r(e,t);if(Ba.hasOwnProperty(t.name)){var i=Ba[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}function Ge(e,t){var r=Ba.hasOwnProperty(e)?Ba[e]:Ba[e]={};c(t,r)}function _e(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Xe(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),r&&r.mode!=e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ye(e,t,r){return!e.startState||e.startState(t,r)}function Ze(e,t,r,n){var i=[e.state.modeGen],o={};ot(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=function(r){var n=e.state.overlays[r],a=1,l=0;ot(e,t.text,n.mode,!0,function(e,t){for(var r=a;le&&i.splice(a,1,e,i[a+1],o),a+=2,l=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;re.options.maxHighlightLength?_e(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Je(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=at(e,t,r),a=o>n.first&&L(n,o-1).stateAfter;return a=a?_e(n.mode,a):Ye(n.mode),n.iter(o,t,function(r){et(e,r.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&ot.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function nt(e,t,r,n){var i,o=function(e){return{start:d.start,end:d.pos,string:d.current(),type:i||null,state:e?_e(a.mode,u):u}},a=e.doc,l=a.mode;t=R(a,t);var s,c=L(a,t.line),u=Je(e,t.line,r),d=new Ra(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pose.options.maxHighlightLength?(l=!1,a&&et(e,t,n,d.pos),d.pos=t.length,s=null):s=it(rt(r,d,n,f),o),f){var p=f[0].name;p&&(s="m-"+(s?p+" "+s:p))}if(!l||u!=s){for(;ca;--l){if(l<=o.first)return o.first;var s=L(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var c=u(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}function lt(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),te(e),re(e,r);var i=n?n(e):1;i!=e.height&&z(e,i)}function st(e){e.parent=null,te(e)}function ct(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Ua:Va;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ut(e,t){var r=n("span",null,null,Qo?"padding-right: .1px":null),i={pre:n("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(Yo||Qo)&&e.getOption("lineWrapping")};r.setAttribute("role","presentation"),i.pre.setAttribute("role","presentation"),t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,s=void 0;i.pos=0,i.addToken=ft,Re(e.display.measure)&&(s=ke(a))&&(i.addToken=ht(i.addToken,s)),i.map=[];var c=t!=e.display.externalMeasured&&N(a);gt(a,i,Qe(e,a,c)),a.styleClasses&&(a.styleClasses.bgClass&&(i.bgClass=l(a.styleClasses.bgClass,i.bgClass||"")),a.styleClasses.textClass&&(i.textClass=l(a.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Be(e.display.measure))),0==o?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Qo){var u=i.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return ze(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=l(i.pre.className,i.textClass||"")),i}function dt(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ft(e,t,r,i,o,a,l){if(t){var s,c=e.splitSpaces?pt(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1;if(u.test(t)){s=document.createDocumentFragment();for(var f=0;;){u.lastIndex=f;var h=u.exec(t),m=h?h.index-f:t.length-f;if(m){var g=document.createTextNode(c.slice(f,f+m));Yo&&Zo<9?s.appendChild(n("span",[g])):s.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;f+=m+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=s.appendChild(n("span",p(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(v=s.appendChild(n("span","\r"==h[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",h[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(h[0]),v.setAttribute("cm-text",h[0]),Yo&&Zo<9?s.appendChild(n("span",[v])):s.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,s=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,s),Yo&&Zo<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||i||o||d||l){var w=r||"";i&&(w+=i),o&&(w+=o);var x=n("span",[s],w,l);return a&&(x.title=a),e.content.appendChild(x)}e.content.appendChild(s)}}function pt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;ic&&d.from<=c));f++);if(d.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-c),i,o,null,l,s),o=null,n=n.slice(d.to-c),c=d.to}}}function mt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function gt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){s=c=u=d=l="",f=null,v=1/0;for(var y=[],b=void 0,w=0;wh||k.collapsed&&x.to==h&&x.from==h)?(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==h&&(u+=" "+k.startStyle),k.endStyle&&x.to==v&&(b||(b=[])).push(k.endStyle,x.to),k.title&&!d&&(d=k.title),k.collapsed&&(!f||oe(f.marker,k)<0)&&(f=x)):x.from>h&&v>x.from&&(v=x.from)}if(b)for(var C=0;C=p)break;for(var M=Math.min(p,v);;){if(g){var L=h+g.length;if(!f){var T=L>M?g.slice(0,M-h):g;t.addToken(t,T,a?a+s:s,u,h+T.length==v?c:"",d,l)}if(L>=M){g=g.slice(M-h),h=M;break}h=L,u=""}g=i.slice(o,o=r[m++]),a=ct(r[m++],t.cm.options)}}else for(var A=1;A2&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Ut(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Kt(e,t){t=ue(t);var n=N(t),i=e.display.externalMeasured=new vt(e.doc,t,n);i.lineN=n;var o=i.built=ut(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function Gt(e,t,r,n){return Yt(e,Xt(e,t),r,n)}function _t(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(o=s-l,i=o-1,t>=s&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[(c-=3)+2],a="left";if("right"==r&&i==s-l)for(;c=0&&(r=e[i]).left==r.right;i--);return r}function Jt(e,t,r,n){var i,o=Zt(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&k(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s0&&(c=n="right");var d;i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(Yo&&Zo<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+vr(e.display),top:f.top,bottom:f.bottom}:_a}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,g=t.view.measure.heights,v=0;v=n.text.length?(c=n.text.length,u="before"):c<=0&&(c=0,u="after"),!s)return a("before"==u?c-1:c,"before"==u);var d=xe(s,c,u),f=za,p=l(c,d,"before"==u);return null!=f&&(p.other=l(c,f,"before"!=u)),p}function ur(e,t){var r=0;t=R(e.doc,t),e.options.lineWrapping||(r=vr(e.display)*t.ch);var n=L(e.doc,t.line),i=ve(n)+It(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function dr(e,t,r,n,i){var o=P(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function fr(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return dr(n.first,0,null,!0,-1);var i=O(n,r),o=n.first+n.size-1;if(i>o)return dr(n.first+n.size-1,L(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=L(n,i);;){var l=mr(e,a,i,t,r),s=se(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=N(a=c.to.line)}}function pr(e,t,r,n){var i=function(n){return ar(e,t,Yt(e,r,n),"line")},o=t.text.length,a=S(function(e){return i(e-1).bottom<=n},o,0);return o=S(function(e){return i(e).top>n},a,o),{begin:a,end:o}}function hr(e,t,r,n){var i=ar(e,t,Yt(e,r,n),"line").top;return pr(e,t,r,i)}function mr(e,t,r,n,i){i-=ve(t);var o,a=0,l=t.text.length,s=Xt(e,t),c=ke(t);if(c){if(e.options.lineWrapping){var u;u=pr(e,t,s,i),a=u.begin,l=u.end,u}o=new P(r,a);var d,f,p=cr(e,o,"line",t,s).left,h=pMath.abs(d)){if(m<0==d<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=f}}else{var g=S(function(r){var o=ar(e,t,Yt(e,s,r),"line");return o.top>i?(l=Math.min(r,l),!0):!(o.bottom<=i)&&(o.left>n||!(o.rightv.right?1:0,o}function gr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==qa){qa=n("pre");for(var i=0;i<49;++i)qa.appendChild(document.createTextNode("x")),qa.appendChild(n("br"));qa.appendChild(document.createTextNode("x"))}r(e.measure,qa);var o=qa.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function vr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function yr(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:br(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function br(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function wr(e){var t=gr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/vr(e.display)-3);return function(i){if(me(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n=e.display.viewTo||l.to().line3&&(i(p,m.top,null,m.bottom),p=u,m.bottoms.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),p0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function zr(e){e.state.focused||(e.display.input.focus(),Or(e))}function Nr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Wr(e))},100)}function Or(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ze(e,"focus",e,t),e.state.focused=!0,a(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Qo&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ar(e))}function Wr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ze(e,"blur",e,t),e.state.focused=!1,ha(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Er(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=br(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a.001||s<-.001)&&(z(i.line,o),Dr(i.line),i.rest))for(var c=0;c=a&&(o=O(t,ve(L(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Ir(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Ko||Sn(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Ko&&Sn(e),bn(e,100))}function Fr(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Er(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Br(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function Rr(e){var t=Br(e);return t.x*=Ya,t.y*=Ya,t}function $r(e,t){var r=Br(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&la&&Qo)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!ia){var a=n("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-It(e.display))+"px;\n height: "+(t.bottom-t.top+Rt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function _r(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var a=!1;i=cr(e,t);var l=r&&r!=t?cr(e,r):i,s=Yr(e,Math.min(i.left,l.left),Math.min(i.top,l.top)-n,Math.max(i.left,l.left),Math.max(i.bottom,l.bottom)+n),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(Ir(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=s.scrollLeft&&(Fr(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(a=!0)),!a)break}return i}function Xr(e,t,r,n,i){var o=Yr(e,t,r,n,i);null!=o.scrollTop&&Ir(e,o.scrollTop),null!=o.scrollLeft&&Fr(e,o.scrollLeft)}function Yr(e,t,r,n,i){var o=e.display,a=gr(e.display);r<0&&(r=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=qt(e),c={};i-r>s&&(i=r+s);var u=e.doc.height+Ft(o),d=ru-a;if(rl+s){var p=Math.min(r,(f?u:i)-s);p!=l&&(c.scrollTop=p)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=$t(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=n-t>m;return g&&(n=t+m),t<10?c.scrollLeft=0:tm+h-3&&(c.scrollLeft=n+(g?0:10)-m),c}function Zr(e,t,r){null==t&&null==r||Jr(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Qr(e){Jr(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?P(t.line,t.ch-1):t,n=P(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Jr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=ur(e,t.from),n=ur(e,t.to),i=Yr(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function en(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++el},bt(e.curOp)}function tn(e){var t=e.curOp;xt(t,function(e){for(var t=0;t=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new tl(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function on(e){e.updatedDisplay=e.mustUpdate&&kn(e.cm,e.update)}function an(e){var t=e.cm,r=t.display;e.updatedDisplay&&jr(t),e.barMeasure=qr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Gt(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Rt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-$t(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function ln(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Aa&&pe(e.doc,t)i.viewFrom?mn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)mn(e);else if(t<=i.viewFrom){var o=gn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):mn(e)}else if(r>=i.viewTo){var a=gn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):mn(e)}else{var l=gn(e,t,t,-1),s=gn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(yt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):mn(e)}var c=i.externalMeasured;c&&(r=i.lineN&&t=n.viewTo)){var o=n.view[Cr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);d(a,r)==-1&&a.push(r)}}}function mn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function gn(e,t,r,n){var i,o=Cr(e,t),a=e.display.view;if(!Aa||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;pe(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function vn(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=yt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=yt(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Cr(e,r)))),n.viewTo=r}function yn(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo)){var r=+new Date+e.options.workTime,n=_e(t.mode,Je(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Ze(e,o,l?_e(t.mode,n):n,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&fr)return bn(e,e.options.workDelay),!0}),i.length&&cn(e,function(){for(var t=0;t=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==yn(e))return!1;Pr(e)&&(mn(e),r.dims=yr(e));var a=i.first+i.size,l=Math.max(r.visible.from-e.options.viewportMargin,i.first),s=Math.min(a,r.visible.to+e.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(a,n.viewTo)),Aa&&(l=pe(e.doc,l),s=he(e.doc,s));var c=l!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;vn(e,l,s),n.viewOffset=ve(L(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=yn(e);if(!c&&0==u&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var d=o();return u>4&&(n.lineDiv.style.display="none"),Mn(e,n.updateLineNumbers,r.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,d&&o()!=d&&d.offsetHeight&&d.focus(),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,c&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,bn(e,400)),n.updateLineNumbers=null,!0}function Cn(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=$t(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Ft(e.display)-qt(e),r.top)}),t.visible=Hr(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&kn(e,t);n=!1){jr(e);var i=qr(e);Sr(e),Vr(e,i),Tn(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Sn(e,t){var r=new tl(e,t);if(kn(e,r)){jr(e),Cn(e,r);var n=qr(e);Sr(e),Vr(e,n),Tn(e,n),r.finish()}}function Mn(e,r,n){function i(t){var r=t.nextSibling;return Qo&&la&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,a=e.options.lineNumbers,l=o.lineDiv,s=l.firstChild,c=o.view,u=o.viewFrom,f=0;f-1&&(h=!1),St(e,p,u,n)),h&&(t(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(E(e.options,u)))),s=p.node.nextSibling}else{var m=Wt(e,p,u,n);l.insertBefore(m,s)}u+=p.size}for(;s;)s=i(s)}function Ln(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Tn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Rt(e)+"px"}function An(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Nn(e,t){var r=e[t];e.sort(function(e,t){return j(e.from(),t.from())}),t=d(e,r);for(var n=1;n=0){var a=F(o.from(),i.from()),l=I(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new nl(s?l:a,s?a:l))}}return new rl(e,t)}function On(e,t){return new rl([new nl(e,t||e)],0)}function Wn(e){return e.text?P(e.from.line+e.text.length-1,h(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function En(e,t){if(j(e,t.from)<0)return e;if(j(e,t.to)<=0)return Wn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Wn(t).ch-t.to.ch),P(r,n)}function Pn(e,t){for(var r=[],n=0;n1&&e.remove(l.line+1,m-1),e.insert(l.line+1,y)}kt(e,"change",e,t)}function Rn(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),h(e.done)):void 0}function Gn(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Kn(i,i.lastOp==n)))a=h(o.changes),0==j(t.from,t.to)&&0==j(t.from,a.to)?a.to=Wn(t):o.changes.push(Vn(e,t));else{var s=h(i.done);for(s&&s.ranges||Yn(e.sel,i.done),o={changes:[Vn(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||ze(e,"historyAdded")}function _n(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Xn(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||_n(e,o,h(i.done),t))?i.done[i.done.length-1]=t:Yn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&Un(i.undone)}function Yn(e,t){var r=h(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Zn(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function Qn(e){if(!e)return null;for(var t,r=0;r-1&&(h(l)[f]=c[f],delete c[f])}}}return n}function ri(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=j(r,i)<0;o!=j(n,i)<0?(i=r,r=n):o!=j(r,n)<0&&(r=n)}return new nl(i,r)}return new nl(n||r,r)}function ni(e,t,r,n){ci(e,new rl([ri(e,e.sel.primary(),t,r)],0),n)}function ii(e,t,r){for(var n=[],i=0;i=t.ch:l.to>t.ch))){if(i&&(ze(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var c=s.find(n<0?1:-1),u=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(c=gi(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=j(c,r))&&(n<0?u<0:u>0))return hi(e,c,t,n,i)}var d=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(d=gi(e,d,n,d.line==t.line?o:null)),d?hi(e,d,t,n,i):null}}return t}function mi(e,t,r,n,i){var o=n||1,a=hi(e,t,r,o,i)||!i&&hi(e,t,r,o,!0)||hi(e,t,r,-o,i)||!i&&hi(e,t,r,-o,!0);return a?a:(e.cantEdit=!0,P(e.first,0))}function gi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?R(e,P(t.line-1)):null:r>0&&t.ch==(n||L(e,t.line)).text.length?t.line=0;--i)wi(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else wi(e,t)}}function wi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=j(t.from,t.to)){var r=Pn(e,t);Gn(e,t,r,e.cm?e.cm.curOp.id:NaN),Ci(e,t,r,Q(e,t));var n=[];Rn(e,function(e,r){r||d(n,e.history)!=-1||(Ai(e.history,t),n.push(e.history)),Ci(e,t,null,Q(e,t))})}}function xi(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s=0;--p){var m=f(p);if(m)return m.v}}}}function ki(e,t){if(0!=t&&(e.first+=t,e.sel=new rl(m(e.sel.ranges,function(e){return new nl(P(e.anchor.line+t,e.anchor.ch),P(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){pn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:P(o,L(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=T(e,t.from,t.to),r||(r=Pn(e,t)),e.cm?Si(e.cm,t,n):Bn(e,t,n),ui(e,r,xa)}}function Si(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=N(ue(L(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Oe(e),Bn(n,t,r,wr(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=ye(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),bn(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?pn(e):o.line!=a.line||1!=t.text.length||Fn(e.doc,t)?pn(e,o.line,a.line+1,c):hn(e,o.line,"text");var u=We(e,"changes"),d=We(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&kt(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function Mi(e,t,r,n,i){if(n||(n=r),j(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),bi(e,{from:r,to:n,text:t,origin:i})}function Li(e,t,r,n){r0||0==l&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=n("span",[a.replacedWith],"CodeMirror-widget"),a.widgetNode.setAttribute("role","presentation"),i.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ce(e,t.line,t,r,a)||t.line!=r.line&&ce(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");U()}a.addToHistory&&Gn(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,u=t.line,d=e.cm;if(e.iter(u,r.line+1,function(e){d&&a.collapsed&&!d.options.lineWrapping&&ue(e)==d.display.maxLine&&(s=!0),a.collapsed&&u!=t.line&&z(e,0),X(e,new K(a,u==t.line?t.ch:null,u==r.line?r.ch:null)),++u}),a.collapsed&&e.iter(t.line,r.line+1,function(t){me(e,t)&&z(t,0)}),a.clearOnEnter&&Wa(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(V(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++ll,a.atomic=!0),d){if(s&&(d.curOp.updateMaxLine=!0),a.collapsed)pn(d,t.line,r.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var f=t.line;f<=r.line;f++)hn(d,f,"text");a.atomic&&fi(d.doc),kt(d,"markerAdded",d,a)}return a}function Ei(e,t,r,n,i){n=c(n),n.shared=!1;var o=[Wi(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Rn(e,function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(Wi(e,R(e,t),R(e,r),n,i));for(var s=0;s-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),ui(t.doc,On(r,r)),u)for(var f=0;f=0;t--)Mi(e.doc,"",n[t].from,n[t].to,"+delete");Qr(e)})}function Qi(e,t){var r=L(e.doc,t),n=ue(r);return n!=r&&(t=N(n)),Me(!0,e,n,t,1)}function Ji(e,t){var r=L(e.doc,t),n=de(r);return n!=r&&(t=N(n)),Me(!0,e,r,t,-1)}function eo(e,t){var r=Qi(e,t.line),n=L(e.doc,r.line),i=ke(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return P(r.line,a?0:o,r.sticky)}return r}function to(e,t,r){if("string"==typeof t&&(t=xl[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=wa}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function ro(e,t,r){for(var n=0;ni-400&&0==j(wl.pos,r)?n="triple":bl&&bl.time>i-400&&0==j(bl.pos,r)?(n="double",wl={time:i,pos:r}):(n="single",bl={time:i,pos:r});var a,l=e.doc.sel,c=la?t.metaKey:t.ctrlKey;e.options.dragDrop&&Ea&&!e.isReadOnly()&&"single"==n&&(a=l.contains(r))>-1&&(j((a=l.ranges[a]).from(),r)<0||r.xRel>0)&&(j(a.to(),r)>0||r.xRel<0)?po(e,t,r,c):ho(e,t,r,n,c)}function po(e,t,r,n){var i=e.display,o=+new Date,a=un(e,function(l){Qo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ae(document,"mouseup",a),Ae(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(Pe(l),!n&&+new Date-200w&&i.push(new nl(P(g,w),P(g,f(y,c,o))))}i.length||i.push(new nl(r,r)),ci(d,Nn(m.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=p,k=x.anchor,C=t;if("single"!=n){var S;S="double"==n?e.findWordAt(t):new nl(P(t.line,0),R(d,P(t.line+1,0))),j(S.anchor,k)>0?(C=S.head,k=F(x.from(),S.anchor)):(C=S.anchor,k=I(x.to(),S.head))}var M=m.ranges.slice(0);M[h]=new nl(R(d,k),C),ci(d,Nn(M,h),ka)}}function l(t){var r=++x,i=kr(e,t,!0,"rect"==n);if(i)if(0!=j(i,b)){e.curOp.focus=o(),a(i);var s=Hr(c,d);(i.line>=s.to||i.linew.bottom?20:0;u&&setTimeout(un(e,function(){x==r&&(c.scroller.scrollTop+=u,l(t))}),50)}}function s(t){e.state.selectingText=!1,x=1/0,Pe(t),c.input.focus(),Ae(document,"mousemove",k),Ae(document,"mouseup",C),d.history.lastSelOrigin=null}var c=e.display,d=e.doc;Pe(t);var p,h,m=d.sel,g=m.ranges;if(i&&!t.shiftKey?(h=d.sel.contains(r),p=h>-1?g[h]:new nl(r,r)):(p=d.sel.primary(),h=d.sel.primIndex),sa?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(p=new nl(r,r)),r=kr(e,t,!0,!0),h=-1;else if("double"==n){var v=e.findWordAt(r);p=e.display.shift||d.extend?ri(d,p,v.anchor,v.head):v}else if("triple"==n){var y=new nl(P(r.line,0),R(d,P(r.line+1,0)));p=e.display.shift||d.extend?ri(d,p,y.anchor,y.head):y}else p=ri(d,p,r);i?h==-1?(h=g.length,ci(d,Nn(g.concat([p]),h),{scroll:!1,origin:"*mouse"})):g.length>1&&g[h].empty()&&"single"==n&&!t.shiftKey?(ci(d,Nn(g.slice(0,h).concat(g.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),m=d.sel):oi(d,h,p,ka):(h=0,ci(d,new rl([p],0),ka),m=d.sel);var b=r,w=c.wrapper.getBoundingClientRect(),x=0,k=un(e,function(e){Fe(e)?l(e):s(e)}),C=un(e,s);e.state.selectingText=C,Wa(document,"mousemove",k),Wa(document,"mouseup",C)}function mo(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Pe(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!We(e,r))return De(t);o-=l.top-a.viewOffset;for(var s=0;s=i){var u=O(e.doc,o),d=e.options.gutters[s];return ze(e,r,e,u,d,t),De(t)}}}function go(e,t){return mo(e,t,"gutterClick",!0)}function vo(e,t){Ht(e.display,t)||yo(e,t)||Ne(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function yo(e,t){return!!We(e,"gutterContextMenu")&&mo(e,t,"gutterContextMenu",!1)}function bo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),nr(e)}function wo(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=Sl&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=Sl,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Hn(e)},!0),t("indentUnit",2,Hn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){In(e),nr(e),pn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(P(n,o))}n++});for(var i=r.length-1;i>=0;i--)Mi(e.doc,t,r[i],P(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Sl&&e.refresh()}),t("specialCharPlaceholder",dt,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",aa?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!ca),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){bo(e),xo(e)},!0),t("keyMap","default",function(e,t,r){var n=Yi(t),i=r!=Sl&&Yi(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("lineWrapping",!1,Co,!0),t("gutters",[],function(e){zn(e.options),xo(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?br(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return Vr(e)},!0),t("scrollbarStyle","native",function(e){Kr(e),Vr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){zn(e.options),xo(e)},!0),t("firstLineNumber",1,xo,!0),t("lineNumberFormatter",function(e){return e},xo,!0),t("showCursorWhenSelecting",!1,Sr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(Wr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,ko),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Sr,!0),t("singleCursorHeightPerLine",!0,Sr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,In,!0),t("addModeClass",!1,In,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,In,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null)}function xo(e){An(e),pn(e),Er(e)}function ko(e,t,r){var n=r&&r!=Sl;if(!t!=!n){var i=e.display.dragFunctions,o=t?Wa:Ae;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Co(e){e.options.lineWrapping?(a(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ha(e.display.wrapper,"CodeMirror-wrap"),be(e)),xr(e),pn(e),nr(e),setTimeout(function(){return Vr(e)},100)}function So(e,t){var r=this;if(!(this instanceof So))return new So(e,t);this.options=t=t?c(t):{},c(Ml,t,!1),zn(t);var n=t.value;"string"==typeof n&&(n=new dl(n,t.mode,null,t.lineSeparator)),this.doc=n;var i=new So.inputStyles[t.inputStyle](this),o=this.display=new M(e,n,i);o.wrapper.CodeMirror=this,An(this),bo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Kr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new ga,keySeq:null,specialChars:null},t.autofocus&&!aa&&o.input.focus(),Yo&&Zo<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Mo(this),$i(),en(this),this.curOp.forceUpdate=!0,$n(this,n),t.autofocus&&!aa||this.hasFocus()?setTimeout(s(Or,this),20):Wr(this);for(var a in Ll)Ll.hasOwnProperty(a)&&Ll[a](r,t[a],Sl);Pr(this),t.finishInit&&t.finishInit(this);for(var l=0;l400}var i=e.display;Wa(i.scroller,"mousedown",un(e,uo)),Yo&&Zo<11?Wa(i.scroller,"dblclick",un(e,function(t){if(!Ne(e,t)){var r=kr(e,t);if(r&&!go(e,t)&&!Ht(e.display,t)){Pe(t);var n=e.findWordAt(r);ni(e.doc,n.anchor,n.head)}}})):Wa(i.scroller,"dblclick",function(t){return Ne(e,t)||Pe(t)}),pa||Wa(i.scroller,"contextmenu",function(t){return vo(e,t)});var o,a={end:0};Wa(i.scroller,"touchstart",function(t){if(!Ne(e,t)&&!r(t)){i.input.ensurePolled(),clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Wa(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Wa(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!Ht(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||n(o,o.prev)?new nl(l,l):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(l):new nl(P(l.line,0),R(e.doc,P(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Pe(r)}t()}),Wa(i.scroller,"touchcancel",t),Wa(i.scroller,"scroll",function(){ -i.scroller.clientHeight&&(Ir(e,i.scroller.scrollTop),Fr(e,i.scroller.scrollLeft,!0),ze(e,"scroll",e))}),Wa(i.scroller,"mousewheel",function(t){return $r(e,t)}),Wa(i.scroller,"DOMMouseScroll",function(t){return $r(e,t)}),Wa(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ne(e,t)||He(t)},over:function(t){Ne(e,t)||(Fi(e,t),He(t))},start:function(t){return Ii(e,t)},drop:un(e,Hi),leave:function(t){Ne(e,t)||Bi(e)}};var l=i.input.getField();Wa(l,"keyup",function(t){return so.call(e,t)}),Wa(l,"keydown",un(e,ao)),Wa(l,"keypress",un(e,co)),Wa(l,"focus",function(t){return Or(e,t)}),Wa(l,"blur",function(t){return Wr(e,t)})}function Lo(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Je(e,t):r="prev");var a=e.options.tabSize,l=L(o,t),s=u(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,d=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&(c=o.mode.indent(i,l.text.slice(d.length),l.text),c==wa||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?u(L(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var m=Math.floor(c/a);m;--m)h+=a,f+="\t";if(h1)if(Al&&Al.text.join("\n")==t){if(n.ranges.length%Al.text.length==0){s=[];for(var c=0;c=0;d--){var f=n.ranges[d],p=f.from(),g=f.to();f.empty()&&(r&&r>0?p=P(p.line,p.ch-r):e.state.overwrite&&!a?g=P(g.line,Math.min(L(o,g.line).text.length,g.ch+h(l).length)):Al&&Al.lineWise&&Al.text.join("\n")==t&&(p=g=P(p.line,0))),u=e.curOp.updateInput;var v={from:p,to:g,text:s?s[d%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};bi(e.doc,v),kt(e,"inputRead",e,v)}t&&!a&&No(e,t),Qr(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function zo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||cn(t,function(){return Ao(t,r,0,null,"paste")}),!0}function No(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l-1){a=Lo(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(L(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Lo(e,i.head.line,"smart"));a&&kt(e,"electricInput",e,i.head.line)}}}function Oo(e){for(var t=[],r=[],n=0;nn&&(Lo(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Qr(t));else{var a=o.from(),l=o.to(),s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c0&&oi(t.doc,i,new nl(a,u[i].to()),xa)}}}),getTokenAt:function(e,t){return nt(this,e,t)},getLineTokens:function(e,t){return nt(this,P(e),t,!0)},getTokenTypeAt:function(e){e=R(this.doc,e);var t,r=Qe(this,L(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]o&&(e=o,i=!0),n=L(this.doc,e)}else n=e;return ar(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-ve(n):0)},defaultTextHeight:function(){return gr(this.display)},defaultCharWidth:function(){return vr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=cr(this,R(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&Xr(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:dn(ao),triggerOnKeyPress:dn(co),triggerOnKeyUp:so,execCommand:function(e){if(xl.hasOwnProperty(e))return xl[e].call(null,this)},triggerElectric:dn(function(e){No(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=R(this.doc,e),l=0;l0&&l(r.charAt(n-1));)--n;for(;i.5)&&xr(this),ze(this,"refresh",this)}),swapDoc:dn(function(e){var t=this.doc;return t.cm=null,$n(this,e),nr(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,kt(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ee(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}function jo(e,t,r,n,i){function o(){var n=t.line+r;return!(n=e.first+e.size)&&(t=new P(n,t.ch,t.sticky),c=L(e,n))}function a(n){var a;if(a=i?Le(e.cm,c,t,r):Se(c,t,r),null==a){if(n||!o())return!1;t=Me(i,e.cm,c,t.line,r)}else t=a;return!0}var l=t,s=r,c=L(e,t.line);if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var u=null,d="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(r<0)||a(!p);p=!1){var h=c.text.charAt(t.ch)||"\n",m=w(h,f)?"w":d&&"\n"==h?"n":!d||/\s/.test(h)?null:"p";if(!d||p||m||(m="s"),u&&u!=m){r<0&&(r=1,a(),t.sticky="after");break}if(m&&(u=m),r>0&&!a(!p))break}var g=mi(e,t,l,s,!0);return D(l,g)&&(g.hitSide=!0),g}function Do(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*gr(e.display),3);i=(r>0?t.bottom:t.top)+r*s}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var c;c=fr(e,a,i),c.outside;){if(r<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*r}return c}function Ho(e,t){var r=_t(e,t.line);if(!r||r.hidden)return null;var n=L(e.doc,t.line),i=Ut(r,n,t.line),o=ke(n),a="left";if(o){var l=xe(o,t.ch);a=l%2?"right":"left"}var s=Zt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Io(e,t){return t&&(e.bad=!0),e}function Fo(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void(l+=""==r?t.textContent.replace(/\u200b/g,""):r);var u,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(P(n,0),P(i+1,0),o(+d));return void(f.length&&(u=f[0].find())&&(l+=T(e.doc,u.from,u.to).join(c)))}if("false"==t.getAttribute("contenteditable"))return;for(var p=0;p=15&&(ta=!1,Qo=!0);var da,fa=la&&(Jo||ta&&(null==ua||ua<12.11)),pa=Ko||Yo&&Zo>=9,ha=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};da=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var ma=function(e){e.select()};oa?ma=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Yo&&(ma=function(e){try{e.select()}catch(e){}});var ga=function(){this.id=null};ga.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var va,ya,ba=30,wa={toString:function(){return"CodeMirror.Pass"}},xa={scroll:!1},ka={origin:"*mouse"},Ca={origin:"+move"},Sa=[""],Ma=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,La=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,Ta=!1,Aa=!1,za=null,Na=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(r){if(!i.test(r))return!1;for(var n=r.length,u=[],d=0;d=this.string.length},Ra.prototype.sol=function(){return this.pos==this.lineStart},Ra.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ra.prototype.next=function(){if(this.post},Ra.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},Ra.prototype.skipToEnd=function(){this.pos=this.string.length},Ra.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ra.prototype.backUp=function(e){this.pos-=e},Ra.prototype.column=function(){return this.lastColumnPos0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},Ra.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ra.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};var $a=function(e,t,r){this.text=e,re(this,t),this.height=r?r(this):1};$a.prototype.lineNo=function(){return N(this)},Ee($a);var qa,Va={},Ua={},Ka=null,Ga=null,_a={left:0,right:0,top:0,bottom:0},Xa=0,Ya=null;Yo?Ya=-.53:Ko?Ya=15:ea?Ya=-.7:ra&&(Ya=-1/3);var Za=function(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),Wa(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Wa(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Yo&&Zo<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Za.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Za.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},Za.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},Za.prototype.zeroWidthHack=function(){var e=la&&!na?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ga,this.disableVert=new ga},Za.prototype.enableZeroWidthBar=function(e,t){function r(){var n=e.getBoundingClientRect(),i=document.elementFromPoint(n.left+1,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},Za.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Qa=function(){};Qa.prototype.update=function(){return{bottom:0,right:0}},Qa.prototype.setScrollLeft=function(){},Qa.prototype.setScrollTop=function(){},Qa.prototype.clear=function(){};var Ja={native:Za,null:Qa},el=0,tl=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Hr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=$t(e),this.force=r,this.dims=yr(e),this.events=[]};tl.prototype.signal=function(e,t){We(e,t)&&this.events.push(arguments)},tl.prototype.finish=function(){for(var e=this,t=0;t=0&&j(e,i.to())<=0)return n}return-1};var nl=function(e,t){this.anchor=e,this.head=t};nl.prototype.from=function(){return F(this.anchor,this.head)},nl.prototype.to=function(){return I(this.anchor,this.head)},nl.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var il=function(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n1||!(this.children[0]instanceof il))){var s=[];this.collapse(s),this.children=[new il(s)],this.children[0].parent=this}},ol.prototype.collapse=function(e){for(var t=this,r=0;r50){for(var l=o.lines.length%25+25,s=l;s10);e.parent.maybeSpill()}},ol.prototype.iterN=function(e,t,r){for(var n=this,i=0;it.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&pn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&fi(t.doc)),t&&kt(t,"markerCleared",t,this),r&&tn(t),this.parent&&this.parent.clear()}},sl.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o=0;c--)bi(n,i[c]);s?si(this,s):this.cm&&Qr(this.cm)}),undo:fn(function(){xi(this,"undo")}),redo:fn(function(){xi(this,"redo")}),undoSelection:fn(function(){xi(this,"undo",!0)}),redoSelection:fn(function(){xi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=R(this,e),t=R(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne?(t=e,!0):(e-=o,void++r)}),R(this,P(r,t))},indexFromPos:function(e){e=R(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to0)i=new P(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),P(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=L(e.doc,i.line-1).text;a&&(i=new P(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),P(i.line-1,a.length-1),i,"+transpose"))}r.push(new nl(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return cn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ne.firstLine()&&(n=P(n.line-1,L(e.doc,n.line-1).length)),i.ch==L(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,a,l;n.line==t.viewFrom||0==(o=Cr(e,n.line))?(a=N(t.view[0].line),l=t.view[0].node):(a=N(t.view[o].line),l=t.view[o-1].node.nextSibling);var s,c,u=Cr(e,i.line);if(u==t.view.length-1?(s=t.viewTo-1,c=t.lineDiv.lastChild):(s=N(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!l)return!1;for(var d=e.doc.splitLines(Fo(e,l,c,a,s)),f=T(e.doc,P(a,0),P(s,L(e.doc,s).text.length));d.length>1&&f.length>1;)if(h(d)==h(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),a++}for(var p=0,m=0,g=d[0],v=f[0],y=Math.min(g.length,v.length);p1||d[0]||j(k,C)?(Mi(e.doc,d,k,C,"+input"),!0):void 0},zl.prototype.ensurePolled=function(){this.forceCompositionEnd()},zl.prototype.reset=function(){this.forceCompositionEnd()},zl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.pollContent()||pn(this.cm),this.div.blur(),this.div.focus())},zl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}!e.cm.isReadOnly()&&e.pollContent()||cn(e.cm,function(){return pn(e.cm)})},80))},zl.prototype.setUneditable=function(e){e.contentEditable="false"},zl.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||un(this.cm,Ao)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},zl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},zl.prototype.onContextMenu=function(){},zl.prototype.resetPosition=function(){},zl.prototype.needsContentAttribute=!0;var Nl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ga,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};Nl.prototype.init=function(e){function t(e){if(!Ne(i,e)){if(i.somethingSelected())To({lineWise:!1,text:i.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,a.value=Al.text.join("\n"),ma(a));else{if(!i.options.lineWiseCopyCut)return;var t=Oo(i);To({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,xa):(n.prevInput="",a.value=t.text.join("\n"),ma(a))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=Eo(),a=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),oa&&(a.style.width="0px"),Wa(a,"input",function(){Yo&&Zo>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),Wa(a,"paste",function(e){Ne(i,e)||zo(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),Wa(a,"cut",t),Wa(a,"copy",t),Wa(e.scroller,"paste",function(t){Ht(e,t)||Ne(i,t)||(i.state.pasteIncoming=!0,n.focus())}),Wa(e.lineSpace,"selectstart",function(t){Ht(e,t)||Pe(t)}),Wa(a,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Wa(a,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Nl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Mr(e);if(e.options.moveInputWithCursor){var i=cr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},Nl.prototype.showSelection=function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Nl.prototype.reset=function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Da&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var a=t?"-":r||n.getSelection();this.textarea.value=a,n.state.focused&&ma(this.textarea),Yo&&Zo>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",Yo&&Zo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},Nl.prototype.getField=function(){return this.textarea},Nl.prototype.supportsTouch=function(){return!1},Nl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!aa||o()!=this.textarea))try{this.textarea.focus()}catch(e){}},Nl.prototype.blur=function(){this.textarea.blur()},Nl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Nl.prototype.receivedFocus=function(){this.slowPoll()},Nl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Nl.prototype.fastPoll=function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},Nl.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ja(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(Yo&&Zo>=9&&this.hasSelection===i||la&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(n.length,i.length);a1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Nl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Nl.prototype.onKeyPress=function(){Yo&&Zo>=9&&(this.hasSelection=null),this.fastPoll()},Nl.prototype.onContextMenu=function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,n.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=d,a.style.cssText=u,Yo&&Zo<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!Yo||Yo&&Zo<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==n.prevInput?un(i,vi)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):(o.selForContextMenu=null, -o.input.reset())};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,a=n.textarea,l=kr(i,e),s=o.scroller.scrollTop;if(l&&!ta){var c=i.options.resetSelectionOnContextMenu;c&&i.doc.sel.contains(l)==-1&&un(i,ci)(i.doc,On(l),xa);var u=a.style.cssText,d=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var f=n.wrapper.getBoundingClientRect();a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(Yo?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var p;if(Qo&&(p=window.scrollY),o.input.focus(),Qo&&window.scrollTo(null,p),o.input.reset(),i.somethingSelected()||(a.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),Yo&&Zo>=9&&t(),pa){He(e);var h=function(){Ae(window,"mouseup",h),setTimeout(r,20)};Wa(window,"mouseup",h)}else setTimeout(r,50)}},Nl.prototype.readOnlyChanged=function(e){e||this.reset()},Nl.prototype.setUneditable=function(){},Nl.prototype.needsContentAttribute=!1,wo(So),Po(So);var Ol="iter insert remove copy getEditor constructor".split(" ");for(var Wl in dl.prototype)dl.prototype.hasOwnProperty(Wl)&&d(Ol,Wl)<0&&(So.prototype[Wl]=function(e){return function(){return e.apply(this.doc,arguments)}}(dl.prototype[Wl]));return Ee(dl),So.inputStyles={textarea:Nl,contenteditable:zl},So.defineMode=function(e){So.defaults.mode||"null"==e||(So.defaults.mode=e),qe.apply(this,arguments)},So.defineMIME=Ve,So.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),So.defineMIME("text/plain","null"),So.defineExtension=function(e,t){So.prototype[e]=t},So.defineDocExtension=function(e,t){dl.prototype[e]=t},So.fromTextArea=$o,qo(So),So.version="5.24.0",So})}),d=function(e){for(var t=arguments,r=1;r$/g.test(r)?r:r+"\n",template:n?n.innerHTML:"",script:i?i.innerHTML:"",styles:o}:{content:r,script:r}}catch(e){return{error:e}}},v=/\.((js)|(jsx))$/,y={};window.require=o;var b=function(e,t){var r=e.template,n=e.script;void 0===n&&(n="module.exports={}");var i=e.styles;void 0===t&&(t={});try{if("module.exports={}"===n&&!r)throw Error("no data");var o=l(n,t);return r&&(o.template=r),{result:o,styles:i&&i.join(" ")}}catch(e){return{error:e}}},w={name:"Vuep",props:{template:String,options:{},keepData:Boolean,value:String,scope:Object,iframe:Boolean},data:function(){return{content:"",preview:"",styles:"",error:""}},render:function(e){var t,r=this;return t=this.error?e("div",{class:"vuep-error"},[this.error]):e(m,{class:"vuep-preview",props:{value:this.preview,styles:this.styles,keepData:this.keepData,iframe:this.iframe},on:{error:this.handleError}}),e("div",{class:"vuep"},[e(h,{class:"vuep-editor",props:{value:this.content,options:this.options},on:{change:[this.executeCode,function(e){return r.$emit("input",e)}]}}),t])},watch:{value:{immediate:!0,handler:function(e){e&&this.executeCode(e)}}},created:function(){if(!this.$isServer){var e=this.template;if(/^[\.#]/.test(this.template)){var t=document.querySelector(this.template);if(!t)throw Error(this.template+" is not found");e=t.innerHTML}e&&(this.executeCode(e),this.$emit("input",e))}},methods:{handleError:function(e){this.error=e},executeCode:function(e){this.error="";var t=g(e);if(t.error)return void(this.error=t.error.message);var r=b(t,this.scope);return r.error?void(this.error=r.error.message):(this.content=t.content,this.preview=r.result,void(r.styles&&(this.styles=r.styles)))}}};w.config=function(e){w.props.options.default=function(){return e}},w.install=s,"undefined"!=typeof Vue&&Vue.use(s);var x=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?u:CodeMirror)}(function(e){e.overlayMode=function(t,r,n){return{startState:function(){return{base:e.startState(t),overlay:e.startState(r),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(n){return{base:e.copyState(t,n.base),overlay:e.copyState(r,n.overlay),basePos:n.basePos,baseCur:null,overlayPos:n.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)2){n.pending=[];for(var f=2;f-1)return e.Pass;var a=n.indent.length-1,l=t[n.state];e:for(;;){for(var c=0;c*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),n(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,n){return e.context=new l(r,t.indentation()+(n===!1?0:g),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,r){return O[r.context.type](e,t,r)}function d(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return u(e,t,r)}function f(e){var t=e.current().toLowerCase();m=T.hasOwnProperty(t)?"atom":L.hasOwnProperty(t)?"keyword":"variable"}var p=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var h,m,g=t.indentUnit,v=r.tokenHooks,y=r.documentTypes||{},b=r.mediaTypes||{},w=r.mediaFeatures||{},x=r.mediaValueKeywords||{},k=r.propertyKeywords||{},C=r.nonStandardPropertyKeywords||{},S=r.fontProperties||{},M=r.counterDescriptors||{},L=r.colorKeywords||{},T=r.valueKeywords||{},A=r.allowNested,z=r.lineComment,N=r.supportsAtComponent===!0,O={};return O.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(N&&/@component/.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(A&&"("==e)return s(r,t,"parens")}return r.context.type},O.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return k.hasOwnProperty(n)?(m="property","maybeprop"):C.hasOwnProperty(n)?(m="string-2","maybeprop"):A?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error","maybeprop")}return"meta"==e?"block":A||"hash"!=e&&"qualifier"!=e?O.top(e,t,r):(m="error","block")},O.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):u(e,t,r)},O.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&A)return s(r,t,"propBlock");if("}"==e||"{"==e)return d(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return s(r,t,"interpolation")}else m+=" error";return"prop"},O.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(m="property","maybeprop"):r.context.type},O.parens=function(e,t,r){return"{"==e||"}"==e?d(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&f(t),"parens")},O.pseudo=function(e,t,r){return"meta"==e?"pseudo":"word"==e?(m="variable-3",r.context.type):u(e,t,r)},O.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",r.context.type):O.atBlock(e,t,r)},O.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,r);if("{"==e)return c(r)&&s(r,t,A?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();m="only"==n||"not"==n||"and"==n||"or"==n?"keyword":b.hasOwnProperty(n)?"attribute":w.hasOwnProperty(n)?"property":x.hasOwnProperty(n)?"keyword":k.hasOwnProperty(n)?"property":C.hasOwnProperty(n)?"string-2":T.hasOwnProperty(n)?"atom":L.hasOwnProperty(n)?"keyword":"error"}return r.context.type},O.atComponentBlock=function(e,t,r){return"}"==e?d(e,t,r):"{"==e?c(r)&&s(r,t,A?"block":"top",!1):("word"==e&&(m="error"),r.context.type)},O.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?d(e,t,r,2):O.atBlock(e,t,r)},O.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(m="variable","restricted_atBlock_before"):u(e,t,r)},O.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(m="@font-face"==r.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!M.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},O.keyframes=function(e,t,r){return"word"==e?(m="variable","keyframes"):"{"==e?s(r,t,"top"):u(e,t,r)},O.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?d(e,t,r):("word"==e?m="tag":"hash"==e&&(m="builtin"),"at")},O.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?d(e,t,r):("word"==e?m="variable":"variable"!=e&&"("!=e&&")"!=e&&(m="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:p?"block":"top",stateArg:null,context:new l(p?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(h=r[1],r=r[0]),m=r,t.state=O[t.state](h,e,t),m},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-g),r=r.prev):(r=r.prev,i=r.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:z,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],i=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(d),p=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],h=t(p),m=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(m),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=t(b),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],k=t(x),C=n.concat(o).concat(l).concat(c).concat(d).concat(p).concat(b).concat(x); -e.registerHelper("hintWords","css",C),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:w,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:w,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:w,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:w,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})})}),S=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?u:CodeMirror)}(function(e){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(n,i){function o(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(s("atom","]]>")):null:e.match("--")?r(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(L=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==n){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=o,L=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return L="equals",null;if("<"==r){t.tokenize=o,t.state=p,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=l(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\'\-]*[^\s\u00a0=<>\"\'\/\-]/),"word")}function l(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=o;break}r.next()}return e}}function c(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=c(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=o;break}return r.tokenize=c(e-1),r.tokenize(t,r)}}return"meta"}}function u(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(C.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function f(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!C.contextGrabbers.hasOwnProperty(r)||!C.contextGrabbers[r].hasOwnProperty(t))return;d(e)}}function p(e,t,r){return"openTag"==e?(r.tagStart=t.column(),h):"closeTag"==e?m:p}function h(e,t,r){return"word"==e?(r.tagName=t.current(),T="tag",y):(T="error",h)}function m(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&C.implicitlyClosed.hasOwnProperty(r.context.tagName)&&d(r),r.context&&r.context.tagName==n||C.matchClosing===!1?(T="tag",g):(T="tag error",v)}return T="error",v}function g(e,t,r){return"endTag"!=e?(T="error",g):(d(r),p)}function v(e,t,r){return T="error",g(e,t,r)}function y(e,t,r){if("word"==e)return T="attribute",b;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||C.autoSelfClosers.hasOwnProperty(n)?f(r,n):(f(r,n),r.context=new u(r,n,i==r.indented)),p}return T="error",y}function b(e,t,r){return"equals"==e?w:(C.allowMissing||(T="error"),y(e,t,r))}function w(e,t,r){return"string"==e?x:"word"==e&&C.allowUnquoted?(T="string",y):(T="error",y(e,t,r))}function x(e,t,r){return"string"==e?x:y(e,t,r)}var k=n.indentUnit,C={},S=i.htmlMode?t:r;for(var M in S)C[M]=S[M];for(var M in i)C[M]=i[M];var L,T;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;L=null;var r=t.tokenize(e,t);return(r||L)&&"comment"!=r&&(T=null,t.state=t.state(L||r,e,t),T&&(r="error"==T?r+" error":T)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return C.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/$/,blockCommentStart:"",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})}),M=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?u:CodeMirror)}(function(e){function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function i(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function o(e,t,r){return Me=e,Le=r,t}function a(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=l(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==n&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return o(n);if("="==n&&e.eat(">"))return o("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==n)return e.eat("*")?(r.tokenize=s,s(e,r)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,r,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(Pe),o("operator","operator",e.current()));if("`"==n)return r.tokenize=c,c(e,r);if("#"==n)return e.skipToEnd(),o("error","error");if(Pe.test(n))return">"==n&&r.lexical&&">"==r.lexical.type||e.eatWhile(Pe),o("operator","operator",e.current());if(We.test(n)){e.eatWhile(We);var a=e.current(),u=Ee.propertyIsEnumerable(a)&&Ee[a];return u&&"."!=r.lastType?o(u.type,u.style,a):o("variable","variable",a)}}function l(e){return function(t,r){var n,i=!1;if(ze&&"@"==t.peek()&&t.match(je))return r.tokenize=a,o("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=a),o("string","string")}}function s(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=a;break}n="*"==r}return o("comment","comment")}function c(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=a;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(Oe){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=De.indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(We.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}function d(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function p(e,t,r,n,i){var o=e.cc;for(Ie.state=e,Ie.stream=i,Ie.marked=null,Ie.cc=o,Ie.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():Ne?C:k;if(a(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Ie.marked?Ie.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function h(){for(var e=arguments,t=arguments.length-1;t>=0;t--)Ie.cc.push(e[t])}function m(){return h.apply(null,arguments),!0}function g(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=Ie.state;if(Ie.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function v(){Ie.state.context={prev:Ie.state.context,vars:Ie.state.localVars},Ie.state.localVars=Fe}function y(){Ie.state.localVars=Ie.state.context.vars,Ie.state.context=Ie.state.context.prev}function b(e,t){var r=function(){var r=Ie.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new d(n,Ie.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function w(){var e=Ie.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(r){return r==e?m():";"==e?h():m(t)}return t}function k(e,t){return"var"==e?m(b("vardef",t.length),Q,x(";"),w):"keyword a"==e?m(b("form"),M,k,w):"keyword b"==e?m(b("form"),k,w):"{"==e?m(b("}"),U,w):";"==e?m():"if"==e?("else"==Ie.state.lexical.info&&Ie.state.cc[Ie.state.cc.length-1]==w&&Ie.state.cc.pop()(),m(b("form"),M,k,w,ne)):"function"==e?m(ce):"for"==e?m(b("form"),ie,k,w):"variable"==e?m(b("stat"),I):"switch"==e?m(b("form"),M,b("}","switch"),x("{"),U,w,w):"case"==e?m(C,x(":")):"default"==e?m(x(":")):"catch"==e?m(b("form"),v,x("("),ue,x(")"),k,w,y):"class"==e?m(b("form"),fe,w):"export"==e?m(b("stat"),ge,w):"import"==e?m(b("stat"),ye,w):"module"==e?m(b("form"),J,b("}"),x("{"),U,w,w):"type"==e?m(G,x("operator"),G,x(";")):"async"==e?m(k):h(b("stat"),C,x(";"),w)}function C(e){return L(e,!1)}function S(e){return L(e,!0)}function M(e){return"("!=e?h():m(b(")"),C,x(")"),w)}function L(e,t){if(Ie.state.fatArrowAt==Ie.stream.start){var r=t?P:E;if("("==e)return m(v,b(")"),q(J,")"),w,x("=>"),r,y);if("variable"==e)return h(v,J,x("=>"),r,y)}var n=t?N:z;return He.hasOwnProperty(e)?m(n):"function"==e?m(ce,n):"class"==e?m(b("form"),de,w):"keyword c"==e||"async"==e?m(t?A:T):"("==e?m(b(")"),T,x(")"),w,n):"operator"==e||"spread"==e?m(t?S:C):"["==e?m(b("]"),Ce,w,n):"{"==e?V(B,"}",null,n):"quasi"==e?h(O,n):"new"==e?m(j(t)):m()}function T(e){return e.match(/[;\}\)\],]/)?h():h(C)}function A(e){return e.match(/[;\}\)\],]/)?h():h(S)}function z(e,t){return","==e?m(C):N(e,t,!1)}function N(e,t,r){var n=0==r?z:N,i=0==r?C:S;return"=>"==e?m(v,r?P:E,y):"operator"==e?/\+\+|--/.test(t)?m(n):"?"==t?m(C,x(":"),i):m(i):"quasi"==e?h(O,n):";"!=e?"("==e?V(S,")","call",n):"."==e?m(F,n):"["==e?m(b("]"),T,x("]"),w,n):void 0:void 0}function O(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?m(O):m(C,W)}function W(e){if("}"==e)return Ie.marked="string-2",Ie.state.tokenize=c,m(O)}function E(e){return u(Ie.stream,Ie.state),h("{"==e?k:C)}function P(e){return u(Ie.stream,Ie.state),h("{"==e?k:S)}function j(e){return function(t){return"."==t?m(e?H:D):h(e?S:C)}}function D(e,t){if("target"==t)return Ie.marked="keyword",m(z)}function H(e,t){if("target"==t)return Ie.marked="keyword",m(N)}function I(e){return":"==e?m(w,k):h(z,x(";"),w)}function F(e){if("variable"==e)return Ie.marked="property",m()}function B(e,t){return"async"==e?(Ie.marked="property",m(B)):"variable"==e||"keyword"==Ie.style?(Ie.marked="property",m("get"==t||"set"==t?R:$)):"number"==e||"string"==e?(Ie.marked=ze?"property":Ie.style+" property",m($)):"jsonld-keyword"==e?m($):"modifier"==e?m(B):"["==e?m(C,x("]"),$):"spread"==e?m(C):":"==e?h($):void 0}function R(e){return"variable"!=e?h($):(Ie.marked="property",m(ce))}function $(e){return":"==e?m(S):"("==e?h(ce):void 0}function q(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=Ie.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),m(function(r,n){return r==t||n==t?h():h(e)},n)}return i==t||o==t?m():m(x(t))}return function(r,i){return r==t||i==t?m():h(e,n)}}function V(e,t,r){for(var n=arguments,i=3;i"==e)return m(G)}function X(e,t){return"variable"==e||"keyword"==Ie.style?(Ie.marked="property",m(X)):"?"==t?m(X):":"==e?m(G):void 0}function Y(e){return"variable"==e?m(Y):":"==e?m(G):void 0}function Z(e,t){return"<"==t?m(b(">"),q(G,">"),w,Z):"|"==t||"."==e?m(G):"["==e?m(x("]"),Z):void 0}function Q(){return h(J,K,te,re)}function J(e,t){return"modifier"==e?m(J):"variable"==e?(g(t),m()):"spread"==e?m(J):"["==e?V(J,"]"):"{"==e?V(ee,"}"):void 0}function ee(e,t){return"variable"!=e||Ie.stream.match(/^\s*:/,!1)?("variable"==e&&(Ie.marked="property"),"spread"==e?m(J):"}"==e?h():m(x(":"),J,te)):(g(t),m(te))}function te(e,t){if("="==t)return m(S)}function re(e){if(","==e)return m(Q)}function ne(e,t){if("keyword b"==e&&"else"==t)return m(b("form","else"),k,w)}function ie(e){if("("==e)return m(b(")"),oe,x(")"),w)}function oe(e){return"var"==e?m(Q,x(";"),le):";"==e?m(le):"variable"==e?m(ae):h(C,x(";"),le)}function ae(e,t){return"in"==t||"of"==t?(Ie.marked="keyword",m(C)):m(z,le)}function le(e,t){return";"==e?m(se):"in"==t||"of"==t?(Ie.marked="keyword",m(C)):h(C,x(";"),se)}function se(e){")"!=e&&m(C)}function ce(e,t){return"*"==t?(Ie.marked="keyword",m(ce)):"variable"==e?(g(t),m(ce)):"("==e?m(v,b(")"),q(ue,")"),w,K,k,y):void 0}function ue(e){return"spread"==e?m(ue):h(J,K,te)}function de(e,t){return"variable"==e?fe(e,t):pe(e,t)}function fe(e,t){if("variable"==e)return g(t),m(pe)}function pe(e,t){return"extends"==t||"implements"==t||Oe&&","==e?m(Oe?G:C,pe):"{"==e?m(b("}"),he,w):void 0}function he(e,t){return"variable"==e||"keyword"==Ie.style?("async"==t||"static"==t||"get"==t||"set"==t||Oe&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&Ie.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Ie.marked="keyword",m(he)):(Ie.marked="property",m(Oe?me:ce,he)):"*"==t?(Ie.marked="keyword",m(he)):";"==e?m(he):"}"==e?m():void 0}function me(e,t){return"?"==t?m(me):":"==e?m(G,te):h(ce)}function ge(e,t){return"*"==t?(Ie.marked="keyword",m(ke,x(";"))):"default"==t?(Ie.marked="keyword",m(C,x(";"))):"{"==e?m(q(ve,"}"),ke,x(";")):h(k)}function ve(e,t){return"as"==t?(Ie.marked="keyword",m(x("variable"))):"variable"==e?h(S,ve):void 0}function ye(e){return"string"==e?m():h(be,we,ke)}function be(e,t){return"{"==e?V(be,"}"):("variable"==e&&g(t),"*"==t&&(Ie.marked="keyword"),m(xe))}function we(e){if(","==e)return m(be,we)}function xe(e,t){if("as"==t)return Ie.marked="keyword",m(be)}function ke(e,t){if("from"==t)return Ie.marked="keyword",m(C)}function Ce(e){return"]"==e?m():h(q(S,"]"))}function Se(e,t){return"operator"==e.lastType||","==e.lastType||Pe.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var Me,Le,Te=r.indentUnit,Ae=n.statementIndent,ze=n.jsonld,Ne=n.json||ze,Oe=n.typescript,We=n.wordCharacters||/[\w$\xa1-\uffff]/,Ee=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n,async:e("async")};if(Oe){var l={type:"variable",style:"variable-3"},s={interface:e("class"),implements:n,namespace:n,module:e("module"),enum:e("module"),type:e("type"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),as:i,string:l,number:l,boolean:l,any:l};for(var c in s)a[c]=s[c]}return a}(),Pe=/[+\-*&%=<>!?|~^]/,je=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,De="([{}])",He={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ie={state:null,column:null,marked:null,cc:null},Fe={name:"this",next:{name:"arguments"}};return w.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new d((e||0)-Te,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=s&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==Me?r:(t.lastType="operator"!=Me||"++"!=Le&&"--"!=Le?Me:"incdec",p(t,r,Me,Le,e))},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var i,o=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==w)l=l.prev;else if(u!=ne)break}for(;("stat"==l.type||"form"==l.type)&&("}"==o||(i=t.cc[t.cc.length-1])&&(i==z||i==N)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;Ae&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=o==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==d&&"{"==o?l.indented:"form"==d?l.indented+Te:"stat"==d?l.indented+(Se(t,r)?Ae||Te:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:Te):l.indented+(/^(?:case|default)\b/.test(r)?Te:2*Te)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ne?null:"/*",blockCommentEnd:Ne?null:"*/",lineComment:Ne?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ne?"json":"javascript",jsonldMode:ze,jsonMode:Ne,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=C&&t!=S||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})}),L=r(function(e,t){!function(r){"object"==typeof t&&"object"==typeof e?r(u,S,M,C):r(CodeMirror)}(function(e){function t(e,t,r){var n=e.current(),i=n.search(t);return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}function r(e){var t=s[e];return t?t:s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function n(e,t){var n=e.match(r(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}function a(e,t){for(var r=0;r\s\/]/.test(n.current())&&(l=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(l))o.inTag=l+" ";else if(o.inTag&&f&&/>$/.test(n.current())){var p=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var h=">"==n.current()&&a(u[p[1]],p[2]),m=e.getMode(r,h),g=i(p[1],!0),v=i(p[1],!1);o.token=function(e,r){return e.match(g,!1)?(r.token=s,r.localState=r.localMode=null,null):t(e,v,r.localMode.token(e,r.localState))},o.localMode=m,o.localState=e.startState(m,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=n.current(),n.eol()&&(o.inTag+=" "));return d}var c=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),u={},d=n&&n.tags,f=n&&n.scriptTypes;if(o(l,u),d&&o(d,u),f)for(var p=f.length-1;p>=0;p--)u.script.unshift(["type",f[p].matches,f[p].mode]);return{startState:function(){var t=e.startState(c);return{token:s,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r){return!t.localMode||/^\s*<\//.test(r)?c.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})}),T=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?u:CodeMirror)}(function(e){e.defineMode("coffeescript",function(e,t){function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var r=t.scope.offset;if(e.eatSpace()){var n=e.indentation();return n>r&&"coffee"==t.scope.type?"indent":n0&&l(e,t)}if(e.eatSpace())return null;var a=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=o,t.tokenize(e,t);if("#"===a)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var s=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(s=!0),e.match(/^-?\d+\.\d*/)&&(s=!0),e.match(/^-?\.\d+/)&&(s=!0),s)return"."==e.peek()&&e.backUp(1),"number";var m=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(m=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),e.match(/^-?0(?![\dx])/i)&&(m=!0),m)return"number"}if(e.match(y))return t.tokenize=i(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(b)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=i(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(u)||e.match(h)?"operator":e.match(d)?"punctuation":e.match(x)?"atom":e.match(p)||t.prop&&e.match(f)?"property":e.match(v)?"keyword":e.match(f)?"variable":(e.next(),c)}function i(e,r,i){return function(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\/\\]/),o.eat("\\")){if(o.next(),r&&o.eol())return i}else{if(o.match(e))return a.tokenize=n,i;o.eat(/['"\/]/)}return r&&(t.singleLineStringErrors?i=c:a.tokenize=n),i}}function o(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=n;break}e.eatWhile("#")}return"comment"}function a(t,r,n){n=n||"coffee";for(var i=0,o=!1,a=null,l=r.scope;l;l=l.prev)if("coffee"===l.type||"}"==l.type){i=l.offset+e.indentUnit;break}"coffee"!==n?(o=null,a=t.column()+t.current().length):r.scope.align&&(r.scope.align=!1),r.scope={offset:i,type:n,prev:r.scope,align:o,alignOffset:a}}function l(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var r=e.indentation(),n=!1,i=t.scope;i;i=i.prev)if(r===i.offset){n=!0;break}if(!n)return!0;for(;t.scope.prev&&t.scope.offset!==r;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function s(e,t){var r=t.tokenize(e,t),n=e.current();"return"===n&&(t.dedent=!0),(("->"===n||"=>"===n)&&e.eol()||"indent"===r)&&a(e,t);var i="[({".indexOf(n);if(i!==-1&&a(e,t,"])}".slice(i,i+1)),m.exec(n)&&a(e,t),"then"==n&&l(e,t),"dedent"===r&&l(e,t))return c;if(i="])}".indexOf(n),i!==-1){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==n&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),r}var c="error",u=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,d=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,f=/^[_A-Za-z$][_A-Za-z$0-9]*/,p=/^@[_A-Za-z$][_A-Za-z$0-9]*/,h=r(["and","or","not","is","isnt","in","instanceof","typeof"]),m=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],g=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],v=r(m.concat(g));m=r(m);var y=/^('{3}|\"{3}|['\"])/,b=/^(\/{3}|\/)/,w=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],x=r(w),k={startState:function(e){return{tokenize:n,scope:{offset:e||0,type:"coffee",prev:null,align:!1},prop:!1,dedent:0}},token:function(e,t){var r=null===t.scope.align&&t.scope;r&&e.sol()&&(r.align=!1);var n=s(e,t);return n&&"comment"!=n&&(r&&(r.align=!0),t.prop="punctuation"==n&&"."==e.current()),n},indent:function(e,t){if(e.tokenize!=n)return 0;var r=e.scope,i=t&&"])}".indexOf(t.charAt(0))>-1;if(i)for(;"coffee"==r.type&&r.prev;)r=r.prev;var o=i&&r.type===t.charAt(0);return r.align?r.alignOffset-(o?1:0):(o?r.prev:r).offset},lineComment:"#",fold:"indent"};return k}),e.defineMIME("text/x-coffeescript","coffeescript"),e.defineMIME("text/coffeescript","coffeescript")})}),A=r(function(e,t){!function(r){"object"==typeof t&&"object"==typeof e?r(u,C):r(CodeMirror)}(function(e){e.defineMode("sass",function(t){function r(e){return new RegExp("^"+e.join("|"))}function n(e){return!e.peek()||e.match(/\s+$/,!1)}function i(e,t){var r=e.peek();return")"===r?(e.next(),t.tokenizer=u,"operator"):"("===r?(e.next(),e.eatSpace(),"operator"):"'"===r||'"'===r?(t.tokenizer=a(e.next()),"string"):(t.tokenizer=a(")",!1),"string")}function o(e,t){return function(r,n){return r.sol()&&r.indentation()<=e?(n.tokenizer=u,u(r,n)):(t&&r.skipTo("*/")?(r.next(),r.next(),n.tokenizer=u):r.skipToEnd(),"comment")}}function a(e,t){function r(i,o){var a=i.next(),s=i.peek(),c=i.string.charAt(i.pos-2),d="\\"!==a&&s===e||a===e&&"\\"!==c;return d?(a!==e&&t&&i.next(),n(i)&&(o.cursorHalf=0),o.tokenizer=u,"string"):"#"===a&&"{"===s?(o.tokenizer=l(r),i.next(),"operator"):"string"}return null==t&&(t=!0),r}function l(e){return function(t,r){return"}"===t.peek()?(t.next(),r.tokenizer=e,"operator"):u(t,r)}}function s(e){if(0==e.indentCount){e.indentCount++;var r=e.scopes[0].offset,n=r+t.indentUnit;e.scopes.unshift({offset:n})}}function c(e){1!=e.scopes.length&&e.scopes.shift()}function u(e,t){var r=e.peek();if(e.match("/*"))return t.tokenizer=o(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=o(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=l(u),"operator";if('"'===r||"'"===r)return e.next(),t.tokenizer=a(r),"string";if(t.cursorHalf){if("#"===r&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return n(e)&&(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return n(e)&&(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return n(e)&&(t.cursorHalf=0),"unit";if(e.match(b))return n(e)&&(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=i,n(e)&&(t.cursorHalf=0),"atom";if("$"===r)return e.next(),e.eatWhile(/[\w-]/),n(e)&&(t.cursorHalf=0),"variable-2";if("!"===r)return e.next(),t.cursorHalf=0,e.match(/^[\w]+/)?"keyword":"operator";if(e.match(x))return n(e)&&(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return n(e)&&(t.cursorHalf=0),f=e.current().toLowerCase(),g.hasOwnProperty(f)?"atom":m.hasOwnProperty(f)?"keyword":h.hasOwnProperty(f)?(t.prevProp=e.current().toLowerCase(),"property"):"tag";if(n(e))return t.cursorHalf=0,null}else{if("-"===r&&e.match(/^-\w+-/))return"meta";if("."===r){if(e.next(),e.match(/^[\w-]+/))return s(t),"qualifier";if("#"===e.peek())return s(t),"tag"}if("#"===r){if(e.next(),e.match(/^[\w-]+/))return s(t),"builtin";if("#"===e.peek())return s(t),"tag"}if("$"===r)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(b))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=i,"atom";if("="===r&&e.match(/^=[\w-]+/))return s(t),"meta";if("+"===r&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===r&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||c(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return s(t),"def";if("@"===r)return e.next(),e.eatWhile(/[\w-]/),"def";if(e.eatWhile(/[\w-]/)){if(e.match(/ *: *[\w-\+\$#!\("']/,!1)){f=e.current().toLowerCase();var d=t.prevProp+"-"+f;return h.hasOwnProperty(d)?"property":h.hasOwnProperty(f)?(t.prevProp=f,"property"):v.hasOwnProperty(f)?"property":"tag"}return e.match(/ *:/,!1)?(s(t),t.cursorHalf=1,t.prevProp=e.current().toLowerCase(),"property"):e.match(/ *,/,!1)?"tag":(s(t),"tag")}if(":"===r)return e.match(k)?"variable-3":(e.next(),t.cursorHalf=1,"operator")}return e.match(x)?"operator":(e.next(),null)}function d(e,r){e.sol()&&(r.indentCount=0);var n=r.tokenizer(e,r),i=e.current();if("@return"!==i&&"}"!==i||c(r),null!==n){for(var o=e.pos-i.length,a=o+t.indentUnit*r.indentCount,l=[],s=0;s","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],x=r(w),k=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:u,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var r=d(e,t);return t.lastToken={style:r,content:e.current()},r},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")})}),z=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?u:CodeMirror)}(function(e){function t(e){return e=e.sort(function(e,t){return t>e}),new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e){for(var t={},r=0;r|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/),t.context.line.firstWord=ne?ne[0].replace(/^\s*/,""):"",t.context.line.indent=e.indentation(),D=e.peek(),e.match("//"))return e.skipToEnd(),["comment","comment"];if(e.match("/*"))return t.tokenize=v,v(e,t);if('"'==D||"'"==D)return e.next(),t.tokenize=y(D),t.tokenize(e,t);if("@"==D)return e.next(),e.eatWhile(/[\w\\-]/),["def",e.current()];if("#"==D){if(e.next(),e.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i))return["atom","atom"];if(e.match(/^[a-z][\w-]*/i))return["builtin","hash"]}return e.match(te)?["meta","vendor-prefixes"]:e.match(/^-?[0-9]?\.?[0-9]/)?(e.eatWhile(/[a-z%]/i),["number","unit"]):"!"==D?(e.next(),[e.match(/^(important|optional)/i)?"keyword":"operator","important"]):"."==D&&e.match(/^\.[a-z][\w-]*/i)?["qualifier","qualifier"]:e.match(_)?("("==e.peek()&&(t.tokenize=b),["property","word"]):e.match(/^[a-z][\w-]*\(/i)?(e.backUp(1),["keyword","mixin"]):e.match(/^(\+|-)[a-z][\w-]*\(/i)?(e.backUp(1),["keyword","block-mixin"]):e.string.match(/^\s*&/)&&e.match(/^[-_]+[a-z][\w-]*/)?["qualifier","qualifier"]:e.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)?(e.backUp(1),["variable-3","reference"]):e.match(/^&{1}\s*$/)?["variable-3","reference"]:e.match(J)?["operator","operator"]:e.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)?e.match(/^(\.|\[)[\w-\'\"\]]+/i,!1)&&!M(e.current())?(e.match(/\./),["variable-2","variable-name"]):["variable-2","word"]:e.match(Q)?["operator",e.current()]:/[:;,{}\[\]\(\)]/.test(D)?(e.next(),[null,D]):(e.next(),[null,null])}function v(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}function y(e){return function(t,r){for(var n,i=!1;null!=(n=t.next());){if(n==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==n}return(n==e||!i&&")"!=e)&&(r.tokenize=null),["string","string"]}}function b(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=y(")"),[null,"("]}function w(e,t,r,n){this.type=e,this.indent=t,this.prev=r,this.line=n||{firstWord:"",indent:0}}function x(e,t,r,n){return n=n>=0?n:B,e.context=new w(r,t.indentation()+n,e.context),r}function k(e,t){var r=e.context.indent-B;return t=t||!1,e.context=e.context.prev,t&&(e.context.indent=r),e.context.type}function C(e,t,r){return ie[r.context.type](e,t,r)}function S(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return C(e,t,r)}function M(e){return e.toLowerCase()in R}function L(e){return e=e.toLowerCase(),e in q||e in Z}function T(e){return e.toLowerCase()in ee}function A(e){return e.toLowerCase().match(te)}function z(e){var t=e.toLowerCase(),r="variable-2";return M(e)?r="tag":T(e)?r="block-keyword":L(e)?r="property":t in U||t in re?r="atom":"return"==t||t in K?r="keyword":e.match(/^[A-Z]/)&&(r="string"),r}function N(e,t){return P(t)&&("{"==e||"]"==e||"hash"==e||"qualifier"==e)||"block-mixin"==e}function O(e,t){return"{"==e&&t.match(/^\s*\$?[\w-]+/i,!1)}function W(e,t){return":"==e&&t.match(/^[a-z-]+/,!1)}function E(e){return e.sol()||e.string.match(new RegExp("^\\s*"+n(e.current())))}function P(e){return e.eol()||e.match(/^\s*$/,!1)}function j(e){var t=/^\s*[-_]*[a-z0-9]+[\w-]*/i,r="string"==typeof e?e.match(t):e.string.match(t);return r?r[0].replace(/^\s*/,""):""}var D,H,I,F,B=e.indentUnit,R=r(i),$=/^(a|b|i|s|col|em)$/i,q=r(s),V=r(c),U=r(f),K=r(d),G=r(o),_=t(o),X=r(l),Y=r(a),Z=r(u),Q=/^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/,J=t(p),ee=r(h),te=new RegExp(/^\-(moz|ms|o|webkit)-/i),re=r(m),ne="",ie={};return ie.block=function(e,t,r){if("comment"==e&&E(t)||","==e&&P(t)||"mixin"==e)return x(r,t,"block",0);if(O(e,t))return x(r,t,"interpolation");if(P(t)&&"]"==e&&!/^\s*(\.|#|:|\[|\*|&)/.test(t.string)&&!M(j(t)))return x(r,t,"block",0);if(N(e,t,r))return x(r,t,"block");if("}"==e&&P(t))return x(r,t,"block",0);if("variable-name"==e)return t.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)||T(j(t))?x(r,t,"variableName"):x(r,t,"variableName",0);if("="==e)return P(t)||T(j(t))?x(r,t,"block"):x(r,t,"block",0);if("*"==e&&(P(t)||t.match(/\s*(,|\.|#|\[|:|{)/,!1)))return F="tag",x(r,t,"block");if(W(e,t))return x(r,t,"pseudo");if(/@(font-face|media|supports|(-moz-)?document)/.test(e))return x(r,t,P(t)?"block":"atBlock");if(/@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return x(r,t,"keyframes");if(/@extends?/.test(e))return x(r,t,"extend",0);if(e&&"@"==e.charAt(0))return t.indentation()>0&&L(t.current().slice(1))?(F="variable-2","block"):/(@import|@require|@charset)/.test(e)?x(r,t,"block",0):x(r,t,"block");if("reference"==e&&P(t))return x(r,t,"block");if("("==e)return x(r,t,"parens");if("vendor-prefixes"==e)return x(r,t,"vendorPrefixes");if("word"==e){var n=t.current();if(F=z(n),"property"==F)return E(t)?x(r,t,"block",0):(F="atom","block");if("tag"==F){if(/embed|menu|pre|progress|sub|table/.test(n)&&L(j(t)))return F="atom","block";if(t.string.match(new RegExp("\\[\\s*"+n+"|"+n+"\\s*\\]")))return F="atom","block";if($.test(n)&&(E(t)&&t.string.match(/=/)||!E(t)&&!t.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/)&&!M(j(t))))return F="variable-2",T(j(t))?"block":x(r,t,"block",0);if(P(t))return x(r,t,"block")}if("block-keyword"==F)return F="keyword",t.current(/(if|unless)/)&&!E(t)?"block":x(r,t,"block");if("return"==n)return x(r,t,"block",0);if("variable-2"==F&&t.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/))return x(r,t,"block")}return r.context.type},ie.parens=function(e,t,r){if("("==e)return x(r,t,"parens");if(")"==e)return"parens"==r.context.prev.type?k(r):t.string.match(/^[a-z][\w-]*\(/i)&&P(t)||T(j(t))||/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(j(t))||!t.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/)&&M(j(t))?x(r,t,"block"):t.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/)||t.string.match(/^\s*(\(|\)|[0-9])/)||t.string.match(/^\s+[a-z][\w-]*\(/i)||t.string.match(/^\s+[\$-]?[a-z]/i)?x(r,t,"block",0):P(t)?x(r,t,"block"):x(r,t,"block",0);if(e&&"@"==e.charAt(0)&&L(t.current().slice(1))&&(F="variable-2"),"word"==e){var n=t.current();F=z(n),"tag"==F&&$.test(n)&&(F="variable-2"),"property"!=F&&"to"!=n||(F="atom")}return"variable-name"==e?x(r,t,"variableName"):W(e,t)?x(r,t,"pseudo"):r.context.type},ie.vendorPrefixes=function(e,t,r){return"word"==e?(F="property",x(r,t,"block",0)):k(r)},ie.pseudo=function(e,t,r){return L(j(t.string))?S(e,t,r):(t.match(/^[a-z-]+/),F="variable-3",P(t)?x(r,t,"block"):k(r))},ie.atBlock=function(e,t,r){if("("==e)return x(r,t,"atBlock_parens");if(N(e,t,r))return x(r,t,"block");if(O(e,t))return x(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();if(F=/^(only|not|and|or)$/.test(n)?"keyword":G.hasOwnProperty(n)?"tag":Y.hasOwnProperty(n)?"attribute":X.hasOwnProperty(n)?"property":V.hasOwnProperty(n)?"string-2":z(t.current()),"tag"==F&&P(t))return x(r,t,"block")}return"operator"==e&&/^(not|and|or)$/.test(t.current())&&(F="keyword"),r.context.type},ie.atBlock_parens=function(e,t,r){if("{"==e||"}"==e)return r.context.type;if(")"==e)return P(t)?x(r,t,"block"):x(r,t,"atBlock");if("word"==e){var n=t.current().toLowerCase();return F=z(n),/^(max|min)/.test(n)&&(F="property"),"tag"==F&&(F=$.test(n)?"variable-2":"atom"),r.context.type}return ie.atBlock(e,t,r)},ie.keyframes=function(e,t,r){return"0"==t.indentation()&&("}"==e&&E(t)||"]"==e||"hash"==e||"qualifier"==e||M(t.current()))?S(e,t,r):"{"==e?x(r,t,"keyframes"):"}"==e?E(t)?k(r,!0):x(r,t,"keyframes"):"unit"==e&&/^[0-9]+\%$/.test(t.current())?x(r,t,"keyframes"):"word"==e&&(F=z(t.current()),"block-keyword"==F)?(F="keyword",x(r,t,"keyframes")):/@(font-face|media|supports|(-moz-)?document)/.test(e)?x(r,t,P(t)?"block":"atBlock"):"mixin"==e?x(r,t,"block",0):r.context.type},ie.interpolation=function(e,t,r){return"{"==e&&k(r)&&x(r,t,"block"),"}"==e?t.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i)||t.string.match(/^\s*[a-z]/i)&&M(j(t))?x(r,t,"block"):!t.string.match(/^(\{|\s*\&)/)||t.match(/\s*[\w-]/,!1)?x(r,t,"block",0):x(r,t,"block"):"variable-name"==e?x(r,t,"variableName",0):("word"==e&&(F=z(t.current()),"tag"==F&&(F="atom")),r.context.type)},ie.extend=function(e,t,r){return"["==e||"="==e?"extend":"]"==e?k(r):"word"==e?(F=z(t.current()),"extend"):k(r)},ie.variableName=function(e,t,r){return"string"==e||"["==e||"]"==e||t.current().match(/^(\.|\$)/)?(t.current().match(/^\.[\w-]+/i)&&(F="variable-2"),"variableName"):S(e,t,r)},{startState:function(e){return{tokenize:null,state:"block",context:new w("block",e||0,null)}},token:function(e,t){return!t.tokenize&&e.eatSpace()?null:(H=(t.tokenize||g)(e,t),H&&"object"==typeof H&&(I=H[1],H=H[0]),F=H,t.state=ie[t.state](I,e,t),F)},indent:function(e,t,r){var n=e.context,i=t&&t.charAt(0),o=n.indent,a=j(t),l=r.length-r.replace(/^\s*/,"").length,s=e.context.prev?e.context.prev.line.firstWord:"",c=e.context.prev?e.context.prev.line.indent:l;return n.prev&&("}"==i&&("block"==n.type||"atBlock"==n.type||"keyframes"==n.type)||")"==i&&("parens"==n.type||"atBlock_parens"==n.type)||"{"==i&&"at"==n.type)?(o=n.indent-B,n=n.prev):/(\})/.test(i)||(/@|\$|\d/.test(i)||/^\{/.test(t)||/^\s*\/(\/|\*)/.test(t)||/^\s*\/\*/.test(s)||/^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(t)||/^(\+|-)?[a-z][\w-]*\(/i.test(t)||/^return/.test(t)||T(a)?o=l:/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(i)||M(a)?o=/\,\s*$/.test(s)?c:/^\s+/.test(r)&&(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(s)||M(s))?l<=c?c:c+B:l:/,\s*$/.test(r)||!A(a)&&!L(a)||(o=T(s)?l<=c?c:c+B:/^\{/.test(s)?l<=c?l:c+B:A(s)||L(s)?l>=c?c:l:/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(s)||/=\s*$/.test(s)||M(s)||/^\$[\w-\.\[\]\'\"]/.test(s)?c+B:l)),o},electricChars:"}",lineComment:"//",fold:"indent"}});var i=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video"],o=["domain","regexp","url","url-prefix"],a=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],s=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"],c=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],u=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],d=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],f=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around","unset"],p=["in","and","or","not","is not","is a","is","isnt","defined","if unless"],h=["for","if","else","unless","from","to"],m=["null","true","false","href","title","type","not-allowed","readonly","disabled"],g=["@font-face","@keyframes","@media","@viewport","@page","@host","@supports","@block","@css"],v=i.concat(o,a,l,s,c,d,f,u,p,h,m,g);e.registerHelper("hintWords","stylus",v),e.defineMIME("text/x-styl","stylus")})}),N=r(function(e,t){!function(r){"object"==typeof t&&"object"==typeof e?r(u,M,C,L):r(CodeMirror)}(function(e){e.defineMode("pug",function(t){function r(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=e.startState(Z),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function n(e,t){if(e.sol()&&(t.javaScriptLine=!1,t.javaScriptLineExcludesColon=!1),t.javaScriptLine){if(t.javaScriptLineExcludesColon&&":"===e.peek())return t.javaScriptLine=!1,void(t.javaScriptLineExcludesColon=!1);var r=Z.token(e,t.jsState);return e.eol()&&(t.javaScriptLine=!1),r||!0}}function i(e,t){if(t.javaScriptArguments){if(0===t.javaScriptArgumentsDepth&&"("!==e.peek())return void(t.javaScriptArguments=!1);if("("===e.peek()?t.javaScriptArgumentsDepth++:")"===e.peek()&&t.javaScriptArgumentsDepth--,0===t.javaScriptArgumentsDepth)return void(t.javaScriptArguments=!1);var r=Z.token(e,t.jsState);return r||!0}}function o(e){if(e.match(/^yield\b/))return"keyword"}function a(e){if(e.match(/^(?:doctype) *([^\n]+)?/))return G}function l(e,t){if(e.match("#{"))return t.isInterpolating=!0,t.interpolationNesting=0,"punctuation"}function s(e,t){if(t.isInterpolating){if("}"===e.peek()){if(t.interpolationNesting--,t.interpolationNesting<0)return e.next(),t.isInterpolating=!1,"punctuation"}else"{"===e.peek()&&t.interpolationNesting++;return Z.token(e,t.jsState)||!0}}function c(e,t){if(e.match(/^case\b/))return t.javaScriptLine=!0,K}function u(e,t){if(e.match(/^when\b/))return t.javaScriptLine=!0,t.javaScriptLineExcludesColon=!0,K}function d(e){if(e.match(/^default\b/))return K}function f(e,t){if(e.match(/^extends?\b/))return t.restOfLine="string",K}function p(e,t){if(e.match(/^append\b/))return t.restOfLine="variable",K}function h(e,t){if(e.match(/^prepend\b/))return t.restOfLine="variable",K}function m(e,t){if(e.match(/^block\b *(?:(prepend|append)\b)?/))return t.restOfLine="variable",K}function g(e,t){if(e.match(/^include\b/))return t.restOfLine="string",K}function v(e,t){if(e.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&e.match("include"))return t.isIncludeFiltered=!0,K}function y(e,t){if(t.isIncludeFiltered){var r=T(e,t);return t.isIncludeFiltered=!1,t.restOfLine="string",r}}function b(e,t){if(e.match(/^mixin\b/))return t.javaScriptLine=!0,K}function w(e,t){return e.match(/^\+([-\w]+)/)?(e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),"variable"):e.match(/^\+#{/,!1)?(e.next(),t.mixinCallAfter=!0,l(e,t)):void 0}function x(e,t){if(t.mixinCallAfter)return t.mixinCallAfter=!1,e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),!0}function k(e,t){if(e.match(/^(if|unless|else if|else)\b/))return t.javaScriptLine=!0,K}function C(e,t){if(e.match(/^(- *)?(each|for)\b/))return t.isEach=!0,K}function S(e,t){if(t.isEach){if(e.match(/^ in\b/))return t.javaScriptLine=!0,t.isEach=!1,K;if(e.sol()||e.eol())t.isEach=!1;else if(e.next()){for(;!e.match(/^ in\b/,!1)&&e.next(););return"variable"}}}function M(e,t){if(e.match(/^while\b/))return t.javaScriptLine=!0,K}function L(e,t){var r;if(r=e.match(/^(\w(?:[-:\w]*\w)?)\/?/))return t.lastTag=r[1].toLowerCase(),"script"===t.lastTag&&(t.scriptType="application/javascript"),"tag"}function T(r,n){if(r.match(/^:([\w\-]+)/)){var i;return t&&t.innerModes&&(i=t.innerModes(r.current().substring(1))),i||(i=r.current().substring(1)),"string"==typeof i&&(i=e.getMode(t,i)),B(r,n,i),"atom"}}function A(e,t){if(e.match(/^(!?=|-)/))return t.javaScriptLine=!0,"punctuation"}function z(e){if(e.match(/^#([\w-]+)/))return _}function N(e){if(e.match(/^\.([\w-]+)/))return X}function O(e,t){if("("==e.peek())return e.next(),t.isAttrs=!0,t.attrsNest=[],t.inAttributeName=!0,t.attrValue="",t.attributeIsType=!1,"punctuation"}function W(t,r){if(r.isAttrs){if(Y[t.peek()]&&r.attrsNest.push(Y[t.peek()]),r.attrsNest[r.attrsNest.length-1]===t.peek())r.attrsNest.pop();else if(t.eat(")"))return r.isAttrs=!1,"punctuation";if(r.inAttributeName&&t.match(/^[^=,\)!]+/))return"="!==t.peek()&&"!"!==t.peek()||(r.inAttributeName=!1,r.jsState=e.startState(Z),"script"===r.lastTag&&"type"===t.current().trim().toLowerCase()?r.attributeIsType=!0:r.attributeIsType=!1),"attribute";var n=Z.token(t,r.jsState);if(r.attributeIsType&&"string"===n&&(r.scriptType=t.current().toString()),0===r.attrsNest.length&&("string"===n||"variable"===n||"keyword"===n))try{return Function("","var x "+r.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),r.inAttributeName=!0,r.attrValue="",t.backUp(t.current().length),W(t,r)}catch(e){}return r.attrValue+=t.current(),n||!0}}function E(e,t){if(e.match(/^&attributes\b/))return t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0,"keyword"}function P(e){if(e.sol()&&e.eatSpace())return"indent"}function j(e,t){if(e.match(/^ *\/\/(-)?([^\n]*)/))return t.indentOf=e.indentation(),t.indentToken="comment","comment"}function D(e){if(e.match(/^: */))return"colon"; -}function H(e,t){return e.match(/^(?:\| ?| )([^\n]+)/)?"string":e.match(/^(<[^\n]*)/,!1)?(B(e,t,"htmlmixed"),t.innerModeForLine=!0,R(e,t,!0)):void 0}function I(e,t){if(e.eat(".")){var r=null;return"script"===t.lastTag&&t.scriptType.toLowerCase().indexOf("javascript")!=-1?r=t.scriptType.toLowerCase().replace(/"|'/g,""):"style"===t.lastTag&&(r="css"),B(e,t,r),"dot"}}function F(e){return e.next(),null}function B(r,n,i){i=e.mimeModes[i]||i,i=t.innerModes?t.innerModes(i)||i:i,i=e.mimeModes[i]||i,i=e.getMode(t,i),n.indentOf=r.indentation(),i&&"null"!==i.name?n.innerMode=i:n.indentToken="string"}function R(t,r,n){return t.indentation()>r.indentOf||r.innerModeForLine&&!t.sol()||n?r.innerMode?(r.innerState||(r.innerState=r.innerMode.startState?e.startState(r.innerMode,t.indentation()):{}),t.hideFirstChars(r.indentOf+2,function(){return r.innerMode.token(t,r.innerState)||!0})):(t.skipToEnd(),r.indentToken):void(t.sol()&&(r.indentOf=1/0,r.indentToken=null,r.innerMode=null,r.innerState=null))}function $(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var r=t.restOfLine;return t.restOfLine="",r}}function q(){return new r}function V(e){return e.copy()}function U(e,t){var r=R(e,t)||$(e,t)||s(e,t)||y(e,t)||S(e,t)||W(e,t)||n(e,t)||i(e,t)||x(e,t)||o(e,t)||a(e,t)||l(e,t)||c(e,t)||u(e,t)||d(e,t)||f(e,t)||p(e,t)||h(e,t)||m(e,t)||g(e,t)||v(e,t)||b(e,t)||w(e,t)||k(e,t)||C(e,t)||M(e,t)||L(e,t)||T(e,t)||A(e,t)||z(e,t)||N(e,t)||O(e,t)||E(e,t)||P(e,t)||H(e,t)||j(e,t)||D(e,t)||I(e,t)||F(e,t);return r===!0?null:r}var K="keyword",G="meta",_="builtin",X="qualifier",Y={"{":"}","(":")","[":"]"},Z=e.getMode(t,"javascript");return r.prototype.copy=function(){var t=new r;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.interpolationNesting,t.jsState=e.copyState(Z,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:q,copyState:V,token:U}},"javascript","css","htmlmixed"),e.defineMIME("text/x-pug","pug"),e.defineMIME("text/x-jade","pug")})}),O=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?u:CodeMirror)}(function(e){e.multiplexingMode=function(t){function r(e,t,r,n){if("string"==typeof t){var i=e.indexOf(t,r);return n&&i>-1?i+t.length:i}var o=t.exec(r?e.slice(r):e);return o?o.index+r+(n?o[0].length:0):-1}var n=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(r){return{outer:e.copyState(t,r.outer),innerActive:r.innerActive,inner:r.innerActive&&e.copyState(r.innerActive.mode,r.inner)}},token:function(i,o){if(o.innerActive){var a=o.innerActive,l=i.string;if(!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);var s=a.close?r(l,a.close,i.pos,a.parseDelimiters):-1;if(s==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle&&a.delimStyle+" "+a.delimStyle+"-close";s>-1&&(i.string=l.slice(0,s));var c=a.mode.token(i,o.inner);return s>-1&&(i.string=l),s==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(c=c?c+" "+a.innerStyle:a.innerStyle),c}for(var u=1/0,l=i.string,d=0;d|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}]}),e.defineMode("handlebars",function(t,r){var n=e.getMode(t,"handlebars-tags");return r&&r.base?e.multiplexingMode(e.getMode(t,r.base),{open:"{{",close:"}}",mode:n,parseDelimiters:!0}):n}),e.defineMIME("text/x-handlebars-template","handlebars")})});r(function(e,t){!function(r){"object"==typeof t&&"object"==typeof e?r(u,x,S,M,T,C,A,z,N,W):r(CodeMirror)}(function(e){var t={script:[["lang",/coffee(script)?/,"coffeescript"],["type",/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,"coffeescript"]],style:[["lang",/^stylus$/i,"stylus"],["lang",/^sass$/i,"sass"],["type",/^(text\/)?(x-)?styl(us)?$/i,"stylus"],["type",/^text\/sass/i,"sass"]],template:[["lang",/^vue-template$/i,"vue"],["lang",/^pug$/i,"pug"],["lang",/^handlebars$/i,"handlebars"],["type",/^(text\/)?(x-)?pug$/i,"pug"],["type",/^text\/x-handlebars-template$/i,"handlebars"],[null,null,"vue-template"]]};e.defineMode("vue-template",function(t,r){var n={token:function(e){if(e.match(/^\{\{.*?\}\}/))return"meta mustache";for(;e.next()&&!e.match("{{",!1););return null}};return e.overlayMode(e.getMode(t,r.backdrop||"text/html"),n)}),e.defineMode("vue",function(r){return e.getMode(r,{name:"htmlmixed",tags:t})},"htmlmixed","xml","javascript","coffeescript","css","sass","stylus","pug","handlebars"),e.defineMIME("script/x-vue","vue"),e.defineMIME("text/x-vue","vue")})}),r(function(e,t){!function(r){"object"==typeof t&&"object"==typeof e?r(u,S,M):r(CodeMirror)}(function(e){function t(e,t,r,n){this.state=e,this.mode=t,this.depth=r,this.prev=n}function r(n){return new t(e.copyState(n.mode,n.state),n.mode,n.depth,n.prev&&r(n.prev))}e.defineMode("jsx",function(n,i){function o(e){var t=e.tagName;e.tagName=null;var r=c.indent(e,"");return e.tagName=t,r}function a(e,t){return t.context.mode==c?l(e,t,t.context):s(e,t,t.context)}function l(r,i,l){if(2==l.depth)return r.match(/^.*?\*\//)?l.depth=1:r.skipToEnd(),"comment";if("{"==r.peek()){c.skipAttribute(l.state);var s=o(l.state),d=l.state.context;if(d&&r.match(/^[^>]*>\s*$/,!1)){for(;d.prev&&!d.startOfLine;)d=d.prev;d.startOfLine?s-=n.indentUnit:l.prev.state.lexical&&(s=l.prev.state.lexical.indented)}else 1==l.depth&&(s+=n.indentUnit);return i.context=new t(e.startState(u,s),u,0,i.context),null}if(1==l.depth){if("<"==r.peek())return c.skipAttribute(l.state),i.context=new t(e.startState(c,o(l.state)),c,0,i.context),null;if(r.match("//"))return r.skipToEnd(),"comment";if(r.match("/*"))return l.depth=2,a(r,i)}var f,p=c.token(r,l.state),h=r.current();return/\btag\b/.test(p)?/>$/.test(h)?l.state.context?l.depth=0:i.context=i.context.prev:/^-1&&r.backUp(h.length-f),p}function s(r,n,i){if("<"==r.peek()&&u.expressionAllowed(r,i.state))return u.skipExpression(i.state),n.context=new t(e.startState(c,u.indent(i.state,"")),c,0,n.context),null;var o=u.token(r,i.state);if(!o&&null!=i.depth){var a=r.current();"{"==a?i.depth++:"}"==a&&0==--i.depth&&(n.context=n.context.prev)}return o}var c=e.getMode(n,{name:"xml",allowMissing:!0,multilineTagIndentPastTag:!1}),u=e.getMode(n,i&&i.base||"javascript");return{startState:function(){return{context:new t(e.startState(u),u)}},copyState:function(e){return{context:r(e.context)}},token:a,indent:function(e,t,r){return e.context.mode.indent(e.context.state,t,r)},innerMode:function(e){return e.context}}},"xml","javascript"),e.defineMIME("text/jsx","jsx"),e.defineMIME("text/typescript-jsx",{name:"jsx",base:{name:"javascript",typescript:!0}})})});Object.defineProperty(e,"__esModule",{value:!0})}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue/dist/vue.common")):"function"==typeof define&&define.amd?define(["exports","vue/dist/vue.common"],t):t(e.Vuep=e.Vuep||{},e.Vue)}(this,function(e,t){"use strict";function r(e,t){return t={exports:{}},e(t,t.exports),t.exports}function n(e){return o(e,"padding-top")+o(e,"padding-bottom")}function i(e){return o(e,"margin-top")+o(e,"margin-bottom")}function o(e,t){return parseInt(window.getComputedStyle(e,null).getPropertyValue(t))}function a(){var e=document.querySelectorAll('link[rel="stylesheet"]'),t=document.querySelectorAll("style");return Array.from(e).concat(Array.from(t))}function l(e,t){var r=/(^|\})\s*([^{]+)/g;return e.trim().replace(r,function(e,r,n){return r?r+" "+t+" "+n:t+" "+n})}function s(e){if(k.test(e))return c(e)}function c(e){var t=new XMLHttpRequest;if(C[e])return C[e];t.open("GET",e,!1),t.send();var r=t.responseText;return C[e]=u(r),C[e]}function u(e,t){if(void 0===t&&(t={}),"undefined"!=typeof Babel){var r=[];window["babel-plugin-transform-vue-jsx"]&&(Babel.availablePlugins["transform-vue-jsx"]||Babel.registerPlugin("transform-vue-jsx",window["babel-plugin-transform-vue-jsx"]),r.push("transform-vue-jsx")),e=Babel.transform(e,{presets:[["es2015",{loose:!0}],"stage-2"],plugins:r,comments:!1}).code}var n="";for(var i in t)t.hasOwnProperty(i)&&(n+="var "+i+" = __vuep['"+i+"'];");e="(function(exports){var module={};module.exports=exports;"+n+";"+e+";return module.exports.__esModule?module.exports.default:module.exports;})({})";var o=new Function("__vuep","return "+e)(t)||{};return o}function d(e,t){M.config(t),e.component(M.name,M)}t="default"in t?t.default:t;var f="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},p=r(function(e,t){!function(r,n){"object"==typeof t&&"undefined"!=typeof e?e.exports=n():r.CodeMirror=n()}(f,function(){function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}function d(e,t){for(var r=0;r=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function p(e){for(;Sa.length<=e;)Sa.push(h(Sa)+" ");return Sa[e]}function h(e){return e[e.length-1]}function m(e,t){for(var r=[],n=0;n"€"&&(e.toUpperCase()!=e.toLowerCase()||Ma.test(e))}function w(e,t){return t?!!(t.source.indexOf("\\w")>-1&&b(e))||t.test(e):b(e)}function x(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function k(e){return e.charCodeAt(0)>=768&&La.test(e)}function C(e,t,r){for(;(r<0?t>0:t=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&tr?P(r,L(e,r).text.length):$(t,L(e,t.line).text.length)}function $(e,t){var r=e.ch;return null==r||r>t?P(e.line,t):r<0?P(e.line,0):e}function V(e,t){for(var r=[],n=0;n=t:o.to>t);(n||(n=[])).push(new K(a,o.from,s?null:o.to))}}return n}function Z(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&l)for(var x=0;x0)){var u=[s,1],f=j(c.from,l.from),p=j(c.to,l.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}function te(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?j(c.to,r)>=0:j(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?j(c.from,n)<=0:j(c.from,n)<0)))return!0}}}function ue(e){for(var t;t=le(e);)e=t.find(-1,!0).line;return e}function de(e){for(var t;t=se(e);)e=t.find(1,!0).line;return e}function fe(e){for(var t,r;t=se(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function pe(e,t){var r=L(e,t),n=ue(r);return r==n?t:O(n)}function he(e,t){if(t>e.lastLine())return t;var r,n=L(e,t);if(!me(e,n))return t;for(;r=se(n);)n=r.find(1,!0).line;return O(n)+1}function me(e,t){var r=za&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function we(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;ot||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function xe(e,t,r){var n;Aa=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:Aa=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Aa=i)}return null!=n?n:Aa}function ke(e){var t=e.order;return null==t&&(t=e.order=Oa(e.text)),t}function Ce(e,t,r){var n=C(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Se(e,t,r){var n=Ce(e,t.ch,r);return null==n?null:new P(t.line,n,r<0?"after":"before")}function Me(e,t,r,n,i){if(e){var o=ke(r);if(o){var a,l=i<0?h(o):o[0],s=i<0==(1==l.level),c=s?"after":"before";if(l.level>0){var u=Xt(t,r);a=i<0?r.text.length-1:0;var d=Yt(t,u,a).top;a=S(function(e){return Yt(t,u,e).top==d},i<0==(1==l.level)?l.from:l.to-1,a),"before"==c&&(a=Ce(r,a,1,!0))}else a=i<0?l.to:l.from;return new P(n,a,c)}}return new P(n,i<0?r.text.length:0,i<0?"before":"after")}function Le(e,t,r,n){var i=ke(t);if(!i)return Se(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=xe(i,r.ch,r.sticky),a=i[o];if(a.level%2==0&&(n>0?a.to>r.ch:a.from0?d>=a.from&&d>=u.begin:d<=a.to&&d<=u.end)){var f=n<0?"before":"after";return new P(r.line,d,f)}}var p=function(e,t,n){for(var o=function(e,t){return t?new P(r.line,s(e,1),"before"):new P(r.line,e,"after")};e>=0&&e0==(1!=a.level),c=l?n.begin:s(n.end,-1);if(a.from<=c&&c0?u.end:s(u.begin,-1);return null==m||n>0&&m==t.text.length||!(h=p(n>0?0:i.length-1,n,c(m)))?null:h}function Te(e,t){return e._handlers&&e._handlers[t]||Na}function ze(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=d(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ae(e,t){var r=Te(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function Ee(e){e.prototype.on=function(e,t){Wa(this,e,t)},e.prototype.off=function(e,t){ze(this,e,t)}}function Pe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function je(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ie(e){Pe(e),je(e)}function He(e){return e.target||e.srcElement}function Fe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),la&&e.ctrlKey&&1==t&&(t=3),t}function Be(e){if(null==va){var t=n("span","​");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(va=t.offsetWidth<=1&&t.offsetHeight>2&&!(Yo&&Zo<8))}var i=va?n("span","​"):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Re(e){if(null!=ya)return ya;var n=r(e,document.createTextNode("AخA")),i=da(n,0,1).getBoundingClientRect(),o=da(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(ya=o.right-i.right<3)}function $e(e){if(null!=Ia)return Ia;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=da(t,0,1).getBoundingClientRect();return Ia=Math.abs(i.left-o.left)>1}function Ve(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ha[e]=t}function qe(e,t){Fa[e]=t}function Ue(e){if("string"==typeof e&&Fa.hasOwnProperty(e))e=Fa[e];else if(e&&"string"==typeof e.name&&Fa.hasOwnProperty(e.name)){var t=Fa[e.name];"string"==typeof t&&(t={name:t}),e=y(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ue("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ue("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ke(e,t){t=Ue(t);var r=Ha[t.name];if(!r)return Ke(e,"text/plain");var n=r(e,t);if(Ba.hasOwnProperty(t.name)){var i=Ba[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}function Ge(e,t){var r=Ba.hasOwnProperty(e)?Ba[e]:Ba[e]={};c(t,r)}function _e(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Xe(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),r&&r.mode!=e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ye(e,t,r){return!e.startState||e.startState(t,r)}function Ze(e,t,r,n){var i=[e.state.modeGen],o={};ot(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=function(r){var n=e.state.overlays[r],a=1,l=0;ot(e,t.text,n.mode,!0,function(e,t){for(var r=a;le&&i.splice(a,1,e,i[a+1],o),a+=2,l=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;re.options.maxHighlightLength?_e(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Je(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=at(e,t,r),a=o>n.first&&L(n,o-1).stateAfter;return a=a?_e(n.mode,a):Ye(n.mode),n.iter(o,t,function(r){et(e,r.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&ot.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function nt(e,t,r,n){var i,o=function(e){return{start:d.start,end:d.pos,string:d.current(),type:i||null,state:e?_e(a.mode,u):u}},a=e.doc,l=a.mode;t=R(a,t);var s,c=L(a,t.line),u=Je(e,t.line,r),d=new Ra(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pose.options.maxHighlightLength?(l=!1,a&&et(e,t,n,d.pos),d.pos=t.length,s=null):s=it(rt(r,d,n,f),o),f){var p=f[0].name;p&&(s="m-"+(s?p+" "+s:p))}if(!l||u!=s){for(;ca;--l){if(l<=o.first)return o.first;var s=L(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var c=u(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}function lt(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),te(e),re(e,r);var i=n?n(e):1;i!=e.height&&A(e,i)}function st(e){e.parent=null,te(e)}function ct(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Ua:qa;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ut(e,t){var r=n("span",null,null,Qo?"padding-right: .1px":null),i={pre:n("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(Yo||Qo)&&e.getOption("lineWrapping")};r.setAttribute("role","presentation"),i.pre.setAttribute("role","presentation"),t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,s=void 0;i.pos=0,i.addToken=ft,Re(e.display.measure)&&(s=ke(a))&&(i.addToken=ht(i.addToken,s)),i.map=[];var c=t!=e.display.externalMeasured&&O(a);gt(a,i,Qe(e,a,c)),a.styleClasses&&(a.styleClasses.bgClass&&(i.bgClass=l(a.styleClasses.bgClass,i.bgClass||"")),a.styleClasses.textClass&&(i.textClass=l(a.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Be(e.display.measure))),0==o?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Qo){var u=i.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Ae(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=l(i.pre.className,i.textClass||"")),i}function dt(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ft(e,t,r,i,o,a,l){if(t){var s,c=e.splitSpaces?pt(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1;if(u.test(t)){s=document.createDocumentFragment();for(var f=0;;){u.lastIndex=f;var h=u.exec(t),m=h?h.index-f:t.length-f;if(m){var g=document.createTextNode(c.slice(f,f+m));Yo&&Zo<9?s.appendChild(n("span",[g])):s.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;f+=m+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=s.appendChild(n("span",p(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(v=s.appendChild(n("span","\r"==h[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",h[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(h[0]),v.setAttribute("cm-text",h[0]),Yo&&Zo<9?s.appendChild(n("span",[v])):s.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,s=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,s),Yo&&Zo<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||i||o||d||l){var w=r||"";i&&(w+=i),o&&(w+=o);var x=n("span",[s],w,l);return a&&(x.title=a),e.content.appendChild(x)}e.content.appendChild(s)}}function pt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;ic&&d.from<=c));f++);if(d.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-c),i,o,null,l,s),o=null,n=n.slice(d.to-c),c=d.to}}}function mt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function gt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){s=c=u=d=l="",f=null,v=1/0;for(var y=[],b=void 0,w=0;wh||k.collapsed&&x.to==h&&x.from==h)?(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==h&&(u+=" "+k.startStyle),k.endStyle&&x.to==v&&(b||(b=[])).push(k.endStyle,x.to),k.title&&!d&&(d=k.title),k.collapsed&&(!f||oe(f.marker,k)<0)&&(f=x)):x.from>h&&v>x.from&&(v=x.from)}if(b)for(var C=0;C=p)break;for(var M=Math.min(p,v);;){if(g){var L=h+g.length;if(!f){var T=L>M?g.slice(0,M-h):g;t.addToken(t,T,a?a+s:s,u,h+T.length==v?c:"",d,l)}if(L>=M){g=g.slice(M-h),h=M;break}h=L,u=""}g=i.slice(o,o=r[m++]),a=ct(r[m++],t.cm.options)}}else for(var z=1;z2&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Ut(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Kt(e,t){t=ue(t);var n=O(t),i=e.display.externalMeasured=new vt(e.doc,t,n);i.lineN=n;var o=i.built=ut(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function Gt(e,t,r,n){return Yt(e,Xt(e,t),r,n)}function _t(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(o=s-l,i=o-1,t>=s&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[(c-=3)+2],a="left";if("right"==r&&i==s-l)for(;c=0&&(r=e[i]).left==r.right;i--);return r}function Jt(e,t,r,n){var i,o=Zt(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&k(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s0&&(c=n="right");var d;i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(Yo&&Zo<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+vr(e.display),top:f.top,bottom:f.bottom}:_a}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,g=t.view.measure.heights,v=0;v=n.text.length?(c=n.text.length,u="before"):c<=0&&(c=0,u="after"),!s)return a("before"==u?c-1:c,"before"==u);var d=xe(s,c,u),f=Aa,p=l(c,d,"before"==u);return null!=f&&(p.other=l(c,f,"before"!=u)),p}function ur(e,t){var r=0;t=R(e.doc,t),e.options.lineWrapping||(r=vr(e.display)*t.ch);var n=L(e.doc,t.line),i=ve(n)+Ht(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function dr(e,t,r,n,i){var o=P(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function fr(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return dr(n.first,0,null,!0,-1);var i=N(n,r),o=n.first+n.size-1;if(i>o)return dr(n.first+n.size-1,L(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=L(n,i);;){var l=mr(e,a,i,t,r),s=se(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=O(a=c.to.line)}}function pr(e,t,r,n){var i=function(n){return ar(e,t,Yt(e,r,n),"line")},o=t.text.length,a=S(function(e){return i(e-1).bottom<=n},o,0);return o=S(function(e){return i(e).top>n},a,o),{begin:a,end:o}}function hr(e,t,r,n){var i=ar(e,t,Yt(e,r,n),"line").top;return pr(e,t,r,i)}function mr(e,t,r,n,i){i-=ve(t);var o,a=0,l=t.text.length,s=Xt(e,t),c=ke(t);if(c){if(e.options.lineWrapping){var u;u=pr(e,t,s,i),a=u.begin,l=u.end,u}o=new P(r,a);var d,f,p=cr(e,o,"line",t,s).left,h=pMath.abs(d)){if(m<0==d<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=f}}else{var g=S(function(r){var o=ar(e,t,Yt(e,s,r),"line");return o.top>i?(l=Math.min(r,l),!0):!(o.bottom<=i)&&(o.left>n||!(o.rightv.right?1:0,o}function gr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Va){Va=n("pre");for(var i=0;i<49;++i)Va.appendChild(document.createTextNode("x")),Va.appendChild(n("br"));Va.appendChild(document.createTextNode("x"))}r(e.measure,Va);var o=Va.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function vr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function yr(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:br(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function br(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function wr(e){var t=gr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/vr(e.display)-3);return function(i){if(me(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n=e.display.viewTo||l.to().line3&&(i(p,m.top,null,m.bottom),p=u,m.bottoms.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),p0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ar(e){e.state.focused||(e.display.input.focus(),Nr(e))}function Or(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Wr(e))},100)}function Nr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ae(e,"focus",e,t),e.state.focused=!0,a(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Qo&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),zr(e))}function Wr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ae(e,"blur",e,t),e.state.focused=!1,ha(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Er(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=br(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a.001||s<-.001)&&(A(i.line,o),Dr(i.line),i.rest))for(var c=0;c=a&&(o=N(t,ve(L(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Hr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Ko||Sn(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Ko&&Sn(e),bn(e,100))}function Fr(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Er(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Br(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function Rr(e){var t=Br(e);return t.x*=Ya,t.y*=Ya,t}function $r(e,t){var r=Br(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&la&&Qo)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!ia){var a=n("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Ht(e.display))+"px;\n height: "+(t.bottom-t.top+Rt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function _r(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var a=!1;i=cr(e,t);var l=r&&r!=t?cr(e,r):i,s=Yr(e,Math.min(i.left,l.left),Math.min(i.top,l.top)-n,Math.max(i.left,l.left),Math.max(i.bottom,l.bottom)+n),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(Hr(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=s.scrollLeft&&(Fr(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(a=!0)),!a)break}return i}function Xr(e,t,r,n,i){var o=Yr(e,t,r,n,i);null!=o.scrollTop&&Hr(e,o.scrollTop),null!=o.scrollLeft&&Fr(e,o.scrollLeft)}function Yr(e,t,r,n,i){var o=e.display,a=gr(e.display);r<0&&(r=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Vt(e),c={};i-r>s&&(i=r+s);var u=e.doc.height+Ft(o),d=ru-a;if(rl+s){var p=Math.min(r,(f?u:i)-s);p!=l&&(c.scrollTop=p)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=$t(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=n-t>m;return g&&(n=t+m),t<10?c.scrollLeft=0:tm+h-3&&(c.scrollLeft=n+(g?0:10)-m),c}function Zr(e,t,r){null==t&&null==r||Jr(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Qr(e){Jr(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?P(t.line,t.ch-1):t,n=P(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Jr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=ur(e,t.from),n=ur(e,t.to),i=Yr(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function en(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++el},bt(e.curOp)}function tn(e){var t=e.curOp;xt(t,function(e){for(var t=0;t=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new tl(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function on(e){e.updatedDisplay=e.mustUpdate&&kn(e.cm,e.update)}function an(e){var t=e.cm,r=t.display;e.updatedDisplay&&jr(t),e.barMeasure=Vr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Gt(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Rt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-$t(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function ln(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)za&&pe(e.doc,t)i.viewFrom?mn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)mn(e);else if(t<=i.viewFrom){var o=gn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):mn(e)}else if(r>=i.viewTo){var a=gn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):mn(e)}else{var l=gn(e,t,t,-1),s=gn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(yt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):mn(e)}var c=i.externalMeasured;c&&(r=i.lineN&&t=n.viewTo)){var o=n.view[Cr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);d(a,r)==-1&&a.push(r)}}}function mn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function gn(e,t,r,n){var i,o=Cr(e,t),a=e.display.view;if(!za||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;pe(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function vn(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=yt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=yt(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Cr(e,r)))),n.viewTo=r}function yn(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo)){var r=+new Date+e.options.workTime,n=_e(t.mode,Je(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Ze(e,o,l?_e(t.mode,n):n,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&fr)return bn(e,e.options.workDelay),!0}),i.length&&cn(e,function(){for(var t=0;t=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==yn(e))return!1;Pr(e)&&(mn(e),r.dims=yr(e));var a=i.first+i.size,l=Math.max(r.visible.from-e.options.viewportMargin,i.first),s=Math.min(a,r.visible.to+e.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(a,n.viewTo)),za&&(l=pe(e.doc,l),s=he(e.doc,s));var c=l!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;vn(e,l,s),n.viewOffset=ve(L(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=yn(e);if(!c&&0==u&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var d=o();return u>4&&(n.lineDiv.style.display="none"),Mn(e,n.updateLineNumbers,r.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,d&&o()!=d&&d.offsetHeight&&d.focus(),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,c&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,bn(e,400)),n.updateLineNumbers=null,!0}function Cn(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=$t(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Ft(e.display)-Vt(e),r.top)}),t.visible=Ir(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&kn(e,t);n=!1){jr(e);var i=Vr(e);Sr(e),qr(e,i),Tn(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Sn(e,t){var r=new tl(e,t);if(kn(e,r)){jr(e),Cn(e,r);var n=Vr(e);Sr(e),qr(e,n),Tn(e,n),r.finish()}}function Mn(e,r,n){function i(t){var r=t.nextSibling;return Qo&&la&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,a=e.options.lineNumbers,l=o.lineDiv,s=l.firstChild,c=o.view,u=o.viewFrom,f=0;f-1&&(h=!1),St(e,p,u,n)),h&&(t(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(E(e.options,u)))),s=p.node.nextSibling}else{var m=Wt(e,p,u,n);l.insertBefore(m,s)}u+=p.size}for(;s;)s=i(s)}function Ln(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Tn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Rt(e)+"px"}function zn(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function On(e,t){var r=e[t];e.sort(function(e,t){return j(e.from(),t.from())}),t=d(e,r);for(var n=1;n=0){var a=F(o.from(),i.from()),l=H(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new nl(s?l:a,s?a:l))}}return new rl(e,t)}function Nn(e,t){return new rl([new nl(e,t||e)],0)}function Wn(e){return e.text?P(e.from.line+e.text.length-1,h(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function En(e,t){if(j(e,t.from)<0)return e;if(j(e,t.to)<=0)return Wn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Wn(t).ch-t.to.ch),P(r,n)}function Pn(e,t){for(var r=[],n=0;n1&&e.remove(l.line+1,m-1),e.insert(l.line+1,y)}kt(e,"change",e,t)}function Rn(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),h(e.done)):void 0}function Gn(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Kn(i,i.lastOp==n)))a=h(o.changes),0==j(t.from,t.to)&&0==j(t.from,a.to)?a.to=Wn(t):o.changes.push(qn(e,t));else{var s=h(i.done);for(s&&s.ranges||Yn(e.sel,i.done),o={changes:[qn(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ae(e,"historyAdded")}function _n(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Xn(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||_n(e,o,h(i.done),t))?i.done[i.done.length-1]=t:Yn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&Un(i.undone)}function Yn(e,t){var r=h(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Zn(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function Qn(e){if(!e)return null;for(var t,r=0;r-1&&(h(l)[f]=c[f],delete c[f])}}}return n}function ri(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=j(r,i)<0;o!=j(n,i)<0?(i=r,r=n):o!=j(r,n)<0&&(r=n)}return new nl(i,r)}return new nl(n||r,r)}function ni(e,t,r,n){ci(e,new rl([ri(e,e.sel.primary(),t,r)],0),n)}function ii(e,t,r){for(var n=[],i=0;i=t.ch:l.to>t.ch))){if(i&&(Ae(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var c=s.find(n<0?1:-1),u=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(c=gi(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=j(c,r))&&(n<0?u<0:u>0))return hi(e,c,t,n,i)}var d=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(d=gi(e,d,n,d.line==t.line?o:null)),d?hi(e,d,t,n,i):null}}return t}function mi(e,t,r,n,i){var o=n||1,a=hi(e,t,r,o,i)||!i&&hi(e,t,r,o,!0)||hi(e,t,r,-o,i)||!i&&hi(e,t,r,-o,!0);return a?a:(e.cantEdit=!0,P(e.first,0))}function gi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?R(e,P(t.line-1)):null:r>0&&t.ch==(n||L(e,t.line)).text.length?t.line=0;--i)wi(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else wi(e,t)}}function wi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=j(t.from,t.to)){var r=Pn(e,t);Gn(e,t,r,e.cm?e.cm.curOp.id:NaN),Ci(e,t,r,Q(e,t));var n=[];Rn(e,function(e,r){r||d(n,e.history)!=-1||(zi(e.history,t),n.push(e.history)),Ci(e,t,null,Q(e,t))})}}function xi(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s=0;--p){var m=f(p);if(m)return m.v}}}}function ki(e,t){if(0!=t&&(e.first+=t,e.sel=new rl(m(e.sel.ranges,function(e){return new nl(P(e.anchor.line+t,e.anchor.ch),P(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){pn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:P(o,L(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=T(e,t.from,t.to),r||(r=Pn(e,t)),e.cm?Si(e.cm,t,n):Bn(e,t,n),ui(e,r,xa)}}function Si(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=O(ue(L(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ne(e),Bn(n,t,r,wr(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=ye(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),bn(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?pn(e):o.line!=a.line||1!=t.text.length||Fn(e.doc,t)?pn(e,o.line,a.line+1,c):hn(e,o.line,"text");var u=We(e,"changes"),d=We(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&kt(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function Mi(e,t,r,n,i){if(n||(n=r),j(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),bi(e,{from:r,to:n,text:t,origin:i})}function Li(e,t,r,n){r0||0==l&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=n("span",[a.replacedWith],"CodeMirror-widget"),a.widgetNode.setAttribute("role","presentation"),i.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ce(e,t.line,t,r,a)||t.line!=r.line&&ce(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");U()}a.addToHistory&&Gn(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,u=t.line,d=e.cm;if(e.iter(u,r.line+1,function(e){d&&a.collapsed&&!d.options.lineWrapping&&ue(e)==d.display.maxLine&&(s=!0),a.collapsed&&u!=t.line&&A(e,0),X(e,new K(a,u==t.line?t.ch:null,u==r.line?r.ch:null)),++u}),a.collapsed&&e.iter(t.line,r.line+1,function(t){me(e,t)&&A(t,0)}),a.clearOnEnter&&Wa(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(q(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++ll,a.atomic=!0),d){if(s&&(d.curOp.updateMaxLine=!0),a.collapsed)pn(d,t.line,r.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var f=t.line;f<=r.line;f++)hn(d,f,"text");a.atomic&&fi(d.doc),kt(d,"markerAdded",d,a)}return a}function Ei(e,t,r,n,i){n=c(n),n.shared=!1;var o=[Wi(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Rn(e,function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(Wi(e,R(e,t),R(e,r),n,i));for(var s=0;s-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),ui(t.doc,Nn(r,r)),u)for(var f=0;f=0;t--)Mi(e.doc,"",n[t].from,n[t].to,"+delete");Qr(e)})}function Qi(e,t){var r=L(e.doc,t),n=ue(r);return n!=r&&(t=O(n)),Me(!0,e,n,t,1)}function Ji(e,t){var r=L(e.doc,t),n=de(r);return n!=r&&(t=O(n)),Me(!0,e,r,t,-1)}function eo(e,t){var r=Qi(e,t.line),n=L(e.doc,r.line),i=ke(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return P(r.line,a?0:o,r.sticky)}return r}function to(e,t,r){if("string"==typeof t&&(t=xl[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=wa}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function ro(e,t,r){for(var n=0;ni-400&&0==j(wl.pos,r)?n="triple":bl&&bl.time>i-400&&0==j(bl.pos,r)?(n="double",wl={time:i,pos:r}):(n="single",bl={time:i,pos:r});var a,l=e.doc.sel,c=la?t.metaKey:t.ctrlKey;e.options.dragDrop&&Ea&&!e.isReadOnly()&&"single"==n&&(a=l.contains(r))>-1&&(j((a=l.ranges[a]).from(),r)<0||r.xRel>0)&&(j(a.to(),r)>0||r.xRel<0)?po(e,t,r,c):ho(e,t,r,n,c)}function po(e,t,r,n){var i=e.display,o=+new Date,a=un(e,function(l){Qo&&(i.scroller.draggable=!1),e.state.draggingText=!1,ze(document,"mouseup",a),ze(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(Pe(l),!n&&+new Date-200w&&i.push(new nl(P(g,w),P(g,f(y,c,o))))}i.length||i.push(new nl(r,r)),ci(d,On(m.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=p,k=x.anchor,C=t;if("single"!=n){var S;S="double"==n?e.findWordAt(t):new nl(P(t.line,0),R(d,P(t.line+1,0))),j(S.anchor,k)>0?(C=S.head,k=F(x.from(),S.anchor)):(C=S.anchor,k=H(x.to(),S.head))}var M=m.ranges.slice(0);M[h]=new nl(R(d,k),C),ci(d,On(M,h),ka)}}function l(t){var r=++x,i=kr(e,t,!0,"rect"==n);if(i)if(0!=j(i,b)){e.curOp.focus=o(),a(i);var s=Ir(c,d);(i.line>=s.to||i.linew.bottom?20:0;u&&setTimeout(un(e,function(){x==r&&(c.scroller.scrollTop+=u,l(t))}),50)}}function s(t){e.state.selectingText=!1,x=1/0,Pe(t),c.input.focus(),ze(document,"mousemove",k),ze(document,"mouseup",C),d.history.lastSelOrigin=null}var c=e.display,d=e.doc;Pe(t);var p,h,m=d.sel,g=m.ranges;if(i&&!t.shiftKey?(h=d.sel.contains(r),p=h>-1?g[h]:new nl(r,r)):(p=d.sel.primary(),h=d.sel.primIndex),sa?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(p=new nl(r,r)),r=kr(e,t,!0,!0),h=-1;else if("double"==n){var v=e.findWordAt(r);p=e.display.shift||d.extend?ri(d,p,v.anchor,v.head):v}else if("triple"==n){var y=new nl(P(r.line,0),R(d,P(r.line+1,0)));p=e.display.shift||d.extend?ri(d,p,y.anchor,y.head):y}else p=ri(d,p,r);i?h==-1?(h=g.length,ci(d,On(g.concat([p]),h),{scroll:!1,origin:"*mouse"})):g.length>1&&g[h].empty()&&"single"==n&&!t.shiftKey?(ci(d,On(g.slice(0,h).concat(g.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),m=d.sel):oi(d,h,p,ka):(h=0,ci(d,new rl([p],0),ka),m=d.sel);var b=r,w=c.wrapper.getBoundingClientRect(),x=0,k=un(e,function(e){Fe(e)?l(e):s(e)}),C=un(e,s);e.state.selectingText=C,Wa(document,"mousemove",k),Wa(document,"mouseup",C)}function mo(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Pe(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!We(e,r))return De(t);o-=l.top-a.viewOffset;for(var s=0;s=i){var u=N(e.doc,o),d=e.options.gutters[s];return Ae(e,r,e,u,d,t),De(t)}}}function go(e,t){return mo(e,t,"gutterClick",!0)}function vo(e,t){It(e.display,t)||yo(e,t)||Oe(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function yo(e,t){return!!We(e,"gutterContextMenu")&&mo(e,t,"gutterContextMenu",!1)}function bo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),nr(e)}function wo(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=Sl&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=Sl,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,In(e)},!0),t("indentUnit",2,In,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Hn(e),nr(e),pn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(P(n,o))}n++});for(var i=r.length-1;i>=0;i--)Mi(e.doc,t,r[i],P(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Sl&&e.refresh()}),t("specialCharPlaceholder",dt,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",aa?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!ca),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){bo(e),xo(e)},!0),t("keyMap","default",function(e,t,r){var n=Yi(t),i=r!=Sl&&Yi(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("lineWrapping",!1,Co,!0),t("gutters",[],function(e){An(e.options),xo(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?br(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return qr(e)},!0),t("scrollbarStyle","native",function(e){Kr(e),qr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){An(e.options),xo(e)},!0),t("firstLineNumber",1,xo,!0),t("lineNumberFormatter",function(e){return e},xo,!0),t("showCursorWhenSelecting",!1,Sr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(Wr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,ko),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Sr,!0),t("singleCursorHeightPerLine",!0,Sr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Hn,!0),t("addModeClass",!1,Hn,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Hn,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null)}function xo(e){zn(e),pn(e),Er(e)}function ko(e,t,r){var n=r&&r!=Sl;if(!t!=!n){var i=e.display.dragFunctions,o=t?Wa:ze;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Co(e){e.options.lineWrapping?(a(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ha(e.display.wrapper,"CodeMirror-wrap"),be(e)),xr(e),pn(e),nr(e),setTimeout(function(){return qr(e)},100)}function So(e,t){var r=this;if(!(this instanceof So))return new So(e,t);this.options=t=t?c(t):{},c(Ml,t,!1),An(t);var n=t.value;"string"==typeof n&&(n=new dl(n,t.mode,null,t.lineSeparator)),this.doc=n;var i=new So.inputStyles[t.inputStyle](this),o=this.display=new M(e,n,i);o.wrapper.CodeMirror=this,zn(this),bo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Kr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new ga,keySeq:null,specialChars:null},t.autofocus&&!aa&&o.input.focus(),Yo&&Zo<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Mo(this),$i(),en(this),this.curOp.forceUpdate=!0,$n(this,n),t.autofocus&&!aa||this.hasFocus()?setTimeout(s(Nr,this),20):Wr(this);for(var a in Ll)Ll.hasOwnProperty(a)&&Ll[a](r,t[a],Sl);Pr(this),t.finishInit&&t.finishInit(this);for(var l=0;l400}var i=e.display;Wa(i.scroller,"mousedown",un(e,uo)),Yo&&Zo<11?Wa(i.scroller,"dblclick",un(e,function(t){if(!Oe(e,t)){var r=kr(e,t);if(r&&!go(e,t)&&!It(e.display,t)){Pe(t);var n=e.findWordAt(r);ni(e.doc,n.anchor,n.head)}}})):Wa(i.scroller,"dblclick",function(t){return Oe(e,t)||Pe(t)}),pa||Wa(i.scroller,"contextmenu",function(t){return vo(e,t)});var o,a={end:0};Wa(i.scroller,"touchstart",function(t){if(!Oe(e,t)&&!r(t)){i.input.ensurePolled(),clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Wa(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Wa(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!It(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||n(o,o.prev)?new nl(l,l):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(l):new nl(P(l.line,0),R(e.doc,P(l.line+1,0))), +e.setSelection(a.anchor,a.head),e.focus(),Pe(r)}t()}),Wa(i.scroller,"touchcancel",t),Wa(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Hr(e,i.scroller.scrollTop),Fr(e,i.scroller.scrollLeft,!0),Ae(e,"scroll",e))}),Wa(i.scroller,"mousewheel",function(t){return $r(e,t)}),Wa(i.scroller,"DOMMouseScroll",function(t){return $r(e,t)}),Wa(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Oe(e,t)||Ie(t)},over:function(t){Oe(e,t)||(Fi(e,t),Ie(t))},start:function(t){return Hi(e,t)},drop:un(e,Ii),leave:function(t){Oe(e,t)||Bi(e)}};var l=i.input.getField();Wa(l,"keyup",function(t){return so.call(e,t)}),Wa(l,"keydown",un(e,ao)),Wa(l,"keypress",un(e,co)),Wa(l,"focus",function(t){return Nr(e,t)}),Wa(l,"blur",function(t){return Wr(e,t)})}function Lo(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Je(e,t):r="prev");var a=e.options.tabSize,l=L(o,t),s=u(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,d=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&(c=o.mode.indent(i,l.text.slice(d.length),l.text),c==wa||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?u(L(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var m=Math.floor(c/a);m;--m)h+=a,f+="\t";if(h1)if(zl&&zl.text.join("\n")==t){if(n.ranges.length%zl.text.length==0){s=[];for(var c=0;c=0;d--){var f=n.ranges[d],p=f.from(),g=f.to();f.empty()&&(r&&r>0?p=P(p.line,p.ch-r):e.state.overwrite&&!a?g=P(g.line,Math.min(L(o,g.line).text.length,g.ch+h(l).length)):zl&&zl.lineWise&&zl.text.join("\n")==t&&(p=g=P(p.line,0))),u=e.curOp.updateInput;var v={from:p,to:g,text:s?s[d%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};bi(e.doc,v),kt(e,"inputRead",e,v)}t&&!a&&Oo(e,t),Qr(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Ao(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||cn(t,function(){return zo(t,r,0,null,"paste")}),!0}function Oo(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l-1){a=Lo(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(L(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Lo(e,i.head.line,"smart"));a&&kt(e,"electricInput",e,i.head.line)}}}function No(e){for(var t=[],r=[],n=0;nn&&(Lo(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Qr(t));else{var a=o.from(),l=o.to(),s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c0&&oi(t.doc,i,new nl(a,u[i].to()),xa)}}}),getTokenAt:function(e,t){return nt(this,e,t)},getLineTokens:function(e,t){return nt(this,P(e),t,!0)},getTokenTypeAt:function(e){e=R(this.doc,e);var t,r=Qe(this,L(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]o&&(e=o,i=!0),n=L(this.doc,e)}else n=e;return ar(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-ve(n):0)},defaultTextHeight:function(){return gr(this.display)},defaultCharWidth:function(){return vr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=cr(this,R(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&Xr(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:dn(ao),triggerOnKeyPress:dn(co),triggerOnKeyUp:so,execCommand:function(e){if(xl.hasOwnProperty(e))return xl[e].call(null,this)},triggerElectric:dn(function(e){Oo(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=R(this.doc,e),l=0;l0&&l(r.charAt(n-1));)--n;for(;i.5)&&xr(this),Ae(this,"refresh",this)}),swapDoc:dn(function(e){var t=this.doc;return t.cm=null,$n(this,e),nr(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,kt(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ee(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}function jo(e,t,r,n,i){function o(){var n=t.line+r;return!(n=e.first+e.size)&&(t=new P(n,t.ch,t.sticky),c=L(e,n))}function a(n){var a;if(a=i?Le(e.cm,c,t,r):Se(c,t,r),null==a){if(n||!o())return!1;t=Me(i,e.cm,c,t.line,r)}else t=a;return!0}var l=t,s=r,c=L(e,t.line);if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var u=null,d="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(r<0)||a(!p);p=!1){var h=c.text.charAt(t.ch)||"\n",m=w(h,f)?"w":d&&"\n"==h?"n":!d||/\s/.test(h)?null:"p";if(!d||p||m||(m="s"),u&&u!=m){r<0&&(r=1,a(),t.sticky="after");break}if(m&&(u=m),r>0&&!a(!p))break}var g=mi(e,t,l,s,!0);return D(l,g)&&(g.hitSide=!0),g}function Do(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*gr(e.display),3);i=(r>0?t.bottom:t.top)+r*s}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var c;c=fr(e,a,i),c.outside;){if(r<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*r}return c}function Io(e,t){var r=_t(e,t.line);if(!r||r.hidden)return null;var n=L(e.doc,t.line),i=Ut(r,n,t.line),o=ke(n),a="left";if(o){var l=xe(o,t.ch);a=l%2?"right":"left"}var s=Zt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Ho(e,t){return t&&(e.bad=!0),e}function Fo(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void(l+=""==r?t.textContent.replace(/\u200b/g,""):r);var u,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(P(n,0),P(i+1,0),o(+d));return void(f.length&&(u=f[0].find())&&(l+=T(e.doc,u.from,u.to).join(c)))}if("false"==t.getAttribute("contenteditable"))return;for(var p=0;p=15&&(ta=!1,Qo=!0);var da,fa=la&&(Jo||ta&&(null==ua||ua<12.11)),pa=Ko||Yo&&Zo>=9,ha=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};da=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var ma=function(e){e.select()};oa?ma=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Yo&&(ma=function(e){try{e.select()}catch(e){}});var ga=function(){this.id=null};ga.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var va,ya,ba=30,wa={toString:function(){return"CodeMirror.Pass"}},xa={scroll:!1},ka={origin:"*mouse"},Ca={origin:"+move"},Sa=[""],Ma=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,La=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,Ta=!1,za=!1,Aa=null,Oa=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(r){if(!i.test(r))return!1;for(var n=r.length,u=[],d=0;d=this.string.length},Ra.prototype.sol=function(){return this.pos==this.lineStart},Ra.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ra.prototype.next=function(){if(this.post},Ra.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},Ra.prototype.skipToEnd=function(){this.pos=this.string.length},Ra.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ra.prototype.backUp=function(e){this.pos-=e},Ra.prototype.column=function(){return this.lastColumnPos0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},Ra.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ra.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};var $a=function(e,t,r){this.text=e,re(this,t),this.height=r?r(this):1};$a.prototype.lineNo=function(){return O(this)},Ee($a);var Va,qa={},Ua={},Ka=null,Ga=null,_a={left:0,right:0,top:0,bottom:0},Xa=0,Ya=null;Yo?Ya=-.53:Ko?Ya=15:ea?Ya=-.7:ra&&(Ya=-1/3);var Za=function(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),Wa(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Wa(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Yo&&Zo<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Za.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Za.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},Za.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},Za.prototype.zeroWidthHack=function(){var e=la&&!na?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ga,this.disableVert=new ga},Za.prototype.enableZeroWidthBar=function(e,t){function r(){var n=e.getBoundingClientRect(),i=document.elementFromPoint(n.left+1,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},Za.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Qa=function(){};Qa.prototype.update=function(){return{bottom:0,right:0}},Qa.prototype.setScrollLeft=function(){},Qa.prototype.setScrollTop=function(){},Qa.prototype.clear=function(){};var Ja={native:Za,null:Qa},el=0,tl=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Ir(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=$t(e),this.force=r,this.dims=yr(e),this.events=[]};tl.prototype.signal=function(e,t){We(e,t)&&this.events.push(arguments)},tl.prototype.finish=function(){for(var e=this,t=0;t=0&&j(e,i.to())<=0)return n}return-1};var nl=function(e,t){this.anchor=e,this.head=t};nl.prototype.from=function(){return F(this.anchor,this.head)},nl.prototype.to=function(){return H(this.anchor,this.head)},nl.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var il=function(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n1||!(this.children[0]instanceof il))){var s=[];this.collapse(s),this.children=[new il(s)],this.children[0].parent=this}},ol.prototype.collapse=function(e){for(var t=this,r=0;r50){for(var l=o.lines.length%25+25,s=l;s10);e.parent.maybeSpill()}},ol.prototype.iterN=function(e,t,r){for(var n=this,i=0;it.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&pn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&fi(t.doc)),t&&kt(t,"markerCleared",t,this),r&&tn(t),this.parent&&this.parent.clear()}},sl.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o=0;c--)bi(n,i[c]);s?si(this,s):this.cm&&Qr(this.cm)}),undo:fn(function(){xi(this,"undo")}),redo:fn(function(){xi(this,"redo")}),undoSelection:fn(function(){xi(this,"undo",!0)}),redoSelection:fn(function(){xi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=R(this,e),t=R(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne?(t=e,!0):(e-=o,void++r)}),R(this,P(r,t))},indexFromPos:function(e){e=R(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to0)i=new P(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),P(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=L(e.doc,i.line-1).text;a&&(i=new P(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),P(i.line-1,a.length-1),i,"+transpose"))}r.push(new nl(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return cn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ne.firstLine()&&(n=P(n.line-1,L(e.doc,n.line-1).length)),i.ch==L(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,a,l;n.line==t.viewFrom||0==(o=Cr(e,n.line))?(a=O(t.view[0].line),l=t.view[0].node):(a=O(t.view[o].line),l=t.view[o-1].node.nextSibling);var s,c,u=Cr(e,i.line);if(u==t.view.length-1?(s=t.viewTo-1,c=t.lineDiv.lastChild):(s=O(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!l)return!1;for(var d=e.doc.splitLines(Fo(e,l,c,a,s)),f=T(e.doc,P(a,0),P(s,L(e.doc,s).text.length));d.length>1&&f.length>1;)if(h(d)==h(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),a++}for(var p=0,m=0,g=d[0],v=f[0],y=Math.min(g.length,v.length);p1||d[0]||j(k,C)?(Mi(e.doc,d,k,C,"+input"),!0):void 0},Al.prototype.ensurePolled=function(){this.forceCompositionEnd()},Al.prototype.reset=function(){this.forceCompositionEnd()},Al.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.pollContent()||pn(this.cm),this.div.blur(),this.div.focus())},Al.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}!e.cm.isReadOnly()&&e.pollContent()||cn(e.cm,function(){return pn(e.cm)})},80))},Al.prototype.setUneditable=function(e){e.contentEditable="false"},Al.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||un(this.cm,zo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Al.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Al.prototype.onContextMenu=function(){},Al.prototype.resetPosition=function(){},Al.prototype.needsContentAttribute=!0;var Ol=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ga,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};Ol.prototype.init=function(e){function t(e){if(!Oe(i,e)){if(i.somethingSelected())To({lineWise:!1,text:i.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,a.value=zl.text.join("\n"),ma(a));else{if(!i.options.lineWiseCopyCut)return;var t=No(i);To({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,xa):(n.prevInput="",a.value=t.text.join("\n"),ma(a))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=Eo(),a=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),oa&&(a.style.width="0px"),Wa(a,"input",function(){Yo&&Zo>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),Wa(a,"paste",function(e){Oe(i,e)||Ao(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),Wa(a,"cut",t),Wa(a,"copy",t),Wa(e.scroller,"paste",function(t){It(e,t)||Oe(i,t)||(i.state.pasteIncoming=!0,n.focus())}),Wa(e.lineSpace,"selectstart",function(t){It(e,t)||Pe(t)}),Wa(a,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Wa(a,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ol.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Mr(e);if(e.options.moveInputWithCursor){var i=cr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},Ol.prototype.showSelection=function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ol.prototype.reset=function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Da&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var a=t?"-":r||n.getSelection();this.textarea.value=a,n.state.focused&&ma(this.textarea),Yo&&Zo>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",Yo&&Zo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},Ol.prototype.getField=function(){return this.textarea},Ol.prototype.supportsTouch=function(){return!1},Ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!aa||o()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ol.prototype.blur=function(){this.textarea.blur()},Ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ol.prototype.receivedFocus=function(){this.slowPoll()},Ol.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ol.prototype.fastPoll=function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},Ol.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ja(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(Yo&&Zo>=9&&this.hasSelection===i||la&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(n.length,i.length);a1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ol.prototype.onKeyPress=function(){Yo&&Zo>=9&&(this.hasSelection=null),this.fastPoll()},Ol.prototype.onContextMenu=function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,n.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=d,a.style.cssText=u,Yo&&Zo<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!Yo||Yo&&Zo<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==n.prevInput?un(i,vi)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):(o.selForContextMenu=null, +o.input.reset())};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,a=n.textarea,l=kr(i,e),s=o.scroller.scrollTop;if(l&&!ta){var c=i.options.resetSelectionOnContextMenu;c&&i.doc.sel.contains(l)==-1&&un(i,ci)(i.doc,Nn(l),xa);var u=a.style.cssText,d=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var f=n.wrapper.getBoundingClientRect();a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(Yo?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var p;if(Qo&&(p=window.scrollY),o.input.focus(),Qo&&window.scrollTo(null,p),o.input.reset(),i.somethingSelected()||(a.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),Yo&&Zo>=9&&t(),pa){Ie(e);var h=function(){ze(window,"mouseup",h),setTimeout(r,20)};Wa(window,"mouseup",h)}else setTimeout(r,50)}},Ol.prototype.readOnlyChanged=function(e){e||this.reset()},Ol.prototype.setUneditable=function(){},Ol.prototype.needsContentAttribute=!1,wo(So),Po(So);var Nl="iter insert remove copy getEditor constructor".split(" ");for(var Wl in dl.prototype)dl.prototype.hasOwnProperty(Wl)&&d(Nl,Wl)<0&&(So.prototype[Wl]=function(e){return function(){return e.apply(this.doc,arguments)}}(dl.prototype[Wl]));return Ee(dl),So.inputStyles={textarea:Ol,contenteditable:Al},So.defineMode=function(e){So.defaults.mode||"null"==e||(So.defaults.mode=e),Ve.apply(this,arguments)},So.defineMIME=qe,So.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),So.defineMIME("text/plain","null"),So.defineExtension=function(e,t){So.prototype[e]=t},So.defineDocExtension=function(e,t){dl.prototype[e]=t},So.fromTextArea=$o,Vo(So),So.version="5.24.0",So})}),h=function(e){for(var t=arguments,r=1;r$/g.test(r)?r:r+"\n",template:n?n.innerHTML:"",script:i?i.innerHTML:"",styles:o}:{content:r,script:r}}catch(e){return{error:e}}},k=/\.((js)|(jsx))$/,C={};window.require=s;var S=function(e,t){var r=e.template,n=e.script;void 0===n&&(n="module.exports={}");var i=e.styles;void 0===t&&(t={});try{if("module.exports={}"===n&&!r)throw Error("no data");var o=u(n,t);return r&&(o.template=r),{result:o,styles:i&&i.join(" ")}}catch(e){return{error:e}}},M={name:"Vuep",props:{template:String,options:{},keepData:Boolean,value:String,scope:Object,iframe:Boolean,fitIframe:Boolean,iframeClass:{type:String,default:"vuep-iframe-preview"}},data:function(){return{content:"",preview:"",styles:"",error:""}},render:function(e){var t,r=this;t=this.error?e("div",{class:"vuep-error"},[this.error]):e(w,{class:"vuep-preview",props:{value:this.preview,styles:this.styles,keepData:this.keepData,iframe:this.iframe,fitIframe:this.fitIframe,iframeClass:this.iframeClass},on:{error:this.handleError}});var n=e(v,{class:"vuep-editor",props:{value:this.content,options:this.options},on:{change:[this.executeCode,function(e){return r.$emit("input",e)}]}}),i=[n,t];return this.$slots.default&&(i=this.addSlots(e,this.$slots.default,[{name:"vuep-preview",child:t},{name:"vuep-editor",child:n}])),e("div",{class:"vuep"},i)},watch:{value:{immediate:!0,handler:function(e){e&&this.executeCode(e)}}},created:function(){if(!this.$isServer){var e=this.template;if(/^[\.#]/.test(this.template)){var t=document.querySelector(this.template);if(!t)throw Error(this.template+" is not found");e=t.innerHTML}e&&(this.executeCode(e),this.$emit("input",e))}},methods:{addSlots:function(e,t,r){var n=this;return t.map(function(t){var i=[];return r.forEach(function(e){var r=e.name,n=e.child;t.data&&t.data.attrs&&void 0!==t.data.attrs[r]&&(i=[n])}),!i.length&&t.children&&t.children.length&&(i=n.addSlots(e,t.children,r)),e(t.tag,t.data,i)})},handleError:function(e){this.error=e},executeCode:function(e){this.error="";var t=x(e);if(t.error)return void(this.error=t.error.message);var r=S(t,this.scope);return r.error?void(this.error=r.error.message):(this.content=t.content,this.preview=r.result,void(r.styles&&(this.styles=r.styles)))}}};M.config=function(e){M.props.options.default=function(){return e}},M.install=d,"undefined"!=typeof Vue&&Vue.use(d);var L=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?p:CodeMirror)}(function(e){e.overlayMode=function(t,r,n){return{startState:function(){return{base:e.startState(t),overlay:e.startState(r),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(n){return{base:e.copyState(t,n.base),overlay:e.copyState(r,n.overlay),basePos:n.basePos,baseCur:null,overlayPos:n.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)2){n.pending=[];for(var f=2;f-1)return e.Pass;var a=n.indent.length-1,l=t[n.state];e:for(;;){for(var c=0;c*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),n(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,n){return e.context=new l(r,t.indentation()+(n===!1?0:g),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,r){return N[r.context.type](e,t,r)}function d(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return u(e,t,r)}function f(e){var t=e.current().toLowerCase();m=T.hasOwnProperty(t)?"atom":L.hasOwnProperty(t)?"keyword":"variable"}var p=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var h,m,g=t.indentUnit,v=r.tokenHooks,y=r.documentTypes||{},b=r.mediaTypes||{},w=r.mediaFeatures||{},x=r.mediaValueKeywords||{},k=r.propertyKeywords||{},C=r.nonStandardPropertyKeywords||{},S=r.fontProperties||{},M=r.counterDescriptors||{},L=r.colorKeywords||{},T=r.valueKeywords||{},z=r.allowNested,A=r.lineComment,O=r.supportsAtComponent===!0,N={};return N.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(O&&/@component/.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(z&&"("==e)return s(r,t,"parens")}return r.context.type},N.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return k.hasOwnProperty(n)?(m="property","maybeprop"):C.hasOwnProperty(n)?(m="string-2","maybeprop"):z?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error","maybeprop")}return"meta"==e?"block":z||"hash"!=e&&"qualifier"!=e?N.top(e,t,r):(m="error","block")},N.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):u(e,t,r)},N.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&z)return s(r,t,"propBlock");if("}"==e||"{"==e)return d(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return s(r,t,"interpolation")}else m+=" error";return"prop"},N.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(m="property","maybeprop"):r.context.type},N.parens=function(e,t,r){return"{"==e||"}"==e?d(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&f(t),"parens")},N.pseudo=function(e,t,r){return"meta"==e?"pseudo":"word"==e?(m="variable-3",r.context.type):u(e,t,r)},N.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",r.context.type):N.atBlock(e,t,r)},N.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,r);if("{"==e)return c(r)&&s(r,t,z?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();m="only"==n||"not"==n||"and"==n||"or"==n?"keyword":b.hasOwnProperty(n)?"attribute":w.hasOwnProperty(n)?"property":x.hasOwnProperty(n)?"keyword":k.hasOwnProperty(n)?"property":C.hasOwnProperty(n)?"string-2":T.hasOwnProperty(n)?"atom":L.hasOwnProperty(n)?"keyword":"error"}return r.context.type},N.atComponentBlock=function(e,t,r){return"}"==e?d(e,t,r):"{"==e?c(r)&&s(r,t,z?"block":"top",!1):("word"==e&&(m="error"),r.context.type)},N.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?d(e,t,r,2):N.atBlock(e,t,r)},N.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(m="variable","restricted_atBlock_before"):u(e,t,r)},N.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(m="@font-face"==r.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!M.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},N.keyframes=function(e,t,r){return"word"==e?(m="variable","keyframes"):"{"==e?s(r,t,"top"):u(e,t,r)},N.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?d(e,t,r):("word"==e?m="tag":"hash"==e&&(m="builtin"),"at")},N.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?d(e,t,r):("word"==e?m="variable":"variable"!=e&&"("!=e&&")"!=e&&(m="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:p?"block":"top",stateArg:null,context:new l(p?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(h=r[1],r=r[0]),m=r,t.state=N[t.state](h,e,t),m},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-g),r=r.prev):(r=r.prev,i=r.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:A,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],i=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(d),p=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],h=t(p),m=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(m),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=t(b),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],k=t(x),C=n.concat(o).concat(l).concat(c).concat(d).concat(p).concat(b).concat(x); +e.registerHelper("hintWords","css",C),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:w,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:w,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:w,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:w,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})})}),A=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?p:CodeMirror)}(function(e){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(n,i){function o(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(s("atom","]]>")):null:e.match("--")?r(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(L=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==n){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=o,L=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return L="equals",null;if("<"==r){t.tokenize=o,t.state=p,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=l(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\'\-]*[^\s\u00a0=<>\"\'\/\-]/),"word")}function l(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=o;break}r.next()}return e}}function c(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=c(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=o;break}return r.tokenize=c(e-1),r.tokenize(t,r)}}return"meta"}}function u(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(C.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function f(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!C.contextGrabbers.hasOwnProperty(r)||!C.contextGrabbers[r].hasOwnProperty(t))return;d(e)}}function p(e,t,r){return"openTag"==e?(r.tagStart=t.column(),h):"closeTag"==e?m:p}function h(e,t,r){return"word"==e?(r.tagName=t.current(),T="tag",y):(T="error",h)}function m(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&C.implicitlyClosed.hasOwnProperty(r.context.tagName)&&d(r),r.context&&r.context.tagName==n||C.matchClosing===!1?(T="tag",g):(T="tag error",v)}return T="error",v}function g(e,t,r){return"endTag"!=e?(T="error",g):(d(r),p)}function v(e,t,r){return T="error",g(e,t,r)}function y(e,t,r){if("word"==e)return T="attribute",b;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||C.autoSelfClosers.hasOwnProperty(n)?f(r,n):(f(r,n),r.context=new u(r,n,i==r.indented)),p}return T="error",y}function b(e,t,r){return"equals"==e?w:(C.allowMissing||(T="error"),y(e,t,r))}function w(e,t,r){return"string"==e?x:"word"==e&&C.allowUnquoted?(T="string",y):(T="error",y(e,t,r))}function x(e,t,r){return"string"==e?x:y(e,t,r)}var k=n.indentUnit,C={},S=i.htmlMode?t:r;for(var M in S)C[M]=S[M];for(var M in i)C[M]=i[M];var L,T;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;L=null;var r=t.tokenize(e,t);return(r||L)&&"comment"!=r&&(T=null,t.state=t.state(L||r,e,t),T&&(r="error"==T?r+" error":T)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return C.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/$/,blockCommentStart:"",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})}),O=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?p:CodeMirror)}(function(e){function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function i(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function o(e,t,r){return Me=e,Le=r,t}function a(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=l(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==n&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return o(n);if("="==n&&e.eat(">"))return o("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==n)return e.eat("*")?(r.tokenize=s,s(e,r)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,r,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(Pe),o("operator","operator",e.current()));if("`"==n)return r.tokenize=c,c(e,r);if("#"==n)return e.skipToEnd(),o("error","error");if(Pe.test(n))return">"==n&&r.lexical&&">"==r.lexical.type||e.eatWhile(Pe),o("operator","operator",e.current());if(We.test(n)){e.eatWhile(We);var a=e.current(),u=Ee.propertyIsEnumerable(a)&&Ee[a];return u&&"."!=r.lastType?o(u.type,u.style,a):o("variable","variable",a)}}function l(e){return function(t,r){var n,i=!1;if(Ae&&"@"==t.peek()&&t.match(je))return r.tokenize=a,o("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=a),o("string","string")}}function s(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=a;break}n="*"==r}return o("comment","comment")}function c(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=a;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(Ne){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=De.indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(We.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}function d(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function p(e,t,r,n,i){var o=e.cc;for(He.state=e,He.stream=i,He.marked=null,He.cc=o,He.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():Oe?C:k;if(a(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return He.marked?He.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function h(){for(var e=arguments,t=arguments.length-1;t>=0;t--)He.cc.push(e[t])}function m(){return h.apply(null,arguments),!0}function g(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=He.state;if(He.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function v(){He.state.context={prev:He.state.context,vars:He.state.localVars},He.state.localVars=Fe}function y(){He.state.localVars=He.state.context.vars,He.state.context=He.state.context.prev}function b(e,t){var r=function(){var r=He.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new d(n,He.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function w(){var e=He.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(r){return r==e?m():";"==e?h():m(t)}return t}function k(e,t){return"var"==e?m(b("vardef",t.length),Q,x(";"),w):"keyword a"==e?m(b("form"),M,k,w):"keyword b"==e?m(b("form"),k,w):"{"==e?m(b("}"),U,w):";"==e?m():"if"==e?("else"==He.state.lexical.info&&He.state.cc[He.state.cc.length-1]==w&&He.state.cc.pop()(),m(b("form"),M,k,w,ne)):"function"==e?m(ce):"for"==e?m(b("form"),ie,k,w):"variable"==e?m(b("stat"),H):"switch"==e?m(b("form"),M,b("}","switch"),x("{"),U,w,w):"case"==e?m(C,x(":")):"default"==e?m(x(":")):"catch"==e?m(b("form"),v,x("("),ue,x(")"),k,w,y):"class"==e?m(b("form"),fe,w):"export"==e?m(b("stat"),ge,w):"import"==e?m(b("stat"),ye,w):"module"==e?m(b("form"),J,b("}"),x("{"),U,w,w):"type"==e?m(G,x("operator"),G,x(";")):"async"==e?m(k):h(b("stat"),C,x(";"),w)}function C(e){return L(e,!1)}function S(e){return L(e,!0)}function M(e){return"("!=e?h():m(b(")"),C,x(")"),w)}function L(e,t){if(He.state.fatArrowAt==He.stream.start){var r=t?P:E;if("("==e)return m(v,b(")"),V(J,")"),w,x("=>"),r,y);if("variable"==e)return h(v,J,x("=>"),r,y)}var n=t?O:A;return Ie.hasOwnProperty(e)?m(n):"function"==e?m(ce,n):"class"==e?m(b("form"),de,w):"keyword c"==e||"async"==e?m(t?z:T):"("==e?m(b(")"),T,x(")"),w,n):"operator"==e||"spread"==e?m(t?S:C):"["==e?m(b("]"),Ce,w,n):"{"==e?q(B,"}",null,n):"quasi"==e?h(N,n):"new"==e?m(j(t)):m()}function T(e){return e.match(/[;\}\)\],]/)?h():h(C)}function z(e){return e.match(/[;\}\)\],]/)?h():h(S)}function A(e,t){return","==e?m(C):O(e,t,!1)}function O(e,t,r){var n=0==r?A:O,i=0==r?C:S;return"=>"==e?m(v,r?P:E,y):"operator"==e?/\+\+|--/.test(t)?m(n):"?"==t?m(C,x(":"),i):m(i):"quasi"==e?h(N,n):";"!=e?"("==e?q(S,")","call",n):"."==e?m(F,n):"["==e?m(b("]"),T,x("]"),w,n):void 0:void 0}function N(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?m(N):m(C,W)}function W(e){if("}"==e)return He.marked="string-2",He.state.tokenize=c,m(N)}function E(e){return u(He.stream,He.state),h("{"==e?k:C)}function P(e){return u(He.stream,He.state),h("{"==e?k:S)}function j(e){return function(t){return"."==t?m(e?I:D):h(e?S:C)}}function D(e,t){if("target"==t)return He.marked="keyword",m(A)}function I(e,t){if("target"==t)return He.marked="keyword",m(O)}function H(e){return":"==e?m(w,k):h(A,x(";"),w)}function F(e){if("variable"==e)return He.marked="property",m()}function B(e,t){return"async"==e?(He.marked="property",m(B)):"variable"==e||"keyword"==He.style?(He.marked="property",m("get"==t||"set"==t?R:$)):"number"==e||"string"==e?(He.marked=Ae?"property":He.style+" property",m($)):"jsonld-keyword"==e?m($):"modifier"==e?m(B):"["==e?m(C,x("]"),$):"spread"==e?m(C):":"==e?h($):void 0}function R(e){return"variable"!=e?h($):(He.marked="property",m(ce))}function $(e){return":"==e?m(S):"("==e?h(ce):void 0}function V(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=He.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),m(function(r,n){return r==t||n==t?h():h(e)},n)}return i==t||o==t?m():m(x(t))}return function(r,i){return r==t||i==t?m():h(e,n)}}function q(e,t,r){for(var n=arguments,i=3;i"==e)return m(G)}function X(e,t){return"variable"==e||"keyword"==He.style?(He.marked="property",m(X)):"?"==t?m(X):":"==e?m(G):void 0}function Y(e){return"variable"==e?m(Y):":"==e?m(G):void 0}function Z(e,t){return"<"==t?m(b(">"),V(G,">"),w,Z):"|"==t||"."==e?m(G):"["==e?m(x("]"),Z):void 0}function Q(){return h(J,K,te,re)}function J(e,t){return"modifier"==e?m(J):"variable"==e?(g(t),m()):"spread"==e?m(J):"["==e?q(J,"]"):"{"==e?q(ee,"}"):void 0}function ee(e,t){return"variable"!=e||He.stream.match(/^\s*:/,!1)?("variable"==e&&(He.marked="property"),"spread"==e?m(J):"}"==e?h():m(x(":"),J,te)):(g(t),m(te))}function te(e,t){if("="==t)return m(S)}function re(e){if(","==e)return m(Q)}function ne(e,t){if("keyword b"==e&&"else"==t)return m(b("form","else"),k,w)}function ie(e){if("("==e)return m(b(")"),oe,x(")"),w)}function oe(e){return"var"==e?m(Q,x(";"),le):";"==e?m(le):"variable"==e?m(ae):h(C,x(";"),le)}function ae(e,t){return"in"==t||"of"==t?(He.marked="keyword",m(C)):m(A,le)}function le(e,t){return";"==e?m(se):"in"==t||"of"==t?(He.marked="keyword",m(C)):h(C,x(";"),se)}function se(e){")"!=e&&m(C)}function ce(e,t){return"*"==t?(He.marked="keyword",m(ce)):"variable"==e?(g(t),m(ce)):"("==e?m(v,b(")"),V(ue,")"),w,K,k,y):void 0}function ue(e){return"spread"==e?m(ue):h(J,K,te)}function de(e,t){return"variable"==e?fe(e,t):pe(e,t)}function fe(e,t){if("variable"==e)return g(t),m(pe)}function pe(e,t){return"extends"==t||"implements"==t||Ne&&","==e?m(Ne?G:C,pe):"{"==e?m(b("}"),he,w):void 0}function he(e,t){return"variable"==e||"keyword"==He.style?("async"==t||"static"==t||"get"==t||"set"==t||Ne&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&He.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(He.marked="keyword",m(he)):(He.marked="property",m(Ne?me:ce,he)):"*"==t?(He.marked="keyword",m(he)):";"==e?m(he):"}"==e?m():void 0}function me(e,t){return"?"==t?m(me):":"==e?m(G,te):h(ce)}function ge(e,t){return"*"==t?(He.marked="keyword",m(ke,x(";"))):"default"==t?(He.marked="keyword",m(C,x(";"))):"{"==e?m(V(ve,"}"),ke,x(";")):h(k)}function ve(e,t){return"as"==t?(He.marked="keyword",m(x("variable"))):"variable"==e?h(S,ve):void 0}function ye(e){return"string"==e?m():h(be,we,ke)}function be(e,t){return"{"==e?q(be,"}"):("variable"==e&&g(t),"*"==t&&(He.marked="keyword"),m(xe))}function we(e){if(","==e)return m(be,we)}function xe(e,t){if("as"==t)return He.marked="keyword",m(be)}function ke(e,t){if("from"==t)return He.marked="keyword",m(C)}function Ce(e){return"]"==e?m():h(V(S,"]"))}function Se(e,t){return"operator"==e.lastType||","==e.lastType||Pe.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var Me,Le,Te=r.indentUnit,ze=n.statementIndent,Ae=n.jsonld,Oe=n.json||Ae,Ne=n.typescript,We=n.wordCharacters||/[\w$\xa1-\uffff]/,Ee=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n,async:e("async")};if(Ne){var l={type:"variable",style:"variable-3"},s={interface:e("class"),implements:n,namespace:n,module:e("module"),enum:e("module"),type:e("type"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),as:i,string:l,number:l,boolean:l,any:l};for(var c in s)a[c]=s[c]}return a}(),Pe=/[+\-*&%=<>!?|~^]/,je=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,De="([{}])",Ie={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},He={state:null,column:null,marked:null,cc:null},Fe={name:"this",next:{name:"arguments"}};return w.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new d((e||0)-Te,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=s&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==Me?r:(t.lastType="operator"!=Me||"++"!=Le&&"--"!=Le?Me:"incdec",p(t,r,Me,Le,e))},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var i,o=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==w)l=l.prev;else if(u!=ne)break}for(;("stat"==l.type||"form"==l.type)&&("}"==o||(i=t.cc[t.cc.length-1])&&(i==A||i==O)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;ze&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=o==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==d&&"{"==o?l.indented:"form"==d?l.indented+Te:"stat"==d?l.indented+(Se(t,r)?ze||Te:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:Te):l.indented+(/^(?:case|default)\b/.test(r)?Te:2*Te)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Oe?null:"/*",blockCommentEnd:Oe?null:"*/",lineComment:Oe?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Oe?"json":"javascript",jsonldMode:Ae,jsonMode:Oe,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=C&&t!=S||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})}),N=r(function(e,t){!function(r){"object"==typeof t&&"object"==typeof e?r(p,A,O,z):r(CodeMirror)}(function(e){function t(e,t,r){var n=e.current(),i=n.search(t);return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}function r(e){var t=s[e];return t?t:s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function n(e,t){var n=e.match(r(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}function a(e,t){for(var r=0;r\s\/]/.test(n.current())&&(l=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(l))o.inTag=l+" ";else if(o.inTag&&f&&/>$/.test(n.current())){var p=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var h=">"==n.current()&&a(u[p[1]],p[2]),m=e.getMode(r,h),g=i(p[1],!0),v=i(p[1],!1);o.token=function(e,r){return e.match(g,!1)?(r.token=s,r.localState=r.localMode=null,null):t(e,v,r.localMode.token(e,r.localState))},o.localMode=m,o.localState=e.startState(m,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=n.current(),n.eol()&&(o.inTag+=" "));return d}var c=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),u={},d=n&&n.tags,f=n&&n.scriptTypes;if(o(l,u),d&&o(d,u),f)for(var p=f.length-1;p>=0;p--)u.script.unshift(["type",f[p].matches,f[p].mode]);return{startState:function(){var t=e.startState(c);return{token:s,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r){return!t.localMode||/^\s*<\//.test(r)?c.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})}),W=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?p:CodeMirror)}(function(e){e.defineMode("coffeescript",function(e,t){function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var r=t.scope.offset;if(e.eatSpace()){var n=e.indentation();return n>r&&"coffee"==t.scope.type?"indent":n0&&l(e,t)}if(e.eatSpace())return null;var a=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=o,t.tokenize(e,t);if("#"===a)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var s=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(s=!0),e.match(/^-?\d+\.\d*/)&&(s=!0),e.match(/^-?\.\d+/)&&(s=!0),s)return"."==e.peek()&&e.backUp(1),"number";var m=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(m=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),e.match(/^-?0(?![\dx])/i)&&(m=!0),m)return"number"}if(e.match(y))return t.tokenize=i(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(b)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=i(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(u)||e.match(h)?"operator":e.match(d)?"punctuation":e.match(x)?"atom":e.match(p)||t.prop&&e.match(f)?"property":e.match(v)?"keyword":e.match(f)?"variable":(e.next(),c)}function i(e,r,i){return function(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\/\\]/),o.eat("\\")){if(o.next(),r&&o.eol())return i}else{if(o.match(e))return a.tokenize=n,i;o.eat(/['"\/]/)}return r&&(t.singleLineStringErrors?i=c:a.tokenize=n),i}}function o(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=n;break}e.eatWhile("#")}return"comment"}function a(t,r,n){n=n||"coffee";for(var i=0,o=!1,a=null,l=r.scope;l;l=l.prev)if("coffee"===l.type||"}"==l.type){i=l.offset+e.indentUnit;break}"coffee"!==n?(o=null,a=t.column()+t.current().length):r.scope.align&&(r.scope.align=!1),r.scope={offset:i,type:n,prev:r.scope,align:o,alignOffset:a}}function l(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var r=e.indentation(),n=!1,i=t.scope;i;i=i.prev)if(r===i.offset){n=!0;break}if(!n)return!0;for(;t.scope.prev&&t.scope.offset!==r;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function s(e,t){var r=t.tokenize(e,t),n=e.current();"return"===n&&(t.dedent=!0),(("->"===n||"=>"===n)&&e.eol()||"indent"===r)&&a(e,t);var i="[({".indexOf(n);if(i!==-1&&a(e,t,"])}".slice(i,i+1)),m.exec(n)&&a(e,t),"then"==n&&l(e,t),"dedent"===r&&l(e,t))return c;if(i="])}".indexOf(n),i!==-1){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==n&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),r}var c="error",u=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,d=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,f=/^[_A-Za-z$][_A-Za-z$0-9]*/,p=/^@[_A-Za-z$][_A-Za-z$0-9]*/,h=r(["and","or","not","is","isnt","in","instanceof","typeof"]),m=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],g=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],v=r(m.concat(g));m=r(m);var y=/^('{3}|\"{3}|['\"])/,b=/^(\/{3}|\/)/,w=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],x=r(w),k={startState:function(e){return{tokenize:n,scope:{offset:e||0,type:"coffee",prev:null,align:!1},prop:!1,dedent:0}},token:function(e,t){var r=null===t.scope.align&&t.scope;r&&e.sol()&&(r.align=!1);var n=s(e,t);return n&&"comment"!=n&&(r&&(r.align=!0),t.prop="punctuation"==n&&"."==e.current()),n},indent:function(e,t){if(e.tokenize!=n)return 0;var r=e.scope,i=t&&"])}".indexOf(t.charAt(0))>-1;if(i)for(;"coffee"==r.type&&r.prev;)r=r.prev;var o=i&&r.type===t.charAt(0);return r.align?r.alignOffset-(o?1:0):(o?r.prev:r).offset},lineComment:"#",fold:"indent"};return k}),e.defineMIME("text/x-coffeescript","coffeescript"),e.defineMIME("text/coffeescript","coffeescript")})}),E=r(function(e,t){!function(r){"object"==typeof t&&"object"==typeof e?r(p,z):r(CodeMirror)}(function(e){e.defineMode("sass",function(t){function r(e){return new RegExp("^"+e.join("|"))}function n(e){return!e.peek()||e.match(/\s+$/,!1)}function i(e,t){var r=e.peek();return")"===r?(e.next(),t.tokenizer=u,"operator"):"("===r?(e.next(),e.eatSpace(),"operator"):"'"===r||'"'===r?(t.tokenizer=a(e.next()),"string"):(t.tokenizer=a(")",!1),"string")}function o(e,t){return function(r,n){return r.sol()&&r.indentation()<=e?(n.tokenizer=u,u(r,n)):(t&&r.skipTo("*/")?(r.next(),r.next(),n.tokenizer=u):r.skipToEnd(),"comment")}}function a(e,t){function r(i,o){var a=i.next(),s=i.peek(),c=i.string.charAt(i.pos-2),d="\\"!==a&&s===e||a===e&&"\\"!==c;return d?(a!==e&&t&&i.next(),n(i)&&(o.cursorHalf=0),o.tokenizer=u,"string"):"#"===a&&"{"===s?(o.tokenizer=l(r),i.next(),"operator"):"string"}return null==t&&(t=!0),r}function l(e){return function(t,r){return"}"===t.peek()?(t.next(),r.tokenizer=e,"operator"):u(t,r)}}function s(e){if(0==e.indentCount){e.indentCount++;var r=e.scopes[0].offset,n=r+t.indentUnit;e.scopes.unshift({offset:n})}}function c(e){1!=e.scopes.length&&e.scopes.shift()}function u(e,t){var r=e.peek();if(e.match("/*"))return t.tokenizer=o(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=o(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=l(u),"operator";if('"'===r||"'"===r)return e.next(),t.tokenizer=a(r),"string";if(t.cursorHalf){if("#"===r&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return n(e)&&(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return n(e)&&(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return n(e)&&(t.cursorHalf=0),"unit";if(e.match(b))return n(e)&&(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=i,n(e)&&(t.cursorHalf=0),"atom";if("$"===r)return e.next(),e.eatWhile(/[\w-]/),n(e)&&(t.cursorHalf=0),"variable-2";if("!"===r)return e.next(),t.cursorHalf=0,e.match(/^[\w]+/)?"keyword":"operator";if(e.match(x))return n(e)&&(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return n(e)&&(t.cursorHalf=0),f=e.current().toLowerCase(),g.hasOwnProperty(f)?"atom":m.hasOwnProperty(f)?"keyword":h.hasOwnProperty(f)?(t.prevProp=e.current().toLowerCase(),"property"):"tag";if(n(e))return t.cursorHalf=0,null}else{if("-"===r&&e.match(/^-\w+-/))return"meta";if("."===r){if(e.next(),e.match(/^[\w-]+/))return s(t),"qualifier";if("#"===e.peek())return s(t),"tag"}if("#"===r){if(e.next(),e.match(/^[\w-]+/))return s(t),"builtin";if("#"===e.peek())return s(t),"tag"}if("$"===r)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(b))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=i,"atom";if("="===r&&e.match(/^=[\w-]+/))return s(t),"meta";if("+"===r&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===r&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||c(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return s(t),"def";if("@"===r)return e.next(),e.eatWhile(/[\w-]/),"def";if(e.eatWhile(/[\w-]/)){if(e.match(/ *: *[\w-\+\$#!\("']/,!1)){f=e.current().toLowerCase();var d=t.prevProp+"-"+f;return h.hasOwnProperty(d)?"property":h.hasOwnProperty(f)?(t.prevProp=f,"property"):v.hasOwnProperty(f)?"property":"tag"}return e.match(/ *:/,!1)?(s(t),t.cursorHalf=1,t.prevProp=e.current().toLowerCase(),"property"):e.match(/ *,/,!1)?"tag":(s(t),"tag")}if(":"===r)return e.match(k)?"variable-3":(e.next(),t.cursorHalf=1,"operator")}return e.match(x)?"operator":(e.next(),null)}function d(e,r){e.sol()&&(r.indentCount=0);var n=r.tokenizer(e,r),i=e.current();if("@return"!==i&&"}"!==i||c(r),null!==n){for(var o=e.pos-i.length,a=o+t.indentUnit*r.indentCount,l=[],s=0;s","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],x=r(w),k=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:u,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var r=d(e,t);return t.lastToken={style:r,content:e.current()},r},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")})}),P=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?p:CodeMirror)}(function(e){function t(e){return e=e.sort(function(e,t){return t>e}),new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e){for(var t={},r=0;r|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/),t.context.line.firstWord=ne?ne[0].replace(/^\s*/,""):"",t.context.line.indent=e.indentation(),D=e.peek(),e.match("//"))return e.skipToEnd(),["comment","comment"];if(e.match("/*"))return t.tokenize=v,v(e,t);if('"'==D||"'"==D)return e.next(),t.tokenize=y(D),t.tokenize(e,t);if("@"==D)return e.next(),e.eatWhile(/[\w\\-]/),["def",e.current()];if("#"==D){if(e.next(),e.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i))return["atom","atom"];if(e.match(/^[a-z][\w-]*/i))return["builtin","hash"]}return e.match(te)?["meta","vendor-prefixes"]:e.match(/^-?[0-9]?\.?[0-9]/)?(e.eatWhile(/[a-z%]/i),["number","unit"]):"!"==D?(e.next(),[e.match(/^(important|optional)/i)?"keyword":"operator","important"]):"."==D&&e.match(/^\.[a-z][\w-]*/i)?["qualifier","qualifier"]:e.match(_)?("("==e.peek()&&(t.tokenize=b),["property","word"]):e.match(/^[a-z][\w-]*\(/i)?(e.backUp(1),["keyword","mixin"]):e.match(/^(\+|-)[a-z][\w-]*\(/i)?(e.backUp(1),["keyword","block-mixin"]):e.string.match(/^\s*&/)&&e.match(/^[-_]+[a-z][\w-]*/)?["qualifier","qualifier"]:e.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)?(e.backUp(1),["variable-3","reference"]):e.match(/^&{1}\s*$/)?["variable-3","reference"]:e.match(J)?["operator","operator"]:e.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)?e.match(/^(\.|\[)[\w-\'\"\]]+/i,!1)&&!M(e.current())?(e.match(/\./),["variable-2","variable-name"]):["variable-2","word"]:e.match(Q)?["operator",e.current()]:/[:;,{}\[\]\(\)]/.test(D)?(e.next(),[null,D]):(e.next(),[null,null])}function v(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}function y(e){return function(t,r){for(var n,i=!1;null!=(n=t.next());){if(n==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==n}return(n==e||!i&&")"!=e)&&(r.tokenize=null),["string","string"]}}function b(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=y(")"),[null,"("]}function w(e,t,r,n){this.type=e,this.indent=t,this.prev=r,this.line=n||{firstWord:"",indent:0}}function x(e,t,r,n){return n=n>=0?n:B,e.context=new w(r,t.indentation()+n,e.context),r}function k(e,t){var r=e.context.indent-B;return t=t||!1,e.context=e.context.prev,t&&(e.context.indent=r),e.context.type}function C(e,t,r){return ie[r.context.type](e,t,r)}function S(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return C(e,t,r)}function M(e){return e.toLowerCase()in R}function L(e){return e=e.toLowerCase(),e in V||e in Z}function T(e){return e.toLowerCase()in ee}function z(e){return e.toLowerCase().match(te)}function A(e){var t=e.toLowerCase(),r="variable-2";return M(e)?r="tag":T(e)?r="block-keyword":L(e)?r="property":t in U||t in re?r="atom":"return"==t||t in K?r="keyword":e.match(/^[A-Z]/)&&(r="string"),r}function O(e,t){return P(t)&&("{"==e||"]"==e||"hash"==e||"qualifier"==e)||"block-mixin"==e}function N(e,t){return"{"==e&&t.match(/^\s*\$?[\w-]+/i,!1)}function W(e,t){return":"==e&&t.match(/^[a-z-]+/,!1)}function E(e){return e.sol()||e.string.match(new RegExp("^\\s*"+n(e.current())))}function P(e){return e.eol()||e.match(/^\s*$/,!1)}function j(e){var t=/^\s*[-_]*[a-z0-9]+[\w-]*/i,r="string"==typeof e?e.match(t):e.string.match(t);return r?r[0].replace(/^\s*/,""):""}var D,I,H,F,B=e.indentUnit,R=r(i),$=/^(a|b|i|s|col|em)$/i,V=r(s),q=r(c),U=r(f),K=r(d),G=r(o),_=t(o),X=r(l),Y=r(a),Z=r(u),Q=/^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/,J=t(p),ee=r(h),te=new RegExp(/^\-(moz|ms|o|webkit)-/i),re=r(m),ne="",ie={};return ie.block=function(e,t,r){if("comment"==e&&E(t)||","==e&&P(t)||"mixin"==e)return x(r,t,"block",0);if(N(e,t))return x(r,t,"interpolation");if(P(t)&&"]"==e&&!/^\s*(\.|#|:|\[|\*|&)/.test(t.string)&&!M(j(t)))return x(r,t,"block",0);if(O(e,t,r))return x(r,t,"block");if("}"==e&&P(t))return x(r,t,"block",0);if("variable-name"==e)return t.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)||T(j(t))?x(r,t,"variableName"):x(r,t,"variableName",0);if("="==e)return P(t)||T(j(t))?x(r,t,"block"):x(r,t,"block",0);if("*"==e&&(P(t)||t.match(/\s*(,|\.|#|\[|:|{)/,!1)))return F="tag",x(r,t,"block");if(W(e,t))return x(r,t,"pseudo");if(/@(font-face|media|supports|(-moz-)?document)/.test(e))return x(r,t,P(t)?"block":"atBlock");if(/@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return x(r,t,"keyframes");if(/@extends?/.test(e))return x(r,t,"extend",0);if(e&&"@"==e.charAt(0))return t.indentation()>0&&L(t.current().slice(1))?(F="variable-2","block"):/(@import|@require|@charset)/.test(e)?x(r,t,"block",0):x(r,t,"block");if("reference"==e&&P(t))return x(r,t,"block");if("("==e)return x(r,t,"parens");if("vendor-prefixes"==e)return x(r,t,"vendorPrefixes");if("word"==e){var n=t.current();if(F=A(n),"property"==F)return E(t)?x(r,t,"block",0):(F="atom","block");if("tag"==F){if(/embed|menu|pre|progress|sub|table/.test(n)&&L(j(t)))return F="atom","block";if(t.string.match(new RegExp("\\[\\s*"+n+"|"+n+"\\s*\\]")))return F="atom","block";if($.test(n)&&(E(t)&&t.string.match(/=/)||!E(t)&&!t.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/)&&!M(j(t))))return F="variable-2",T(j(t))?"block":x(r,t,"block",0);if(P(t))return x(r,t,"block")}if("block-keyword"==F)return F="keyword",t.current(/(if|unless)/)&&!E(t)?"block":x(r,t,"block");if("return"==n)return x(r,t,"block",0);if("variable-2"==F&&t.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/))return x(r,t,"block")}return r.context.type},ie.parens=function(e,t,r){if("("==e)return x(r,t,"parens");if(")"==e)return"parens"==r.context.prev.type?k(r):t.string.match(/^[a-z][\w-]*\(/i)&&P(t)||T(j(t))||/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(j(t))||!t.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/)&&M(j(t))?x(r,t,"block"):t.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/)||t.string.match(/^\s*(\(|\)|[0-9])/)||t.string.match(/^\s+[a-z][\w-]*\(/i)||t.string.match(/^\s+[\$-]?[a-z]/i)?x(r,t,"block",0):P(t)?x(r,t,"block"):x(r,t,"block",0);if(e&&"@"==e.charAt(0)&&L(t.current().slice(1))&&(F="variable-2"),"word"==e){var n=t.current();F=A(n),"tag"==F&&$.test(n)&&(F="variable-2"),"property"!=F&&"to"!=n||(F="atom")}return"variable-name"==e?x(r,t,"variableName"):W(e,t)?x(r,t,"pseudo"):r.context.type},ie.vendorPrefixes=function(e,t,r){return"word"==e?(F="property",x(r,t,"block",0)):k(r)},ie.pseudo=function(e,t,r){return L(j(t.string))?S(e,t,r):(t.match(/^[a-z-]+/),F="variable-3",P(t)?x(r,t,"block"):k(r))},ie.atBlock=function(e,t,r){if("("==e)return x(r,t,"atBlock_parens");if(O(e,t,r))return x(r,t,"block");if(N(e,t))return x(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();if(F=/^(only|not|and|or)$/.test(n)?"keyword":G.hasOwnProperty(n)?"tag":Y.hasOwnProperty(n)?"attribute":X.hasOwnProperty(n)?"property":q.hasOwnProperty(n)?"string-2":A(t.current()),"tag"==F&&P(t))return x(r,t,"block")}return"operator"==e&&/^(not|and|or)$/.test(t.current())&&(F="keyword"),r.context.type},ie.atBlock_parens=function(e,t,r){if("{"==e||"}"==e)return r.context.type;if(")"==e)return P(t)?x(r,t,"block"):x(r,t,"atBlock");if("word"==e){var n=t.current().toLowerCase();return F=A(n),/^(max|min)/.test(n)&&(F="property"),"tag"==F&&(F=$.test(n)?"variable-2":"atom"),r.context.type}return ie.atBlock(e,t,r)},ie.keyframes=function(e,t,r){return"0"==t.indentation()&&("}"==e&&E(t)||"]"==e||"hash"==e||"qualifier"==e||M(t.current()))?S(e,t,r):"{"==e?x(r,t,"keyframes"):"}"==e?E(t)?k(r,!0):x(r,t,"keyframes"):"unit"==e&&/^[0-9]+\%$/.test(t.current())?x(r,t,"keyframes"):"word"==e&&(F=A(t.current()),"block-keyword"==F)?(F="keyword",x(r,t,"keyframes")):/@(font-face|media|supports|(-moz-)?document)/.test(e)?x(r,t,P(t)?"block":"atBlock"):"mixin"==e?x(r,t,"block",0):r.context.type},ie.interpolation=function(e,t,r){return"{"==e&&k(r)&&x(r,t,"block"),"}"==e?t.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i)||t.string.match(/^\s*[a-z]/i)&&M(j(t))?x(r,t,"block"):!t.string.match(/^(\{|\s*\&)/)||t.match(/\s*[\w-]/,!1)?x(r,t,"block",0):x(r,t,"block"):"variable-name"==e?x(r,t,"variableName",0):("word"==e&&(F=A(t.current()),"tag"==F&&(F="atom")),r.context.type)},ie.extend=function(e,t,r){return"["==e||"="==e?"extend":"]"==e?k(r):"word"==e?(F=A(t.current()),"extend"):k(r)},ie.variableName=function(e,t,r){return"string"==e||"["==e||"]"==e||t.current().match(/^(\.|\$)/)?(t.current().match(/^\.[\w-]+/i)&&(F="variable-2"),"variableName"):S(e,t,r)},{startState:function(e){return{tokenize:null,state:"block",context:new w("block",e||0,null)}},token:function(e,t){return!t.tokenize&&e.eatSpace()?null:(I=(t.tokenize||g)(e,t),I&&"object"==typeof I&&(H=I[1],I=I[0]),F=I,t.state=ie[t.state](H,e,t),F)},indent:function(e,t,r){var n=e.context,i=t&&t.charAt(0),o=n.indent,a=j(t),l=r.length-r.replace(/^\s*/,"").length,s=e.context.prev?e.context.prev.line.firstWord:"",c=e.context.prev?e.context.prev.line.indent:l;return n.prev&&("}"==i&&("block"==n.type||"atBlock"==n.type||"keyframes"==n.type)||")"==i&&("parens"==n.type||"atBlock_parens"==n.type)||"{"==i&&"at"==n.type)?(o=n.indent-B,n=n.prev):/(\})/.test(i)||(/@|\$|\d/.test(i)||/^\{/.test(t)||/^\s*\/(\/|\*)/.test(t)||/^\s*\/\*/.test(s)||/^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(t)||/^(\+|-)?[a-z][\w-]*\(/i.test(t)||/^return/.test(t)||T(a)?o=l:/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(i)||M(a)?o=/\,\s*$/.test(s)?c:/^\s+/.test(r)&&(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(s)||M(s))?l<=c?c:c+B:l:/,\s*$/.test(r)||!z(a)&&!L(a)||(o=T(s)?l<=c?c:c+B:/^\{/.test(s)?l<=c?l:c+B:z(s)||L(s)?l>=c?c:l:/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(s)||/=\s*$/.test(s)||M(s)||/^\$[\w-\.\[\]\'\"]/.test(s)?c+B:l)),o},electricChars:"}",lineComment:"//",fold:"indent"}});var i=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video"],o=["domain","regexp","url","url-prefix"],a=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],s=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"],c=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],u=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],d=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],f=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around","unset"],p=["in","and","or","not","is not","is a","is","isnt","defined","if unless"],h=["for","if","else","unless","from","to"],m=["null","true","false","href","title","type","not-allowed","readonly","disabled"],g=["@font-face","@keyframes","@media","@viewport","@page","@host","@supports","@block","@css"],v=i.concat(o,a,l,s,c,d,f,u,p,h,m,g);e.registerHelper("hintWords","stylus",v),e.defineMIME("text/x-styl","stylus")})}),j=r(function(e,t){!function(r){"object"==typeof t&&"object"==typeof e?r(p,O,z,N):r(CodeMirror)}(function(e){e.defineMode("pug",function(t){function r(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=e.startState(Z),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function n(e,t){if(e.sol()&&(t.javaScriptLine=!1,t.javaScriptLineExcludesColon=!1),t.javaScriptLine){if(t.javaScriptLineExcludesColon&&":"===e.peek())return t.javaScriptLine=!1,void(t.javaScriptLineExcludesColon=!1);var r=Z.token(e,t.jsState);return e.eol()&&(t.javaScriptLine=!1),r||!0}}function i(e,t){if(t.javaScriptArguments){if(0===t.javaScriptArgumentsDepth&&"("!==e.peek())return void(t.javaScriptArguments=!1);if("("===e.peek()?t.javaScriptArgumentsDepth++:")"===e.peek()&&t.javaScriptArgumentsDepth--,0===t.javaScriptArgumentsDepth)return void(t.javaScriptArguments=!1);var r=Z.token(e,t.jsState);return r||!0}}function o(e){if(e.match(/^yield\b/))return"keyword"}function a(e){if(e.match(/^(?:doctype) *([^\n]+)?/))return G}function l(e,t){if(e.match("#{"))return t.isInterpolating=!0,t.interpolationNesting=0,"punctuation"}function s(e,t){if(t.isInterpolating){if("}"===e.peek()){if(t.interpolationNesting--,t.interpolationNesting<0)return e.next(),t.isInterpolating=!1,"punctuation"}else"{"===e.peek()&&t.interpolationNesting++;return Z.token(e,t.jsState)||!0}}function c(e,t){if(e.match(/^case\b/))return t.javaScriptLine=!0,K}function u(e,t){if(e.match(/^when\b/))return t.javaScriptLine=!0,t.javaScriptLineExcludesColon=!0,K}function d(e){if(e.match(/^default\b/))return K}function f(e,t){if(e.match(/^extends?\b/))return t.restOfLine="string",K}function p(e,t){if(e.match(/^append\b/))return t.restOfLine="variable",K}function h(e,t){if(e.match(/^prepend\b/))return t.restOfLine="variable",K}function m(e,t){if(e.match(/^block\b *(?:(prepend|append)\b)?/))return t.restOfLine="variable",K}function g(e,t){if(e.match(/^include\b/))return t.restOfLine="string",K}function v(e,t){if(e.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&e.match("include"))return t.isIncludeFiltered=!0,K}function y(e,t){if(t.isIncludeFiltered){var r=T(e,t);return t.isIncludeFiltered=!1,t.restOfLine="string",r}}function b(e,t){if(e.match(/^mixin\b/))return t.javaScriptLine=!0,K}function w(e,t){return e.match(/^\+([-\w]+)/)?(e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),"variable"):e.match(/^\+#{/,!1)?(e.next(),t.mixinCallAfter=!0,l(e,t)):void 0}function x(e,t){if(t.mixinCallAfter)return t.mixinCallAfter=!1,e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),!0}function k(e,t){if(e.match(/^(if|unless|else if|else)\b/))return t.javaScriptLine=!0,K}function C(e,t){if(e.match(/^(- *)?(each|for)\b/))return t.isEach=!0,K}function S(e,t){if(t.isEach){if(e.match(/^ in\b/))return t.javaScriptLine=!0,t.isEach=!1,K;if(e.sol()||e.eol())t.isEach=!1;else if(e.next()){for(;!e.match(/^ in\b/,!1)&&e.next(););return"variable"}}}function M(e,t){if(e.match(/^while\b/))return t.javaScriptLine=!0,K}function L(e,t){var r;if(r=e.match(/^(\w(?:[-:\w]*\w)?)\/?/))return t.lastTag=r[1].toLowerCase(),"script"===t.lastTag&&(t.scriptType="application/javascript"),"tag"}function T(r,n){if(r.match(/^:([\w\-]+)/)){var i;return t&&t.innerModes&&(i=t.innerModes(r.current().substring(1))),i||(i=r.current().substring(1)),"string"==typeof i&&(i=e.getMode(t,i)),B(r,n,i),"atom"}}function z(e,t){if(e.match(/^(!?=|-)/))return t.javaScriptLine=!0,"punctuation"}function A(e){if(e.match(/^#([\w-]+)/))return _}function O(e){if(e.match(/^\.([\w-]+)/))return X}function N(e,t){if("("==e.peek())return e.next(),t.isAttrs=!0,t.attrsNest=[],t.inAttributeName=!0,t.attrValue="",t.attributeIsType=!1,"punctuation"}function W(t,r){if(r.isAttrs){if(Y[t.peek()]&&r.attrsNest.push(Y[t.peek()]),r.attrsNest[r.attrsNest.length-1]===t.peek())r.attrsNest.pop();else if(t.eat(")"))return r.isAttrs=!1,"punctuation";if(r.inAttributeName&&t.match(/^[^=,\)!]+/))return"="!==t.peek()&&"!"!==t.peek()||(r.inAttributeName=!1,r.jsState=e.startState(Z),"script"===r.lastTag&&"type"===t.current().trim().toLowerCase()?r.attributeIsType=!0:r.attributeIsType=!1),"attribute";var n=Z.token(t,r.jsState);if(r.attributeIsType&&"string"===n&&(r.scriptType=t.current().toString()),0===r.attrsNest.length&&("string"===n||"variable"===n||"keyword"===n))try{return Function("","var x "+r.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),r.inAttributeName=!0,r.attrValue="",t.backUp(t.current().length),W(t,r)}catch(e){}return r.attrValue+=t.current(),n||!0}}function E(e,t){if(e.match(/^&attributes\b/))return t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0,"keyword"}function P(e){if(e.sol()&&e.eatSpace())return"indent"}function j(e,t){if(e.match(/^ *\/\/(-)?([^\n]*)/))return t.indentOf=e.indentation(),t.indentToken="comment","comment"}function D(e){if(e.match(/^: */))return"colon"; +}function I(e,t){return e.match(/^(?:\| ?| )([^\n]+)/)?"string":e.match(/^(<[^\n]*)/,!1)?(B(e,t,"htmlmixed"),t.innerModeForLine=!0,R(e,t,!0)):void 0}function H(e,t){if(e.eat(".")){var r=null;return"script"===t.lastTag&&t.scriptType.toLowerCase().indexOf("javascript")!=-1?r=t.scriptType.toLowerCase().replace(/"|'/g,""):"style"===t.lastTag&&(r="css"),B(e,t,r),"dot"}}function F(e){return e.next(),null}function B(r,n,i){i=e.mimeModes[i]||i,i=t.innerModes?t.innerModes(i)||i:i,i=e.mimeModes[i]||i,i=e.getMode(t,i),n.indentOf=r.indentation(),i&&"null"!==i.name?n.innerMode=i:n.indentToken="string"}function R(t,r,n){return t.indentation()>r.indentOf||r.innerModeForLine&&!t.sol()||n?r.innerMode?(r.innerState||(r.innerState=r.innerMode.startState?e.startState(r.innerMode,t.indentation()):{}),t.hideFirstChars(r.indentOf+2,function(){return r.innerMode.token(t,r.innerState)||!0})):(t.skipToEnd(),r.indentToken):void(t.sol()&&(r.indentOf=1/0,r.indentToken=null,r.innerMode=null,r.innerState=null))}function $(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var r=t.restOfLine;return t.restOfLine="",r}}function V(){return new r}function q(e){return e.copy()}function U(e,t){var r=R(e,t)||$(e,t)||s(e,t)||y(e,t)||S(e,t)||W(e,t)||n(e,t)||i(e,t)||x(e,t)||o(e,t)||a(e,t)||l(e,t)||c(e,t)||u(e,t)||d(e,t)||f(e,t)||p(e,t)||h(e,t)||m(e,t)||g(e,t)||v(e,t)||b(e,t)||w(e,t)||k(e,t)||C(e,t)||M(e,t)||L(e,t)||T(e,t)||z(e,t)||A(e,t)||O(e,t)||N(e,t)||E(e,t)||P(e,t)||I(e,t)||j(e,t)||D(e,t)||H(e,t)||F(e,t);return r===!0?null:r}var K="keyword",G="meta",_="builtin",X="qualifier",Y={"{":"}","(":")","[":"]"},Z=e.getMode(t,"javascript");return r.prototype.copy=function(){var t=new r;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.interpolationNesting,t.jsState=e.copyState(Z,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:V,copyState:q,token:U}},"javascript","css","htmlmixed"),e.defineMIME("text/x-pug","pug"),e.defineMIME("text/x-jade","pug")})}),D=r(function(e,t){!function(r){r("object"==typeof t&&"object"==typeof e?p:CodeMirror)}(function(e){e.multiplexingMode=function(t){function r(e,t,r,n){if("string"==typeof t){var i=e.indexOf(t,r);return n&&i>-1?i+t.length:i}var o=t.exec(r?e.slice(r):e);return o?o.index+r+(n?o[0].length:0):-1}var n=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(r){return{outer:e.copyState(t,r.outer),innerActive:r.innerActive,inner:r.innerActive&&e.copyState(r.innerActive.mode,r.inner)}},token:function(i,o){if(o.innerActive){var a=o.innerActive,l=i.string;if(!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);var s=a.close?r(l,a.close,i.pos,a.parseDelimiters):-1;if(s==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle&&a.delimStyle+" "+a.delimStyle+"-close";s>-1&&(i.string=l.slice(0,s));var c=a.mode.token(i,o.inner);return s>-1&&(i.string=l),s==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(c=c?c+" "+a.innerStyle:a.innerStyle),c}for(var u=1/0,l=i.string,d=0;d|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}]}),e.defineMode("handlebars",function(t,r){var n=e.getMode(t,"handlebars-tags");return r&&r.base?e.multiplexingMode(e.getMode(t,r.base),{open:"{{",close:"}}",mode:n,parseDelimiters:!0}):n}),e.defineMIME("text/x-handlebars-template","handlebars")})});r(function(e,t){!function(r){"object"==typeof t&&"object"==typeof e?r(p,L,A,O,W,z,E,P,j,I):r(CodeMirror)}(function(e){var t={script:[["lang",/coffee(script)?/,"coffeescript"],["type",/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,"coffeescript"]],style:[["lang",/^stylus$/i,"stylus"],["lang",/^sass$/i,"sass"],["type",/^(text\/)?(x-)?styl(us)?$/i,"stylus"],["type",/^text\/sass/i,"sass"]],template:[["lang",/^vue-template$/i,"vue"],["lang",/^pug$/i,"pug"],["lang",/^handlebars$/i,"handlebars"],["type",/^(text\/)?(x-)?pug$/i,"pug"],["type",/^text\/x-handlebars-template$/i,"handlebars"],[null,null,"vue-template"]]};e.defineMode("vue-template",function(t,r){var n={token:function(e){if(e.match(/^\{\{.*?\}\}/))return"meta mustache";for(;e.next()&&!e.match("{{",!1););return null}};return e.overlayMode(e.getMode(t,r.backdrop||"text/html"),n)}),e.defineMode("vue",function(r){return e.getMode(r,{name:"htmlmixed",tags:t})},"htmlmixed","xml","javascript","coffeescript","css","sass","stylus","pug","handlebars"),e.defineMIME("script/x-vue","vue"),e.defineMIME("text/x-vue","vue")})}),r(function(e,t){!function(r){"object"==typeof t&&"object"==typeof e?r(p,A,O):r(CodeMirror)}(function(e){function t(e,t,r,n){this.state=e,this.mode=t,this.depth=r,this.prev=n}function r(n){return new t(e.copyState(n.mode,n.state),n.mode,n.depth,n.prev&&r(n.prev))}e.defineMode("jsx",function(n,i){function o(e){var t=e.tagName;e.tagName=null;var r=c.indent(e,"");return e.tagName=t,r}function a(e,t){return t.context.mode==c?l(e,t,t.context):s(e,t,t.context)}function l(r,i,l){if(2==l.depth)return r.match(/^.*?\*\//)?l.depth=1:r.skipToEnd(),"comment";if("{"==r.peek()){c.skipAttribute(l.state);var s=o(l.state),d=l.state.context;if(d&&r.match(/^[^>]*>\s*$/,!1)){for(;d.prev&&!d.startOfLine;)d=d.prev;d.startOfLine?s-=n.indentUnit:l.prev.state.lexical&&(s=l.prev.state.lexical.indented)}else 1==l.depth&&(s+=n.indentUnit);return i.context=new t(e.startState(u,s),u,0,i.context),null}if(1==l.depth){if("<"==r.peek())return c.skipAttribute(l.state),i.context=new t(e.startState(c,o(l.state)),c,0,i.context),null;if(r.match("//"))return r.skipToEnd(),"comment";if(r.match("/*"))return l.depth=2,a(r,i)}var f,p=c.token(r,l.state),h=r.current();return/\btag\b/.test(p)?/>$/.test(h)?l.state.context?l.depth=0:i.context=i.context.prev:/^-1&&r.backUp(h.length-f),p}function s(r,n,i){if("<"==r.peek()&&u.expressionAllowed(r,i.state))return u.skipExpression(i.state),n.context=new t(e.startState(c,u.indent(i.state,"")),c,0,n.context),null;var o=u.token(r,i.state);if(!o&&null!=i.depth){var a=r.current();"{"==a?i.depth++:"}"==a&&0==--i.depth&&(n.context=n.context.prev)}return o}var c=e.getMode(n,{name:"xml",allowMissing:!0,multilineTagIndentPastTag:!1}),u=e.getMode(n,i&&i.base||"javascript");return{startState:function(){return{context:new t(e.startState(u),u)}},copyState:function(e){return{context:r(e.context)}},token:a,indent:function(e,t,r){return e.context.mode.indent(e.context.state,t,r)},innerMode:function(e){return e.context}}},"xml","javascript"),e.defineMIME("text/jsx","jsx"),e.defineMIME("text/typescript-jsx",{name:"jsx",base:{name:"javascript",typescript:!0}})})});Object.defineProperty(e,"__esModule",{value:!0})}); diff --git a/src/components/playground.js b/src/components/playground.js index b62a861..131209a 100644 --- a/src/components/playground.js +++ b/src/components/playground.js @@ -12,7 +12,12 @@ export default { keepData: Boolean, value: String, scope: Object, - iframe: Boolean + iframe: Boolean, + fitIframe: Boolean, + iframeClass: { + type: String, + default: 'vuep-iframe-preview' + } }, data () { @@ -39,7 +44,9 @@ export default { value: this.preview, styles: this.styles, keepData: this.keepData, - iframe: this.iframe + iframe: this.iframe, + fitIframe: this.fitIframe, + iframeClass: this.iframeClass }, on: { error: this.handleError @@ -47,19 +54,31 @@ export default { }) } - return h('div', { class: 'vuep' }, [ - h(Editor, { - class: 'vuep-editor', - props: { - value: this.content, - options: this.options + const editor = h(Editor, { + class: 'vuep-editor', + props: { + value: this.content, + options: this.options + }, + on: { + change: [this.executeCode, val => this.$emit('input', val)] + } + }) + + let children = [editor, win] + if (this.$slots.default) { + children = this.addSlots(h, this.$slots.default, [ + { + name: 'vuep-preview', + child: win }, - on: { - change: [this.executeCode, val => this.$emit('input', val)] + { + name: 'vuep-editor', + child: editor } - }), - win - ]) + ]) + } + return h('div', { class: 'vuep' }, children) }, watch: { @@ -91,6 +110,21 @@ export default { }, methods: { + addSlots (h, vnodes, slots) { + return vnodes.map(vnode => { + let children = [] + slots.forEach(({ name, child }) => { + if (vnode.data && vnode.data.attrs && vnode.data.attrs[name] !== undefined) { + children = [child] + } + }) + if (!children.length && vnode.children && vnode.children.length) { + children = this.addSlots(h, vnode.children, slots) + } + return h(vnode.tag, vnode.data, children) + }) + }, + handleError (err) { /* istanbul ignore next */ this.error = err diff --git a/src/components/preview.js b/src/components/preview.js index 8822051..beabd73 100644 --- a/src/components/preview.js +++ b/src/components/preview.js @@ -1,10 +1,12 @@ import Vue from 'vue/dist/vue.common' import assign from '../utils/assign' // eslint-disable-line +import IframeResizer from '../utils/iframe-resizer' +import IframeStyler from '../utils/iframe-styler' export default { name: 'preview', - props: ['value', 'styles', 'keepData', 'iframe'], + props: ['value', 'styles', 'keepData', 'iframe', 'fitIframe', 'iframeClass'], render (h) { this.className = 'vuep-scoped-' + this._uid @@ -16,6 +18,13 @@ export default { ]) }, + data () { + return { + resizer: null, + styler: null + } + }, + computed: { scopedStyle () { return this.styles @@ -27,15 +36,55 @@ export default { mounted () { this.$watch('value', this.renderCode, { immediate: true }) if (this.iframe) { - this.$el.addEventListener('load', this.renderCode) + // Firefox needs the iframe to be loaded + if (this.$el.contentDocument.readyState === 'complete') { + this.initIframe() + } else { + this.$el.addEventListener('load', this.initIframe) + } + this.$watch('fitIframe', (fitIframe) => { + fitIframe ? this.startResizer() : this.stopResizer() + }, { immediate: true }) } }, beforeDestroy () { if (this.iframe) { - this.$el.removeEventListener('load', this.renderCode) + this.$el.removeEventListener('load', this.initIframe) + this.cleanupIframe() } }, methods: { + initIframe () { + this.resizer = new IframeResizer(this.$el) + this.styler = new IframeStyler(this.$el) + this.renderCode() + this.startStyler() + }, + cleanupIframe () { + this.stopResizer() + this.stopStyler() + }, + startResizer () { + if (this.resizer) { + this.resizer.start() + } + }, + stopResizer () { + if (this.resizer) { + this.resizer.stop() + } + }, + startStyler () { + if (this.styler) { + this.styler.start() + this.styler.setStyles(this.styles) + } + }, + stopStyler () { + if (this.styler) { + this.styler.stop() + } + }, renderCode () { // Firefox needs the iframe to be loaded if (this.iframe && this.$el.contentDocument.readyState !== 'complete') { @@ -55,22 +104,10 @@ export default { container.appendChild(this.codeEl) if (this.iframe) { - const head = this.$el.contentDocument.head - if (this.styleEl) { - head.removeChild(this.styleEl) - for (const key in this.styleNodes) { - head.removeChild(this.styleNodes[key]) - } + container.classList.add(this.iframeClass) + if (this.styler) { + this.styler.setStyles(this.styles) } - this.styleEl = document.createElement('style') - this.styleEl.appendChild(document.createTextNode(this.styles)) - this.styleNodes = [] - const documentStyles = getDocumentStyle() - for (const key in documentStyles) { - this.styleNodes[key] = documentStyles[key].cloneNode(true) - head.appendChild(this.styleNodes[key]) - } - head.appendChild(this.styleEl) } try { @@ -96,9 +133,3 @@ function insertScope (style, scope) { return g1 ? `${g1} ${scope} ${g2}` : `${scope} ${g2}` }) } - -function getDocumentStyle () { - const links = document.querySelectorAll('link[rel="stylesheet"]') - const styles = document.querySelectorAll('style') - return Array.from(links).concat(Array.from(styles)) -} diff --git a/src/utils/iframe-resizer.js b/src/utils/iframe-resizer.js new file mode 100644 index 0000000..2c1053c --- /dev/null +++ b/src/utils/iframe-resizer.js @@ -0,0 +1,119 @@ +export default class IframeResizer { + constructor ($el) { + this.$el = $el + this.observer = null + this.resize = this.resizeIframe.bind(this) + } + + start () { + this.resize() + } + + stop () { + this.stopObserve() + } + + observe () { + this.bindResizeObserver() + this.bindLoadObserver() + this.bindContentObserver() + } + + stopObserve () { + this.unbindResizeObserver() + this.unbindLoadObserver() + this.unbindContentObserver() + } + + resizeIframe () { + if (!this.$el || !this.$el.contentWindow) { + return + } + this.stopObserve() + const body = this.$el.contentWindow.document.body + // Add element for height calculation + const heightEl = document.createElement('div') + body.appendChild(heightEl) + const padding = getPadding(this.$el) + const bodyOffset = getPadding(body) + getMargin(body) + this.$el.style.height = `${heightEl.offsetTop + padding + bodyOffset}px` + body.removeChild(heightEl) + setTimeout(this.observe.bind(this), 100) + } + + bindResizeObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.addEventListener( + 'resize', + this.resize + ) + } + } + + unbindResizeObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.removeEventListener( + 'resize', + this.resize + ) + } + } + + // Listen for async loaded content (images) + bindLoadObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.document.body.addEventListener( + 'load', + this.resize, + true + ) + } + } + + unbindLoadObserver () { + if (this.$el && this.$el.contentWindow) { + this.$el.contentWindow.document.body.removeEventListener( + 'load', + this.resize + ) + } + } + + bindContentObserver () { + if (!this.$el || !this.$el.contentWindow) { + return + } + const MutationObserver = window.MutationObserver || window.WebKitMutationObserver + if (MutationObserver) { + const target = this.$el.contentWindow.document.body + const config = { + attributes: true, + attributeOldValue: false, + characterData: true, + characterDataOldValue: false, + childList: true, + subtree: true + } + this.observer = new MutationObserver(this.resize) + this.observer.observe(target, config) + } + } + + unbindContentObserver () { + if (this.observer) { + this.observer.disconnect() + } + } +} + +function getPadding (e) { + return getProperty(e, 'padding-top') + getProperty(e, 'padding-bottom') +} + +function getMargin (e) { + return getProperty(e, 'margin-top') + getProperty(e, 'margin-bottom') +} + +function getProperty (e, p) { + return parseInt(window.getComputedStyle(e, null).getPropertyValue(p)) +} diff --git a/src/utils/iframe-styler.js b/src/utils/iframe-styler.js new file mode 100644 index 0000000..a79bd92 --- /dev/null +++ b/src/utils/iframe-styler.js @@ -0,0 +1,70 @@ +export default class IframeStyler { + constructor ($el) { + this.$el = $el + this.observer = null + this.style = this.styleIframe.bind(this) + this.styleEl = null + this.styleNodes = [] + this.styles = null + } + + start () { + this.observe() + this.style() + } + + stop () { + this.stopObserve() + } + + setStyles (styles) { + this.styles = styles + this.style() + } + + observe () { + const MutationObserver = window.MutationObserver || window.WebKitMutationObserver + if (MutationObserver) { + const head = document.querySelector('head') + const config = { attributes: true, childList: true, subtree: true } + this.observer = new MutationObserver(this.style) + this.observer.observe(head, config) + } + } + + stopObserve () { + if (this.observer) { + this.observer.disconnect() + } + } + + styleIframe () { + if (!this.$el || !this.$el.contentDocument) { + return + } + const head = this.$el.contentDocument.head + // Remove old styles + if (this.styleEl) { + head.removeChild(this.styleEl) + } + for (const key in this.styleNodes) { + head.removeChild(this.styleNodes[key]) + } + // Set new styles + this.styleEl = document.createElement('style') + this.styleEl.appendChild(document.createTextNode(this.styles)) + this.styleNodes = [] + const documentStyles = getDocumentStyle() + for (const key in documentStyles) { + this.styleNodes[key] = documentStyles[key].cloneNode(true) + head.appendChild(this.styleNodes[key]) + } + head.appendChild(this.styleEl) + } +} + +function getDocumentStyle () { + const links = document.querySelectorAll('link[rel="stylesheet"]') + const styles = document.querySelectorAll('style') + return Array.from(links).concat(Array.from(styles)) +} diff --git a/test.html b/test.html index 9259cb9..71792ec 100644 --- a/test.html +++ b/test.html @@ -29,8 +29,37 @@

Single File Component with <features> from scope

Single File Component displayed in iframe

- +
+

Single File Component displayed in iframe with fit-iframe

+ +
+ +
+

Single File Component with custom layout

+ + +
+
+
+
+
+
+ + + + + +