!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("tiptap"),require("tiptap-extensions"),require("prosemirror-state"),require("vue-codemirror"),require("mermaid"),require("prosemirror-model"),require("prosemirror-utils"),require("katex")):"function"==typeof define&&define.amd?define(["exports","vue","tiptap","tiptap-extensions","prosemirror-state","vue-codemirror","mermaid","prosemirror-model","prosemirror-utils","katex"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).QuasarTiptap={},e.Vue,e.tiptap,e.tiptapExtensions,e.prosemirrorState,e.vueCodemirror,e.mermaid,e.prosemirrorModel,e.prosemirrorUtils,e.katex)}(this,(function(e,t,n,r,i,o,a,l,s,c){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=u(t),d=u(a),p=u(c),h=function(e){return"object"==typeof e?null!==e:"function"==typeof e};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function m(e,t){return e(t={exports:{}},t.exports),t.exports}var g=0,v=Math.random(),y=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++g+v).toString(36))},b={}.hasOwnProperty,x=function(e,t){return b.call(e,t)},w=function(e){if(!h(e))throw TypeError(e+" is not an object!");return e},k=function(e){try{return!!e()}catch(e){return!0}},S=!k((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),C=m((function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)})),O=C.document,_=h(O)&&h(O.createElement),M=function(e){return _?O.createElement(e):{}},A=!S&&!k((function(){return 7!=Object.defineProperty(M("div"),"a",{get:function(){return 7}}).a})),T=function(e,t){if(!h(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!h(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!h(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!h(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},L=Object.defineProperty,E={f:S?Object.defineProperty:function(e,t,n){if(w(e),t=T(t,!0),w(n),A)try{return L(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},D=m((function(e){var t=y("meta"),n=E.f,r=0,i=Object.isExtensible||function(){return!0},o=!k((function(){return i(Object.preventExtensions({}))})),a=function(e){n(e,t,{value:{i:"O"+ ++r,w:{}}})},l=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!h(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!x(e,t)){if(!i(e))return"F";if(!n)return"E";a(e)}return e[t].i},getWeak:function(e,n){if(!x(e,t)){if(!i(e))return!0;if(!n)return!1;a(e)}return e[t].w},onFreeze:function(e){return o&&l.NEED&&i(e)&&!x(e,t)&&a(e),e}}})),F=(D.KEY,D.NEED,D.fastKey,D.getWeak,D.onFreeze,m((function(e){var t=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=t)}))),N=(F.version,function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}),R=S?function(e,t,n){return E.f(e,t,N(1,n))}:function(e,t,n){return e[t]=n,e},I=m((function(e){var t=C["__core-js_shared__"]||(C["__core-js_shared__"]={});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:F.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),P=I("native-function-to-string",Function.toString),j=m((function(e){var t=y("src"),n=(""+P).split("toString");F.inspectSource=function(e){return P.call(e)},(e.exports=function(e,r,i,o){var a="function"==typeof i;a&&(x(i,"name")||R(i,"name",r)),e[r]!==i&&(a&&(x(i,t)||R(i,t,e[r]?""+e[r]:n.join(String(r)))),e===C?e[r]=i:o?e[r]?e[r]=i:R(e,r,i):(delete e[r],R(e,r,i)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[t]||P.call(this)}))})),z=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},B=function(e,t,n){if(z(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},q=function(e,t,n){var r,i,o,a,l=e&q.F,s=e&q.G,c=e&q.S,u=e&q.P,f=e&q.B,d=s?C:c?C[t]||(C[t]={}):(C[t]||{}).prototype,p=s?F:F[t]||(F[t]={}),h=p.prototype||(p.prototype={});for(r in s&&(n=t),n)o=((i=!l&&d&&void 0!==d[r])?d:n)[r],a=f&&i?B(o,C):u&&"function"==typeof o?B(Function.call,o):o,d&&j(d,r,o,e&q.U),p[r]!=o&&R(p,r,a),u&&h[r]!=o&&(h[r]=o)};C.core=F,q.F=1,q.G=2,q.S=4,q.P=8,q.B=16,q.W=32,q.U=64,q.R=128;var $=q,H=function(e,t){var n=(F.Object||{})[e]||Object[e],r={};r[e]=t(n),$($.S+$.F*k((function(){n(1)})),"Object",r)},W=D.onFreeze;H("freeze",(function(e){return function(t){return e&&h(t)?e(W(t)):t}}));var U={"en-us":{isoName:"en-us",nativeName:"English (US)",diagram:{name:"Text Diagram",flow:"Flow Diagram",sequence:"Sequence Diagram",class:"Class Diagram",state:"State Diagram",gantt:"Gantt Diagram",tips:"Generation of diagram and chart from text in a similar manner as markdown"},editor:{add:"Add",addMore:"Add More",url:"URL",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",underline:"Underline",textFormat:"More text format",list:"List",unorderedList:"Unordered List",orderedList:"Ordered List",todoList:"Todo List",subscript:"Subscript",superscript:"Superscript",hyperlink:"Hyperlink",toggleFullscreen:"Toggle Fullscreen",quote:"Quote",left:"Left align",center:"Center align",right:"Right align",justify:"Justify align",print:"Print",outdent:"Decrease indentation",indent:"Increase indentation",indentDropdown:"Indent",removeFormat:"Remove formatting",formatting:"Formatting",fontFamily:"Font Family",defaultFont:"Default Font",fontSize:"Font Size",align:"Align",hr:"Insert Horizontal Rule",undo:"Undo",redo:"Redo",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",headings:"Headings",paragraph:"Paragraph",code:"Code",codeBlock:"Code Block",size1:"Very small",size2:"A bit small",size3:"Normal",size4:"Medium-large",size5:"Big",size6:"Very big",size7:"Maximum",viewSource:"View Source",textColor:"Text Color",highlightColor:"Highlight Color",default:"Default",lineHeight:"Line Height",blockquote:"Blockquote",table:"Table",photo:"Insert Photo",formula:"Formula",inlineFormula:"Inline",blockFormula:"Block",thirdPartyService:"Third party services"},label:{cancel:"Cancel",edit:"Edit",link:"Link",linkAddress:"Link Address",ok:"Ok",preview:"Preview",template:"Template",example:"Example",submit:"Submit",settings:"Settings",remove:"Remove",help:"Help",back:"Back"},table:{insert:"Insert Table",remove:"Remove Table",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",removeColumns:"Remove selected columns",insertRowUp:"Insert row up",insertRowDown:"Insert row down",removeRows:"Remove selected rows",merge:"Merge/Unmerge cells"},image:{preferences:"Image Preferences",size:"Size",width:"Width",height:"Height",src:"Image Source",caption:"Caption",link:"Link",lockAspectRatio:"Lock aspect ratio",unlockAspectRatio:"Unlock aspect ratio"},embed:{video:"Video",map:"Map",design:"Design",develop:"Develop",data:"Data",others:"Others",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"Youku",iqiyi:"iQiyi",bilibili:"Bilibili",qqvideo:"QQ Video",google_map:"Google Map",amap:"AMap",baidu_map:"Baidu Map",modao:"Modao",lanhu:"Lanhu",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"Jinshuju",iframe:"IFrame",linkTips:"Link or embed code",linkWarning:"Invalid link"},link:{back:"Back to main menu",edit:"Edit Link",off:"Disable Link",open:"Open Link",open_in_new_tab:"Open in new tab"}},pl:{isoName:"pl",nativeName:"Polski",diagram:{name:"Schemat tekstowy",flow:"Schemat przepływu",sequence:"Schemat sekwencji",class:"Schemat klas",state:"Diagram stanu",gantt:"Diagram Gantta",tips:"Generowanie diagramu i wykresu z tekstu w podobny sposób jak markdown"},editor:{add:"Dodaj",addMore:"Dodaj więcej",url:"URL",bold:"Pogrubienie",italic:"Kursywa",strikethrough:"Przekreślenie",underline:"Podkreślenie",textFormat:"More text format",unorderedList:"Lista wypunktowana",orderedList:"Lista numerowana",list:"List",todoList:"Lista rzeczy do zrobienia",subscript:"Indeks dolny",superscript:"Indeks górny",hyperlink:"Hiperłącze",toggleFullscreen:"Przełącz na tryb pełnoekranowy",quote:"Zacytuj",left:"Wyrównaj do lewej",center:"Wyrównaj do środka",right:"Wyrównaj do prawej",justify:"Wyjustuj",print:"Drukuj",outdent:"Zmniejsz wcięcie",indent:"Zwiększ wcięcie",indentDropdown:"Wcięcie",removeFormat:"Usuń formatowanie",formatting:"Formatowanie",fontFamily:"Nazwa czcionki",defaultFont:"Domyślna czcionka",fontSize:"Rozmiar czcionki",align:"Wyrównanie",hr:"Wstaw poziomą linię",undo:"Cofnij",redo:"Przywróć",heading1:"Nagłówek 1",heading2:"Nagłówek 2",heading3:"Nagłówek 3",heading4:"Nagłówek 4",heading5:"Nagłówek 5",headings:"Nagłówki",paragraph:"Paragraf",code:"Kod",codeBlock:"Blok kodu",size1:"Bardzo mała",size2:"Mała",size3:"Normalna",size4:"Średnio-duża",size5:"Duża",size6:"Bardzo duża",size7:"Maksymalna",viewSource:"Pokaż źródło",textColor:"Kolor czcionki",highlightColor:"Kolor wyróżnienia",default:"Dymyślny",lineHeight:"Wysokość linii",blockquote:"Cytat",table:"Tabela",photo:"Wstaw obraz",formula:"Formuła",inlineFormula:"Formuła w treści",blockFormula:"Blokowa formuła",thirdPartyService:"Third party services"},label:{cancel:"Anuluj",edit:"Edycja",link:"Łącze",linkAddress:"Adres łącza",ok:"Ok",preview:"Podgląd",template:"Szablon",example:"Example",submit:"Submit",settings:"Settings",remove:"Remove",help:"Help",back:"Back"},table:{insert:"Wstaw tabelę",remove:"Usuń tabelę",insertColumnLeft:"Wstaw kolumnę przed",insertColumnRight:"Wstaw kolumnę po",removeColumns:"Usuń zaznaczone kolumny",insertRowUp:"Wstaw wiersz powyżej",insertRowDown:"Wstaw wiersz poniżej",removeRows:"Usuń zaznaczone wiersze",merge:"Scal/podziel komórki"},image:{preferences:"Preferencje obrazu",size:"Rozmiar",width:"Szerokość",height:"Wysokość",src:"Źródło obrazu",caption:"Nagłówek",link:"Łącze",lockAspectRatio:"Lock aspect ratio",unlockAspectRatio:"Unlock aspect ratio"},embed:{video:"Video",map:"Map",design:"Design",develop:"Develop",data:"Data",others:"Others",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"Youku",iqiyi:"iQiyi",bilibili:"Bilibili",qqvideo:"QQ Video",google_map:"Google Map",amap:"AMap",baidu_map:"Baidu Map",modao:"Modao",lanhu:"Lanhu",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"Jinshuju",iframe:"IFrame",linkTips:"Link or embed code",linkWarning:"Invalid link"},link:{back:"Back to main menu",edit:"Edit Link",off:"Disable Link",open:"Open Link",open_in_new_tab:"Open in new tab"}},"zh-hans":{isoName:"zh-hans",nativeName:"简体中文",diagram:{name:"文本绘图",flow:"流程图",sequence:"时序图",class:"类图",state:"状态图",gantt:"甘特图",tips:"使用Markdown风格文本生成流程图、顺序图、类图、状态图和甘特图"},editor:{add:"添加",addMore:"添加更多",url:"URL",bold:"粗体",italic:"斜体",strikethrough:"删除线",underline:"下划线",textFormat:"更多格式",list:"列表",unorderedList:"无序列表",orderedList:"有序列表",todoList:"任务列表",subscript:"下标",superscript:"上标",hyperlink:"超链接",toggleFullscreen:"全屏切换",quote:"引号",left:"左对齐",center:"居中对齐",right:"右对齐",justify:"两端对齐",print:"打印",outdent:"减少缩进",indent:"增加缩进",indentDropdown:"缩进",removeFormat:"清除格式",formatting:"格式化",fontFamily:"字体",defaultFont:"默认字体",fontSize:"字体大小",align:"对齐方式",hr:"插入分割线",undo:"撤消",redo:"重做",heading1:"标题一",heading2:"标题二",heading3:"标题三",heading4:"标题四",heading5:"标题五",headings:"标题",paragraph:"正文",code:"代码",codeBlock:"代码块",size1:"非常小",size2:"比较小",size3:"正常",size4:"中等偏大",size5:"大",size6:"非常大",size7:"超级大",viewSource:"查看资料",textColor:"文字颜色",highlightColor:"背景颜色",default:"默认",lineHeight:"行高",blockquote:"插入引用",table:"表格",photo:"图片",formula:"数学公式",inlineFormula:"行内公式",blockFormula:"块级公式",thirdPartyService:"第三方服务"},label:{cancel:"取消",edit:"编辑",link:"Link",linkAddress:"链接地址",ok:"确定",preview:"预览",template:"模板",example:"示例",submit:"确定",settings:"设置",remove:"删除",help:"帮助",back:"返回"},table:{insert:"插入表格",remove:"删除表格",insertColumnLeft:"左边插入列",insertColumnRight:"右边插入列",removeColumns:"删除选中列",insertRowUp:"上方插入行",insertRowDown:"下方插入行",removeRows:"删除选中行",merge:"合并/拆分 单元格"},image:{preferences:"图片设置",size:"尺寸",width:"宽度",height:"高度",src:"图片地址",caption:"图片说明",link:"链接",lockAspectRatio:"锁定长宽比",unlockAspectRatio:"解锁长宽比"},embed:{video:"视频",map:"地图",design:"设计",develop:"开发",data:"数据",others:"其它",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"优酷",iqiyi:"爱奇艺",bilibili:"Bilibili",qqvideo:"腾讯视频",google_map:"谷歌地图",amap:"高德地图",baidu_map:"百度",modao:"墨刀",lanhu:"蓝湖",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"金数据",iframe:"IFrame",linkTips:"链接或代码",linkWarning:"无效的链接"},link:{back:"返回主菜单",edit:"编辑链接",off:"取消链接",open:"打开链接",open_in_new_tab:"在新标签页打开"}},"pt-br":{isoName:"pt-br",nativeName:"Português (BR)",diagram:{name:"Diagrama de Texto",flow:"Diagrama de Fluxo",sequence:"Diagrama de sequência",class:"Diagrama de Classe",state:"Diagrama de Estado",gantt:"Diagrama de Gantt",tips:"Geração de diagrama ou gráfico a partir de texto semelhante a markdown"},editor:{add:"Adicionar",addMore:"Adicione Mais",url:"URL",bold:"Negrito",italic:"Itálico",strikethrough:"Tachar",underline:"Sublinhado",textFormat:"Mais formatos de textos",list:"Lista",unorderedList:"Lista com Marcadores",orderedList:"Lista Numerada",todoList:"Lista de afazer",subscript:"Subscrito",superscript:"Sobrescrito",hyperlink:"Hyperlink",toggleFullscreen:"Alternar tela-cheia",quote:"Citação",left:"Alinhar à esquerda",center:"Alinhar ao centro",right:"Alinhar à direita",justify:"Justificar",print:"Imprimir",outdent:"Diminuir recuo",indent:"Aumentar recuo",indentDropdown:"Recuo",removeFormat:"Limpar formatação",formatting:"Formatação",fontFamily:"Fonte",defaultFont:"Fonte Padrão",fontSize:"Tamanho da fontee",align:"Alinhamento",hr:"Linha Horizontal",undo:"Desfazer",redo:"Refazer",heading1:"Título 1",heading2:"Título 2",heading3:"Título 3",heading4:"Título 4",heading5:"Título 5",headings:"Estilos de Parágrafo",paragraph:"Parágrafo",code:"Código",codeBlock:"Bloco de Código",size1:"Muito Pequeno",size2:"Pequeno",size3:"Normal",size4:"Médio",size5:"Grande",size6:"Enorme",size7:"Máximo",viewSource:"Código Fonte",textColor:"Cor do texto",highlightColor:"Cor do fundo",default:"Padrão",lineHeight:"Espaço entre linhas",blockquote:"Bloco de citação",table:"Tabela",photo:"Inserir Foto",formula:"Fórmula",inlineFormula:"Linha",blockFormula:"Bloco",thirdPartyService:"Serviços de terceiros"},label:{cancel:"Cancelar",edit:"Editar",link:"Link",linkAddress:"Endereço do Link",ok:"Ok",preview:"Pré Visualização",template:"Modelo",example:"Exemplo",submit:"Enviar",settings:"Configurações",remove:"Excluir",help:"Ajuda",back:"Voltar"},table:{insert:"Inserir Tabela",remove:"Excluir Tabela",insertColumnLeft:"Inserir coluna à esquerda",insertColumnRight:"Inserir coluna à direita",removeColumns:"Excluir colunas selecionadas",insertRowUp:"Inserir linha à cima",insertRowDown:"Inserir linha à baixo",removeRows:"Excluir linhas  selecionadas",merge:"Agrupar/Desagrupar célula"},image:{preferences:"Preferências da Imagem",size:"Tamanho",width:"Largura",height:"Altura",src:"Origem da imagem",caption:"Legenda",link:"Link",lockAspectRatio:"Bloquear proporção",unlockAspectRatio:"Desbloquear proporção"},embed:{video:"Vídeo",map:"Mapa",design:"Design",develop:"Desenvolvimento",data:"Dados",others:"Outros",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"Youku",iqiyi:"iQiyi",bilibili:"Bilibili",qqvideo:"QQ Video",google_map:"Google Map",amap:"AMap",baidu_map:"Baidu Map",modao:"Modao",lanhu:"Lanhu",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"Jinshuju",iframe:"IFrame",linkTips:"Link or embed code",linkWarning:"Invalid link"},link:{back:"Back to main menu",edit:"Edit Link",off:"Disable Link",open:"Open Link",open_in_new_tab:"Open in new tab"}}},G=process.env.DEFAULT_LOCALE||"en-us",V=U[G],K={install:function(e,t){var n=this;this.set=function(t){var r=function(e){return U[e]||V}(t=t||n.getLocale());r.set=n.set,r.getLocale=n.getLocale,e&&e.lang?e.lang=r:f.default.util.defineReactive(e,"lang",r),n.isoName=r.isoName,n.nativeName=r.nativeName,n.props=r},this.set(t)},getLocale:function(){var e=navigator.language||navigator.languages[0]||navigator.browserLanguage||navigator.userLanguage||navigator.systemLanguage;if(e)return e.toLowerCase()}},J={config:{}};var Y=m((function(e){var t=I("wks"),n=C.Symbol,r="function"==typeof n;(e.exports=function(e){return t[e]||(t[e]=r&&n[e]||(r?n:y)("Symbol."+e))}).store=t})),X=Y("unscopables"),Q=Array.prototype;null==Q[X]&&R(Q,X,{});var Z=function(e){Q[X][e]=!0},ee=function(e,t){return{value:t,done:!!e}},te={},ne={}.toString,re=function(e){return ne.call(e).slice(8,-1)},ie=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==re(e)?e.split(""):Object(e)},oe=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e},ae=function(e){return ie(oe(e))},le=Math.ceil,se=Math.floor,ce=function(e){return isNaN(e=+e)?0:(e>0?se:le)(e)},ue=Math.min,fe=function(e){return e>0?ue(ce(e),9007199254740991):0},de=Math.max,pe=Math.min,he=function(e){return function(t,n,r){var i,o=ae(t),a=fe(o.length),l=function(e,t){return(e=ce(e))<0?de(e+t,0):pe(e,t)}(r,a);if(e&&n!=n){for(;a>l;)if((i=o[l++])!=i)return!0}else for(;a>l;l++)if((e||l in o)&&o[l]===n)return e||l||0;return!e&&-1}},me=I("keys"),ge=function(e){return me[e]||(me[e]=y(e))},ve=he(!1),ye=ge("IE_PROTO"),be=function(e,t){var n,r=ae(e),i=0,o=[];for(n in r)n!=ye&&x(r,n)&&o.push(n);for(;t.length>i;)x(r,n=t[i++])&&(~ve(o,n)||o.push(n));return o},xe="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),we=Object.keys||function(e){return be(e,xe)},ke=S?Object.defineProperties:function(e,t){w(e);for(var n,r=we(t),i=r.length,o=0;i>o;)E.f(e,n=r[o++],t[n]);return e},Se=C.document,Ce=Se&&Se.documentElement,Oe=ge("IE_PROTO"),_e=function(){},Me=function(){var e,t=M("iframe"),n=xe.length;for(t.style.display="none",Ce.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),Me=e.F;n--;)delete Me.prototype[xe[n]];return Me()},Ae=Object.create||function(e,t){var n;return null!==e?(_e.prototype=w(e),n=new _e,_e.prototype=null,n[Oe]=e):n=Me(),void 0===t?n:ke(n,t)},Te=E.f,Le=Y("toStringTag"),Ee=function(e,t,n){e&&!x(e=n?e:e.prototype,Le)&&Te(e,Le,{configurable:!0,value:t})},De={};R(De,Y("iterator"),(function(){return this}));var Fe=function(e,t,n){e.prototype=Ae(De,{next:N(1,n)}),Ee(e,t+" Iterator")},Ne=function(e){return Object(oe(e))},Re=ge("IE_PROTO"),Ie=Object.prototype,Pe=Object.getPrototypeOf||function(e){return e=Ne(e),x(e,Re)?e[Re]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Ie:null},je=Y("iterator"),ze=!([].keys&&"next"in[].keys()),Be=function(){return this},qe=function(e,t,n,r,i,o,a){Fe(n,t,r);var l,s,c,u=function(e){if(!ze&&e in h)return h[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},f=t+" Iterator",d="values"==i,p=!1,h=e.prototype,m=h[je]||h["@@iterator"]||i&&h[i],g=m||u(i),v=i?d?u("entries"):g:void 0,y="Array"==t&&h.entries||m;if(y&&(c=Pe(y.call(new e)))!==Object.prototype&&c.next&&(Ee(c,f,!0),"function"!=typeof c[je]&&R(c,je,Be)),d&&m&&"values"!==m.name&&(p=!0,g=function(){return m.call(this)}),(ze||p||!h[je])&&R(h,je,g),te[t]=g,te[f]=Be,i)if(l={values:d?g:u("values"),keys:o?g:u("keys"),entries:v},a)for(s in l)s in h||j(h,s,l[s]);else $($.P+$.F*(ze||p),t,l);return l},$e=qe(Array,"Array",(function(e,t){this._t=ae(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,ee(1)):ee(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values");te.Arguments=te.Array,Z("keys"),Z("values"),Z("entries");for(var He=Y("iterator"),We=Y("toStringTag"),Ue=te.Array,Ge={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Ve=we(Ge),Ke=0;Ke<Ve.length;Ke++){var Je,Ye=Ve[Ke],Xe=Ge[Ye],Qe=C[Ye],Ze=Qe&&Qe.prototype;if(Ze&&(Ze[He]||R(Ze,He,Ue),Ze[We]||R(Ze,We,Ye),te[Ye]=Ue,Xe))for(Je in $e)Ze[Je]||j(Ze,Je,$e[Je],!0)}var et={f:Y},tt=E.f,nt=function(e){var t=F.Symbol||(F.Symbol=C.Symbol||{});"_"==e.charAt(0)||e in t||tt(t,e,{value:et.f(e)})};nt("asyncIterator");var rt={f:Object.getOwnPropertySymbols},it={f:{}.propertyIsEnumerable},ot=Array.isArray||function(e){return"Array"==re(e)},at=xe.concat("length","prototype"),lt={f:Object.getOwnPropertyNames||function(e){return be(e,at)}},st=lt.f,ct={}.toString,ut="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],ft={f:function(e){return ut&&"[object Window]"==ct.call(e)?function(e){try{return st(e)}catch(e){return ut.slice()}}(e):st(ae(e))}},dt=Object.getOwnPropertyDescriptor,pt={f:S?dt:function(e,t){if(e=ae(e),t=T(t,!0),A)try{return dt(e,t)}catch(e){}if(x(e,t))return N(!it.f.call(e,t),e[t])}},ht=D.KEY,mt=pt.f,gt=E.f,vt=ft.f,yt=C.Symbol,bt=C.JSON,xt=bt&&bt.stringify,wt=Y("_hidden"),kt=Y("toPrimitive"),St={}.propertyIsEnumerable,Ct=I("symbol-registry"),Ot=I("symbols"),_t=I("op-symbols"),Mt=Object.prototype,At="function"==typeof yt&&!!rt.f,Tt=C.QObject,Lt=!Tt||!Tt.prototype||!Tt.prototype.findChild,Et=S&&k((function(){return 7!=Ae(gt({},"a",{get:function(){return gt(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=mt(Mt,t);r&&delete Mt[t],gt(e,t,n),r&&e!==Mt&&gt(Mt,t,r)}:gt,Dt=function(e){var t=Ot[e]=Ae(yt.prototype);return t._k=e,t},Ft=At&&"symbol"==typeof yt.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof yt},Nt=function(e,t,n){return e===Mt&&Nt(_t,t,n),w(e),t=T(t,!0),w(n),x(Ot,t)?(n.enumerable?(x(e,wt)&&e[wt][t]&&(e[wt][t]=!1),n=Ae(n,{enumerable:N(0,!1)})):(x(e,wt)||gt(e,wt,N(1,{})),e[wt][t]=!0),Et(e,t,n)):gt(e,t,n)},Rt=function(e,t){w(e);for(var n,r=function(e){var t=we(e),n=rt.f;if(n)for(var r,i=n(e),o=it.f,a=0;i.length>a;)o.call(e,r=i[a++])&&t.push(r);return t}(t=ae(t)),i=0,o=r.length;o>i;)Nt(e,n=r[i++],t[n]);return e},It=function(e){var t=St.call(this,e=T(e,!0));return!(this===Mt&&x(Ot,e)&&!x(_t,e))&&(!(t||!x(this,e)||!x(Ot,e)||x(this,wt)&&this[wt][e])||t)},Pt=function(e,t){if(e=ae(e),t=T(t,!0),e!==Mt||!x(Ot,t)||x(_t,t)){var n=mt(e,t);return!n||!x(Ot,t)||x(e,wt)&&e[wt][t]||(n.enumerable=!0),n}},jt=function(e){for(var t,n=vt(ae(e)),r=[],i=0;n.length>i;)x(Ot,t=n[i++])||t==wt||t==ht||r.push(t);return r},zt=function(e){for(var t,n=e===Mt,r=vt(n?_t:ae(e)),i=[],o=0;r.length>o;)!x(Ot,t=r[o++])||n&&!x(Mt,t)||i.push(Ot[t]);return i};At||(j((yt=function(){if(this instanceof yt)throw TypeError("Symbol is not a constructor!");var e=y(arguments.length>0?arguments[0]:void 0),t=function(n){this===Mt&&t.call(_t,n),x(this,wt)&&x(this[wt],e)&&(this[wt][e]=!1),Et(this,e,N(1,n))};return S&&Lt&&Et(Mt,e,{configurable:!0,set:t}),Dt(e)}).prototype,"toString",(function(){return this._k})),pt.f=Pt,E.f=Nt,lt.f=ft.f=jt,it.f=It,rt.f=zt,S&&j(Mt,"propertyIsEnumerable",It,!0),et.f=function(e){return Dt(Y(e))}),$($.G+$.W+$.F*!At,{Symbol:yt});for(var Bt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),qt=0;Bt.length>qt;)Y(Bt[qt++]);for(var $t=we(Y.store),Ht=0;$t.length>Ht;)nt($t[Ht++]);$($.S+$.F*!At,"Symbol",{for:function(e){return x(Ct,e+="")?Ct[e]:Ct[e]=yt(e)},keyFor:function(e){if(!Ft(e))throw TypeError(e+" is not a symbol!");for(var t in Ct)if(Ct[t]===e)return t},useSetter:function(){Lt=!0},useSimple:function(){Lt=!1}}),$($.S+$.F*!At,"Object",{create:function(e,t){return void 0===t?Ae(e):Rt(Ae(e),t)},defineProperty:Nt,defineProperties:Rt,getOwnPropertyDescriptor:Pt,getOwnPropertyNames:jt,getOwnPropertySymbols:zt});var Wt=k((function(){rt.f(1)}));$($.S+$.F*Wt,"Object",{getOwnPropertySymbols:function(e){return rt.f(Ne(e))}}),bt&&$($.S+$.F*(!At||k((function(){var e=yt();return"[null]"!=xt([e])||"{}"!=xt({a:e})||"{}"!=xt(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(h(t)||void 0!==e)&&!Ft(e))return ot(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Ft(t))return t}),r[1]=t,xt.apply(bt,r)}}),yt.prototype[kt]||R(yt.prototype,kt,yt.prototype.valueOf),Ee(yt,"Symbol"),Ee(Math,"Math",!0),Ee(C.JSON,"JSON",!0);var Ut=function(e){return function(t,n){var r,i,o=String(oe(t)),a=ce(n),l=o.length;return a<0||a>=l?e?"":void 0:(r=o.charCodeAt(a))<55296||r>56319||a+1===l||(i=o.charCodeAt(a+1))<56320||i>57343?e?o.charAt(a):r:e?o.slice(a,a+2):i-56320+(r-55296<<10)+65536}},Gt=Ut(!0);qe(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=Gt(t,n),this._i+=e.length,{value:e,done:!1})}));var Vt=function(e,t,n,r){try{return r?t(w(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&w(i.call(e)),t}},Kt=Y("iterator"),Jt=Array.prototype,Yt=function(e){return void 0!==e&&(te.Array===e||Jt[Kt]===e)},Xt=function(e,t,n){t in e?E.f(e,t,N(0,n)):e[t]=n},Qt=Y("toStringTag"),Zt="Arguments"==re(function(){return arguments}()),en=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Qt))?n:Zt?re(t):"Object"==(r=re(t))&&"function"==typeof t.callee?"Arguments":r},tn=Y("iterator"),nn=F.getIteratorMethod=function(e){if(null!=e)return e[tn]||e["@@iterator"]||te[en(e)]},rn=Y("iterator"),on=!1;try{var an=[7][rn]();an.return=function(){on=!0},Array.from(an,(function(){throw 2}))}catch(e){}var ln=function(e,t){if(!t&&!on)return!1;var n=!1;try{var r=[7],i=r[rn]();i.next=function(){return{done:n=!0}},r[rn]=function(){return i},e(r)}catch(e){}return n};$($.S+$.F*!ln((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,r,i,o=Ne(e),a="function"==typeof this?this:Array,l=arguments.length,s=l>1?arguments[1]:void 0,c=void 0!==s,u=0,f=nn(o);if(c&&(s=B(s,l>2?arguments[2]:void 0,2)),null==f||a==Array&&Yt(f))for(n=new a(t=fe(o.length));t>u;u++)Xt(n,u,c?s(o[u],u):o[u]);else for(i=f.call(o),n=new a;!(r=i.next()).done;u++)Xt(n,u,c?Vt(i,s,[r.value,u],!0):r.value);return n.length=u,n}});var sn=E.f,cn=Function.prototype,un=/^\s*function ([^ (]*)/;"name"in cn||S&&sn(cn,"name",{configurable:!0,get:function(){try{return(""+this).match(un)[1]}catch(e){return""}}});var fn=function(){var e=w(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};S&&"g"!=/./g.flags&&E.f(RegExp.prototype,"flags",{configurable:!0,get:fn});var dn=/./.toString,pn=function(e){j(RegExp.prototype,"toString",e,!0)};k((function(){return"/a/b"!=dn.call({source:"a",flags:"b"})}))?pn((function(){var e=w(this);return"/".concat(e.source,"/","flags"in e?e.flags:!S&&e instanceof RegExp?fn.call(e):void 0)})):"toString"!=dn.name&&pn((function(){return dn.call(this)}));var hn={};hn[Y("toStringTag")]="z",hn+""!="[object z]"&&j(Object.prototype,"toString",(function(){return"[object "+en(this)+"]"}),!0);var mn=he(!0);$($.P,"Array",{includes:function(e){return mn(this,e,arguments.length>1?arguments[1]:void 0)}}),Z("includes");var gn=Y("match"),vn=function(e){var t;return h(e)&&(void 0!==(t=e[gn])?!!t:"RegExp"==re(e))},yn=function(e,t,n){if(vn(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(oe(e))},bn=Y("match"),xn=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[bn]=!1,!"/./"[e](t)}catch(e){}}return!0};$($.P+$.F*xn("includes"),"String",{includes:function(e){return!!~yn(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}});var wn=m((function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)})),kn=m((function(e){var t=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=t)})),Sn=(kn.version,function(e,t,n){if(function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!")}(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}),Cn=function(e){return"object"==typeof e?null!==e:"function"==typeof e},On=function(e){if(!Cn(e))throw TypeError(e+" is not an object!");return e},_n=function(e){try{return!!e()}catch(e){return!0}},Mn=!_n((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),An=wn.document,Tn=Cn(An)&&Cn(An.createElement),Ln=function(e){return Tn?An.createElement(e):{}},En=!Mn&&!_n((function(){return 7!=Object.defineProperty(Ln("div"),"a",{get:function(){return 7}}).a})),Dn=function(e,t){if(!Cn(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!Cn(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!Cn(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!Cn(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Fn=Object.defineProperty,Nn={f:Mn?Object.defineProperty:function(e,t,n){if(On(e),t=Dn(t,!0),On(n),En)try{return Fn(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},Rn=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},In=Mn?function(e,t,n){return Nn.f(e,t,Rn(1,n))}:function(e,t,n){return e[t]=n,e},Pn={}.hasOwnProperty,jn=function(e,t){return Pn.call(e,t)},zn=function(e,t,n){var r,i,o,a=e&zn.F,l=e&zn.G,s=e&zn.S,c=e&zn.P,u=e&zn.B,f=e&zn.W,d=l?kn:kn[t]||(kn[t]={}),p=d.prototype,h=l?wn:s?wn[t]:(wn[t]||{}).prototype;for(r in l&&(n=t),n)(i=!a&&h&&void 0!==h[r])&&jn(d,r)||(o=i?h[r]:n[r],d[r]=l&&"function"!=typeof h[r]?n[r]:u&&i?Sn(o,wn):f&&h[r]==o?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(o):c&&"function"==typeof o?Sn(Function.call,o):o,c&&((d.virtual||(d.virtual={}))[r]=o,e&zn.R&&p&&!p[r]&&In(p,r,o)))};zn.F=1,zn.G=2,zn.S=4,zn.P=8,zn.B=16,zn.W=32,zn.U=64,zn.R=128;var Bn=zn,qn={}.toString,$n=function(e){return qn.call(e).slice(8,-1)},Hn=Array.isArray||function(e){return"Array"==$n(e)};Bn(Bn.S,"Array",{isArray:Hn});var Wn=kn.Array.isArray;var Un=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r};var Gn,Vn=function(e){if(Wn(e))return Un(e)},Kn=Math.ceil,Jn=Math.floor,Yn=function(e){return isNaN(e=+e)?0:(e>0?Jn:Kn)(e)},Xn=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e},Qn=In,Zn={},er=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==$n(e)?e.split(""):Object(e)},tr=function(e){return er(Xn(e))},nr=Math.min,rr=function(e){return e>0?nr(Yn(e),9007199254740991):0},ir=Math.max,or=Math.min,ar=m((function(e){var t=wn["__core-js_shared__"]||(wn["__core-js_shared__"]={});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:kn.version,mode:"pure",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),lr=0,sr=Math.random(),cr=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++lr+sr).toString(36))},ur=ar("keys"),fr=function(e){return ur[e]||(ur[e]=cr(e))},dr=(Gn=!1,function(e,t,n){var r,i=tr(e),o=rr(i.length),a=function(e,t){return(e=Yn(e))<0?ir(e+t,0):or(e,t)}(n,o);if(Gn&&t!=t){for(;o>a;)if((r=i[a++])!=r)return!0}else for(;o>a;a++)if((Gn||a in i)&&i[a]===t)return Gn||a||0;return!Gn&&-1}),pr=fr("IE_PROTO"),hr=function(e,t){var n,r=tr(e),i=0,o=[];for(n in r)n!=pr&&jn(r,n)&&o.push(n);for(;t.length>i;)jn(r,n=t[i++])&&(~dr(o,n)||o.push(n));return o},mr="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),gr=Object.keys||function(e){return hr(e,mr)},vr=Mn?Object.defineProperties:function(e,t){On(e);for(var n,r=gr(t),i=r.length,o=0;i>o;)Nn.f(e,n=r[o++],t[n]);return e},yr=wn.document,br=yr&&yr.documentElement,xr=fr("IE_PROTO"),wr=function(){},kr=function(){var e,t=Ln("iframe"),n=mr.length;for(t.style.display="none",br.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),kr=e.F;n--;)delete kr.prototype[mr[n]];return kr()},Sr=Object.create||function(e,t){var n;return null!==e?(wr.prototype=On(e),n=new wr,wr.prototype=null,n[xr]=e):n=kr(),void 0===t?n:vr(n,t)},Cr=m((function(e){var t=ar("wks"),n=wn.Symbol,r="function"==typeof n;(e.exports=function(e){return t[e]||(t[e]=r&&n[e]||(r?n:cr)("Symbol."+e))}).store=t})),Or=Nn.f,_r=Cr("toStringTag"),Mr=function(e,t,n){e&&!jn(e=n?e:e.prototype,_r)&&Or(e,_r,{configurable:!0,value:t})},Ar={};In(Ar,Cr("iterator"),(function(){return this}));var Tr=function(e){return Object(Xn(e))},Lr=fr("IE_PROTO"),Er=Object.prototype,Dr=Object.getPrototypeOf||function(e){return e=Tr(e),jn(e,Lr)?e[Lr]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Er:null},Fr=Cr("iterator"),Nr=!([].keys&&"next"in[].keys()),Rr=function(){return this},Ir=function(e,t,n,r,i,o,a){!function(e,t,n){e.prototype=Sr(Ar,{next:Rn(1,n)}),Mr(e,t+" Iterator")}(n,t,r);var l,s,c,u=function(e){if(!Nr&&e in h)return h[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},f=t+" Iterator",d="values"==i,p=!1,h=e.prototype,m=h[Fr]||h["@@iterator"]||i&&h[i],g=m||u(i),v=i?d?u("entries"):g:void 0,y="Array"==t&&h.entries||m;if(y&&(c=Dr(y.call(new e)))!==Object.prototype&&c.next&&Mr(c,f,!0),d&&m&&"values"!==m.name&&(p=!0,g=function(){return m.call(this)}),a&&(Nr||p||!h[Fr])&&In(h,Fr,g),Zn[t]=g,Zn[f]=Rr,i)if(l={values:d?g:u("values"),keys:o?g:u("keys"),entries:v},a)for(s in l)s in h||Qn(h,s,l[s]);else Bn(Bn.P+Bn.F*(Nr||p),t,l);return l},Pr=function(e){return function(t,n){var r,i,o=String(Xn(t)),a=Yn(n),l=o.length;return a<0||a>=l?e?"":void 0:(r=o.charCodeAt(a))<55296||r>56319||a+1===l||(i=o.charCodeAt(a+1))<56320||i>57343?e?o.charAt(a):r:e?o.slice(a,a+2):i-56320+(r-55296<<10)+65536}}(!0);Ir(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=Pr(t,n),this._i+=e.length,{value:e,done:!1})}));var jr=function(e,t,n,r){try{return r?t(On(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&On(i.call(e)),t}},zr=Cr("iterator"),Br=Array.prototype,qr=function(e){return void 0!==e&&(Zn.Array===e||Br[zr]===e)},$r=function(e,t,n){t in e?Nn.f(e,t,Rn(0,n)):e[t]=n},Hr=Cr("toStringTag"),Wr="Arguments"==$n(function(){return arguments}()),Ur=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Hr))?n:Wr?$n(t):"Object"==(r=$n(t))&&"function"==typeof t.callee?"Arguments":r},Gr=Cr("iterator"),Vr=kn.getIteratorMethod=function(e){if(null!=e)return e[Gr]||e["@@iterator"]||Zn[Ur(e)]},Kr=Cr("iterator"),Jr=!1;try{var Yr=[7][Kr]();Yr.return=function(){Jr=!0},Array.from(Yr,(function(){throw 2}))}catch(e){}Bn(Bn.S+Bn.F*!function(e,t){if(!t&&!Jr)return!1;var n=!1;try{var r=[7],i=r[Kr]();i.next=function(){return{done:n=!0}},r[Kr]=function(){return i},e(r)}catch(e){}return n}((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,r,i,o=Tr(e),a="function"==typeof this?this:Array,l=arguments.length,s=l>1?arguments[1]:void 0,c=void 0!==s,u=0,f=Vr(o);if(c&&(s=Sn(s,l>2?arguments[2]:void 0,2)),null==f||a==Array&&qr(f))for(n=new a(t=rr(o.length));t>u;u++)$r(n,u,c?s(o[u],u):o[u]);else for(i=f.call(o),n=new a;!(r=i.next()).done;u++)$r(n,u,c?jr(i,s,[r.value,u],!0):r.value);return n.length=u,n}});var Xr=kn.Array.from,Qr=function(e,t){return{value:t,done:!!e}};Ir(Array,"Array",(function(e,t){this._t=tr(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,Qr(1)):Qr(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values");Zn.Arguments=Zn.Array;for(var Zr=Cr("toStringTag"),ei="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),ti=0;ti<ei.length;ti++){var ni=ei[ti],ri=wn[ni],ii=ri&&ri.prototype;ii&&!ii[Zr]&&In(ii,Zr,ni),Zn[ni]=Zn.Array}var oi=Cr("iterator"),ai=kn.isIterable=function(e){var t=Object(e);return void 0!==t[oi]||"@@iterator"in t||Zn.hasOwnProperty(Ur(t))},li=m((function(e){var t=cr("meta"),n=Nn.f,r=0,i=Object.isExtensible||function(){return!0},o=!_n((function(){return i(Object.preventExtensions({}))})),a=function(e){n(e,t,{value:{i:"O"+ ++r,w:{}}})},l=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!Cn(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!jn(e,t)){if(!i(e))return"F";if(!n)return"E";a(e)}return e[t].i},getWeak:function(e,n){if(!jn(e,t)){if(!i(e))return!0;if(!n)return!1;a(e)}return e[t].w},onFreeze:function(e){return o&&l.NEED&&i(e)&&!jn(e,t)&&a(e),e}}})),si=(li.KEY,li.NEED,li.fastKey,li.getWeak,li.onFreeze,{f:Cr}),ci=Nn.f,ui=function(e){var t=kn.Symbol||(kn.Symbol={});"_"==e.charAt(0)||e in t||ci(t,e,{value:si.f(e)})},fi={f:Object.getOwnPropertySymbols},di={f:{}.propertyIsEnumerable},pi=mr.concat("length","prototype"),hi={f:Object.getOwnPropertyNames||function(e){return hr(e,pi)}},mi=hi.f,gi={}.toString,vi="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],yi={f:function(e){return vi&&"[object Window]"==gi.call(e)?function(e){try{return mi(e)}catch(e){return vi.slice()}}(e):mi(tr(e))}},bi=Object.getOwnPropertyDescriptor,xi={f:Mn?bi:function(e,t){if(e=tr(e),t=Dn(t,!0),En)try{return bi(e,t)}catch(e){}if(jn(e,t))return Rn(!di.f.call(e,t),e[t])}},wi=li.KEY,ki=xi.f,Si=Nn.f,Ci=yi.f,Oi=wn.Symbol,_i=wn.JSON,Mi=_i&&_i.stringify,Ai=Cr("_hidden"),Ti=Cr("toPrimitive"),Li={}.propertyIsEnumerable,Ei=ar("symbol-registry"),Di=ar("symbols"),Fi=ar("op-symbols"),Ni=Object.prototype,Ri="function"==typeof Oi&&!!fi.f,Ii=wn.QObject,Pi=!Ii||!Ii.prototype||!Ii.prototype.findChild,ji=Mn&&_n((function(){return 7!=Sr(Si({},"a",{get:function(){return Si(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=ki(Ni,t);r&&delete Ni[t],Si(e,t,n),r&&e!==Ni&&Si(Ni,t,r)}:Si,zi=function(e){var t=Di[e]=Sr(Oi.prototype);return t._k=e,t},Bi=Ri&&"symbol"==typeof Oi.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof Oi},qi=function(e,t,n){return e===Ni&&qi(Fi,t,n),On(e),t=Dn(t,!0),On(n),jn(Di,t)?(n.enumerable?(jn(e,Ai)&&e[Ai][t]&&(e[Ai][t]=!1),n=Sr(n,{enumerable:Rn(0,!1)})):(jn(e,Ai)||Si(e,Ai,Rn(1,{})),e[Ai][t]=!0),ji(e,t,n)):Si(e,t,n)},$i=function(e,t){On(e);for(var n,r=function(e){var t=gr(e),n=fi.f;if(n)for(var r,i=n(e),o=di.f,a=0;i.length>a;)o.call(e,r=i[a++])&&t.push(r);return t}(t=tr(t)),i=0,o=r.length;o>i;)qi(e,n=r[i++],t[n]);return e},Hi=function(e){var t=Li.call(this,e=Dn(e,!0));return!(this===Ni&&jn(Di,e)&&!jn(Fi,e))&&(!(t||!jn(this,e)||!jn(Di,e)||jn(this,Ai)&&this[Ai][e])||t)},Wi=function(e,t){if(e=tr(e),t=Dn(t,!0),e!==Ni||!jn(Di,t)||jn(Fi,t)){var n=ki(e,t);return!n||!jn(Di,t)||jn(e,Ai)&&e[Ai][t]||(n.enumerable=!0),n}},Ui=function(e){for(var t,n=Ci(tr(e)),r=[],i=0;n.length>i;)jn(Di,t=n[i++])||t==Ai||t==wi||r.push(t);return r},Gi=function(e){for(var t,n=e===Ni,r=Ci(n?Fi:tr(e)),i=[],o=0;r.length>o;)!jn(Di,t=r[o++])||n&&!jn(Ni,t)||i.push(Di[t]);return i};Ri||(Qn((Oi=function(){if(this instanceof Oi)throw TypeError("Symbol is not a constructor!");var e=cr(arguments.length>0?arguments[0]:void 0),t=function(n){this===Ni&&t.call(Fi,n),jn(this,Ai)&&jn(this[Ai],e)&&(this[Ai][e]=!1),ji(this,e,Rn(1,n))};return Mn&&Pi&&ji(Ni,e,{configurable:!0,set:t}),zi(e)}).prototype,"toString",(function(){return this._k})),xi.f=Wi,Nn.f=qi,hi.f=yi.f=Ui,di.f=Hi,fi.f=Gi,si.f=function(e){return zi(Cr(e))}),Bn(Bn.G+Bn.W+Bn.F*!Ri,{Symbol:Oi});for(var Vi="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Ki=0;Vi.length>Ki;)Cr(Vi[Ki++]);for(var Ji=gr(Cr.store),Yi=0;Ji.length>Yi;)ui(Ji[Yi++]);Bn(Bn.S+Bn.F*!Ri,"Symbol",{for:function(e){return jn(Ei,e+="")?Ei[e]:Ei[e]=Oi(e)},keyFor:function(e){if(!Bi(e))throw TypeError(e+" is not a symbol!");for(var t in Ei)if(Ei[t]===e)return t},useSetter:function(){Pi=!0},useSimple:function(){Pi=!1}}),Bn(Bn.S+Bn.F*!Ri,"Object",{create:function(e,t){return void 0===t?Sr(e):$i(Sr(e),t)},defineProperty:qi,defineProperties:$i,getOwnPropertyDescriptor:Wi,getOwnPropertyNames:Ui,getOwnPropertySymbols:Gi});var Xi=_n((function(){fi.f(1)}));Bn(Bn.S+Bn.F*Xi,"Object",{getOwnPropertySymbols:function(e){return fi.f(Tr(e))}}),_i&&Bn(Bn.S+Bn.F*(!Ri||_n((function(){var e=Oi();return"[null]"!=Mi([e])||"{}"!=Mi({a:e})||"{}"!=Mi(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(Cn(t)||void 0!==e)&&!Bi(e))return Hn(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Bi(t))return t}),r[1]=t,Mi.apply(_i,r)}}),Oi.prototype[Ti]||In(Oi.prototype,Ti,Oi.prototype.valueOf),Mr(Oi,"Symbol"),Mr(Math,"Math",!0),Mr(wn.JSON,"JSON",!0),ui("asyncIterator"),ui("observable");var Qi=kn.Symbol;var Zi=function(e){if(void 0!==Qi&&ai(Object(e)))return Xr(e)};var eo=function(e,t){if(e){if("string"==typeof e)return Un(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Xr(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Un(e,t):void 0}};var to=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var no=function(e){return Vn(e)||Zi(e)||eo(e)||to()};function ro(e){return e?"string"==typeof e?e:e.source:null}function io(e){return oo("(",e,")?")}function oo(...e){return e.map(e=>ro(e)).join("")}function ao(...e){return"("+e.map(e=>ro(e)).join("|")+")"}!function(e){var t,n='<svg><symbol id="icon-google-forms" viewBox="0 0 1024 1024"><path d="M882.918147 279.679514l-281.075171-277.57631H201.80653s-15.939256 0.777525-40.042521 22.159454c-17.494305 17.494305-20.993166 39.264996-20.993166 39.264996v893.375854s5.442673 63.368261 54.426727 63.368261h624.352316s63.368261 1.555049 63.368261-60.258162v-680.334093z m-528.328018 215.763098c19.438117 0 34.98861 15.550494 34.988611 34.98861s-15.550494 34.98861-34.988611 34.988611-34.98861-15.550494-34.98861-34.988611 15.939256-34.98861 34.98861-34.98861z m0 116.628702c19.438117 0 34.98861 15.550494 34.988611 34.98861s-15.550494 34.98861-34.988611 34.988611-34.98861-15.550494-34.98861-34.988611 15.939256-34.98861 34.98861-34.98861z m1.166287 182.329536c-19.438117 0-34.98861-15.550494-34.98861-34.98861s15.550494-34.98861 34.98861-34.988611 34.98861 15.550494 34.988611 34.988611-15.550494 34.98861-34.988611 34.98861z m345.220957-9.330296h-254.25057v-47.040243h254.25057v47.040243z m1.166287-115.462414h-254.25057v-47.040243h254.25057v47.040243z m0.777525-115.462415h-254.25057v-47.040243h254.25057v47.040243z" fill="#734ABC" ></path><path d="M601.842976 2.103204l1.55505 209.154138s3.110099 66.089598 70.754745 67.644647 209.154138 0 209.154139 0l-281.463934-276.798785z" fill="#B6A1DC" ></path></symbol><symbol id="icon-amap" viewBox="0 0 1024 1024"><path d="M120.453891 0h782.950289q120.453891 0 120.45389 120.453891v782.950289q0 120.453891-120.45389 120.45389H120.453891Q0 1023.85907 0 903.40418V120.453891Q0 0 120.453891 0z" fill="#F1F1F1" ></path><path d="M658.189402 621.632435h365.669668v272.225753a122.501889 122.501889 0 0 1-128.133884 129.999882H658.190402z" fill="#B2D8FF" ></path><path d="M1023.85907 364.342669v-145.749868H0v145.749868z" fill="#FFFFFF" ></path><path d="M649.035411 1023.85907h145.749867V0h-145.749867z" fill="#FFFFFF" ></path><path d="M1023.85907 729.318338v-145.749868H0v145.749868z" fill="#FFCF68" ></path><path d="M0 218.593801h649.09641V0H146.259867C29.721973 0 0 65.496941 0 146.260867v72.272935z" fill="#AFE881" ></path><path d="M195.677822 1023.85907h145.748868V0h-145.749868z" fill="#FFCF68" ></path><path d="M103.860906 543.608506l245.726777 74.379933 302.579725-256.927767-234.523787 276.742749 262.739761 81.305926 135.299877-520.119528z" fill="#0093FD" ></path><path d="M652.137408 361.090672l-302.609725 256.867767 68.085938 19.814982z" fill="#0066BD" ></path><path d="M349.587683 618.019439v143.881869l97.928911-114.822896-97.959911-29.059973z" fill="#0064BB" ></path></symbol><symbol id="icon-bilibili" viewBox="0 0 1129 1024"><path d="M234.909 9.656a80.468 80.468 0 0 1 68.398 0 167.374 167.374 0 0 1 41.843 30.578l160.937 140.82h115.07l160.936-140.82a168.983 168.983 0 0 1 41.843-30.578A80.468 80.468 0 0 1 930.96 76.445a80.468 80.468 0 0 1-17.703 53.914 449.818 449.818 0 0 1-35.406 32.187 232.553 232.553 0 0 1-22.531 18.508h100.585a170.593 170.593 0 0 1 118.289 53.109 171.397 171.397 0 0 1 53.914 118.288v462.693a325.897 325.897 0 0 1-4.024 70.007 178.64 178.64 0 0 1-80.468 112.656 173.007 173.007 0 0 1-92.539 25.75H212.377a341.186 341.186 0 0 1-72.421-4.024A177.835 177.835 0 0 1 28.91 939.065a172.202 172.202 0 0 1-27.36-92.539V388.662a360.498 360.498 0 0 1 0-66.789A177.03 177.03 0 0 1 162.487 178.64h105.414c-16.899-12.07-31.383-26.555-46.672-39.43a80.468 80.468 0 0 1-25.75-65.984 80.468 80.468 0 0 1 39.43-63.57M216.4 321.873a80.468 80.468 0 0 0-63.57 57.937 108.632 108.632 0 0 0 0 30.578v380.615a80.468 80.468 0 0 0 55.523 80.469 106.218 106.218 0 0 0 34.601 5.632h654.208a80.468 80.468 0 0 0 76.444-47.476 112.656 112.656 0 0 0 8.047-53.109v-354.06a135.187 135.187 0 0 0 0-38.625 80.468 80.468 0 0 0-52.304-54.719 129.554 129.554 0 0 0-49.89-7.242H254.22a268.764 268.764 0 0 0-37.82 0z m0 0" fill="#20B0E3" ></path><path d="M348.369 447.404a80.468 80.468 0 0 1 55.523 18.507 80.468 80.468 0 0 1 28.164 59.547v80.468a80.468 80.468 0 0 1-16.094 51.5 80.468 80.468 0 0 1-131.968-9.656 104.609 104.609 0 0 1-10.46-54.719v-80.468a80.468 80.468 0 0 1 70.007-67.593z m416.02 0a80.468 80.468 0 0 1 86.102 75.64v80.468a94.148 94.148 0 0 1-12.07 53.11 80.468 80.468 0 0 1-132.773 0 95.757 95.757 0 0 1-12.875-57.133V519.02a80.468 80.468 0 0 1 70.007-70.812z m0 0" fill="#20B0E3" ></path></symbol><symbol id="icon-jinshuju" viewBox="0 0 1024 1024"><path d="M146.32 152.23c-0.45 23.17 35.78 29.87 52.65 32.67 70.66 11.7 141.49 26.67 208.03 53.8 28.78 11.74 53.96 21.67 74.57 46.45 18.8 22.6 30.55 51.28 31.6 80.77 3.18 89.93-82.08 151.12-166.1 143C226.65 497.29 168.5 387.32 152.5 278.2c-6.1-41.67-7.45-83.96-6.18-125.97zM706.46 134.13c-3.5-5.64-57.29 38.93-60.58 41.86-60.12 53.56-112.03 130.03-93.14 214.48 7.52 33.64 29.77 71.89 63.39 84.7 36.7 13.98 78.47-1.69 104.36-29.33 43.9-46.85 53.25-111.36 41.92-172.69-9.11-49.3-29.61-96.54-55.95-139.02zM111.25 583.73c4.98 1.25 22.86-9.92 28.18-11.92 11.45-4.3 23.1-8.06 34.92-11.19 24.06-6.37 49.1-10.45 74.06-9.62 32.77 1.09 65.86 13.5 87.1 39.28 41.66 50.56 19.86 126.32-50 131.06-55.38 3.76-98.49-32.08-124.54-77.47-11.26-19.6-25.14-54-49.72-60.14zM912.44 512.09c-63.98-37.07-171.93-28.35-224.07 25-24.02 24.58-31.4 63.56-15.72 94.55 19.43 38.38 65.08 49.21 104.42 40 48.41-11.34 79.95-51.28 102.75-92.93 2.84-5.18 36.47-64.39 32.62-66.62z" fill="#ff8533" ></path><path d="M458.81 514.11s-60.58 20.73-46.24 47.83c20.87 39.42 31.96 73.84 31.09 120.37-2.89 154.59-157.02 170.26-155.45 170.86 1.6 0.61 0 33.04 0 37.2h393.8v-46.24c-34.77 0-69.52 2.38-104.27 1.03-11.12-0.43-22.84-3.01-30.74-10.84-15.68-15.54-14.86-49.21-14.13-69.59 0.97-27.09 7.84-53.79 20.8-77.64 70.15-129.14 74.92-74.73 66.16-139.5-8.99-66.46-34.82-3.76-80.51 11.96-19.83 6.82-47.03-48.63-80.51-45.44z" fill="#ff8533" ></path></symbol><symbol id="icon-canva" viewBox="0 0 1024 1024"><path d="M512 0C229.248 0 0 229.248 0 512s229.248 512 512 512 512-229.248 512-512S794.752 0 512 0zM297.056 327.68c32.16 0 57.056 23.424 59.936 51.2 2.944 24.864-7.296 46.816-35.072 60-14.624 7.296-20.48 7.328-23.424 2.944-1.44-2.944 0-5.856 2.944-8.8 26.336-21.92 26.336-39.52 23.392-64.352-1.44-16.128-13.152-26.368-24.864-26.368-51.2 0-124.32 114.08-114.08 197.504 4.384 32.16 23.424 70.24 64.384 70.24 13.152 0 27.744-4.384 40.96-10.24 21.344-11.264 34.08-20.064 46.816-34.144-3.104-37.76 30.048-87.296 78.976-87.296 21.984 0 39.52 8.736 40.96 24.864 2.912 21.92-16.096 24.832-21.92 24.832s-16.128-1.44-16.128-7.264c-1.44-5.888 13.184-2.976 11.744-16.128-1.504-8.8-10.24-11.68-19.04-11.68-30.72 0-48.256 42.4-43.904 68.736 1.504 11.744 7.328 23.424 19.072 23.424 8.736 0 21.92-13.216 26.336-32.224 2.912-13.152 14.624-21.92 24.864-21.92 4.352 0 7.264 1.44 8.736 7.296v5.888c-1.44 5.856-5.856 23.392-4.352 27.776 0 2.944 1.44 7.296 7.264 7.296 3.936 0 18.592-7.68 33.152-19.584 4.992-25.184 10.784-55.392 10.784-57.888 1.44-10.24 5.856-20.48 26.336-20.48 4.384 0 7.296 1.44 8.736 7.296v5.888l-5.792 26.336c18.976-24.864 46.816-42.4 64.352-42.4 7.328 0 13.184 4.352 13.184 11.68 0 4.384 0 11.68-2.944 19.04a474.88 474.88 0 0 0-17.568 62.88c0 5.856 1.504 11.68 8.832 11.68 7.296 0 29.216-8.8 46.752-32.16l0.288-0.16c-0.096-2.912-0.288-5.728-0.288-8.608 0-17.536 1.504-32.16 4.448-42.4 2.912-11.68 17.536-21.92 26.336-21.92 4.384 0 8.736 2.944 8.736 7.296 0 1.504 0 4.384-1.44 5.856-5.856 19.04-10.24 36.576-10.24 54.144 0 10.24 1.44 24.832 4.352 33.632 0 1.44 1.504 2.944 2.976 2.944 2.912 0 23.392-18.976 37.984-43.872-13.152-8.8-20.48-23.424-20.48-40.96 0-30.72 19.04-46.816 36.608-46.816 14.624 0 26.336 10.24 26.336 30.72 0 13.152-4.384 27.744-11.68 40.96h4.352l1.056 0.032c9.376 0 17.856-3.936 23.84-10.24a12.448 12.448 0 0 1 5.632-4.96l0.096-0.032c14.304-18.144 35.424-31.584 60.16-31.584 20.48 0 39.424 8.736 40.928 24.832 2.912 21.984-16.128 26.368-21.984 26.368l-0.096-0.096c-5.888 0-16.096-1.504-16.096-7.328s13.184-2.912 11.68-16.032c-1.44-8.8-10.24-11.744-19.04-11.744-29.28 0-48.224 38.016-43.872 68.736 1.44 11.744 7.296 24.864 18.976 24.864 8.8 0 21.984-13.152 27.808-32.16 2.912-11.68 14.624-21.92 24.864-21.92 4.384 0 7.264 1.44 8.736 7.296 0 2.944 0 8.8-5.856 27.808-7.264 13.152-7.296 20.48-5.856 26.336 1.44 11.68 7.296 20.48 13.184 24.864 1.44 1.44 2.912 4.352 2.912 4.352 0 2.944-1.44 5.888-5.856 5.888-1.44 0-2.912 0-4.384-1.504-21.92-8.736-30.72-23.392-33.664-38.016-8.736 10.24-18.976 16.096-30.72 16.096-18.976 0-37.984-17.536-40.96-39.52a68.8 68.8 0 0 1 3.328-28.192l-0.128 0.48c-8.672 5.536-18.016 8.672-26.592 8.672h-7.264c-19.072 27.808-39.552 46.848-54.176 55.584a38.048 38.048 0 0 1-16 4.448h-0.096c-2.912 0-7.296-1.504-8.736-4.448-4.064-6.496-6.656-16.736-8.224-28.448-20.512 22.496-48.864 34.336-61.984 34.336-14.624 0-23.392-8.8-24.832-23.456v-16.032c4.352-32.16 16.096-51.2 16.096-57.056a3.136 3.136 0 0 0-2.944-2.976c-10.24 0-43.872 35.168-49.76 58.592l-4.384 18.976c-2.912 13.184-16.096 21.984-24.832 21.984-4.384 0-7.328-1.504-8.8-7.328v-5.856l1.952-9.952c-18.56 13.216-37.12 21.664-45.856 21.664-13.152 0-20.48-7.328-21.92-17.568-8.8 11.68-18.976 17.568-32.16 17.568-15.008 0-29.696-10.24-36.768-25.312-10.4 11.744-22.304 23.584-36.352 32.608-20.48 13.184-43.872 23.424-71.68 23.424-24.832 0-46.816-13.184-58.496-24.864-17.568-16.096-27.776-40.96-29.28-64.384-8.736-71.68 35.104-163.84 102.4-204.8 16.128-8.736 32.224-14.624 48.288-14.624z m416.832 140.416c-4.448 0-7.328 7.328-7.328 14.624 0 11.68 5.856 24.864 13.184 32.224a72.64 72.64 0 0 0 4.352-24.864c0-14.624-5.856-21.984-10.208-21.984z" fill="#00C4CC" ></path></symbol><symbol id="icon-processon" viewBox="0 0 1024 1024"><path d="M917.333333 896c0 12.8-8.533333 21.333333-21.333333 21.333333H128c-12.8 0-21.333333-8.533333-21.333333-21.333333V128c0-12.8 8.533333-21.333333 21.333333-21.333333h768c12.8 0 21.333333 8.533333 21.333333 21.333333v768z" fill="#008EDB" ></path><path d="M189.866667 518.4c0-53.333333 10.666667-93.866667 34.133333-125.866667 17.066667-25.6 42.666667-42.666667 74.666667-55.466666 21.333333-8.533333 44.8-12.8 68.266666-12.8s44.8 4.266667 66.133334 12.8c32 10.666667 55.466667 29.866667 74.666666 55.466666 23.466667 32 36.266667 74.666667 36.266667 125.866667 0 53.333333-10.666667 93.866667-34.133333 125.866667-17.066667 25.6-42.666667 42.666667-74.666667 55.466666-21.333333 8.533333-44.8 12.8-68.266667 12.8s-44.8-4.266667-66.133333-12.8c-32-10.666667-55.466667-29.866667-74.666667-55.466666-25.6-32-36.266667-74.666667-36.266666-125.866667z m76.8 0c0 46.933333 10.666667 81.066667 34.133333 102.4 17.066667 17.066667 38.4 25.6 66.133333 25.6 25.6 0 46.933333-8.533333 66.133334-25.6 23.466667-21.333333 34.133333-55.466667 34.133333-102.4 0-46.933333-10.666667-81.066667-34.133333-102.4-17.066667-17.066667-38.4-25.6-66.133334-25.6-25.6 0-46.933333 8.533333-66.133333 25.6-23.466667 21.333333-34.133333 55.466667-34.133333 102.4zM844.8 514.133333v187.733334h-72.533333v-166.4c0-14.933333-2.133333-27.733333-6.4-34.133334-6.4-12.8-21.333333-19.2-40.533334-19.2-17.066667 0-29.866667 6.4-40.533333 17.066667s-14.933333 25.6-14.933333 46.933333v155.733334H597.333333V428.8h68.266667V469.333333c10.666667-17.066667 23.466667-29.866667 36.266667-36.266666s27.733333-10.666667 44.8-10.666667c27.733333 0 51.2 8.533333 68.266666 23.466667 21.333333 17.066667 29.866667 38.4 29.866667 68.266666z" fill="#FFFFFF" ></path></symbol><symbol id="icon-lanhu" viewBox="0 0 1024 1024"><path d="M959.445292 862.225843c38.558128 43.498852 6.246304 133.850105-74.735493 94.088796-167.319032-82.174739-200.485883 60.133477-374.071698 65.217559-173.596055 5.094322-211.422035-147.387178-373.677464-65.217559-80.495404 40.749454-113.303861-50.589943-74.750853-94.088796 53.800134-60.665949 104.461757-130.138162 105.506221-384.147703-0.445433-8.125315 0-11.04367 0-19.271384 0-103.340494 35.977688-197.244972 94.626387-266.732546-5.913509-6.891414-12.123974-15.856397-18.267879-26.213998a61.346898 61.346898 0 0 1-1.658855-2.969554 340.239257 340.239257 0 0 1-16.102153-31.164962 370.523592 370.523592 0 0 1-13.444913-33.996278c-0.455673-1.443818-0.993265-2.887636-1.372139-4.336573a303.662539 303.662539 0 0 1-6.082467-21.862065C197.677785 37.903137 199.121603 9.113819 218.408347 0.947544c10.941272-4.638649 24.160909 8.46323 39.495073 27.744854 0.537592 0.686069 1.146862 1.382379 1.745894 2.129887 0.691189 0.844787 1.372139 1.684454 2.053088 2.590681 10.019686 12.953401 21.114556 28.118608 33.177091 42.142073 0.931826 1.059824 1.827812 2.135007 2.749398 3.20507 0.527352 0.604151 1.059824 1.203182 1.587175 1.827812 14.602016 16.419588 30.60177 30.842407 47.989024 37.974457 49.105166-30.217776 105.470381-47.405352 165.42466-47.405352 58.443903 0 113.493298 16.347909 161.728078 45.173067 15.492882-7.679882 29.838902-20.87904 43.038059-35.737052 0.537592-0.62975 1.075183-1.228781 1.597416-1.832932l2.734038-3.20507c12.083015-14.028585 23.172764-29.183552 33.18221-42.142073 0.691189-0.906226 1.372139-1.745893 2.063329-2.590681 0.599031-0.747509 1.208301-1.443818 1.740773-2.129887 15.339285-19.281624 28.548682-32.383503 39.500194-27.744854 19.276504 8.161155 20.735682 36.955593 12.98412 70.572997a298.419739 298.419739 0 0 1-6.082466 21.867184c-0.368634 1.448938-0.906226 2.892756-1.361899 4.336573a379.514174 379.514174 0 0 1-13.434674 33.996278 342.829938 342.829938 0 0 1-16.112393 31.164962c-0.522232 0.993265-1.059824 1.97117-1.669094 2.969555-4.710328 7.935878-9.446255 15.052569-14.079784 21.047996C819.743116 256.882175 857.543496 352.880702 857.543496 458.811876c0 6.041507-0.02048 6.246304-0.266236 12.231492 0.122878 259.411058 47.917344 330.004534 102.168032 391.187595z" fill="#0692FF" ></path><path d="M510.863377 640.374529c112.67923 0 203.982789-92.189305 203.982789-205.87716 0-39.295397-10.931032-75.994993-29.96178-107.282833 0-0.081919-0.071679-0.153598-0.143358-0.240637-35.747291-58.955895-100.227582-98.261532-173.872531-98.261531-112.668991 0-204.054468 92.117626-204.054467 205.785001a206.368672 206.368672 0 0 0 53.027026 138.432435c37.354947 41.389445 91.124361 67.444725 151.022321 67.444725z" fill="#FFFFFF" ></path><path d="M554.223992 290.089986c57.030805 0 103.268815 46.632244 103.268815 104.1904 0 57.532557-46.23801 104.169921-103.268815 104.169921-57.030805 0-103.268815-46.637364-103.268815-104.169921 0-57.558156 46.23801-104.190401 103.268815-104.1904z" fill="#293D50" ></path></symbol><symbol id="icon-figma" viewBox="0 0 1024 1024"><path d="M498.920727 512c0-45.288727 17.687273-88.669091 49.198546-120.692364a166.679273 166.679273 0 0 1 118.784-49.989818c44.544 0 87.272727 18.013091 118.784 49.989818A172.032 172.032 0 0 1 834.885818 512c0 45.242182-17.687273 88.669091-49.198545 120.692364a166.632727 166.632727 0 0 1-118.784 49.989818 166.632727 166.632727 0 0 1-118.784-49.989818A172.032 172.032 0 0 1 498.920727 512z" fill="#1ABCFE" ></path><path d="M162.909091 853.317818c0-45.242182 17.687273-88.669091 49.198545-120.645818a166.679273 166.679273 0 0 1 118.784-49.989818h168.029091v170.635636c0 45.288727-17.687273 88.669091-49.198545 120.692364A166.679273 166.679273 0 0 1 330.891636 1024a166.679273 166.679273 0 0 1-118.784-49.989818A172.078545 172.078545 0 0 1 162.909091 853.317818z" fill="#0ACF83" ></path><path d="M498.920727 0v341.317818h168.029091A166.632727 166.632727 0 0 0 785.687273 291.374545a172.032 172.032 0 0 0 49.198545-120.645818c0-45.288727-17.687273-88.669091-49.198545-120.692363A166.632727 166.632727 0 0 0 666.903273 0h-168.029091z" fill="#FF7262" ></path><path d="M162.909091 170.682182c0 45.242182 17.687273 88.669091 49.198545 120.645818A166.679273 166.679273 0 0 0 330.938182 341.317818h168.029091V0h-168.029091c-44.544 0-87.272727 17.966545-118.784 49.989818A172.032 172.032 0 0 0 162.909091 170.682182z" fill="#F24E1E" ></path><path d="M162.909091 512c0 45.242182 17.687273 88.669091 49.198545 120.692364a166.632727 166.632727 0 0 0 118.784 49.989818h168.029091V341.317818h-168.029091c-44.544 0-87.272727 18.013091-118.784 49.989818A172.032 172.032 0 0 0 162.909091 512z" fill="#A259FF" ></path></symbol><symbol id="icon-baidu-map" viewBox="0 0 1024 1024"><path d="M824.32 1018.88h-163.84l348.16-348.16v163.84c0 102.4-81.92 184.32-184.32 184.32z m0-1008.64c102.4 0 184.32 81.92 184.32 184.32v97.28l-281.6-281.6h97.28z m-58.88 366.08c0 66.56-25.6 128-66.56 174.08l-7.68 5.12c-79.36 87.04-140.8 192-179.2 307.2-2.56 2.56-5.12 5.12-10.24 5.12s-7.68-2.56-10.24-5.12c-38.4-115.2-99.84-217.6-179.2-307.2l-7.68-7.68-2.56-2.56 2.56 2.56c-40.96-46.08-66.56-107.52-66.56-174.08 0-56.32 17.92-107.52 46.08-148.48C332.8 156.16 409.6 112.64 499.2 112.64s168.96 43.52 215.04 112.64c33.28 43.52 51.2 94.72 51.2 151.04z m-289.28-112.64h-33.28v61.44h-38.4c-38.4 0-71.68 30.72-71.68 71.68v15.36c0 38.4 30.72 71.68 71.68 71.68h66.56v-2.56h2.56v-217.6z m176.64 64h-35.84v125.44h-40.96c-15.36 0-30.72-12.8-30.72-30.72v-97.28H512V435.2c0 25.6 20.48 48.64 48.64 48.64h92.16v-156.16z m-276.48 84.48v-15.36c0-20.48 15.36-35.84 35.84-35.84h30.72v89.6h-30.72c-20.48-2.56-35.84-17.92-35.84-38.4z m-97.28-194.56c-17.92 28.16-33.28 58.88-40.96 89.6L28.16 94.72C61.44 43.52 117.76 7.68 184.32 7.68h307.2l107.52 107.52c-30.72-12.8-64-17.92-97.28-17.92-92.16 2.56-174.08 48.64-222.72 120.32z m20.48 335.36l7.68 7.68c28.16 30.72 53.76 61.44 76.8 97.28L64 972.8C25.6 939.52 0 890.88 0 834.56V225.28l250.88 250.88c12.8 28.16 28.16 53.76 48.64 76.8z m476.16-181.76c0-35.84-7.68-69.12-17.92-99.84l245.76 245.76-276.48 279.04-117.76-117.76c25.6-40.96 56.32-79.36 89.6-117.76l7.68-7.68c40.96-48.64 69.12-112.64 69.12-181.76zM491.52 878.08c2.56 2.56 5.12 5.12 10.24 5.12s7.68-2.56 10.24-5.12c10.24-33.28 25.6-66.56 40.96-99.84l94.72 94.72-145.92 145.92H184.32c-15.36 0-30.72-2.56-43.52-5.12l286.72-286.72c25.6 48.64 48.64 99.84 64 151.04z" fill="#B3CE7D" ></path><path d="M765.44 376.32c0 66.56-25.6 128-66.56 174.08l-7.68 5.12c-79.36 87.04-140.8 192-179.2 307.2-2.56 2.56-5.12 5.12-10.24 5.12s-7.68-2.56-10.24-5.12c-38.4-115.2-99.84-217.6-179.2-307.2l-7.68-7.68-2.56-2.56 2.56 2.56c-40.96-46.08-66.56-107.52-66.56-174.08 0-56.32 17.92-107.52 46.08-148.48C332.8 156.16 409.6 112.64 499.2 112.64s168.96 43.52 215.04 112.64c33.28 43.52 51.2 94.72 51.2 151.04z m-289.28-112.64h-33.28v61.44h-38.4c-38.4 0-71.68 30.72-71.68 71.68v15.36c0 38.4 30.72 71.68 71.68 71.68h66.56v-2.56h2.56v-217.6z m176.64 64h-35.84v125.44h-40.96c-15.36 0-30.72-12.8-30.72-30.72v-97.28H512V435.2c0 25.6 20.48 48.64 48.64 48.64h92.16v-156.16z m-276.48 84.48v-15.36c0-20.48 15.36-35.84 35.84-35.84h30.72v89.6h-30.72c-20.48-2.56-35.84-17.92-35.84-38.4z" fill="#F93737" ></path><path d="M824.32 10.24c102.4 0 184.32 81.92 184.32 184.32v97.28l-281.6-281.6h97.28z" fill="#B2E5FF" ></path><path d="M279.04 217.6c-17.92 28.16-33.28 58.88-40.96 89.6L28.16 94.72C61.44 43.52 117.76 7.68 184.32 7.68h307.2l107.52 107.52c-30.72-12.8-64-17.92-97.28-17.92-92.16 2.56-174.08 48.64-222.72 120.32z m496.64 153.6c0-35.84-7.68-69.12-17.92-99.84l245.76 245.76-276.48 279.04-117.76-117.76c25.6-40.96 56.32-79.36 89.6-117.76l7.68-7.68c40.96-48.64 69.12-112.64 69.12-181.76z" fill="#E6F28F" ></path></symbol><symbol id="icon-modao" viewBox="0 0 1024 1024"><path d="M910.46 699.7c-31.25 54.78-90.22 91.8-157.67 91.8H273.83c-69.26 0-129.56-39.02-160.11-96.23l-46.53 22.46c38.94 74.47 116.94 125.41 206.64 125.41h478.96c87.89 0 164.57-48.92 204.25-120.95l-46.58-22.49zM109.33 337.52c28.88-61.96 91.75-105.02 164.5-105.02h478.96c70.69 0 132.05 40.65 161.97 99.79l44.81-25.76c-38.89-74.61-116.98-125.67-206.77-125.67H273.83c-91.86 0-171.46 53.43-209.39 130.84l44.89 25.82zM242.15 591.4h-56.7c-12.15 0-22-9.85-22-22V454.6c0-12.15 9.85-22 22-22h56.7c12.15 0 22 9.85 22 22v114.8c0 12.15-9.85 22-22 22zM540.46 592.69h-56.7c-12.15 0-22-9.85-22-22V455.9c0-12.15 9.85-22 22-22h56.7c12.15 0 22 9.85 22 22v114.79c0 12.15-9.85 22-22 22z" fill="#ff6161" ></path></symbol><symbol id="icon-qqvideo" viewBox="0 0 1024 1024"><path d="M316.928 44.032c30.208-2.56 59.904 2.56 87.552 13.824 62.976 22.016 122.88 49.152 180.224 79.36 98.304 51.712 190.976 112.128 281.088 177.664 38.4 30.208 79.36 59.904 109.056 98.304 18.944 22.016 32.768 51.712 30.208 81.92-5.632 35.328-27.136 65.536-51.712 90.112-98.304 98.304-204.8 188.416-322.048 262.144-59.904 38.4-122.88 71.168-188.416 95.744-40.96 16.384-87.552 30.208-131.072 24.576-27.136-2.56-51.712-13.824-71.168-35.328-16.384-18.944-24.576-40.96-30.208-65.536v-2.56c18.944-5.632 38.4-10.752 59.904-16.384 81.92-22.016 163.84-57.344 240.128-95.744 81.92-43.52 161.28-92.672 235.008-150.016 24.576-18.944 51.712-38.4 62.976-68.096 10.752-22.016 8.192-49.152-5.632-68.096-13.824-24.576-35.328-43.52-54.784-59.904-24.576-18.944-51.712-38.4-79.36-51.712-51.712-32.768-106.496-59.904-161.28-90.112-62.976-32.768-128.512-59.904-194.048-81.92-30.208-8.192-59.904-18.944-90.112-27.136 2.56-13.824 8.192-27.136 13.824-40.96 16.896-39.936 47.104-64.512 79.872-70.144z" fill="#10ABF2" ></path><path d="M133.632 156.16c27.136-13.824 59.904-10.752 90.112-5.632-10.752 40.96-16.384 84.48-22.016 125.44 0 18.944-2.56 35.328-5.632 54.784-2.56 22.016-2.56 46.592-5.632 68.096 0 27.136-2.56 51.712-2.56 79.36-2.56 24.576 0 51.712-2.56 76.288 0 38.4 0 76.288 2.56 114.688 2.56 57.344 5.632 117.248 13.824 174.592v8.192c-27.136 5.632-59.904 10.752-84.48-8.192s-32.768-51.712-40.96-81.92c-13.824-90.112-22.016-188.416-22.016-286.72 0-51.712 5.632-100.864 13.824-150.016 5.632-40.96 13.824-81.92 27.136-120.32 5.632-21.504 19.456-40.448 38.4-48.64z" fill="#FF8F21" ></path><path d="M223.744 147.968h5.632c30.208 8.192 59.904 18.944 90.112 27.136 65.536 22.016 131.072 51.712 194.048 81.92 54.784 30.208 109.056 57.344 161.28 90.112 27.136 16.384 54.784 32.768 79.36 51.712 22.016 16.384 40.96 35.328 54.784 59.904 10.752 18.944 13.824 46.592 5.632 68.096-13.824 30.208-40.96 49.152-62.976 68.096-76.288 59.904-155.648 109.056-237.568 153.088-76.288 40.96-155.648 73.728-240.128 95.744-18.944 5.632-38.4 10.752-59.904 16.384-2.56 0-8.192 2.56-10.752 2.56 0-5.632 0-10.752-2.56-16.384-8.192-57.344-10.752-117.248-13.824-174.592-2.56-38.4-2.56-76.288-2.56-114.688 0-24.576 0-51.712 2.56-76.288 0-27.136 2.56-51.712 2.56-79.36 2.56-22.016 2.56-46.592 5.632-68.096 2.56-18.944 2.56-35.328 5.632-54.784 6.656-43.008 12.288-87.04 23.04-130.56m112.128 153.088c-10.752 2.56-16.384 16.384-16.384 27.136v338.432c0 10.752 2.56 24.576 10.752 27.136 10.752 2.56 22.016 0 30.208-8.192l229.376-163.84c10.752-8.192 18.944-18.944 18.944-32.768s-10.752-22.016-22.016-30.208c-76.288-51.2-155.136-103.424-231.936-155.136-2.56 0-10.752-5.632-18.944-2.56z" fill="#7DE621" ></path></symbol><symbol id="icon-iqiyi" viewBox="0 0 1024 1024"><path d="M524.08911 916.21c-149.39 1.237-284.473-6.841-418.276-31.83C38.37211 871.794-1.05189 826.24 0.48311 762.823c0.456-17.991 6.87-27.335 25.26-27.207 14.506 0.1 29.013 0.1 43.49 0.2 16.883 0.127 29.185 4.735 34.419 23.864 7.11 25.884 27.818 37.646 53.176 41.188 63.517 8.846 127.104 16.924 191.218 20.622 101.334 5.888 202.624 8.234 304.014 0.455 73.216-5.618 146.347-11.449 218.824-23.865 19.086-3.271 34.66-12.117 39.068-30.748 6.884-29.07 25.813-32.57 51.115-32.313 64.839 0.71 66.986 2.503 50.062 64.142-10.468 38.258-31.773 65.735-72.107 77.739-63.004 18.773-128.142 24.462-192.782 30.506-78.194 7.31-156.871 12.7-222.151 8.818zM525.34011 75.59c115.556-7.168 242.347 6.656 368.171 26.88 74.382 11.947 110.18 30.649 125.895 118.713 4.224 23.609-5.504 33.266-27.99 32.555-14.506-0.455-28.984-2.56-43.434-2.319-17.92 0.313-28.771-6.5-35.129-23.893-8.561-23.609-27.733-35.271-52.053-38.5-149.177-19.768-298.951-32.227-449.38-24.135-86.755 4.651-173.184 16.043-259.64 25.344-20.509 2.205-38.898 12.616-45.384 33.21-7.907 25.087-24.504 30.833-47.644 28.7a253.98 253.98 0 0 0-31.076-0.882C7.69411 251.89 0.51211 242.532 0.62611 222.848c0.327-54.23 33.792-99.271 86.186-110.89C227.14311 80.81 369.53611 72.091 525.34011 75.59zM411.73311 497.607c0 41.358 0.484 82.73-0.256 124.075-0.256 14.307-2.417 28.8-5.646 42.766-4.096 17.75-31.73 36.836 7.609 50.02 9.202 3.086 6.784 22.727 2.987 34.787-3.712 11.904-15.062 14.962-25.174 14.208-29.24-2.233-61.553 2.19-79.587-30.194-5.305-9.529-14.734-10.154-24.278-10.524-10.34-0.398-20.75-0.47-30.933-1.963-95.673-14.051-106.795-26.95-106.809-122.95 0-80.627-0.213-161.28 0.128-241.92 0.17-43.208 16.384-63.617 57.657-76.9 51.229-16.484 101.973-14.223 152.334 2.915 34.987 11.918 50.503 33.949 51.542 76.117 1.137 46.493 0.241 93.042 0.241 139.563h0.185z m-105.258-0.611h0.1c0-44.416-0.143-88.832 0.07-133.263 0.071-18.346-2.915-32.924-26.396-32.981-21.504-0.057-29.383 10.866-29.355 30.805 0.142 88.847 0.043 177.693 0.142 266.525 0 19.498 5.69 36.238 28.587 36.295 24.32 0.085 26.695-18.631 26.78-37.22 0.2-43.377 0.072-86.755 0.072-130.161z m433.735-75.264c13.084-41.586 24.69-73.643 33.038-106.54 6.4-25.244 19.058-34.986 45.682-34.9 79.872 0.284 69.148 4.522 47.73 64.37-18.802 52.522-34.56 106.382-57.23 157.198-23.197 52.024-15.36 105.4-17.608 158.634-0.754 17.664 7.438 40.733-15.502 49.038-24.704 8.96-50.987 3.4-76.089-2.773-6.187-1.522-7.879-9.031-8.675-15.388-0.285-2.048-0.754-4.182-0.47-6.173 19.328-131.242-46.15-242.844-84.053-360.76-12.445-38.685-10.368-43.222 29.838-43.578 9.33-0.1 18.73 0.783 27.933-0.17 22.243-2.29 34.318 7.082 40.334 28.729 9.642 34.73 21.362 68.878 35.072 112.313z m282.425 77.056c0 58.95-0.57 117.902 0.27 176.839 0.355 24.064-6.841 35.64-33.45 36.081-67.67 1.124-67.67 2.134-67.67-66.432-0.014-108.6 0.754-217.173-0.54-325.745-0.37-29.91 10.211-39.766 39.708-39.282 61.54 0.995 61.554-0.242 61.54 60.302v158.237h0.142z m-459.193 0.839c0 60.956-0.797 121.955 0.455 182.897 0.427 20.239-6.585 27.45-26.169 28.843-76.132 5.447-76.089 5.888-76.089-69.547 0-105.4-0.043-210.816 0-316.245 0.014-41.557 2.916-44.43 43.563-44.757 6.2-0.043 12.487 0.626 18.63-0.1 29.654-3.413 40.236 9.43 39.425 39.069-1.678 59.904-0.498 119.893-0.498 179.84h0.683zM96.37011 559.217c-0.043 40.235-0.654 80.499 0.199 120.719 0.47 22.471-9.06 30.734-31.289 31.573C0.37011 713.927 0.37011 714.567 0.37011 649.074c0-68.125 0.768-136.235-0.356-204.288-0.426-25.358 8.747-34.532 34.205-34.631 73.685-0.228 61.88-4.935 62.165 59.306 0.142 29.91 0.014 59.819-0.014 89.743z m0.042-228.28c-0.014 50.489-0.014 50.489-45.568 50.489-50.545 0-50.545 0-50.488-51.542 0.042-49.18 0.042-49.18 49.92-49.109 46.165 0.085 46.165 0.085 46.136 50.162z" fill="#42BD56" ></path></symbol><symbol id="icon-youku" viewBox="0 0 1024 1024"><path d="M740.3 556.4c0.1-0.1 0.1-0.2 0.2-0.3 0.5-0.8 0.9-1.7 1.4-2.5 0.2-0.4 0.4-0.8 0.7-1.2 0.2-0.3 0.3-0.7 0.5-1 5.5-10.8 8.5-22.7 8.6-34.8v-1.2-1.2c-0.2-12.1-3.1-24-8.6-34.8-0.2-0.3-0.3-0.7-0.5-1-0.2-0.4-0.4-0.8-0.7-1.2-0.5-0.8-0.9-1.7-1.4-2.5-0.1-0.1-0.1-0.2-0.2-0.3-1.5-2.5-3.1-4.9-4.9-7.2v-0.1c-2.4-3.2-5.1-6.2-8-9l-0.2-0.2c-1.6-1.5-3.3-3-5-4.4-0.4-0.3-0.7-0.6-1.1-0.9l-3.6-2.7c-0.3-0.2-0.6-0.4-0.8-0.6l-247-165.5c-17.6-11.8-38.8-16.1-59.6-12-20.8 4.1-38.8 16.1-50.6 33.7-24.4 36.4-14.7 85.9 21.7 110.3l148.5 99.6L381.1 615c-36.4 24.4-46.1 73.9-21.7 110.3 11.8 17.6 29.8 29.6 50.6 33.7 20.8 4.1 42-0.2 59.6-12l246.9-165.6c0.3-0.2 0.6-0.4 0.8-0.6l1.5-1c0.7-0.5 1.5-1.1 2.2-1.6 0.4-0.3 0.7-0.6 1.1-0.9 1.8-1.4 3.4-2.9 5-4.4l0.2-0.2c2.9-2.8 5.6-5.8 8-9v-0.1c1.9-2.3 3.5-4.7 5-7.2z m0 0" fill="#FF4A4A" ></path><path d="M975.6 317.5c-25.2-59.6-61.2-113-107.2-158.9-45.9-45.9-99.4-81.9-158.9-107.1-61.7-26.1-127.2-39.3-194.7-39.3-84.7 0-168.4 21.6-242.1 62.4C201.4 114 140.2 171 95.6 239.4c-52.9 81.2-80.9 175.5-80.9 272.8 0 67.5 13.2 133 39.3 194.7 25.2 59.6 61.2 113 107.1 158.9C207 911.7 260.5 947.7 320 973c61.7 26.1 127.2 39.3 194.7 39.3 81.6 0 162.5-20.1 234.2-58.1 69.3-36.8 129.8-90.2 175-154.4 59.5-84.5 90.9-184 90.9-287.6 0.2-67.5-13.1-133-39.2-194.7zM514.8 853.9c-188.4 0-341.7-153.3-341.7-341.7 0-66.5 19.1-130.9 55.2-186.3 63.4-97.3 170.6-155.4 286.5-155.4 188.4 0 341.7 153.3 341.7 341.7 0 70.8-21.5 138.8-62.1 196.4-63.9 91-168.5 145.3-279.6 145.3z m0 0" fill="#38CEFF" ></path><path d="M904.9 689.4c-35.8-25.2-85.2-16.6-110.3 19.2-25.2 35.8-16.6 85.2 19.2 110.3 13.9 9.8 29.8 14.4 45.5 14.4 24.9 0 49.4-11.7 64.8-33.6 25.1-35.7 16.5-85.1-19.2-110.3zM118.7 349c36.6 23.9 85.7 13.5 109.6-23.1 23.9-36.6 13.5-85.7-23.1-109.6-36.6-23.9-85.7-13.5-109.6 23.1C71.7 276 82.1 325.1 118.7 349z m0 0" fill="#0B99FF" ></path><path d="M751.7 514.2c-0.2-12.1-3.2-24-8.6-34.8-0.2-0.3-0.3-0.7-0.5-1-0.2-0.4-0.4-0.8-0.7-1.2-0.5-0.8-0.9-1.7-1.4-2.5-0.1-0.1-0.1-0.2-0.2-0.3-0.7-1.1-1.3-2.2-2.1-3.2-0.9-1.4-1.9-2.7-2.9-4v-0.1c-2.5-3.2-5.1-6.2-8-9l-0.2-0.2c-1.6-1.5-3.3-3-5-4.4-0.4-0.3-0.7-0.6-1.1-0.9-0.7-0.6-1.4-1.1-2.2-1.6-0.5-0.3-1-0.7-1.5-1-13.3-9.2-29-14.1-45.2-14-15.8 0-31.1 4.7-44.2 13.5l-98.4 66 98.4 66c13.1 8.8 28.4 13.5 44.2 13.5 16.4 0 32.1-5 45.2-14l1.5-1c0.7-0.5 1.5-1.1 2.2-1.6 0.4-0.3 0.7-0.6 1.1-0.9 1.7-1.4 3.4-2.9 5-4.4l0.2-0.2c2.9-2.8 5.5-5.7 8-9v-0.1c1-1.3 1.9-2.6 2.9-4 0.7-1.1 1.4-2.2 2.1-3.2 0.1-0.1 0.1-0.2 0.2-0.3 0.5-0.8 1-1.7 1.4-2.5 0.2-0.4 0.4-0.8 0.7-1.2 0.2-0.3 0.3-0.7 0.5-1 5.5-10.8 8.4-22.7 8.6-34.8v-1.2-1.4z m0 0" fill="#F5001A" ></path></symbol></svg>';if((t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss")&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(t){console&&console.log(t)}}!function(t){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(t,0);else{document.addEventListener("DOMContentLoaded",(function e(){document.removeEventListener("DOMContentLoaded",e,!1),t()}),!1)}else document.attachEvent&&(r=t,i=e.document,o=!1,(a=function(){try{i.documentElement.doScroll("left")}catch(e){return void setTimeout(a,50)}n()})(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,n())});function n(){o||(o=!0,r())}var r,i,o,a}((function(){var e,t,r,i,o,a;(e=document.createElement("div")).innerHTML=n,n=null,(t=e.getElementsByTagName("svg")[0])&&(t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.width=0,t.style.height=0,t.style.overflow="hidden",r=t,(i=document.body).firstChild?(o=r,(a=i.firstChild).parentNode.insertBefore(o,a)):i.appendChild(r))}))}(window);var lo=function(e){var t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",r={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},i=e=>oo("[",e,"]+([",e,"_]*[",e,"]+)?"),o={className:"number",variants:[{begin:`\\b(0[bB]${i("01")})[lL]?`},{begin:`\\b(0${i("0-7")})[dDfFlL]?`},{begin:oo(/\b0[xX]/,ao(oo(i("a-fA-F0-9"),/\./,i("a-fA-F0-9")),oo(i("a-fA-F0-9"),/\.?/),oo(/\./,i("a-fA-F0-9"))),/([pP][+-]?(\d+))?/,/[fFdDlL]?/)},{begin:oo(/\b/,ao(oo(/\d*\./,i("\\d")),i("\\d")),/[eE][+-]?[\d]+[dDfF]?/)},{begin:oo(/\b/,i(/\d/),io(/\.?/),io(i(/\d/)),/[dDfFlL]?/)}],relevance:0};return{name:"Java",aliases:["jsp"],keywords:n,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"class",beginKeywords:"class interface",end:/[{;=]/,excludeEnd:!0,keywords:"class interface",illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"new throw return else",relevance:0},{className:"function",begin:"([À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(<[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*)*>)?\\s+)+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:n,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:n,relevance:0,contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},o,r]}};const so=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],co=["true","false","null","undefined","NaN","Infinity"],uo=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);function fo(e){return po("(?=",e,")")}function po(...e){return e.map(e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t}).join("")}var ho=function(e){var t="[A-Za-z$_][0-9A-Za-z$_]*",n="<>",r="</>",i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/},o={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:so.join(" "),literal:co.join(" "),built_in:uo.join(" ")},a={className:"number",variants:[{begin:"\\b(0[bB][01]+)n?"},{begin:"\\b(0[oO][0-7]+)n?"},{begin:e.C_NUMBER_RE+"n?"}],relevance:0},l={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},s={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,l],subLanguage:"xml"}},c={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,l],subLanguage:"css"}},u={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,l]};l.contains=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,s,c,u,a,e.REGEXP_MODE];var f=l.contains.concat([{begin:/\(/,end:/\)/,contains:["self"].concat(l.contains,[e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE])},e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]),d={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:f};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,contains:[e.SHEBANG({binary:"node",relevance:5}),{className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,s,c,u,e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:t+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,a,{begin:po(/[{,\n]\s*/,fo(po(/(((\/\/.*)|(\/\*(.|\n)*\*\/))\s*)*/,t+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:t+fo("\\s*:"),relevance:0}]},{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.REGEXP_MODE,{className:"function",begin:"(\\([^(]*(\\([^(]*(\\([^(]*\\))?\\))?\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:f}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:n,end:r},{begin:i.begin,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:t}),d],illegal:/\[|%/},{begin:/\$[(.]/},e.METHOD_GUARD,{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"constructor",end:/\{/,excludeEnd:!0},{begin:"(get|set)\\s+(?="+t+"\\()",end:/{/,keywords:"get set",contains:[e.inherit(e.TITLE_MODE,{begin:t}),{begin:/\(\)/},d]}],illegal:/#(?!!)/}};var mo=function(e){var t={begin:/(?:[A-Z\_\.\-]+|--[a-zA-Z0-9_-]+)\s*:/,returnBegin:!0,end:";",endsWithParent:!0,contains:[{className:"attribute",begin:/\S/,end:":",excludeEnd:!0,starts:{endsWithParent:!0,excludeEnd:!0,contains:[{begin:/[\w-]+\(/,returnBegin:!0,contains:[{className:"built_in",begin:/[\w-]+/},{begin:/\(/,end:/\)/,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{className:"number",begin:"#[0-9A-Fa-f]+"},{className:"meta",begin:"!important"}]}}]};return{name:"CSS",case_insensitive:!0,illegal:/[=\/|'\$]/,contains:[e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/},{className:"selector-class",begin:/\.[A-Za-z0-9_-]+/},{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},{className:"selector-pseudo",begin:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{begin:"@(page|font-face)",lexemes:"@[a-z-]+",keywords:"@page @font-face"},{begin:"@",end:"[{;]",illegal:/:/,returnBegin:!0,contains:[{className:"keyword",begin:/@\-?\w[\w]*(\-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:"and or not only",contains:[{begin:/[a-z-]+:/,className:"attribute"},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},{begin:"{",end:"}",illegal:/\S/,contains:[e.C_BLOCK_COMMENT_MODE,t]}]}},go=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)},vo=[].slice,yo={},bo=function(e,t,n){if(!(t in yo)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";yo[t]=Function("F,a","return new F("+r.join(",")+")")}return yo[t](e,n)},xo=Function.bind||function(e){var t=z(this),n=vo.call(arguments,1),r=function(){var i=n.concat(vo.call(arguments));return this instanceof r?bo(t,i.length,i):go(t,i,e)};return h(t.prototype)&&(r.prototype=t.prototype),r},wo=(C.Reflect||{}).construct,ko=k((function(){function e(){}return!(wo((function(){}),[],e)instanceof e)})),So=!k((function(){wo((function(){}))}));$($.S+$.F*(ko||So),"Reflect",{construct:function(e,t){z(e),w(t);var n=arguments.length<3?e:z(arguments[2]);if(So&&!ko)return wo(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(xo.apply(e,r))}var i=n.prototype,o=Ae(h(i)?i:Object.prototype),a=Function.apply.call(e,o,t);return h(a)?a:o}});var Co=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};Bn(Bn.S+Bn.F*!Mn,"Object",{defineProperty:Nn.f});var Oo=kn.Object,_o=function(e,t,n){return Oo.defineProperty(e,t,n)};function Mo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),_o(e,r.key,r)}}var Ao=function(e,t,n){return t&&Mo(e.prototype,t),n&&Mo(e,n),e};Bn(Bn.S,"Object",{create:Sr});var To=kn.Object,Lo=function(e,t){return To.create(e,t)},Eo=function(e,t){if(On(e),!Cn(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},Do={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=Sn(Function.call,xi.f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return Eo(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:Eo};Bn(Bn.S,"Object",{setPrototypeOf:Do.set});var Fo=kn.Object.setPrototypeOf,No=m((function(e){function t(n,r){return e.exports=t=Fo||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t}));var Ro=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Lo(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&No(e,t)},Io=si.f("iterator"),Po=m((function(e){function t(n){return e.exports=t="function"==typeof Qi&&"symbol"==typeof Io?function(e){return typeof e}:function(e){return e&&"function"==typeof Qi&&e.constructor===Qi&&e!==Qi.prototype?"symbol":typeof e},t(n)}e.exports=t}));var jo=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};var zo=function(e,t){return!t||"object"!==Po(t)&&"function"!=typeof t?jo(e):t};!function(e,t){var n=(kn.Object||{})[e]||Object[e],r={};r[e]=t(n),Bn(Bn.S+Bn.F*_n((function(){n(1)})),"Object",r)}("getPrototypeOf",(function(){return function(e){return Dr(Tr(e))}}));var Bo=kn.Object.getPrototypeOf,qo=m((function(e){function t(n){return e.exports=t=Fo?Bo:function(e){return e.__proto__||Bo(e)},t(n)}e.exports=t}));function $o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var Ho=function(e){Ro(n,e);var t=$o(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"name",get:function(){return"title"}},{key:"schema",get:function(){return{content:"inline*",parseDOM:[{tag:"h1"}],toDOM:function(){return["h1",0]}}}}]),n}(n.Node);function Wo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var Uo=function(e){Ro(n,e);var t=Wo(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"schema",get:function(){return{content:"title block+"}}}]),n}(n.Doc);function Go(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}function Vo(e){var t=e.style,n=t.textAlign,r=t.lineHeight;return{textAlign:e.getAttribute("data-text-align")||n||"",indent:parseInt(e.getAttribute("data-indent"),10)||0,lineHeight:r}}function Ko(e){var t=e.attrs,n=t.textAlign,r=t.indent,i=t.lineHeight,o={};return n&&"left"!==n&&(o["data-text-align"]=n),r&&(o["data-indent"]=r),i&&(o["data-line-height"]=i),["p",o,0]}var Jo={attrs:{textAlign:{default:null},indent:{default:null},lineHeight:{default:null}},content:"inline*",group:"block",parseDOM:[{tag:"p",getAttrs:Vo}],toDOM:Ko},Yo=function(e){Ro(n,e);var t=Go(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"schema",get:function(){return Jo}}]),n}(n.Paragraph),Xo=Ko,Qo=Vo,Zo=C.Reflect,ea=Zo&&Zo.ownKeys||function(e){var t=lt.f(w(e)),n=rt.f;return n?t.concat(n(e)):t};$($.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=ae(e),i=pt.f,o=ea(r),a={},l=0;o.length>l;)void 0!==(n=i(r,t=o[l++]))&&Xt(a,t,n);return a}}),H("keys",(function(){return function(e){return we(Ne(e))}}));var ta=function(e,t,n){return t in e?_o(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};function na(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}function ra(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(n),!0).forEach((function(t){ta(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ra(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var oa=ia(ia({},Jo),{},{attrs:{textAlign:{default:null},indent:{default:null}},content:"block*",defining:!0,parseDOM:[{tag:"blockquote",getAttrs:function(e){return Qo(e)}}],toDOM:function(e){var t=Xo(e);return t[0]="blockquote",t}}),aa=function(e){Ro(n,e);var t=na(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"schema",get:function(){return oa}}]),n}(r.Blockquote);function la(e,t,n,r,i,o,a,l,s,c){"boolean"!=typeof a&&(s=l,l=a,a=!1);const u="function"==typeof n?n.options:n;let f;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(f=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,s(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=f):t&&(f=a?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,l(e))}),f)if(u.functional){const e=u.render;u.render=function(t,n){return f.call(n),e(t,n)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,f):[f]}return n}const sa=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{staticClass:"o-todo-item",class:{"todo-item--done":e.done},attrs:{"data-type":e.node.type.name,"data-done":e.done.toString(),"data-text-align":e.node.attrs.textAlign,"data-drag-handle":""}},[n("div",{staticClass:"row col-12 items-center todo-checkbox",attrs:{contenteditable:"false"},on:{click:function(t){return t.stopPropagation(),e.toggle(t)}}},[n("q-icon",{attrs:{name:e.done?"check_box":"check_box_outline_blank"}})],1),e._v(" "),n("div",{ref:"content",staticClass:"full-width todo-content",attrs:{contenteditable:e.view.editable.toString()}})])},staticRenderFns:[]},void 0,{name:"o-todo-item",data:function(){return{}},props:["node","updateAttrs","view"],components:{},methods:{toggle:function(){this.done=!this.done}},computed:{done:{get:function(){return this.node.attrs.done},set:function(e){this.updateAttrs({done:e})}}}},void 0,!1,void 0,!1,void 0,void 0,void 0);function ca(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}function ua(e){var t=e.style,n=t.textAlign,r=t.lineHeight;return{textAlign:e.getAttribute("data-text-align")||n||""||null,lineHeight:r||null,done:"true"===e.getAttribute("data-done")}}function fa(e){var t=e.attrs,n=t.done,r=t.textAlign,i={"data-type":"todo_item"};return i["data-done"]=n.toString(),r&&"left"!==r&&(i["data-text-align"]=r),["li",i,["span",{class:"todo-checkbox",contenteditable:"false"}],["div",{class:"todo-content"},0]]}var da=function(e){Ro(n,e);var t=ca(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"schema",get:function(){return{attrs:{done:{default:!1},textAlign:{default:null},lineHeight:{default:null}},draggable:!0,content:this.options.nested?"(paragraph|todo_list)+":"paragraph+",parseDOM:[{priority:51,tag:'[data-type="'.concat(this.name,'"]'),getAttrs:ua}],toDOM:fa}}},{key:"view",get:function(){return sa}}]),n}(r.TodoItem);const pa=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"o-block-card",class:{fullscreen:e.fullScreen,selected:e.selected}},[e.toolbar?n("section",{staticClass:"row col-12 o-card-toolbar"},[n("div",{staticClass:"row col"},[e.fullScreen?n("div",{staticClass:"q-px-sm"},[n("q-btn",{staticClass:"full-height",attrs:{icon:"keyboard_arrow_left",label:e.$o.lang.label.back,flat:""},on:{click:e.onToggleScreen}})],1):e._e(),e._v(" "),n("div",{staticClass:"col"},[e._t("toolbar-left")],2)]),e._v(" "),n("div",{staticClass:"row col-auto q-pl-sm"},[n("q-btn",{attrs:{icon:"fullscreen",dense:"",flat:""},on:{click:e.onToggleScreen}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle"}},[e._v(e._s(e.$o.lang.editor.toggleFullscreen))])],1),e._v(" "),e._t("toolbar-right")],2)]):n("section",{staticClass:"o-card-inner-toolbar"},[n("q-btn",{attrs:{icon:"fullscreen",color:"blue",round:"",flat:""},on:{click:e.onToggleScreen}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle"}},[e._v(e._s(e.$o.lang.editor.toggleFullscreen))])],1)],1),e._v(" "),n("section",{staticClass:"o-card-content",on:{click:e.select}},[e._t("default")],2)])},staticRenderFns:[]},void 0,{name:"o-block-card",data:function(){return{fullScreen:!1}},props:{view:{},getPos:{},selected:{type:Boolean},toolbar:{type:Boolean,default:!0}},methods:{onToggleScreen:function(){this.fullScreen=!this.fullScreen,this.$emit("toggle-screen",this.fullScreen)},select:function(){var e=this.view.state,t=e.tr,n=i.NodeSelection.create(e.doc,this.getPos());t=t.setSelection(n),this.view.dispatch(t)}},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);const ha=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-item",{staticClass:"o-common-item",class:e.dense?"dense":"",attrs:{to:e.to,clickable:"","v-close-popup":e.closable,exact:""}},[n("q-item-section",{attrs:{avatar:""}},[n("q-avatar",{staticClass:"themed",attrs:{size:e.size,icon:e.icon,textColor:e.color}})],1),e._v(" "),n("q-item-section",{staticClass:"q-pr-md"},[n("q-item-label",[e._v(e._s(e.label))]),e._v(" "),e.sublabel?n("q-item-label",{attrs:{caption:""}},[e._v(e._s(e.sublabel))]):e._e()],1),e._v(" "),e.sideIcon?n("q-item-section",{attrs:{side:""}},[n("q-avatar",{attrs:{size:e.size,icon:e.sideIcon}})],1):e._e(),e._v(" "),e.sideLabel?n("q-item-section",{attrs:{side:""}},[n("q-item-label",{staticClass:"q-pr-md"},[e._v(e._s(e.sideLabel))]),e._v(" "),e.sideSublabel?n("q-item-label",{attrs:{caption:""}},[e._v(e._s(e.sideSublabel))]):e._e()],1):e._e(),e._v(" "),e._t("default")],2)},staticRenderFns:[]},void 0,{name:"o-common-item",data:function(){return{}},props:{closable:{type:Boolean,default:!1},dense:{type:Boolean,default:!1},id:{type:String,default:""},to:{type:String,default:""},size:{type:String,default:"2.4rem"},color:{type:String,default:""},icon:{type:String,default:"apps"},label:{type:String,default:"Label"},sublabel:{type:String,default:""},sideIcon:{type:String,default:""},sideLabel:{type:String,default:""},sideSublabel:{type:String,default:""}},methods:{onConfirm:function(){this.$emit("confirm",this.value)}},computed:{textColor:function(){return this.color+"-10"}}},void 0,!1,void 0,!1,void 0,void 0,void 0);var ma=m((function(e,t){e.exports=function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,l=a&&(r?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),c=s&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=f&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,s=!0);var k=y&&(c||f&&(null==w||w<12.11)),S=n||a&&l>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var O,_=function(e,t){var n=e.className,r=C(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function M(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return M(e).appendChild(t)}function T(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function L(e,t,n,r){var i=T(e,t,n,r);return i.setAttribute("role","presentation"),i}function E(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function D(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function F(e,t){var n=e.className;C(t).test(n)||(e.className+=(n?" ":"")+t)}function N(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!C(n[r]).test(t)&&(t+=" "+n[r]);return t}O=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var R=function(e){e.select()};function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function P(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function j(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}m?R=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(R=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};function B(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},z.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var q={toString:function(){return"CodeMirror.Pass"}},$={scroll:!1},H={origin:"*mouse"},W={origin:"+move"};function U(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var G=[""];function V(e){for(;G.length<=e;)G.push(K(G)+" ");return G[e]}function K(e){return e[e.length-1]}function J(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Y(){}function X(e,t){var n;return Object.create?n=Object.create(e):(Y.prototype=e,n=new Y),t&&P(t,n),n}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Z(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Z(e))||t.test(e):Z(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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]/;function re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,n){for(;(n<0?t>0:t<e.length)&&re(e.charAt(t));)t+=n;return t}function oe(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var ae=null;function le(e,t,n){var r;ae=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ae=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ae=i)}return null!=r?r:ae}var se=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,l){var s="ltr"==l?"L":"R";if(0==a.length||"ltr"==l&&!e.test(a))return!1;for(var c,u=a.length,f=[],d=0;d<u;++d)f.push((c=a.charCodeAt(d))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var p=0,h=s;p<u;++p){var m=f[p];"m"==m?f[p]=h:h=m}for(var g=0,v=s;g<u;++g){var y=f[g];"1"==y&&"r"==v?f[g]="n":n.test(y)&&(v=y,"r"==y&&(f[g]="R"))}for(var b=1,x=f[0];b<u-1;++b){var w=f[b];"+"==w&&"1"==x&&"1"==f[b+1]?f[b]="1":","!=w||x!=f[b+1]||"1"!=x&&"n"!=x||(f[b]=x),x=w}for(var k=0;k<u;++k){var S=f[k];if(","==S)f[k]="N";else if("%"==S){var C=void 0;for(C=k+1;C<u&&"%"==f[C];++C);for(var O=k&&"!"==f[k-1]||C<u&&"1"==f[C]?"1":"N",_=k;_<C;++_)f[_]=O;k=C-1}}for(var M=0,A=s;M<u;++M){var T=f[M];"L"==A&&"1"==T?f[M]="L":n.test(T)&&(A=T)}for(var L=0;L<u;++L)if(t.test(f[L])){var E=void 0;for(E=L+1;E<u&&t.test(f[E]);++E);for(var D="L"==(L?f[L-1]:s),F=D==("L"==(E<u?f[E]:s))?D?"L":"R":s,N=L;N<E;++N)f[N]=F;L=E-1}for(var R,I=[],P=0;P<u;)if(r.test(f[P])){var j=P;for(++P;P<u&&r.test(f[P]);++P);I.push(new o(0,j,P))}else{var z=P,B=I.length,q="rtl"==l?1:0;for(++P;P<u&&"L"!=f[P];++P);for(var $=z;$<P;)if(i.test(f[$])){z<$&&(I.splice(B,0,new o(1,z,$)),B+=q);var H=$;for(++$;$<P&&i.test(f[$]);++$);I.splice(B,0,new o(2,H,$)),B+=q,z=$}else++$;z<P&&I.splice(B,0,new o(1,z,P))}return"ltr"==l&&(1==I[0].level&&(R=a.match(/^\s+/))&&(I[0].from=R[0].length,I.unshift(new o(0,0,R[0].length))),1==K(I).level&&(R=a.match(/\s+$/))&&(K(I).to-=R[0].length,I.push(new o(0,u-R[0].length,u)))),"rtl"==l?I.reverse():I}}();function ce(e,t){var n=e.order;return null==n&&(n=e.order=se(e.text,t)),n}var ue=[],fe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ue).concat(n)}};function de(e,t){return e._handlers&&e._handlers[t]||ue}function pe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=B(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function he(e,t){var n=de(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function me(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),he(e,n||t.type,e,t),we(t)||t.codemirrorIgnore}function ge(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==B(n,t[r])&&n.push(t[r])}function ve(e,t){return de(e,t).length>0}function ye(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){pe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function we(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ke(e){be(e),xe(e)}function Se(e){return e.target||e.srcElement}function Ce(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Oe,_e,Me=function(){if(a&&l<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function Ae(e){if(null==Oe){var t=T("span","​");A(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Oe=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&l<8))}var n=Oe?T("span","​"):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Te(e){if(null!=_e)return _e;var t=A(e,document.createTextNode("AخA")),n=O(t,0,1).getBoundingClientRect(),r=O(t,1,2).getBoundingClientRect();return M(e),!(!n||n.left==n.right)&&(_e=r.right-n.right<3)}var Le,Ee=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},De=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Fe="oncopy"in(Le=T("div"))||(Le.setAttribute("oncopy","return;"),"function"==typeof Le.oncopy),Ne=null,Re={},Ie={};function Pe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Re[e]=t}function je(e){if("string"==typeof e&&Ie.hasOwnProperty(e))e=Ie[e];else if(e&&"string"==typeof e.name&&Ie.hasOwnProperty(e.name)){var t=Ie[e.name];"string"==typeof t&&(t={name:t}),(e=X(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return je("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return je("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function ze(e,t){t=je(t);var n=Re[t.name];if(!n)return ze(e,"text/plain");var r=n(e,t);if(Be.hasOwnProperty(t.name)){var i=Be[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Be={};function qe(e,t){P(t,Be.hasOwnProperty(e)?Be[e]:Be[e]={})}function $e(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function He(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function We(e,t,n){return!e.startState||e.startState(t,n)}var Ue=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ge(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Ve(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function Ke(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Je(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Ye(e){if(null==e.parent)return null;for(var t=e.parent,n=B(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Xe(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a].height;if(t<l)break;t-=l}return n+a}function Qe(e,t){return t>=e.first&&t<e.first+e.size}function Ze(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,n){if(void 0===n&&(n=null),!(this instanceof et))return new et(e,t,n);this.line=e,this.ch=t,this.sticky=n}function tt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function rt(e){return et(e.line,e.ch)}function it(e,t){return tt(e,t)<0?t:e}function ot(e,t){return tt(e,t)<0?e:t}function at(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function lt(e,t){if(t.line<e.first)return et(e.first,0);var n=e.first+e.size-1;return t.line>n?et(n,Ge(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ge(e,t.line).text.length)}function st(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=lt(e,t[r]);return n}Ue.prototype.eol=function(){return this.pos>=this.string.length},Ue.prototype.sol=function(){return this.pos==this.lineStart},Ue.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ue.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ue.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ue.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ue.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ue.prototype.skipToEnd=function(){this.pos=this.string.length},Ue.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ue.prototype.backUp=function(e){this.pos-=e},Ue.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=j(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.indentation=function(){return j(this.string,null,this.tabSize)-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ue.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ue.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ue.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ue.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,n,r){var i=[e.state.modeGen],o={};xt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,l=function(r){n.baseTokens=i;var l=e.state.overlays[r],s=1,c=0;n.state=!0,xt(e,t.text,l.mode,n,(function(e,t){for(var n=s;c<e;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function dt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=pt(e,Ye(t)),i=t.text.length>e.options.maxHighlightLength&&$e(e.doc.mode,r.state),o=ft(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function pt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ut(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Ge(o,l-1),c=s.stateAfter;if(c&&(!n||l+(c instanceof ct?c.lookAhead:0)<=o.modeFrontier))return l;var u=j(s.text,null,e.options.tabSize);(null==i||r>u)&&(i=l-1,r=u)}return i}(e,t,n),a=o>r.first&&Ge(r,o-1).stateAfter,l=a?ut.fromSaved(r,a,o):new ut(r,We(r.mode),o);return r.iter(o,t,(function(n){ht(e,n.text,l);var r=l.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?l.save():null,l.nextLine()})),n&&(r.modeFrontier=l.line),l}function ht(e,t,n,r){var i=e.doc.mode,o=new Ue(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&mt(i,n.state);!o.eol();)gt(i,o,n.state),o.start=o.pos}function mt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=He(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function gt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=He(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,n){return t instanceof ct?new ut(e,$e(e.mode,t.state),n,t.lookAhead):new ut(e,$e(e.mode,t),n)},ut.prototype.save=function(e){var t=!1!==e?$e(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var i,o,a=e.doc,l=a.mode,s=Ge(a,(t=lt(a,t)).line),c=pt(e,t.line,n),u=new Ue(s.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=gt(l,u,c.state),r&&o.push(new vt(u,i,$e(a.mode,c.state)));return r?o:new vt(u,i,c.state)}function bt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function xt(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,f=new Ue(t,e.options.tabSize,r),d=e.options.addModeClass&&[null];for(""==t&&bt(mt(n,r.state),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,a&&ht(e,t,r,f.pos),f.pos=t.length,s=null):s=bt(gt(n,f,r.state,d),o),d){var p=d[0].name;p&&(s="m-"+(s?p+" "+s:p))}if(!l||u!=s){for(;c<f.start;)i(c=Math.min(f.start,c+5e3),u);u=s}f.start=f.pos}for(;c<f.pos;){var h=Math.min(f.pos,c+5e3);i(h,u),c=h}}var wt=!1,kt=!1;function St(e,t,n){this.marker=e,this.from=t,this.to=n}function Ct(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Ot(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function _t(e,t){if(t.full)return null;var n=Qe(e,t.from.line)&&Ge(e,t.from.line).markedSpans,r=Qe(e,t.to.line)&&Ge(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==tt(t.from,t.to),l=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new St(a,o.from,l?null:o.to))}}return r}(n,i,a),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new St(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,o,a),c=1==t.text.length,u=K(t.text).length+(c?i:0);if(l)for(var f=0;f<l.length;++f){var d=l[f];if(null==d.to){var p=Ct(s,d.marker);p?c&&(d.to=null==p.to?null:p.to+u):d.to=i}}if(s)for(var h=0;h<s.length;++h){var m=s[h];null!=m.to&&(m.to+=u),null==m.from?Ct(l,m.marker)||(m.from=u,c&&(l||(l=[])).push(m)):(m.from+=u,c&&(l||(l=[])).push(m))}l&&(l=Mt(l)),s&&s!=l&&(s=Mt(s));var g=[l];if(!c){var v,y=t.text.length-2;if(y>0&&l)for(var b=0;b<l.length;++b)null==l[b].to&&(v||(v=[])).push(new St(l[b].marker,null,null));for(var x=0;x<y;++x)g.push(v);g.push(s)}return g}function Mt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function At(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Tt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Lt(e){return e.inclusiveLeft?-1:0}function Et(e){return e.inclusiveRight?1:0}function Dt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=tt(r.from,i.from)||Lt(e)-Lt(t);if(o)return-o;var a=tt(r.to,i.to)||Et(e)-Et(t);return a||t.id-e.id}function Ft(e,t){var n,r=kt&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Dt(n,i.marker)<0)&&(n=i.marker);return n}function Nt(e){return Ft(e,!0)}function Rt(e){return Ft(e,!1)}function It(e,t){var n,r=kt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Dt(n,o.marker)<0)&&(n=o.marker)}return n}function Pt(e,t,n,r,i){var o=Ge(e,t),a=kt&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=tt(c.from,n)||Lt(s.marker)-Lt(i),f=tt(c.to,r)||Et(s.marker)-Et(i);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?tt(c.to,n)>=0:tt(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?tt(c.from,r)<=0:tt(c.from,r)<0)))return!0}}}function jt(e){for(var t;t=Nt(e);)e=t.find(-1,!0).line;return e}function zt(e,t){var n=Ge(e,t),r=jt(n);return n==r?t:Ye(r)}function Bt(e,t){if(t>e.lastLine())return t;var n,r=Ge(e,t);if(!qt(e,r))return t;for(;n=Rt(r);)r=n.find(1,!0).line;return Ye(r)+1}function qt(e,t){var n=kt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&$t(e,t,r))return!0}}function $t(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return $t(e,r.line,Ct(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&$t(e,t,i))return!0}function Ht(e){for(var t=0,n=(e=jt(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function Wt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Nt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=Rt(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function Ut(e){var t=e.display,n=e.doc;t.maxLine=Ge(n,n.first),t.maxLineLength=Wt(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=Wt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Gt=function(e,t,n){this.text=e,Tt(this,t),this.height=n?n(this):1};function Vt(e){e.parent=null,At(e)}Gt.prototype.lineNo=function(){return Ye(this)},ye(Gt);var Kt={},Jt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Jt:Kt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var n=L("span",null,null,s?"padding-right: .1px":null),r={pre:L("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Zt,Te(e.display.measure)&&(a=ce(o,e.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[],nn(o,r,dt(e,o,t!=e.display.externalMeasured&&Ye(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=N(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=N(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ae(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return he(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=N(r.pre.className,r.textClass||"")),r}function Qt(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Zt(e,t,n,r,i,o,s){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/  /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(t,e.trailingSpace):t,f=e.cm.state.specialChars,d=!1;if(f.test(t)){c=document.createDocumentFragment();for(var p=0;;){f.lastIndex=p;var h=f.exec(t),m=h?h.index-p:t.length-p;if(m){var g=document.createTextNode(u.slice(p,p+m));a&&l<9?c.appendChild(T("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;p+=m+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=c.appendChild(T("span",V(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?((v=c.appendChild(T("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),a&&l<9?c.appendChild(T("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&l<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||d||o){var x=n||"";r&&(x+=r),i&&(x+=i);var w=T("span",[c],x,o);if(s)for(var k in s)s.hasOwnProperty(k)&&"style"!=k&&"class"!=k&&w.setAttribute(k,s[k]);return e.content.appendChild(w)}e.content.appendChild(c)}}function en(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=void 0,d=0;d<t.length&&!((f=t[d]).to>c&&f.from<=c);d++);if(f.to>=u)return e(n,r,i,o,a,l,s);e(n,r.slice(0,f.to-c),i,o,null,l,s),o=null,r=r.slice(f.to-c),c=f.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,c,u,f,d,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){s=c=u=l="",d=null,f=null,v=1/0;for(var y=[],b=void 0,x=0;x<r.length;++x){var w=r[x],k=w.marker;if("bookmark"==k.type&&w.from==h&&k.widgetNode)y.push(k);else if(w.from<=h&&(null==w.to||w.to>h||k.collapsed&&w.to==h&&w.from==h)){if(null!=w.to&&w.to!=h&&v>w.to&&(v=w.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&w.from==h&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(b||(b=[])).push(k.endStyle,w.to),k.title&&((d||(d={})).title=k.title),k.attributes)for(var S in k.attributes)(d||(d={}))[S]=k.attributes[S];k.collapsed&&(!f||Dt(f.marker,k)<0)&&(f=w)}else w.from>h&&v>w.from&&(v=w.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==v&&(c+=" "+b[C]);if(!f||f.from==h)for(var O=0;O<y.length;++O)tn(t,0,y[O]);if(f&&(f.from||0)==h){if(tn(t,(null==f.to?p+1:f.to)-h,f.marker,null==f.from),null==f.to)return;f.to==h&&(f=!1)}}if(h>=p)break;for(var _=Math.min(p,v);;){if(g){var M=h+g.length;if(!f){var A=M>_?g.slice(0,_-h):g;t.addToken(t,A,a?a+s:s,u,h+A.length==v?c:"",l,d)}if(M>=_){g=g.slice(_-h),h=_;break}h=M,u=""}g=i.slice(o,o=n[m++]),a=Yt(n[m++],t.cm.options)}}else for(var T=1;T<n.length;T+=2)t.addToken(t,i.slice(o,o=n[T]),Yt(n[T+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Rt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Ye(K(this.rest))-n+1:1,this.node=this.text=null,this.hidden=qt(e,t)}function on(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new rn(e.doc,Ge(e.doc,o),o);r=o+a.size,i.push(a)}return i}var an=null,ln=null;function sn(e,t){var n=de(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);an?r=an.delayedCallbacks:ln?r=ln:(r=ln=[],setTimeout(cn,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},a=0;a<n.length;++a)o(a)}}function cn(){var e=ln;ln=null;for(var t=0;t<e.length;++t)e[t]()}function un(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?pn(e,t):"gutter"==o?mn(e,t,n,r):"class"==o?hn(e,t):"widget"==o&&gn(e,t,r)}t.changes=null}function fn(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&l<8&&(e.node.style.zIndex=2)),e.node}function dn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Xt(e,t)}function pn(e,t){var n=t.text.className,r=dn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,hn(e,t)):n&&(t.text.className=n)}function hn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=fn(t);t.background=r.insertBefore(T("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?fn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function mn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=fn(t);t.gutterBackground=T("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=fn(t),l=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(T("div",Ze(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,u=o.hasOwnProperty(c)&&o[c];u&&l.appendChild(T("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function gn(e,t,n){t.alignable&&(t.alignable=null);for(var r=C("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);yn(e,t,n)}function vn(e,t,n,r){var i=dn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),hn(e,t),mn(e,t,n,r),yn(e,t,r),t.node}function yn(e,t,n){if(bn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)bn(e,t.rest[r],t,n,!1)}function bn(e,t,n,r,i){if(t.widgets)for(var o=fn(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=T("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),xn(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),sn(s,"redraw")}}function xn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function wn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!E(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),A(t.display.measure,T("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function kn(e,t){for(var n=Se(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Sn(e){return e.lineSpace.offsetTop}function Cn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function On(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,T("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function _n(e){return 50-e.display.nativeBarWidth}function Mn(e){return e.display.scroller.clientWidth-_n(e)-e.display.barWidth}function An(e){return e.display.scroller.clientHeight-_n(e)-e.display.barHeight}function Tn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(Ye(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ln(e,t,n,r){return Fn(e,Dn(e,t),n,r)}function En(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ur(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Dn(e,t){var n=Ye(t),r=En(e,n);r&&!r.text?r=null:r&&r.changes&&(un(e,r,n,or(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Ye(t=jt(t)),r=e.display.externalMeasured=new rn(e.doc,t,n);r.lineN=n;var i=r.built=Xt(e,r);return r.text=i.pre,A(e.display.lineMeasure,i.pre),r}(e,t));var i=Tn(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Fn(e,t,n,r,i){t.before&&(n=-1);var o,s=n+(r||"");return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&Mn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=In(t.map,n,r),s=o.node,c=o.start,u=o.end,f=o.collapse;if(3==s.nodeType){for(var d=0;d<4;d++){for(;c&&re(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&re(t.line.text.charAt(o.coverStart+u));)++u;if((i=a&&l<9&&0==c&&u==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():Pn(O(s,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,f="right"}a&&l<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ne)return Ne;var t=A(e,T("span","x")),n=t.getBoundingClientRect(),r=O(t,0,1).getBoundingClientRect();return Ne=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var p;c>0&&(f=r="right"),i=e.options.lineWrapping&&(p=s.getClientRects()).length>1?p["right"==r?p.length-1:0]:s.getBoundingClientRect()}if(a&&l<9&&!c&&(!i||!i.left&&!i.right)){var h=s.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+ir(e.display),top:h.top,bottom:h.bottom}:Rn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var x=b?y[b-1]:0,w=y[b],k={left:("right"==f?i.right:i.left)-t.rect.left,right:("left"==f?i.left:i.right)-t.rect.left,top:x,bottom:w};return i.left||i.right||(k.bogus=!0),e.options.singleCursorHeightPerLine||(k.rtop=m,k.rbottom=g),k}(e,t,n,r)).bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Nn,Rn={left:0,right:0,top:0,bottom:0};function In(e,t,n){for(var r,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?o=1+(i=t-l):(c==e.length-3||t==s&&e[c+3]>t)&&(i=(o=s-l)-1,t>=s&&(a="right")),null!=i){if(r=e[c+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Pn(e,t){var n=Rn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function jn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function zn(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)jn(e.display.view[t])}function Bn(e){zn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function qn(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function $n(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Hn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=wn(e.widgets[n]));return t}function Wn(e,t,n,r,i){if(!i){var o=Hn(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Ht(t);if("local"==r?a+=Sn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:$n());var s=l.left+("window"==r?0:qn());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function Un(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=qn(),i-=$n();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Gn(e,t,n,r,i){return r||(r=Ge(e.doc,t.line)),Wn(e,r,Ln(e,r,t.ch,i),n)}function Vn(e,t,n,r,i,o){function a(t,a){var l=Fn(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,Wn(e,r,l,n)}r=r||Ge(e.doc,t.line),i||(i=Dn(e,r));var l=ce(r,e.doc.direction),s=t.ch,c=t.sticky;if(s>=r.text.length?(s=r.text.length,c="before"):s<=0&&(s=0,c="after"),!l)return a("before"==c?s-1:s,"before"==c);function u(e,t,n){return a(n?e-1:e,1==l[t].level!=n)}var f=le(l,s,c),d=ae,p=u(s,f,"before"==c);return null!=d&&(p.other=u(s,d,"before"!=c)),p}function Kn(e,t){var n=0;t=lt(e.doc,t),e.options.lineWrapping||(n=ir(e.display)*t.ch);var r=Ge(e.doc,t.line),i=Ht(r)+Sn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Jn(e,t,n,r,i){var o=et(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Yn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Jn(r.first,0,null,-1,-1);var i=Xe(r,n),o=r.first+r.size-1;if(i>o)return Jn(r.first+r.size-1,Ge(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Ge(r,i);;){var l=er(e,a,i,t,n),s=It(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var c=s.find(1);if(c.line==i)return c;a=Ge(r,i=c.line)}}function Xn(e,t,n,r){r-=Hn(t);var i=t.text.length,o=oe((function(t){return Fn(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=oe((function(t){return Fn(e,n,t).top>r}),o,i)}}function Qn(e,t,n,r){return n||(n=Dn(e,t)),Xn(e,t,n,Wn(e,t,Fn(e,n,r),"line").top)}function Zn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=Ht(t);var o=Dn(e,t),a=Hn(t),l=0,s=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var f=(e.options.lineWrapping?nr:tr)(e,t,n,o,u,r,i);l=(c=1!=f.level)?f.from:f.to-1,s=c?f.to:f.from-1}var d,p,h=null,m=null,g=oe((function(t){var n=Fn(e,o,t);return n.top+=a,n.bottom+=a,!!Zn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),l,s),v=!1;if(m){var y=r-m.left<m.right-r,b=y==c;g=h+(b?0:1),p=b?"after":"before",d=y?m.left:m.right}else{c||g!=s&&g!=l||g++,p=0==g?"after":g==t.text.length?"before":Fn(e,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var x=Vn(e,et(n,g,p),"line",t,o);d=x.left,v=i<x.top?-1:i>=x.bottom?1:0}return Jn(n,g=ie(t.text,g,1),p,v,r-d)}function tr(e,t,n,r,i,o,a){var l=oe((function(l){var s=i[l],c=1!=s.level;return Zn(Vn(e,et(n,c?s.to:s.from,c?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),s=i[l];if(l>0){var c=1!=s.level,u=Vn(e,et(n,c?s.from:s.to,c?"after":"before"),"line",t,r);Zn(u,o,a,!0)&&u.top>a&&(s=i[l-1])}return s}function nr(e,t,n,r,i,o,a){var l=Xn(e,t,r,a),s=l.begin,c=l.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,f=null,d=0;d<i.length;d++){var p=i[d];if(!(p.from>=c||p.to<=s)){var h=Fn(e,r,1!=p.level?Math.min(c,p.to)-1:Math.max(s,p.from)).right,m=h<o?o-h+1e9:h-o;(!u||f>m)&&(u=p,f=m)}}return u||(u=i[i.length-1]),u.from<s&&(u={from:s,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Nn){Nn=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(T("br"));Nn.appendChild(document.createTextNode("x"))}A(e.measure,Nn);var n=Nn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),M(e.measure),n||1}function ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");A(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function or(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+i,r[l]=o.clientWidth}return{fixedPos:ar(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function lr(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(i){if(qt(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function sr(e){var t=e.doc,n=lr(e);t.iter((function(e){var t=n(e);t!=e.height&&Je(e,t)}))}function cr(e,t,n,r){var i=e.display;if(!n&&"true"==Se(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(e){return null}var s,c=Yn(e,o,a);if(r&&c.xRel>0&&(s=Ge(e.doc,c.line).text).length==c.ch){var u=j(s,s.length,e.options.tabSize)-s.length;c=et(c.line,Math.max(0,Math.round((o-On(e.display).left)/ir(e.display))-u))}return c}function ur(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function fr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)kt&&zt(e.doc,t)<i.viewTo&&pr(e);else if(n<=i.viewFrom)kt&&Bt(e.doc,n+r)>i.viewFrom?pr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)pr(e);else if(t<=i.viewFrom){var o=hr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):pr(e)}else if(n>=i.viewTo){var a=hr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):pr(e)}else{var l=hr(e,t,t,-1),s=hr(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(on(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):pr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function dr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[ur(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==B(a,n)&&a.push(n)}}}function pr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function hr(e,t,n,r){var i,o=ur(e,t),a=e.display.view;if(!kt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(r>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,n+=i}for(;zt(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function mr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function gr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function vr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var l=n.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&yr(e,l.head,i),s||xr(e,l,o)}}return r}function yr(e,t,n){var r=Vn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(T("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function br(e,t){return e.top-t.top||e.left-t.left}function xr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=On(e.display),l=a.left,s=Math.max(r.sizerWidth,Mn(e)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==n?s-e:n)+"px;\n                             height: "+(r-t)+"px"))}function f(t,n,r){var o,a,f=Ge(i,t),d=f.text.length;function p(n,r){return Gn(e,et(t,n),"div",f,r)}function h(t,n,r){var i=Qn(e,f,null,t),o="ltr"==n==("after"==r)?"left":"right";return p("after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var m=ce(f,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?d:r,(function(e,t,i,f){var g="ltr"==i,v=p(e,g?"left":"right"),y=p(t-1,g?"right":"left"),b=null==n&&0==e,x=null==r&&t==d,w=0==f,k=!m||f==m.length-1;if(y.top-v.top<=3){var S=(c?x:b)&&k,C=(c?b:x)&&w?l:(g?v:y).left,O=S?s:(g?y:v).right;u(C,v.top,O-C,v.bottom)}else{var _,M,A,T;g?(_=c&&b&&w?l:v.left,M=c?s:h(e,i,"before"),A=c?l:h(t,i,"after"),T=c&&x&&k?s:y.right):(_=c?h(e,i,"before"):l,M=!c&&b&&w?s:v.right,A=!c&&x&&k?l:y.left,T=c?h(t,i,"after"):s),u(_,v.top,M-_,v.bottom),v.bottom<y.top&&u(l,v.bottom,null,y.top),u(A,y.top,T-A,y.bottom)}(!o||br(v,o)<0)&&(o=v),br(y,o)<0&&(o=y),(!a||br(v,a)<0)&&(a=v),br(y,a)<0&&(a=y)})),{start:o,end:a}}var d=t.from(),p=t.to();if(d.line==p.line)f(d.line,d.ch,p.ch);else{var h=Ge(i,d.line),m=Ge(i,p.line),g=jt(h)==jt(m),v=f(d.line,d.ch,g?h.text.length+1:null).end,y=f(p.line,g?0:null,p.ch).start;g&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(l,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(l,v.bottom,null,y.top)}n.appendChild(o)}function wr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function kr(e){e.state.focused||(e.display.input.focus(),Cr(e))}function Sr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Or(e))}),100)}function Cr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(he(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),wr(e))}function Or(e,t){e.state.delayingBlurEvent||(e.state.focused&&(he(e,"blur",e,t),e.state.focused=!1,_(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function _r(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,s=void 0,c=0;if(!i.hidden){if(a&&l<8){var u=i.node.offsetTop+i.node.offsetHeight;s=u-n,n=u}else{var f=i.node.getBoundingClientRect();s=f.bottom-f.top,!o&&i.text.firstChild&&(c=i.text.firstChild.getBoundingClientRect().right-f.left-1)}var d=i.line.height-s;if((d>.005||d<-.005)&&(Je(i.line,s),Mr(i.line),i.rest))for(var p=0;p<i.rest.length;p++)Mr(i.rest[p]);if(c>e.display.sizerWidth){var h=Math.ceil(c/ir(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Mr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Ar(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Sn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=Xe(t,r),a=Xe(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=Xe(t,Ht(Ge(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=Xe(t,Ht(Ge(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Tr(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=An(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Cn(n),s=t.top<r,c=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=i&&(a.scrollTop=u)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,d=Mn(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),p=t.right-t.left>d;return p&&(t.right=t.left+d),t.left<10?a.scrollLeft=0:t.left<f?a.scrollLeft=Math.max(0,t.left-(p?0:10)):t.right>d+f-3&&(a.scrollLeft=t.right+(p?0:10)-d),a}function Lr(e,t){null!=t&&(Fr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Er(e){Fr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Dr(e,t,n){null==t&&null==n||Fr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Fr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Nr(e,Kn(e,t.from),Kn(e,t.to),t.margin))}function Nr(e,t,n,r){var i=Tr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Dr(e,i.scrollLeft,i.scrollTop)}function Rr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||si(e,{top:t}),Ir(e,t,!0),n&&si(e),ri(e,100))}function Ir(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Pr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,fi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function jr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Cn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+_n(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var zr=function(e,t,n){this.cm=n;var r=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),fe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),fe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r: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=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r: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==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},zr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zr.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},zr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},zr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Br=function(){};function qr(e,t){t||(t=jr(e));var n=e.display.barWidth,r=e.display.barHeight;$r(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&_r(e),$r(e,jr(e)),n=e.display.barWidth,r=e.display.barHeight}function $r(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Br.prototype.update=function(){return{bottom:0,right:0}},Br.prototype.setScrollLeft=function(){},Br.prototype.setScrollTop=function(){},Br.prototype.clear=function(){};var Hr={native:zr,null:Br};function Wr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Hr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Pr(e,t):Rr(e,t)}),e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Ur=0;function Gr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ur},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function Vr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{an=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)Kr(t[n]);for(var r=0;r<t.length;r++)Jr(t[r]);for(var i=0;i<t.length;i++)Yr(t[i]);for(var o=0;o<t.length;o++)Xr(t[o]);for(var a=0;a<t.length;a++)Qr(t[a])}(e)}))}function Kr(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=_n(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=_n(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Ut(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Jr(e){e.updatedDisplay=e.mustUpdate&&ai(e.cm,e.update)}function Yr(e){var t=e.cm,n=t.display;e.updatedDisplay&&_r(t),e.barMeasure=jr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ln(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+_n(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Mn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Xr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Pr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==D();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qr(t,e.barMeasure),e.updatedDisplay&&ui(t,e.barMeasure),e.selectionChanged&&wr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&kr(e.cm)}function Qr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&li(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Ir(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Pr(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!me(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!h){var o=T("div","​",null,"position: absolute;\n                         top: "+(t.top-n.viewOffset-Sn(e.display))+"px;\n                         height: "+(t.bottom-t.top+_n(e)+n.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,l=Vn(e,t),s=n&&n!=t?Vn(e,n):l,c=Tr(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r}),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(Rr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Pr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}(t,lt(r,e.scrollToPos.from),lt(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||he(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&he(o[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&he(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Zr(e,t){if(e.curOp)return t();Gr(e);try{return t()}finally{Vr(e)}}function ei(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Gr(e);try{return t.apply(e,arguments)}finally{Vr(e)}}}function ti(e){return function(){if(this.curOp)return e.apply(this,arguments);Gr(this);try{return e.apply(this,arguments)}finally{Vr(this)}}}function ni(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Gr(t);try{return e.apply(this,arguments)}finally{Vr(t)}}}function ri(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(ii,e))}function ii(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=pt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?$e(t.mode,r.state):null,s=ft(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!f&&d<a.length;++d)f=a[d]!=o.styles[d];f&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&ht(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ri(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Zr(e,(function(){for(var t=0;t<i.length;t++)dr(e,i[t],"text")}))}}var oi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Ar(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Mn(e),this.force=n,this.dims=or(e),this.events=[]};function ai(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return pr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mr(e))return!1;di(e)&&(pr(e),t.dims=or(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),kt&&(o=zt(e.doc,o),a=Bt(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(ur(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(on(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,ur(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Ht(Ge(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=mr(e);if(!l&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=D();if(!t||!E(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&E(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(t){var n=t.nextSibling;return s&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,f=0;f<c.length;f++){var d=c[f];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=l(a);var p=i&&null!=t&&t<=u&&d.lineNumber;d.changes&&(B(d.changes,"gutter")>-1&&(p=!1),un(e,d,u,n)),p&&(M(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Ze(e.options,u)))),a=d.node.nextSibling}else{var h=vn(e,d,u,n);o.insertBefore(h,a)}u+=d.size}for(;a;)a=l(a)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),M(n.cursorDiv),M(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ri(e,400)),n.updateLineNumbers=null,!0}function li(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Mn(e))r&&(t.visible=Ar(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Cn(e.display)-An(e),n.top)}),t.visible=Ar(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ai(e,t))break;_r(e);var i=jr(e);gr(e),qr(e,i),ui(e,i),t.force=!1}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 si(e,t){var n=new oi(e,t);if(ai(e,n)){_r(e),li(e,n);var r=jr(e);gr(e),qr(e,r),ui(e,r),n.finish()}}function ci(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ui(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+_n(e)+"px"}function fi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ar(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function di(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Ze(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(T("div",[T("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ci(e.display),!0}return!1}function pi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function hi(e){var t=e.gutters,n=e.gutterSpecs;M(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,l=t.appendChild(T("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ci(e)}function mi(e){hi(e.display),fr(e),fi(e)}function gi(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=L("div",null,"CodeMirror-code"),o.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=T("div",null,"CodeMirror-cursors"),o.measure=T("div",null,"CodeMirror-measure"),o.lineMeasure=T("div",null,"CodeMirror-measure"),o.lineSpace=L("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=L("div",[o.lineSpace],"CodeMirror-lines");o.mover=T("div",[c],null,"position: relative"),o.sizer=T("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=T("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=T("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=T("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=T("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&l<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),s||n&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=pi(i.gutters,i.lineNumbers),hi(o),r.init(o)}oi.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},oi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)he.apply(null,this.events[e])};var vi=0,yi=null;function bi(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function xi(e){var t=bi(e);return t.x*=yi,t.y*=yi,t}function wi(e,t){var r=bi(t),i=r.x,o=r.y,a=e.display,l=a.scroller,c=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(i&&c||o&&u){if(o&&y&&s)e:for(var d=t.target,p=a.view;d!=l;d=d.parentNode)for(var h=0;h<p.length;h++)if(p[h].node==d){e.display.currentWheelTarget=d;break e}if(i&&!n&&!f&&null!=yi)return o&&u&&Rr(e,Math.max(0,l.scrollTop+o*yi)),Pr(e,Math.max(0,l.scrollLeft+i*yi)),(!o||o&&u)&&be(t),void(a.wheelStartX=null);if(o&&null!=yi){var m=o*yi,g=e.doc.scrollTop,v=g+a.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),si(e,{top:g,bottom:v})}vi<20&&(null==a.wheelStartX?(a.wheelStartX=l.scrollLeft,a.wheelStartY=l.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=l.scrollLeft-a.wheelStartX,t=l.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(yi=(yi*vi+n)/(vi+1),++vi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?yi=-.53:n?yi=15:u?yi=-.7:d&&(yi=-1/3);var ki=function(e,t){this.ranges=e,this.primIndex=t};ki.prototype.primary=function(){return this.ranges[this.primIndex]},ki.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!nt(n.anchor,r.anchor)||!nt(n.head,r.head))return!1}return!0},ki.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Si(rt(this.ranges[t].anchor),rt(this.ranges[t].head));return new ki(e,this.primIndex)},ki.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ki.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(tt(t,r.from())>=0&&tt(e,r.to())<=0)return n}return-1};var Si=function(e,t){this.anchor=e,this.head=t};function Ci(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=B(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=tt(l.to(),a.from());if(r&&!a.empty()?s>0:s>=0){var c=ot(l.from(),a.from()),u=it(l.to(),a.to()),f=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new Si(f?u:c,f?c:u))}}return new ki(t,n)}function Oi(e,t){return new ki([new Si(e,t||e)],0)}function _i(e){return e.text?et(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Mi(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return _i(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=_i(t).ch-t.to.ch),et(n,r)}function Ai(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Si(Mi(i.anchor,t),Mi(i.head,t)))}return Ci(e.cm,n,e.sel.primIndex)}function Ti(e,t,n){return e.line==t.line?et(n.line,e.ch-t.ch+n.ch):et(n.line+(e.line-t.line),e.ch)}function Li(e){e.doc.mode=ze(e.options,e.doc.modeOption),Ei(e)}function Ei(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ri(e,100),e.state.modeGen++,e.curOp&&fr(e)}function Di(e,t){return 0==t.from.ch&&0==t.to.ch&&""==K(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Fi(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),At(e),Tt(e,n);var i=r?r(e):1;i!=e.height&&Je(e,i)}(e,n,i,r),sn(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new Gt(c[o],i(o),r));return n}var l=t.from,s=t.to,c=t.text,u=Ge(e,l.line),f=Ge(e,s.line),d=K(c),p=i(c.length-1),h=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Di(e,t)){var m=a(0,c.length-1);o(f,f.text,p),h&&e.remove(l.line,h),m.length&&e.insert(l.line,m)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,l.ch)+d+u.text.slice(s.ch),p);else{var g=a(1,c.length-1);g.push(new Gt(d+u.text.slice(s.ch),p,r)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,g)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+f.text.slice(s.ch),i(0)),e.remove(l.line+1,h);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(f,d+f.text.slice(s.ch),p);var v=a(1,c.length-1);h>1&&e.remove(l.line+1,h-1),e.insert(l.line+1,v)}sn(e,"change",e,t)}function Ni(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;a<r.linked.length;++a){var l=r.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;n&&!s||(t(l.doc,s),e(l.doc,r,s))}}}(e,null,!0)}function Ri(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,sr(e),Li(e),Ii(e),e.options.lineWrapping||Ut(e),e.options.mode=t.modeOption,fr(e)}function Ii(e){("rtl"==e.doc.direction?F:_)(e.display.lineDiv,"CodeMirror-rtl")}function Pi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ji(e,t){var n={from:rt(t.from),to:_i(t),text:Ve(e,t.from,t.to)};return Hi(e,n,t.from.line,t.to.line+1),Ni(e,(function(e){return Hi(e,n,t.from.line,t.to.line+1)}),!0),n}function zi(e){for(;e.length&&K(e).ranges;)e.pop()}function Bi(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(zi(e.done),K(e.done)):e.done.length&&!K(e.done).ranges?K(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}(i,i.lastOp==r)))a=K(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=_i(t):o.changes.push(ji(e,t));else{var s=K(i.done);for(s&&s.ranges||$i(e.sel,i.done),o={changes:[ji(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(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||he(e,"historyAdded")}function qi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,K(i.done),t))?i.done[i.done.length-1]=t:$i(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&zi(i.undone)}function $i(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Hi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Wi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Ui(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Wi(n[i]));return r}(e,t),r=_t(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function Gi(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?ki.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];r.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&B(t,Number(u[1]))>-1&&(K(l)[f]=c[f],delete c[f])}}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=tt(t,i)<0;o!=tt(n,i)<0?(i=t,t=n):o!=tt(t,n)<0&&(t=n)}return new Si(i,t)}return new Si(n||t,t)}function Ki(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Zi(e,new ki([Vi(e.sel.primary(),t,n,i)],0),r)}function Ji(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Vi(e.sel.ranges[o],t[o],null,i);Zi(e,Ci(e.cm,r,e.sel.primIndex),n)}function Yi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Zi(e,Ci(e.cm,i,e.sel.primIndex),r)}function Xi(e,t,n,r){Zi(e,Oi(t,n),r)}function Qi(e,t,n){var r=e.history.done,i=K(r);i&&i.ranges?(r[r.length-1]=t,eo(e,t,n)):Zi(e,t,n)}function Zi(e,t,n){eo(e,t,n),qi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function eo(e,t,n){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Si(lt(e,t[n].anchor),lt(e,t[n].head))},origin:n&&n.origin};return he(e,"beforeSelectionChange",e,r),e.cm&&he(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ci(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);to(e,ro(e,t,r,!0)),n&&!1===n.scroll||!e.cm||Er(e.cm)}function to(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ge(e.cm)),sn(e,"cursorActivity",e))}function no(e){to(e,ro(e,e.sel,null,!1))}function ro(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=oo(e,a.anchor,l&&l.anchor,n,r),c=oo(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Si(s,c))}return i?Ci(e.cm,i,t.primIndex):t}function io(e,t,n,r,i){var o=Ge(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,u="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==l.from||(c?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(u?l.to>=t.ch:l.to>t.ch))){if(i&&(he(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var f=s.find(r<0?1:-1),d=void 0;if((r<0?u:c)&&(f=ao(e,f,-r,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(d=tt(f,n))&&(r<0?d<0:d>0))return io(e,f,t,r,i)}var p=s.find(r<0?-1:1);return(r<0?c:u)&&(p=ao(e,p,r,p.line==t.line?o:null)),p?io(e,p,t,r,i):null}}return t}function oo(e,t,n,r,i){var o=r||1,a=io(e,t,n,o,i)||!i&&io(e,t,n,o,!0)||io(e,t,n,-o,i)||!i&&io(e,t,n,-o,!0);return a||(e.cantEdit=!0,et(e.first,0))}function ao(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?lt(e,et(t.line-1)):null:n>0&&t.ch==(r||Ge(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+n)}function lo(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),$)}function so(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=lt(e,t)),n&&(r.to=lt(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),he(e,"beforeChange",e,r),e.cm&&he(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function co(e,t,n){if(e.cm){if(!e.cm.curOp)return ei(e.cm,co)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))||(t=so(e,t,!0))){var r=wt&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=B(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(tt(c.to,l.from)<0||tt(c.from,l.to)>0)){var u=[s,1],f=tt(c.from,l.from),d=tt(c.to,l.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)uo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else uo(e,t)}}function uo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Ai(e,t);Bi(e,t,n,e.cm?e.cm.curOp.id:NaN),ho(e,t,n,_t(e,t));var r=[];Ni(e,(function(e,n){n||-1!=B(r,e.history)||(yo(e.history,t),r.push(e.history)),ho(e,t,null,_t(e,t))}))}}function fo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,l="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,c=0;c<l.length&&(i=l[c],n?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=l.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=l.pop()).ranges){if(r)return void l.push(i);break}if($i(i,s),n&&!i.equals(e.sel))return void Zi(e,i,{clearRedo:!1});a=i}var u=[];$i(a,s),s.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),d=function(n){var r=i.changes[n];if(r.origin=t,f&&!so(e,r,!1))return l.length=0,{};u.push(ji(e,r));var o=n?Ai(e,r):K(l);ho(e,r,o,Ui(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:_i(r)});var a=[];Ni(e,(function(e,t){t||-1!=B(a,e.history)||(yo(e.history,r),a.push(e.history)),ho(e,r,null,Ui(e,r))}))},p=i.changes.length-1;p>=0;--p){var h=d(p);if(h)return h.v}}}}function po(e,t){if(0!=t&&(e.first+=t,e.sel=new ki(J(e.sel.ranges,(function(e){return new Si(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){fr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)dr(e.cm,r,"gutter")}}function ho(e,t,n,r){if(e.cm&&!e.cm.curOp)return ei(e.cm,ho)(e,t,n,r);if(t.to.line<e.first)po(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);po(e,i),t={from:et(e.first,0),to:et(t.to.line+i,t.to.ch),text:[K(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:et(o,Ge(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ve(e,t.from,t.to),n||(n=Ai(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=Ye(jt(Ge(r,o.line))),r.iter(s,a.line+1,(function(e){if(e==i.maxLine)return l=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ge(e),Fi(r,t,n,lr(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,(function(e){var t=Wt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)})),l&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Ge(e,r).stateAfter;if(i&&(!(i instanceof ct)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,o.line),ri(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?fr(e):o.line!=a.line||1!=t.text.length||Di(e.doc,t)?fr(e,o.line,a.line+1,c):dr(e,o.line,"text");var u=ve(e,"changes"),f=ve(e,"change");if(f||u){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&sn(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,r):Fi(e,t,r),eo(e,n,$),e.cantEdit&&oo(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function mo(e,t,n,r,i){var o;r||(r=n),tt(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),co(e,{from:n,to:r,text:t,origin:i})}function go(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function vo(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)go(o.ranges[l].anchor,t,n,r),go(o.ranges[l].head,t,n,r)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(n<c.from.line)c.from=et(c.from.line+r,c.from.ch),c.to=et(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function yo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;vo(e.done,n,r,i),vo(e.undone,n,r,i)}function bo(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Ge(e,at(e,t)):i=Ye(t),null==i?null:(r(o,i)&&e.cm&&dr(e.cm,i,n),o)}function xo(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function wo(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Si.prototype.from=function(){return ot(this.anchor,this.head)},Si.prototype.to=function(){return it(this.anchor,this.head)},Si.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},xo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Vt(i),sn(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},wo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof xo))){var l=[];this.collapse(l),this.children=[new xo(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new xo(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new wo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=B(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new wo(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var ko=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function So(e,t,n){Ht(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Lr(e,n)}ko.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Ye(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=wn(this);Je(n,Math.max(0,n.height-o)),e&&(Zr(e,(function(){So(e,n,-o),dr(e,r,"widget")})),sn(e,"lineWidgetCleared",e,this,r))}},ko.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=wn(this)-t;i&&(qt(this.doc,r)||Je(r,r.height+i),n&&Zr(n,(function(){n.curOp.forceUpdate=!0,So(n,r,i),sn(n,"lineWidgetChanged",n,e,Ye(r))})))},ye(ko);var Co=0,Oo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Co};function _o(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=P(r)).shared=!1;var o=[_o(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Ni(e,(function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(_o(e,lt(e,t),lt(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=K(o)})),new Mo(o,a)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ei(e.cm,_o)(e,t,n,r,i);var o=new Oo(e,i),a=tt(t,n);if(r&&P(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=L("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Pt(e,t.line,t,n,o)||t.line!=n.line&&Pt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");kt=!0}o.addToHistory&&Bi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&jt(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&Je(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new St(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){qt(e,t)&&Je(t,0)})),o.clearOnEnter&&fe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(wt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Co,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)fr(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)dr(c,u,"text");o.atomic&&no(c.doc),sn(c,"markerAdded",c,o)}return o}Oo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Gr(e),ve(this,"clear")){var n=this.find();n&&sn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=Ct(a.markedSpans,this);e&&!this.collapsed?dr(e,Ye(a),"text"):e&&(null!=l.to&&(i=Ye(a)),null!=l.from&&(r=Ye(a))),a.markedSpans=Ot(a.markedSpans,l),null==l.from&&this.collapsed&&!qt(this.doc,a)&&e&&Je(a,rr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var c=jt(this.lines[s]),u=Wt(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&fr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&sn(e,"markerCleared",e,this,r,i),t&&Vr(e),this.parent&&this.parent.clear()}},Oo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Ct(o.markedSpans,this);if(null!=a.from&&(n=et(t?o:Ye(o),a.from),-1==e))return n;if(null!=a.to&&(r=et(t?o:Ye(o),a.to),1==e))return r}return n&&{from:n,to:r}},Oo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Zr(r,(function(){var i=t.line,o=Ye(t.line),a=En(r,o);if(a&&(jn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!qt(n.doc,i)&&null!=n.height){var l=n.height;n.height=null;var s=wn(n)-l;s&&Je(i,i.height+s)}sn(r,"markerChanged",r,e)}))},Oo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Oo.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(Oo);var Mo=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Ao(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function To(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Ni(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==B(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}Mo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sn(this,"clear")}},Mo.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Mo);var Lo=0,Eo=function(e,t,n,r,i){if(!(this instanceof Eo))return new Eo(e,t,n,r,i);null==n&&(n=0),wo.call(this,[new xo([new Gt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=et(n,0);this.sel=Oi(o),this.history=new Pi(null),this.id=++Lo,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Fi(this,{from:o,to:o,text:e}),Zi(this,Oi(o),$)};Eo.prototype=X(wo.prototype,{constructor:Eo,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ke(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ni((function(e){var t=et(this.first,0),n=this.first+this.size-1;co(this,{from:t,to:et(n,Ge(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Dr(this.cm,0,0),Zi(this,Oi(t),$)})),replaceRange:function(e,t,n,r){mo(this,e,t=lt(this,t),n=n?lt(this,n):t,r)},getRange:function(e,t,n){var r=Ve(this,lt(this,e),lt(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qe(this,e))return Ge(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ge(this,e)),jt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return lt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ni((function(e,t,n){Xi(this,lt(this,"number"==typeof e?et(e,t||0):e),null,n)})),setSelection:ni((function(e,t,n){Xi(this,lt(this,e),lt(this,t||e),n)})),extendSelection:ni((function(e,t,n){Ki(this,lt(this,e),t&&lt(this,t),n)})),extendSelections:ni((function(e,t){Ji(this,st(this,e),t)})),extendSelectionsBy:ni((function(e,t){Ji(this,st(this,J(this.sel.ranges,e)),t)})),setSelections:ni((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Si(lt(this,e[i].anchor),lt(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Zi(this,Ci(this.cm,r,t),n)}})),addSelection:ni((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Si(lt(this,e),lt(this,t||e))),Zi(this,Ci(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Ve(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Ve(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:ni((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&"end"!=t&&function(e,t,n){for(var r=[],i=et(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Ti(l.from,i,o),c=Ti(_i(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],f=tt(u.head,u.anchor)<0;r[a]=new Si(f?c:s,f?s:c)}else r[a]=new Si(s,s)}return new ki(r,e.sel.primIndex)}(this,r,t),s=r.length-1;s>=0;s--)co(this,r[s]);l?Qi(this,l):this.cm&&Er(this.cm)})),undo:ni((function(){fo(this,"undo")})),redo:ni((function(){fo(this,"redo")})),undoSelection:ni((function(){fo(this,"undo",!0)})),redoSelection:ni((function(){fo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Pi(this.history.maxGeneration),Ni(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Gi(this.history.done),undone:Gi(this.history.undone)}},setHistory:function(e){var t=this.history=new Pi(this.history.maxGeneration);t.done=Gi(e.done.slice(0),null,!0),t.undone=Gi(e.undone.slice(0),null,!0)},setGutterMarker:ni((function(e,t,n){return bo(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&te(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:ni((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bo(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,te(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Qe(this,e))return null;if(t=e,!(e=Ge(this,e)))return null}else if(null==(t=Ye(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ni((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(C(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:ni((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(C(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:ni((function(e,t,n){return function(e,t,n,r){var i=new ko(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),bo(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!qt(e,t)){var r=Ht(t)<e.scrollTop;Je(t,t.height+wn(i)),r&&Lr(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&sn(o,"lineWidgetAdded",o,i,"number"==typeof t?t:Ye(t)),i}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return _o(this,lt(this,e),lt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return _o(this,e=lt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ge(this,(e=lt(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=lt(this,e),t=lt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),lt(this,et(n,t))},indexFromPos:function(e){var t=(e=lt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Eo(Ke(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Eo(Ke(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(tt(o,a)){var l=_o(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}(r,Ao(this)),r},unlinkDoc:function(e){if(e instanceof Ma&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),To(Ao(this));break}if(e.history==this.history){var n=[e.id];Ni(e,(function(e){return n.push(e.id)}),!0),e.history=new Pi(null),e.history.done=Gi(this.history.done,n),e.history.undone=Gi(this.history.undone,n)}},iterLinkedDocs:function(e){Ni(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ee(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ni((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Zr(t=this.cm,(function(){Ii(t),fr(t)})))}))}),Eo.prototype.eachLine=Eo.prototype.iter;var Do=0;function Fo(e){var t=this;if(No(t),!me(t,e)&&!kn(t.display,e)){be(e),a&&(Do=+new Date);var n=cr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),l=0,s=function(){++l==i&&ei(t,(function(){var e={from:n=lt(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};co(t.doc,e),Qi(t.doc,Oi(lt(t.doc,n),lt(t.doc,_i(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==B(t.options.allowDropFileTypes,e.type))s();else{var r=new FileReader;r.onerror=function(){return s()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),s()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),eo(t.doc,Oi(n,n)),d)for(var p=0;p<d.length;++p)mo(t.doc,"",d[p].anchor,d[p].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(e){}}}}function No(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ro(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Io=!1;function Po(){var e;Io||(fe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Ro(jo)}),100))})),fe(window,"blur",(function(){return Ro(Or)})),Io=!0)}function jo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var zo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Bo=0;Bo<10;Bo++)zo[Bo+48]=zo[Bo+96]=String(Bo);for(var qo=65;qo<=90;qo++)zo[qo]=String.fromCharCode(qo);for(var $o=1;$o<=12;$o++)zo[$o+111]=zo[$o+63235]="F"+$o;var Ho={};function Wo(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Uo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=J(n.split(" "),Wo),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function Go(e,t,n,r){var i=(t=Yo(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Go(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Go(e,t.fallthrough[o],n,r);if(a)return a}}}function Vo(e){var t="string"==typeof e?e:zo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ko(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(k?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(k?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Jo(e,t){if(f&&34==e.keyCode&&e.char)return!1;var n=zo[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ko(n,e,t))}function Yo(e){return"string"==typeof e?Ho[e]:e}function Xo(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&tt(o.from,K(r).to)<=0;){var a=r.pop();if(tt(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Zr(e,(function(){for(var t=r.length-1;t>=0;t--)mo(e.doc,"",r[t].from,r[t].to,"+delete");Er(e)}))}function Qo(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Zo(e,t,n){var r=Qo(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function ea(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ce(n,t.doc.direction);if(o){var a,l=i<0?K(o):o[0],s=i<0==(1==l.level)?"after":"before";if(l.level>0||"rtl"==t.doc.direction){var c=Dn(t,n);a=i<0?n.text.length-1:0;var u=Fn(t,c,a).top;a=oe((function(e){return Fn(t,c,e).top==u}),i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=Qo(n,a,1))}else a=i<0?l.to:l.from;return new et(r,a,s)}}return new et(r,i<0?n.text.length:0,i<0?"before":"after")}Ho.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ho.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ho.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ho.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ho.default=y?Ho.macDefault:Ho.pcDefault;var ta={selectAll:lo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return Xo(e,(function(t){if(t.empty()){var n=Ge(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Xo(e,(function(t){return{from:et(t.from().line,0),to:lt(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Xo(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Xo(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Xo(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return na(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ge(e.doc,t),r=function(e){for(var t;t=Rt(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Ye(r)),ea(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),W)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),W)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ra(e,t.head):r}),W)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=j(e.getLine(o.line),o.ch,r);t.push(V(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Zr(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=Ge(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new et(i.line,i.ch-1)),i.ch>0)i=new et(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Ge(e.doc,i.line-1).text;a&&(i=new et(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(i.line-1,a.length-1),i,"+transpose"))}n.push(new Si(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Zr(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Er(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function na(e,t){var n=Ge(e.doc,t),r=jt(n);return r!=n&&(t=Ye(r)),ea(!0,e,r,t,1)}function ra(e,t){var n=na(e,t.line),r=Ge(e.doc,n.line),i=ce(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return et(n.line,a?0:o,n.sticky)}return n}function ia(e,t,n){if("string"==typeof t&&!(t=ta[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=q}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var oa=new z;function aa(e,t,n,r){var i=e.state.keySeq;if(i){if(Vo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:oa.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),la(e,i+" "+t,n,r))return!0}return la(e,t,n,r)}function la(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Go(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Go(t,e.options.extraKeys,n,e)||Go(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&sn(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(be(n),wr(e)),!!i}function sa(e,t){var n=Jo(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?aa(e,"Shift-"+n,t,(function(t){return ia(e,t,!0)}))||aa(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ia(e,t)})):aa(e,n,t,(function(t){return ia(e,t)})))}var ca=null;function ua(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=D(),me(t,e)))){a&&l<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=sa(t,e);f&&(ca=i?r:null,i||88!=r||Fe||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(_(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n))}F(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n)}(t)}}function fa(e){16==e.keyCode&&(this.doc.sel.shift=!1),me(this,e)}function da(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||kn(t.display,e)||me(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==ca)return ca=null,void be(e);if(!f||e.which&&!(e.which<10)||!sa(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return aa(e,"'"+n+"'",t,(function(t){return ia(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var pa,ha,ma=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ga(e){var t=this,n=t.display;if(!(me(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,kn(n,e))s||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!ba(t,e)){var r=cr(t,e),i=Ce(e),o=r?function(e,t){var n=+new Date;return ha&&ha.compare(n,e,t)?(pa=ha=null,"triple"):pa&&pa.compare(n,e,t)?(ha=new ma(n,e,t),pa=null,"double"):(pa=new ma(n,e,t),ha=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),aa(e,Ko(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=ta[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=q}finally{e.state.suppressEdits=!1}return r}))}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){a?setTimeout(I(kr,e),0):e.curOp.focus=D();var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey)),i}(e,n,r),c=e.doc.sel;e.options.dragDrop&&Me&&!e.isReadOnly()&&"single"==n&&(i=c.contains(t))>-1&&(tt((i=c.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,c=ei(e,(function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,pe(i.wrapper.ownerDocument,"mouseup",c),pe(i.wrapper.ownerDocument,"mousemove",u),pe(i.scroller,"dragstart",f),pe(i.scroller,"drop",c),o||(be(t),r.addNew||Ki(e.doc,n,null,null,r.extend),s&&!d||a&&9==l?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return o=!0};s&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),fe(i.wrapper.ownerDocument,"mouseup",c),fe(i.wrapper.ownerDocument,"mousemove",u),fe(i.scroller,"dragstart",f),fe(i.scroller,"drop",c),Sr(e),setTimeout((function(){return i.input.focus()}),20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;be(t);var a,l,s=o.sel,c=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),a=l>-1?c[l]:new Si(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new Si(n,n)),n=cr(e,t,!0,!0),l=-1;else{var u=va(e,n,r.unit);a=r.extend?Vi(a,u.anchor,u.head,r.extend):u}r.addNew?-1==l?(l=c.length,Zi(o,Ci(e,c.concat([a]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(Zi(o,Ci(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):Yi(o,l,a,H):(l=0,Zi(o,new ki([a],0),H),s=o.sel);var f=n;function d(t){if(0!=tt(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],c=e.options.tabSize,u=j(Ge(o,n.line).text,n.ch,c),d=j(Ge(o,t.line).text,t.ch,c),p=Math.min(u,d),h=Math.max(u,d),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Ge(o,m).text,y=U(v,p,c);p==h?i.push(new Si(et(m,y),et(m,y))):v.length>y&&i.push(new Si(et(m,y),et(m,U(v,h,c))))}i.length||i.push(new Si(n,n)),Zi(o,Ci(e,s.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,w=va(e,t,r.unit),k=x.anchor;tt(w.anchor,k)>0?(b=w.head,k=ot(x.from(),w.anchor)):(b=w.anchor,k=it(x.to(),w.head));var S=s.ranges.slice(0);S[l]=function(e,t){var n=t.anchor,r=t.head,i=Ge(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var o=ce(i);if(!o)return t;var a=le(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s,c=a+(l.from==n.ch==(1!=l.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=le(o,r.ch,r.sticky),f=u-a||(r.ch-n.ch)*(1==l.level?-1:1);s=u==c-1||u==c?f<0:f>0}var d=o[c+(s?-1:0)],p=s==(1==d.level),h=p?d.from:d.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new Si(new et(n.line,h,m),r)}(e,new Si(lt(o,k),b)),Zi(o,Ci(e,S,l),H)}}var p=i.wrapper.getBoundingClientRect(),h=0;function m(t){e.state.selectingText=!1,h=1/0,t&&(be(t),i.input.focus()),pe(i.wrapper.ownerDocument,"mousemove",g),pe(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var g=ei(e,(function(t){0!==t.buttons&&Ce(t)?function t(n){var a=++h,l=cr(e,n,!0,"rectangle"==r.unit);if(l)if(0!=tt(l,f)){e.curOp.focus=D(),d(l);var s=Ar(i,o);(l.line>=s.to||l.line<s.from)&&setTimeout(ei(e,(function(){h==a&&t(n)})),150)}else{var c=n.clientY<p.top?-20:n.clientY>p.bottom?20:0;c&&setTimeout(ei(e,(function(){h==a&&(i.scroller.scrollTop+=c,t(n))})),50)}}(t):m(t)})),v=ei(e,m);e.state.selectingText=v,fe(i.wrapper.ownerDocument,"mousemove",g),fe(i.wrapper.ownerDocument,"mouseup",v)}(e,r,t,o)}(t,r,o,e):Se(e)==n.scroller&&be(e):2==i?(r&&Ki(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):Sr(t)))}}function va(e,t,n){if("char"==n)return new Si(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Si(et(t.line,0),lt(e.doc,et(t.line+1,0)));var r=n(e,t);return new Si(r.from,r.to)}function ya(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&be(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!ve(e,n))return we(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i)return he(e,n,e,Xe(e.doc,o),e.display.gutterSpecs[s].className,t),we(t)}}function ba(e,t){return ya(e,t,"gutterClick",!0)}function xa(e,t){kn(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function wa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Bn(e)}ma.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var ka={toString:function(){return"CodeMirror.Init"}},Sa={},Ca={};function Oa(e,t,n){if(!t!=!(n&&n!=ka)){var r=e.display.dragFunctions,i=t?fe:pe;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function _a(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),Ut(e)),sr(e),fr(e),Bn(e),setTimeout((function(){return qr(e)}),100)}function Ma(e,t){var n=this;if(!(this instanceof Ma))return new Ma(e,t);this.options=t=t?P(t):{},P(Sa,t,!1);var r=t.value;"string"==typeof r?r=new Eo(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ma.inputStyles[t.inputStyle](this),o=this.display=new gi(e,r,i,t);for(var c in o.wrapper.CodeMirror=this,wa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wr(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 z,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&l<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;fe(t.scroller,"mousedown",ei(e,ga)),fe(t.scroller,"dblclick",a&&l<11?ei(e,(function(t){if(!me(e,t)){var n=cr(e,t);if(n&&!ba(e,t)&&!kn(e.display,t)){be(t);var r=e.findWordAt(n);Ki(e.doc,r.anchor,r.head)}}})):function(t){return me(e,t)||be(t)}),fe(t.scroller,"contextmenu",(function(t){return xa(e,t)})),fe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||xa(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}fe(t.scroller,"touchstart",(function(i){if(!me(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!ba(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!kn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,l=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new Si(l,l):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(l):new Si(et(l.line,0),lt(e.doc,et(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(n)}i()})),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Rr(e,t.scroller.scrollTop),Pr(e,t.scroller.scrollLeft,!0),he(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return wi(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return wi(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||ke(t)},over:function(t){me(e,t)||(function(e,t){var n=cr(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,r)}}(e,t),ke(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Do<100))ke(t);else if(!me(e,t)&&!kn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=T("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}(e,t)},drop:ei(e,Fo),leave:function(t){me(e,t)||No(e)}};var s=t.input.getField();fe(s,"keyup",(function(t){return fa.call(e,t)})),fe(s,"keydown",ei(e,ua)),fe(s,"keypress",ei(e,da)),fe(s,"focus",(function(t){return Cr(e,t)})),fe(s,"blur",(function(t){return Or(e,t)}))}(this),Po(),Gr(this),this.curOp.forceUpdate=!0,Ri(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(I(Cr,this),20):Or(this),Ca)Ca.hasOwnProperty(c)&&Ca[c](this,t[c],ka);di(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Aa.length;++u)Aa[u](this);Vr(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Ma.defaults=Sa,Ma.optionHandlers=Ca;var Aa=[];function Ta(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=pt(e,t).state:n="prev");var a=e.options.tabSize,l=Ge(o,t),s=j(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==q||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?j(Ge(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,f+="\t";if(d<c&&(f+=V(c-d)),f!=u)return mo(o,f,et(t,0),et(t,u.length),"+input"),l.stateAfter=null,!0;for(var h=0;h<o.sel.ranges.length;h++){var m=o.sel.ranges[h];if(m.head.line==t&&m.head.ch<u.length){var g=et(t,u.length);Yi(o,h,new Si(g,g));break}}}Ma.defineInitHook=function(e){return Aa.push(e)};var La=null;function Ea(e){La=e}function Da(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,l="paste"==i||e.state.pasteIncoming>a,s=Ee(t),c=null;if(l&&r.ranges.length>1)if(La&&La.text.join("\n")==t){if(r.ranges.length%La.text.length==0){c=[];for(var u=0;u<La.text.length;u++)c.push(o.splitLines(La.text[u]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=J(s,(function(e){return[e]})));for(var f=e.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var p=r.ranges[d],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=et(h.line,h.ch-n):e.state.overwrite&&!l?m=et(m.line,Math.min(Ge(o,m.line).text.length,m.ch+K(s).length)):l&&La&&La.lineWise&&La.text.join("\n")==s.join("\n")&&(h=m=et(h.line,0)));var g={from:h,to:m,text:c?c[d%c.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};co(e.doc,g),sn(e,"inputRead",e,g)}t&&!l&&Na(e,t),Er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Fa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Zr(t,(function(){return Da(t,n,0,null,"paste")})),!0}function Na(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Ta(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ge(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Ta(e,i.head.line,"smart"));a&&sn(e,"electricInput",e,i.head.line)}}}function Ra(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:et(i,0),head:et(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Ia(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Pa(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Ia(e),t}function ja(e,t,n,r,i){var o=t,a=n,l=Ge(e,t.line),s=i&&"rtl"==e.direction?-n:n;function c(r){var o,a;if(null==(o=i?function(e,t,n,r){var i=ce(t,e.doc.direction);if(!i)return Zo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=le(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Zo(t,n,r);var l,s=function(e,n){return Qo(t,e instanceof et?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(l=l||Dn(e,t),Qn(e,t,l,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?s(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var f=1==a.level==r<0,d=s(n,f?1:-1);if(null!=d&&(f?d<=a.to&&d<=u.end:d>=a.from&&d>=u.begin)){var p=f?"before":"after";return new et(n.line,d,p)}}var h=function(e,t,r){for(var o=function(e,t){return t?new et(n.line,s(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),c=l?r.begin:s(r.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),r.begin<=c&&c<r.end)return o(c,l)}},m=h(o+r,r,u);if(m)return m;var g=r>0?u.end:s(u.begin,-1);return null==g||r>0&&g==t.text.length||!(m=h(r>0?0:i.length-1,r,c(g)))?null:m}(e.cm,l,t,n):Zo(l,t,n))){if(r||(a=t.line+s)<e.first||a>=e.first+e.size||(t=new et(a,t.ch,t.sticky),!(l=Ge(e,a))))return!1;t=ea(i,e.cm,l,t.line,s)}else t=o;return!0}if("char"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,f="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var h=l.text.charAt(t.ch)||"\n",m=ee(h,d)?"w":f&&"\n"==h?"n":!f||/\s/.test(h)?null:"p";if(!f||p||m||(m="s"),u&&u!=m){n<0&&(n=1,c(),t.sticky="after");break}if(m&&(u=m),n>0&&!c(!p))break}var g=oo(e,t,o,a,!0);return nt(o,g)&&(g.hitSide=!0),g}function za(e,t,n,r){var i,o,a=e.doc,l=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*rr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Yn(e,l,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ba=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function qa(e,t){var n=En(e,t.line);if(!n||n.hidden)return null;var r=Ge(e.doc,t.line),i=Tn(n,r,t.line),o=ce(r,e.doc.direction),a="left";o&&(a=le(o,t.ch)%2?"right":"left");var l=In(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function $a(e,t){return t&&(e.bad=!0),e}function Ha(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return $a(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Wa(o,t,n)}}function Wa(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!E(r,t))return $a(et(Ye(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?K(e.rest):e.line;return $a(et(Ye(o),o.text.length),i)}var a=3==t.nodeType?t:null,l=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,c=s.maps;function u(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?s.map:c[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var u=Ye(i<0?e.line:e.rest[i]),f=o[a]+r;return(r<0||l!=t)&&(f=o[a+(r?1:0)]),et(u,f)}}}var f=u(a,l,n);if(f)return $a(f,i);for(var d=l.nextSibling,p=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(f=u(d,d.firstChild,0))return $a(et(f.line,f.ch-p),i);p+=d.textContent.length}for(var h=l.previousSibling,m=n;h;h=h.previousSibling){if(f=u(h,h.firstChild,-1))return $a(et(f.line,f.ch+m),i);m+=h.textContent.length}}Ba.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!me(r,e)){if(r.somethingSelected())Ea({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Ra(r);Ea({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,$),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=La.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var l=Pa(),s=l.firstChild;r.display.lineSpace.insertBefore(l,r.display.lineSpace.firstChild),s.value=La.text.join("\n");var c=document.activeElement;R(s),setTimeout((function(){r.display.lineSpace.removeChild(l),c.focus(),c==i&&n.showPrimarySelection()}),50)}}Ia(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),fe(i,"paste",(function(e){!o(e)||me(r,e)||Fa(e,r)||l<=11&&setTimeout(ei(r,(function(){return t.updateFromDOM()})),20)})),fe(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),fe(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),fe(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),fe(i,"touchstart",(function(){return n.forceCompositionEnd()})),fe(i,"input",(function(){t.composing||t.readFromDOMSoon()})),fe(i,"copy",a),fe(i,"cut",a)},Ba.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ba.prototype.prepareSelection=function(){var e=vr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ba.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ba.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ba.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=Ha(t,e.anchorNode,e.anchorOffset),l=Ha(t,e.focusNode,e.focusOffset);if(!a||a.bad||!l||l.bad||0!=tt(ot(a,l),i)||0!=tt(it(a,l),o)){var s=t.display.view,c=i.line>=t.display.viewFrom&&qa(t,i)||{node:s[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&qa(t,o);if(!u){var f=s[s.length-1].measure,d=f.maps?f.maps[f.maps.length-1]:f.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var p,h=e.rangeCount&&e.getRangeAt(0);try{p=O(c.node,c.offset,u.offset,u.node)}catch(e){}p&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),h&&null==e.anchorNode?e.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ba.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Ba.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},Ba.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ba.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},Ba.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ba.prototype.blur=function(){this.div.blur()},Ba.prototype.getField=function(){return this.div},Ba.prototype.supportsTouch=function(){return!0},Ba.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Zr(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Ba.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ba.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Ha(t,e.anchorNode,e.anchorOffset),r=Ha(t,e.focusNode,e.focusOffset);n&&r&&Zr(t,(function(){Zi(t.doc,Oi(n,r),$),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Ba.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=et(a.line-1,Ge(r.doc,a.line-1).length)),l.ch==Ge(r.doc,l.line).text.length&&l.line<r.lastLine()&&(l=et(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=ur(r,a.line))?(t=Ye(i.view[0].line),n=i.view[0].node):(t=Ye(i.view[e].line),n=i.view[e-1].node.nextSibling);var s,c,u=ur(r,l.line);if(u==i.view.length-1?(s=i.viewTo-1,c=i.lineDiv.lastChild):(s=Ye(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function c(){a&&(o+=l,s&&(o+=l),a=s=!1)}function u(e){e&&(c(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,d=t.getAttribute("cm-marker");if(d){var p=e.findMarks(et(r,0),et(i+1,0),function(e){return function(t){return t.id==e}}(+d));return void(p.length&&(o=p[0].find(0))&&u(Ve(e.doc,o.from,o.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&c();for(var m=0;m<t.childNodes.length;m++)f(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),h&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;f(t),t!=n;)t=t.nextSibling,s=!1;return o}(r,n,c,t,s)),d=Ve(r.doc,et(t,0),et(s,Ge(r.doc,s).text.length));f.length>1&&d.length>1;)if(K(f)==K(d))f.pop(),d.pop(),s--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var p=0,h=0,m=f[0],g=d[0],v=Math.min(m.length,g.length);p<v&&m.charCodeAt(p)==g.charCodeAt(p);)++p;for(var y=K(f),b=K(d),x=Math.min(y.length-(1==f.length?p:0),b.length-(1==d.length?p:0));h<x&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;if(1==f.length&&1==d.length&&t==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)p--,h++;f[f.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),f[0]=f[0].slice(p).replace(/\u200b+$/,"");var w=et(t,p),k=et(s,d.length?K(d).length-h:0);return f.length>1||f[0]||tt(w,k)?(mo(r.doc,f,w,k,"+input"),!0):void 0},Ba.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ba.prototype.reset=function(){this.forceCompositionEnd()},Ba.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ba.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.updateFromDOM()}),80))},Ba.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Zr(this.cm,(function(){return fr(e.cm)}))},Ba.prototype.setUneditable=function(e){e.contentEditable="false"},Ba.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,Da)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ba.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ba.prototype.onContextMenu=function(){},Ba.prototype.resetPosition=function(){},Ba.prototype.needsContentAttribute=!0;var Ua=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};Ua.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!me(r,e)){if(r.somethingSelected())Ea({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Ra(r);Ea({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,$):(n.prevInput="",i.value=t.text.join("\n"),R(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),fe(i,"input",(function(){a&&l>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),fe(i,"paste",(function(e){me(r,e)||Fa(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),fe(i,"cut",o),fe(i,"copy",o),fe(e.scroller,"paste",(function(t){if(!kn(e,t)&&!me(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),fe(e.lineSpace,"selectstart",(function(t){kn(e,t)||be(t)})),fe(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Ua.prototype.createField=function(e){this.wrapper=Pa(),this.textarea=this.wrapper.firstChild},Ua.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ua.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vr(e);if(e.options.moveInputWithCursor){var i=Vn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Ua.prototype.showSelection=function(e){var t=this.cm.display;A(t.cursorDiv,e.cursors),A(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ua.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&R(this.textarea),a&&l>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&l>=9&&(this.hasSelection=null))}},Ua.prototype.getField=function(){return this.textarea},Ua.prototype.supportsTouch=function(){return!1},Ua.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ua.prototype.blur=function(){this.textarea.blur()},Ua.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ua.prototype.receivedFocus=function(){this.slowPoll()},Ua.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Ua.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Ua.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||De(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&l>=9&&this.hasSelection===i||y&&/[\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||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,c=Math.min(r.length,i.length);s<c&&r.charCodeAt(s)==i.charCodeAt(s);)++s;return Zr(t,(function(){Da(t,i.slice(s),r.length-s,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.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},Ua.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ua.prototype.onKeyPress=function(){a&&l>=9&&(this.hasSelection=null),this.fastPoll()},Ua.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=cr(n,e),c=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ei(n,Zi)(n.doc,Oi(o),$);var u,d=i.style.cssText,p=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n      z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(u=window.scrollY),r.input.focus(),s&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&l>=9&&g(),S){ke(e);var m=function(){pe(window,"mouseup",m),setTimeout(v,20)};fe(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=d,a&&l<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&l<9)&&g();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ei(n,lo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Ua.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Ua.prototype.setUneditable=function(){},Ua.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=ka&&i(e,t,n)}:i)}e.defineOption=n,e.Init=ka,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Li(e)}),!0),n("indentUnit",2,Li,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ei(e),Bn(e),fr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(et(r,o))}r++}));for(var i=n.length-1;i>=0;i--)mo(e.doc,t,n[i],et(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=ka&&e.refresh()})),n("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){wa(e),mi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Yo(t),i=n!=ka&&Yo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,_a,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=pi(t,e.options.lineNumbers),mi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ar(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return qr(e)}),!0),n("scrollbarStyle","native",(function(e){Wr(e),qr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=pi(e.options.gutters,t),mi(e)}),!0),n("firstLineNumber",1,mi,!0),n("lineNumberFormatter",(function(e){return e}),mi,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Or(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Oa),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ei,!0),n("addModeClass",!1,Ei,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ei,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Ma),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ei(this,t[e])(this,n,i),he(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Yo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:ti((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,fr(this)})),removeOverlay:ti((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void fr(this)}})),indentLine:ti((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Qe(this.doc,e)&&Ta(this,e,t,n)})),indentSelection:ti((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Ta(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Er(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s<n;++s)Ta(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&Yi(this.doc,r,new Si(o,c[r].to()),$)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=lt(this.doc,e);var t,n=dt(this,Ge(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var l=i[o[t][a]];l&&r.push(l)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var s=0;s<i._global.length;s++){var c=i._global[s];c.pred(o,this)&&-1==B(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return pt(this,(e=at(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Vn(this,null==e?n.head:"object"==typeof e?lt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Gn(this,lt(this.doc,e),t||"page")},coordsChar:function(e,t){return Yn(this,(e=Un(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Un(this,{top:e,left:0},t||"page").top,Xe(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=Ge(this.doc,e)}else r=e;return Wn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Ht(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,l,s=this.display,c=(e=Vn(this,lt(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var f=Math.max(s.wrapper.clientHeight,this.doc.height),d=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(c=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(l=Tr(o,a)).scrollTop&&Rr(o,l.scrollTop),null!=l.scrollLeft&&Pr(o,l.scrollLeft))},triggerOnKeyDown:ti(ua),triggerOnKeyPress:ti(da),triggerOnKeyUp:fa,triggerOnMouseDown:ti(ga),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:ti((function(e){Na(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=lt(this.doc,e),a=0;a<t&&!(o=ja(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:ti((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?ja(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),W)})),deleteH:ti((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Xo(this,(function(n){var i=ja(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=lt(this.doc,e),l=0;l<t;++l){var s=Vn(this,a,"div");if(null==o?o=s.left:s.left=o,(a=za(this,s,i,n)).hitSide)break}return a},moveV:ti((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var l=Vn(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=za(n,l,e,t);return"page"==t&&a==r.sel.primary()&&Lr(n,Gn(n,s,"div").top-l.top),s}),W),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=Ge(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),a=ee(o,i)?function(e){return ee(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new Si(et(e.line,n),et(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):_(this.display.cursorDiv,"CodeMirror-overwrite"),he(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ti((function(e,t){Dr(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-_n(this)-this.display.barHeight,width:e.scrollWidth-_n(this)-this.display.barWidth,clientHeight:An(this),clientWidth:Mn(this)}},scrollIntoView:ti((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Fr(e),e.curOp.scrollToPos=t}(this,e):Nr(this,e.from,e.to,e.margin)})),setSize:ti((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&zn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){dr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,he(this,"refresh",this)})),operation:function(e){return Zr(this,e)},startOperation:function(){return Gr(this)},endOperation:function(){return Vr(this)},refresh:ti((function(){var e=this.display.cachedTextHeight;fr(this),this.curOp.forceUpdate=!0,Bn(this),Dr(this,this.doc.scrollLeft,this.doc.scrollTop),ci(this.display),(null==e||Math.abs(e-rr(this.display))>.5||this.options.lineWrapping)&&sr(this),he(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ri(this,e),Bn(this),this.display.input.reset(),Dr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},ye(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Ma);var Ga="iter insert remove copy getEditor constructor".split(" ");for(var Va in Eo.prototype)Eo.prototype.hasOwnProperty(Va)&&B(Ga,Va)<0&&(Ma.prototype[Va]=function(e){return function(){return e.apply(this.doc,arguments)}}(Eo.prototype[Va]));return ye(Eo),Ma.inputStyles={textarea:Ua,contenteditable:Ba},Ma.defineMode=function(e){Ma.defaults.mode||"null"==e||(Ma.defaults.mode=e),Pe.apply(this,arguments)},Ma.defineMIME=function(e,t){Ie[e]=t},Ma.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ma.defineMIME("text/plain","null"),Ma.defineExtension=function(e,t){Ma.prototype[e]=t},Ma.defineDocExtension=function(e,t){Eo.prototype[e]=t},Ma.fromTextArea=function(e,t){if((t=t?P(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=D();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(pe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var l=Ma((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l},function(e){e.off=pe,e.on=fe,e.wheelEventPixels=xi,e.Doc=Eo,e.splitLines=Ee,e.countColumn=j,e.findColumn=U,e.isWordChar=Z,e.Pass=q,e.signal=he,e.Line=Gt,e.changeEnd=_i,e.scrollbarModel=Hr,e.Pos=et,e.cmpPos=tt,e.modes=Re,e.mimeModes=Ie,e.resolveMode=je,e.getMode=ze,e.modeExtensions=Be,e.extendMode=qe,e.copyState=$e,e.startState=We,e.innerMode=He,e.commands=ta,e.keyMap=Ho,e.keyName=Jo,e.isModifierKey=Vo,e.lookupKey=Go,e.normalizeKeyMap=Uo,e.StringStream=Ue,e.SharedTextMarker=Mo,e.TextMarker=Oo,e.LineWidget=ko,e.e_preventDefault=be,e.e_stopPropagation=xe,e.e_stop=ke,e.addClass=F,e.contains=E,e.rmClass=_,e.keyNames=zo}(Ma),Ma.version="5.57.0",Ma}()})),ga=(m((function(e,t){!function(e){var t=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;function i(e,n){var r=n.line,i=0,o=0,a=t.exec(e.getLine(r)),l=a[1];do{var s=r+(i+=1),c=e.getLine(s),u=t.exec(c);if(u){var f=u[1],d=parseInt(a[3],10)+i-o,p=parseInt(u[3],10),h=p;if(l!==f||isNaN(p)){if(l.length>f.length)return;if(l.length<f.length&&1===i)return;o+=1}else d===p&&(h=p+1),d>p&&(h=d+1),e.replaceRange(c.replace(t,f+h+u[4]+u[5]),{line:s,ch:0},{line:s,ch:c.length})}}while(u)}e.commands.newlineAndIndentContinueMarkdownList=function(o){if(o.getOption("disableInput"))return e.Pass;for(var a=o.listSelections(),l=[],s=0;s<a.length;s++){var c=a[s].head,u=o.getStateAfter(c.line),f=e.innerMode(o.getMode(),u);if("markdown"!==f.mode.name)return void o.execCommand("newlineAndIndent");var d=!1!==(u=f.state).list,p=0!==u.quote,h=o.getLine(c.line),m=t.exec(h),g=/^\s*$/.test(h.slice(0,c.ch));if(!a[s].empty()||!d&&!p||!m||g)return void o.execCommand("newlineAndIndent");if(n.test(h)){var v=p&&/>\s*$/.test(h),y=!/>\s*$/.test(h);(v||y)&&o.replaceRange("",{line:c.line,ch:0},{line:c.line,ch:c.ch+1}),l[s]="\n"}else{var b=m[1],x=m[5],w=!(r.test(m[2])||m[2].indexOf(">")>=0),k=w?parseInt(m[3],10)+1+m[4]:m[2].replace("x"," ");l[s]="\n"+b+k+x,w&&i(o,c)}}o.replaceSelections(l)}}(ma)})),m((function(e,t){!function(e){var t="CodeMirror-activeline-background";function n(e){for(var n=0;n<e.state.activeLines.length;n++)e.removeLineClass(e.state.activeLines[n],"wrap","CodeMirror-activeline"),e.removeLineClass(e.state.activeLines[n],"background",t),e.removeLineClass(e.state.activeLines[n],"gutter","CodeMirror-activeline-gutter")}function r(e,r){for(var i=[],o=0;o<r.length;o++){var a=r[o],l=e.getOption("styleActiveLine");if("object"==typeof l&&l.nonEmpty?a.anchor.line==a.head.line:a.empty()){var s=e.getLineHandleVisualStart(a.head.line);i[i.length-1]!=s&&i.push(s)}}(function(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0})(e.state.activeLines,i)||e.operation((function(){n(e);for(var r=0;r<i.length;r++)e.addLineClass(i[r],"wrap","CodeMirror-activeline"),e.addLineClass(i[r],"background",t),e.addLineClass(i[r],"gutter","CodeMirror-activeline-gutter");e.state.activeLines=i}))}function i(e,t){r(e,t.ranges)}e.defineOption("styleActiveLine",!1,(function(t,o,a){var l=a!=e.Init&&a;o!=l&&(l&&(t.off("beforeSelectionChange",i),n(t),delete t.state.activeLines),o&&(t.state.activeLines=[],r(t,t.listSelections()),t.on("beforeSelectionChange",i)))}))}(ma)})),m((function(e,t){var n,r,i;r={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},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1},(n=ma).defineMode("xml",(function(e,t){var o,a,l=e.indentUnit,s={},c=t.htmlMode?r:i;for(var u in c)s[u]=c[u];for(var u in t)s[u]=t[u];function f(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(p("atom","]]>")):null:e.match("--")?n(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(function e(t){return function(n,r){for(var i;null!=(i=n.next());){if("<"==i)return r.tokenize=e(t+1),r.tokenize(n,r);if(">"==i){if(1==t){r.tokenize=f;break}return r.tokenize=e(t-1),r.tokenize(n,r)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function d(e,t){var n,r,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=f,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){t.tokenize=f,t.state=v,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(n=i,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=d;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=f;break}n.next()}return e}}function h(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function g(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!s.contextGrabbers.hasOwnProperty(n)||!s.contextGrabbers[n].hasOwnProperty(t))return;m(e)}}function v(e,t,n){return"openTag"==e?(n.tagStart=t.column(),y):"closeTag"==e?b:v}function y(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",k):s.allowMissingTagName&&"endTag"==e?(a="tag bracket",k(e,0,n)):(a="error",y)}function b(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&s.implicitlyClosed.hasOwnProperty(n.context.tagName)&&m(n),n.context&&n.context.tagName==r||!1===s.matchClosing?(a="tag",x):(a="tag error",w)}return s.allowMissingTagName&&"endTag"==e?(a="tag bracket",x(e,0,n)):(a="error",w)}function x(e,t,n){return"endTag"!=e?(a="error",x):(m(n),v)}function w(e,t,n){return a="error",x(e,0,n)}function k(e,t,n){if("word"==e)return a="attribute",S;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(r)?g(n,r):(g(n,r),n.context=new h(n,r,i==n.indented)),v}return a="error",k}function S(e,t,n){return"equals"==e?C:(s.allowMissing||(a="error"),k(e,0,n))}function C(e,t,n){return"string"==e?O:"word"==e&&s.allowUnquoted?(a="string",k):(a="error",k(e,0,n))}function O(e,t,n){return"string"==e?O:k(e,0,n)}return f.isInText=!0,{startState:function(e){var t={tokenize:f,state:v,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;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(e,t,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+l;if(i&&i.noIndent)return n.Pass;if(e.tokenize!=d&&e.tokenize!=f)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==s.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+l*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var o=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!s.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(o)for(;i;){var a=s.contextGrabbers[i.tagName];if(!a||!a.hasOwnProperty(o[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+l:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==C&&(e.state=k)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}})),n.defineMIME("text/xml","xml"),n.defineMIME("application/xml","xml"),n.mimeModes.hasOwnProperty("text/html")||n.defineMIME("text/html",{name:"xml",htmlMode:!0})})),m((function(e,t){!function(e){e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),o=i>-1&&t.substring(i+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}}(ma)})),m((function(e,t){var n;(n=ma).defineMode("markdown",(function(e,t){var r=n.getMode(e,"text/html"),i="null"==r.name;void 0===t.highlightFormatting&&(t.highlightFormatting=!1),void 0===t.maxBlockquoteDepth&&(t.maxBlockquoteDepth=0),void 0===t.taskLists&&(t.taskLists=!1),void 0===t.strikethrough&&(t.strikethrough=!1),void 0===t.emoji&&(t.emoji=!1),void 0===t.fencedCodeBlockHighlighting&&(t.fencedCodeBlockHighlighting=!0),void 0===t.fencedCodeBlockDefaultMode&&(t.fencedCodeBlockDefaultMode="text/plain"),void 0===t.xml&&(t.xml=!0),void 0===t.tokenTypeOverrides&&(t.tokenTypeOverrides={});var o={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var a in o)o.hasOwnProperty(a)&&t.tokenTypeOverrides[a]&&(o[a]=t.tokenTypeOverrides[a]);var l=/^([*\-_])(?:\s*\1){2,}\s*$/,s=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,u=t.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,f=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,h=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function g(e,t,n){return t.f=t.inline=n,n(e,t)}function v(e,t,n){return t.f=t.block=n,n(e,t)}function y(e){if(e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==x){var t=i;if(!t){var o=n.innerMode(r,e.htmlState);t="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}t&&(e.f=C,e.block=b,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function b(r,i){var a,d=r.column()===i.indentation,m=!(a=i.prevLine.stream)||!/\S/.test(a.string),v=i.indentedCode,y=i.prevLine.hr,b=!1!==i.list,x=(i.listStack[i.listStack.length-1]||0)+3;i.indentedCode=!1;var S=i.indentation;if(null===i.indentationDiff&&(i.indentationDiff=i.indentation,b)){for(i.list=null;S<i.listStack[i.listStack.length-1];)i.listStack.pop(),i.listStack.length?i.indentation=i.listStack[i.listStack.length-1]:i.list=!1;!1!==i.list&&(i.indentationDiff=S-i.listStack[i.listStack.length-1])}var C=!(m||y||i.prevLine.header||b&&v||i.prevLine.fencedCodeEnd),O=(!1===i.list||y||m)&&i.indentation<=x&&r.match(l),_=null;if(i.indentationDiff>=4&&(v||i.prevLine.fencedCodeEnd||i.prevLine.header||m))return r.skipToEnd(),i.indentedCode=!0,o.code;if(r.eatSpace())return null;if(d&&i.indentation<=x&&(_=r.match(u))&&_[1].length<=6)return i.quote=0,i.header=_[1].length,i.thisLine.header=!0,t.highlightFormatting&&(i.formatting="header"),i.f=i.inline,k(i);if(i.indentation<=x&&r.eat(">"))return i.quote=d?1:i.quote+1,t.highlightFormatting&&(i.formatting="quote"),r.eatSpace(),k(i);if(!O&&!i.setext&&d&&i.indentation<=x&&(_=r.match(s))){var M=_[1]?"ol":"ul";return i.indentation=S+r.current().length,i.list=!0,i.quote=0,i.listStack.push(i.indentation),i.em=!1,i.strong=!1,i.code=!1,i.strikethrough=!1,t.taskLists&&r.match(c,!1)&&(i.taskList=!0),i.f=i.inline,t.highlightFormatting&&(i.formatting=["list","list-"+M]),k(i)}return d&&i.indentation<=x&&(_=r.match(p,!0))?(i.quote=0,i.fencedEndRE=new RegExp(_[1]+"+ *$"),i.localMode=t.fencedCodeBlockHighlighting&&function(t){if(n.findModeByName){var r=n.findModeByName(t);r&&(t=r.mime||r.mimes[0])}var i=n.getMode(e,t);return"null"==i.name?null:i}(_[2]||t.fencedCodeBlockDefaultMode),i.localMode&&(i.localState=n.startState(i.localMode)),i.f=i.block=w,t.highlightFormatting&&(i.formatting="code-block"),i.code=-1,k(i)):i.setext||!(C&&b||i.quote||!1!==i.list||i.code||O||h.test(r.string))&&(_=r.lookAhead(1))&&(_=_.match(f))?(i.setext?(i.header=i.setext,i.setext=0,r.skipToEnd(),t.highlightFormatting&&(i.formatting="header")):(i.header="="==_[0].charAt(0)?1:2,i.setext=i.header),i.thisLine.header=!0,i.f=i.inline,k(i)):O?(r.skipToEnd(),i.hr=!0,i.thisLine.hr=!0,o.hr):"["===r.peek()?g(r,i,A):g(r,i,i.inline)}function x(e,t){var o=r.token(e,t.htmlState);if(!i){var a=n.innerMode(r,t.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=C,t.block=b,t.htmlState=null)}return o}function w(e,n){var r,i=n.listStack[n.listStack.length-1]||0,a=n.indentation<i,l=i+3;return n.fencedEndRE&&n.indentation<=l&&(a||e.match(n.fencedEndRE))?(t.highlightFormatting&&(n.formatting="code-block"),a||(r=k(n)),n.localMode=n.localState=null,n.block=b,n.f=C,n.fencedEndRE=null,n.code=0,n.thisLine.fencedCodeEnd=!0,a?v(e,n,n.block):r):n.localMode?n.localMode.token(e,n.localState):(e.skipToEnd(),o.code)}function k(e){var n=[];if(e.formatting){n.push(o.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)n.push(o.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&n.push(o.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?n.push(o.formatting+"-"+e.formatting[r]+"-"+e.quote):n.push("error"))}if(e.taskOpen)return n.push("meta"),n.length?n.join(" "):null;if(e.taskClosed)return n.push("property"),n.length?n.join(" "):null;if(e.linkHref?n.push(o.linkHref,"url"):(e.strong&&n.push(o.strong),e.em&&n.push(o.em),e.strikethrough&&n.push(o.strikethrough),e.emoji&&n.push(o.emoji),e.linkText&&n.push(o.linkText),e.code&&n.push(o.code),e.image&&n.push(o.image),e.imageAltText&&n.push(o.imageAltText,"link"),e.imageMarker&&n.push(o.imageMarker)),e.header&&n.push(o.header,o.header+"-"+e.header),e.quote&&(n.push(o.quote),!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?n.push(o.quote+"-"+e.quote):n.push(o.quote+"-"+t.maxBlockquoteDepth)),!1!==e.list){var i=(e.listStack.length-1)%3;i?1===i?n.push(o.list2):n.push(o.list3):n.push(o.list1)}return e.trailingSpaceNewLine?n.push("trailing-space-new-line"):e.trailingSpace&&n.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),n.length?n.join(" "):null}function S(e,t){if(e.match(d,!0))return k(t)}function C(e,i){var a=i.text(e,i);if(void 0!==a)return a;if(i.list)return i.list=null,k(i);if(i.taskList)return" "===e.match(c,!0)[1]?i.taskOpen=!0:i.taskClosed=!0,t.highlightFormatting&&(i.formatting="task"),i.taskList=!1,k(i);if(i.taskOpen=!1,i.taskClosed=!1,i.header&&e.match(/^#+$/,!0))return t.highlightFormatting&&(i.formatting="header"),k(i);var l=e.next();if(i.linkTitle){i.linkTitle=!1;var s=l;"("===l&&(s=")");var u="^\\s*(?:[^"+(s=(s+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+s;if(e.match(new RegExp(u),!0))return o.linkHref}if("`"===l){var f=i.formatting;t.highlightFormatting&&(i.formatting="code"),e.eatWhile("`");var d=e.current().length;if(0!=i.code||i.quote&&1!=d){if(d==i.code){var p=k(i);return i.code=0,p}return i.formatting=f,k(i)}return i.code=d,k(i)}if(i.code)return k(i);if("\\"===l&&(e.next(),t.highlightFormatting)){var h=k(i),g=o.formatting+"-escape";return h?h+" "+g:g}if("!"===l&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,t.highlightFormatting&&(i.formatting="image"),k(i);if("["===l&&i.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,t.highlightFormatting&&(i.formatting="image"),k(i);if("]"===l&&i.imageAltText){t.highlightFormatting&&(i.formatting="image");var h=k(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=_,h}if("["===l&&!i.image)return i.linkText&&e.match(/^.*?\]/)||(i.linkText=!0,t.highlightFormatting&&(i.formatting="link")),k(i);if("]"===l&&i.linkText){t.highlightFormatting&&(i.formatting="link");var h=k(i);return i.linkText=!1,i.inline=i.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?_:C,h}if("<"===l&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=O,t.highlightFormatting&&(i.formatting="link"),(h=k(i))?h+=" ":h="",h+o.linkInline;if("<"===l&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=O,t.highlightFormatting&&(i.formatting="link"),(h=k(i))?h+=" ":h="",h+o.linkEmail;if(t.xml&&"<"===l&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var y=e.string.indexOf(">",e.pos);if(-1!=y){var b=e.string.substring(e.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(i.md_inside=!0)}return e.backUp(1),i.htmlState=n.startState(r),v(e,i,x)}if(t.xml&&"<"===l&&e.match(/^\/\w*?>/))return i.md_inside=!1,"tag";if("*"===l||"_"===l){for(var w=1,S=1==e.pos?" ":e.string.charAt(e.pos-2);w<3&&e.eat(l);)w++;var M=e.peek()||" ",A=!/\s/.test(M)&&(!m.test(M)||/\s/.test(S)||m.test(S)),T=!/\s/.test(S)&&(!m.test(S)||/\s/.test(M)||m.test(M)),L=null,E=null;if(w%2&&(i.em||!A||"*"!==l&&T&&!m.test(S)?i.em!=l||!T||"*"!==l&&A&&!m.test(M)||(L=!1):L=!0),w>1&&(i.strong||!A||"*"!==l&&T&&!m.test(S)?i.strong!=l||!T||"*"!==l&&A&&!m.test(M)||(E=!1):E=!0),null!=E||null!=L)return t.highlightFormatting&&(i.formatting=null==L?"strong":null==E?"em":"strong em"),!0===L&&(i.em=l),!0===E&&(i.strong=l),p=k(i),!1===L&&(i.em=!1),!1===E&&(i.strong=!1),p}else if(" "===l&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return k(i);e.backUp(1)}if(t.strikethrough)if("~"===l&&e.eatWhile(l)){if(i.strikethrough)return t.highlightFormatting&&(i.formatting="strikethrough"),p=k(i),i.strikethrough=!1,p;if(e.match(/^[^\s]/,!1))return i.strikethrough=!0,t.highlightFormatting&&(i.formatting="strikethrough"),k(i)}else if(" "===l&&e.match(/^~~/,!0)){if(" "===e.peek())return k(i);e.backUp(2)}if(t.emoji&&":"===l&&e.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){i.emoji=!0,t.highlightFormatting&&(i.formatting="emoji");var D=k(i);return i.emoji=!1,D}return" "===l&&(e.match(/^ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),k(i)}function O(e,n){if(">"===e.next()){n.f=n.inline=C,t.highlightFormatting&&(n.formatting="link");var r=k(n);return r?r+=" ":r="",r+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function _(e,n){if(e.eatSpace())return null;var r,i=e.next();return"("===i||"["===i?(n.f=n.inline=(r="("===i?")":"]",function(e,n){if(e.next()===r){n.f=n.inline=C,t.highlightFormatting&&(n.formatting="link-string");var i=k(n);return n.linkHref=!1,i}return e.match(M[r]),n.linkHref=!0,k(n)}),t.highlightFormatting&&(n.formatting="link-string"),n.linkHref=!0,k(n)):"error"}var M={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function A(e,n){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(n.f=T,e.next(),t.highlightFormatting&&(n.formatting="link"),n.linkText=!0,k(n)):g(e,n,C)}function T(e,n){if(e.match(/^\]:/,!0)){n.f=n.inline=L,t.highlightFormatting&&(n.formatting="link");var r=k(n);return n.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function L(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=C,o.linkHref+" url")}var E={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:C,text:S,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&n.copyState(r,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?n.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,linkHref:e.linkHref,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return y(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=x)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g,"    ").length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==x?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:E}},indent:function(e,t,i){return e.block==x&&r.indent?r.indent(e.htmlState,t,i):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,t,i):n.Pass},blankLine:y,getType:k,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return E}),"xml"),n.defineMIME("text/markdown","markdown"),n.defineMIME("text/x-markdown","markdown")})),{flow:"graph TD\nA[Christmas] --\x3e|Get money| B(Go shopping)\nB --\x3e C{Let me think}\nC --\x3e|One| D[Laptop]\nC --\x3e|Two| E[iPhonee]\nC --\x3e|Three| F[Cars]",sequence:"sequenceDiagram\nAlice->>John: Hello John, how are you?\nloop Healthcheck\n    John->>John: Fight against hypochondria\nend\nNote right of John: Rational thoughts!\nJohn--\x3e>Alice: Great!\nJohn->>Bob: How about you?\nBob--\x3e>John: Jolly good!",class:"classDiagram\nClass01 <|-- AveryLongClass : Cool\n<<interface>> Class01\nClass09 --\x3e C2 : Where am i?\nClass09 --* C3\nClass09 --|> Class07\nClass07 : equals()\nClass07 : Object[] elementData\nClass01 : size()\nClass01 : int chimp\nClass01 : int gorilla\nclass Class10 {\n  <<service>>\n  int id\n  size()\n}",state:"stateDiagram\n[*] --\x3e Still\nStill --\x3e [*]\nStill --\x3e Moving\nMoving --\x3e Still\nMoving --\x3e Crash\nCrash --\x3e [*]",gantt:"gantt\ntitle A Gantt Diagram\ndateFormat  YYYY-MM-DD\nsection Section\nA task           :a1, 2014-01-01, 30d\nAnother task     :after a1  , 20d\nsection Another\nTask in sec      :2014-01-12  , 12d\nanother task      : 24d"});const va=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("o-block-card",{staticClass:"o-diagram",class:e.contentClass,attrs:{view:e.view,selected:e.selected,"get-pos":e.getPos,toolbar:e.view.editable},on:{"toggle-screen":e.onToggleFullScreen}},[n("template",{slot:"toolbar-left"},[n("div",{staticClass:"row col items-center full-height q-px-sm providers"},[n("q-icon",{attrs:{name:"mdi-sitemap"}}),e._v(" "+e._s(e.$o.lang.diagram.name)+"\n    ")],1)]),e._v(" "),n("template",{slot:"toolbar-right"},[e.view.editable?n("q-btn-dropdown",{attrs:{label:e.$o.lang.label.template,"menu-anchor":"bottom left","menu-self":"top left","menu-offset":[0,8],"content-class":"o-menu",dense:"",flat:""}},[n("q-list",e._l(e.mermaidDiagrams,(function(t,r){return n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],key:r,attrs:{clickable:""},nativeOn:{click:function(n){return e.onSelectTemplate(t)}}},[e._e(),e._v(" "),n("q-item-section",[e._v(e._s(t.label))])],1)})),1)],1):e._e(),e._v(" "),e.view.editable&&!e.fullScreen?n("q-btn",{staticClass:"text-blue",attrs:{label:e.toggleLabel,flat:""},on:{click:e.toggleMode}}):e._e(),e._v(" "),n("q-btn-dropdown",{staticClass:"dropdown-menu",attrs:{"dropdown-icon":"more_vert",flat:"",dense:""}},[n("q-list",{staticStyle:{"min-width":"120px"}},[n("o-common-item",{attrs:{icon:"delete",label:e.$o.lang.label.remove},nativeOn:{click:function(t){return e.onDelete(t)}}}),e._v(" "),n("o-common-item",{attrs:{icon:"help_outline",label:e.$o.lang.label.help},nativeOn:{click:function(t){return e.onHelp(t)}}})],1)],1)],1),e._v(" "),n("section",{staticClass:"row col-12 diagram"},[("edit"===e.mode||e.fullScreen)&&e.view.editable?n("section",{staticClass:"col source"},[n("codemirror",{ref:"codemirror",staticClass:"diagram-editor",attrs:{id:"codemirror",options:e.editorOption,hint:!0},on:{input:e.onEditorChanged},model:{value:e.src,callback:function(t){e.src=t},expression:"src"}}),e._v(" "),e.error?n("div",{staticClass:"text-red error"},[n("q-icon",{attrs:{name:"info"}}),e._v(" 语法错误")],1):e._e()],1):e._e(),e._v(" "),"preview"===e.mode||e.fullScreen?n("section",{staticClass:"col preview"},[e.fullScreen?n("q-scroll-area",{staticClass:"scroll-area"},[n("div",{domProps:{innerHTML:e._s(e.svg)}})]):n("div",{domProps:{innerHTML:e._s(e.svg)}})],1):e._e()])],2)},staticRenderFns:[]},void 0,{name:"o-diagram",data:function(){return{fullScreen:!1,mode:"preview",provider:"mermaid",example:"",svg:"",error:!1,timeout:0,editorOption:{tabSize:4,mode:{name:"markdown",json:!0},theme:"neat",line:!0,lineWrapping:!0,lineNumbers:!0,extraKeys:{Enter:"newlineAndIndentContinueMarkdownList"},foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],styleActiveLine:!0,styleSelectedText:!0,scrollbarStyle:"native",tabindex:1,autofocus:!1}}},props:["node","updateAttrs","view","selected","getPos"],components:{codemirror:o.codemirror,OBlockCard:pa,OCommonItem:ha},methods:{initDiagram:function(){var e=this;"mermaid"===this.provider&&(this.src?this.renderMermaid():setTimeout((function(){e.src=ga.flow,e.renderMermaid()}),100))},renderMermaid:function(){var e=this;try{d.default.mermaidAPI.initialize({securityLevel:"loose",sequence:{showSequenceNumbers:!0}}),d.default.parse(this.src),this.error=!1;var t="svg-".concat(this.getUuid().substr(0,6));d.default.mermaidAPI.render(t,this.src,(function(t){e.svg=t}))}catch(e){this.error=!0}},onToggleFullScreen:function(e){this.fullScreen=e},toggleMode:function(){var e=this;try{this.error=!1,"edit"===this.mode&&d.default.parse(this.src),this.mode="edit"===this.mode?"preview":"edit","preview"===this.mode?this.renderMermaid():setTimeout((function(){e.$refs.codemirror.codemirror.focus()}),100)}catch(e){console.error(e),this.error=!0}},onEditorChanged:function(){var e=this;this.fullScreen&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.renderMermaid()}),300))},onSelectTemplate:function(e){"mermaid"===this.provider&&(this.src=ga[e.value],this.renderMermaid())},onDelete:function(){var e=this.view.state.tr,t=this.getPos();e.delete(t,t+this.node.nodeSize),this.view.dispatch(e)},onHelp:function(){window.open("https://mermaid-js.github.io/mermaid/#/examples","_blank")},getUuid:function(){for(var e=[],t=0;t<36;t++)e[t]="0123456789abcdef".substr(Math.floor(16*Math.random()),1);return e[14]="4",e[19]="0123456789abcdef".substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23]="",e.join("").substr(0,6)}},computed:{src:{get:function(){return this.node.attrs.src},set:function(e){this.updateAttrs({src:e})}},height:{get:function(){return this.node.attrs.height||400},set:function(e){this.updateAttrs({height:e})}},toggleLabel:function(){return"edit"===this.mode?this.$o.lang.label.preview:this.$o.lang.label.edit},contentClass:function(){return this.fullScreen?"full-screen":""},mermaidDiagrams:function(){return[{label:this.$o.lang.diagram.flow,value:"flow"},{label:this.$o.lang.diagram.sequence,value:"sequence"},{label:this.$o.lang.diagram.class,value:"class"},{label:this.$o.lang.diagram.state,value:"state"},{label:this.$o.lang.diagram.gantt,value:"gantt"}]}},mounted:function(){this.initDiagram()}},void 0,!1,void 0,!1,void 0,void 0,void 0);function ya(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var ba=function(e){Ro(n,e);var t=ya(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(e){var t=e.type;return function(e){return function(n,r){var i=n.selection,o=i.$cursor?i.$cursor.pos:i.$to.pos,a=t.create(e);r(n.tr.insert(o,a))}}}},{key:"name",get:function(){return"diagram"}},{key:"schema",get:function(){return{attrs:{src:{default:null},height:{default:null}},group:"block",selectable:!1,parseDOM:[{tag:"diagram",getAttrs:function(e){return{src:e.getAttribute("src"),height:e.getAttribute("height")}}}],toDOM:function(e){return["diagram",{src:e.attrs.src}]}}}},{key:"view",get:function(){return va}}]),n}(n.Node),xa=function(e,t){if(w(e),!h(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},wa={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=B(Function.call,pt.f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return xa(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:xa}.set,ka=function(e,t,n){var r,i=t.constructor;return i!==n&&"function"==typeof i&&(r=i.prototype)!==n.prototype&&h(r)&&wa&&wa(e,r),e},Sa=Y("species"),Ca=function(e){var t=C[e];S&&t&&!t[Sa]&&E.f(t,Sa,{configurable:!0,get:function(){return this}})},Oa=E.f,_a=lt.f,Ma=C.RegExp,Aa=Ma,Ta=Ma.prototype,La=/a/g,Ea=/a/g,Da=new Ma(La)!==La;if(S&&(!Da||k((function(){return Ea[Y("match")]=!1,Ma(La)!=La||Ma(Ea)==Ea||"/a/i"!=Ma(La,"i")})))){Ma=function(e,t){var n=this instanceof Ma,r=vn(e),i=void 0===t;return!n&&r&&e.constructor===Ma&&i?e:ka(Da?new Aa(r&&!i?e.source:e,t):Aa((r=e instanceof Ma)?e.source:e,r&&i?fn.call(e):t),n?this:Ta,Ma)};for(var Fa=function(e){e in Ma||Oa(Ma,e,{configurable:!0,get:function(){return Aa[e]},set:function(t){Aa[e]=t}})},Na=_a(Aa),Ra=0;Na.length>Ra;)Fa(Na[Ra++]);Ta.constructor=Ma,Ma.prototype=Ta,j(C,"RegExp",Ma)}Ca("RegExp");var Ia=Math.pow(2,16);function Pa(e){return 65535&e}var ja=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},za=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};za.prototype.recover=function(e){var t=0,n=Pa(e);if(!this.inverted)for(var r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Ia}(e)},za.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},za.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},za.prototype._map=function(e,t,n){for(var r=0,i=this.inverted?2:1,o=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;var s=this.ranges[a+i],c=this.ranges[a+o],u=l+s;if(e<=u){var f=l+r+((s?e==l?-1:e==u?1:t:t)<0?0:c);if(n)return f;var d=e==(t<0?l:u)?null:a/3+(e-l)*Ia;return new ja(f,t<0?e!=l:e!=u,d)}r+=c-s}return n?e+r:new ja(e+r)},za.prototype.touches=function(e,t){for(var n=0,r=Pa(t),i=this.inverted?2:1,o=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;var s=this.ranges[a+i];if(e<=l+s&&a==3*r)return!0;n+=this.ranges[a+o]-s}return!1},za.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,i=0;r<this.ranges.length;r+=3){var o=this.ranges[r],a=o-(this.inverted?i:0),l=o+(this.inverted?0:i),s=this.ranges[r+t],c=this.ranges[r+n];e(a,a+s,l,l+c),i+=c-s}},za.prototype.invert=function(){return new za(this.ranges,!this.inverted)},za.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},za.offset=function(e){return 0==e?za.empty:new za(e<0?[0,-e,0]:[0,0,e])},za.empty=new za([]);var Ba=function(e,t,n,r){this.maps=e||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=t};function qa(e){var t=Error.call(this,e);return t.__proto__=qa.prototype,t}Ba.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new Ba(this.maps,this.mirror,e,t)},Ba.prototype.copy=function(){return new Ba(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},Ba.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},Ba.prototype.appendMapping=function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:null)}},Ba.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},Ba.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},Ba.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:null)}},Ba.prototype.invert=function(){var e=new Ba;return e.appendMappingInverted(this),e},Ba.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e},Ba.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},Ba.prototype._map=function(e,t,n){for(var r=!1,i=this.from;i<this.to;i++){var o=this.maps[i].mapResult(e,t);if(null!=o.recover){var a=this.getMirror(i);if(null!=a&&a>i&&a<this.to){i=a,e=this.maps[a].recover(o.recover);continue}}o.deleted&&(r=!0),e=o.pos}return n?e:new ja(e,r)},qa.prototype=Object.create(Error.prototype),qa.prototype.constructor=qa,qa.prototype.name="TransformError";var $a=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ba},Ha={before:{configurable:!0},docChanged:{configurable:!0}};function Wa(){throw new Error("Override me")}Ha.before.get=function(){return this.docs.length?this.docs[0]:this.doc},$a.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new qa(t.failed);return this},$a.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},Ha.docChanged.get=function(){return this.steps.length>0},$a.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties($a.prototype,Ha);var Ua=Object.create(null),Ga=function(){};Ga.prototype.apply=function(e){return Wa()},Ga.prototype.getMap=function(){return za.empty},Ga.prototype.invert=function(e){return Wa()},Ga.prototype.map=function(e){return Wa()},Ga.prototype.merge=function(e){return null},Ga.prototype.toJSON=function(){return Wa()},Ga.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=Ua[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},Ga.jsonID=function(e,t){if(e in Ua)throw new RangeError("Duplicate use of step JSON ID "+e);return Ua[e]=t,t.prototype.jsonID=e,t};var Va=function(e,t){this.doc=e,this.failed=t};Va.ok=function(e){return new Va(e,null)},Va.fail=function(e){return new Va(null,e)},Va.fromReplace=function(e,t,n,r){try{return Va.ok(e.replace(t,n,r))}catch(e){if(e instanceof l.ReplaceError)return Va.fail(e.message);throw e}};var Ka=function(e){function t(t,n,r,i){e.call(this),this.from=t,this.to=n,this.slice=r,this.structure=!!i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&Ya(e,this.from,this.to)?Va.fail("Structure replace would overwrite content"):Va.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new za([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure!=this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?l.Slice.empty:new l.Slice(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var r=this.slice.size+e.slice.size==0?l.Slice.empty:new l.Slice(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),r,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,l.Slice.fromJSON(e,n.slice),!!n.structure)},t}(Ga);Ga.jsonID("replace",Ka);var Ja=function(e){function t(t,n,r,i,o,a,l){e.call(this),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=!!l}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(Ya(e,this.from,this.gapFrom)||Ya(e,this.gapTo,this.to)))return Va.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Va.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?Va.fromReplace(e,this.from,this.to,n):Va.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new za([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return n.deleted&&r.deleted||i<n.pos||o>r.pos?null:new t(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,l.Slice.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(Ga);function Ya(e,t,n){for(var r=e.resolve(t),i=n-t,o=r.depth;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0)for(var a=r.node(o).maybeChild(r.indexAfter(o));i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}return!1}function Xa(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Qa(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!Xa(r,i,o))break}}function Za(e,t,n,r){void 0===n&&(n=1);var i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(var l=i.depth-1,s=n-2;l>o;l--,s--){var c=i.node(l),u=i.index(l);if(c.type.spec.isolating)return!1;var f=c.content.cutByIndex(u,c.childCount),d=r&&r[s]||c;if(d!=c&&(f=f.replaceChild(0,d.type.create(d.attrs))),!c.canReplace(u+1,c.childCount)||!d.type.validContent(f))return!1}var p=i.indexAfter(o),h=r&&r[0];return i.node(o).canReplaceWith(p,p,h?h.type:i.node(o+1).type)}function el(e,t){var n,r,i=e.resolve(t),o=i.index();return n=i.nodeBefore,r=i.nodeAfter,n&&r&&!n.isLeaf&&n.canAppend(r)&&i.parent.canReplace(o,o+1)}function tl(e,t,n){for(var r=[],i=0;i<e.childCount;i++){var o=e.child(i);o.content.size&&(o=o.copy(tl(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return l.Fragment.fromArray(r)}Ga.jsonID("replaceAround",Ja),$a.prototype.lift=function(e,t){for(var n=e.$from,r=e.$to,i=e.depth,o=n.before(i+1),a=r.after(i+1),s=o,c=a,u=l.Fragment.empty,f=0,d=i,p=!1;d>t;d--)p||n.index(d)>0?(p=!0,u=l.Fragment.from(n.node(d).copy(u)),f++):s--;for(var h=l.Fragment.empty,m=0,g=i,v=!1;g>t;g--)v||r.after(g+1)<r.end(g)?(v=!0,h=l.Fragment.from(r.node(g).copy(h)),m++):c++;return this.step(new Ja(s,c,o,a,new l.Slice(u.append(h),f,m),u.size-f,!0))},$a.prototype.wrap=function(e,t){for(var n=l.Fragment.empty,r=t.length-1;r>=0;r--)n=l.Fragment.from(t[r].type.create(t[r].attrs,n));var i=e.start,o=e.end;return this.step(new Ja(i,o,i,o,new l.Slice(n,0,0),t.length,!0))},$a.prototype.setBlockType=function(e,t,n,r){var i=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var o=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(n,r)&&function(e,t,n){var r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(i.doc,i.mapping.slice(o).map(t),n)){i.clearIncompatible(i.mapping.slice(o).map(t,1),n);var a=i.mapping.slice(o),s=a.map(t,1),c=a.map(t+e.nodeSize,1);return i.step(new Ja(s,c,s+1,c-1,new l.Slice(l.Fragment.from(n.create(r,null,e.marks)),0,0),1,!0)),!1}})),this},$a.prototype.setNodeMarkup=function(e,t,n,r){var i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);var o=t.create(n,null,r||i.marks);if(i.isLeaf)return this.replaceWith(e,e+i.nodeSize,o);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new Ja(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new l.Slice(l.Fragment.from(o),0,0),1,!0))},$a.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var r=this.doc.resolve(e),i=l.Fragment.empty,o=l.Fragment.empty,a=r.depth,s=r.depth-t,c=t-1;a>s;a--,c--){i=l.Fragment.from(r.node(a).copy(i));var u=n&&n[c];o=l.Fragment.from(u?u.type.create(u.attrs,o):r.node(a).copy(o))}return this.step(new Ka(e,e,new l.Slice(i.append(o),t,t),!0))},$a.prototype.join=function(e,t){void 0===t&&(t=1);var n=new Ka(e-t,e+t,l.Slice.empty,!0);return this.step(n)};var nl=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new l.Slice(tl(n.content,(function(e,n){return n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),i),n.openStart,n.openEnd);return Va.fromReplace(e,this.from,this.to,o)},t.prototype.invert=function(){return new rl(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(Ga);Ga.jsonID("addMark",nl);var rl=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),r=new l.Slice(tl(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),n.openStart,n.openEnd);return Va.fromReplace(e,this.from,this.to,r)},t.prototype.invert=function(){return new nl(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(Ga);function il(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ga.jsonID("removeMark",rl),$a.prototype.addMark=function(e,t,n){var r=this,i=[],o=[],a=null,l=null;return this.doc.nodesBetween(e,t,(function(r,s,c){if(r.isInline){var u=r.marks;if(!n.isInSet(u)&&c.type.allowsMarkType(n.type)){for(var f=Math.max(s,e),d=Math.min(s+r.nodeSize,t),p=n.addToSet(u),h=0;h<u.length;h++)u[h].isInSet(p)||(a&&a.to==f&&a.mark.eq(u[h])?a.to=d:i.push(a=new rl(f,d,u[h])));l&&l.to==f?l.to=d:o.push(l=new nl(f,d,n))}}})),i.forEach((function(e){return r.step(e)})),o.forEach((function(e){return r.step(e)})),this},$a.prototype.removeMark=function(e,t,n){var r=this;void 0===n&&(n=null);var i=[],o=0;return this.doc.nodesBetween(e,t,(function(r,a){if(r.isInline){o++;var s=null;if(n instanceof l.MarkType){var c=n.isInSet(r.marks);c&&(s=[c])}else n?n.isInSet(r.marks)&&(s=[n]):s=r.marks;if(s&&s.length)for(var u=Math.min(a+r.nodeSize,t),f=0;f<s.length;f++){for(var d=s[f],p=void 0,h=0;h<i.length;h++){var m=i[h];m.step==o-1&&d.eq(i[h].style)&&(p=m)}p?(p.to=u,p.step=o):i.push({style:d,from:Math.max(a,e),to:u,step:o})}}})),i.forEach((function(e){return r.step(new rl(e.from,e.to,e.style))})),this},$a.prototype.clearIncompatible=function(e,t,n){void 0===n&&(n=t.contentMatch);for(var r=this.doc.nodeAt(e),i=[],o=e+1,a=0;a<r.childCount;a++){var s=r.child(a),c=o+s.nodeSize,u=n.matchType(s.type,s.attrs);if(u){n=u;for(var f=0;f<s.marks.length;f++)t.allowsMarkType(s.marks[f].type)||this.step(new rl(o,c,s.marks[f]))}else i.push(new Ka(o,c,l.Slice.empty));o=c}if(!n.validEnd){var d=n.fillBefore(l.Fragment.empty,!0);this.replace(o,o,new l.Slice(d,0,0))}for(var p=i.length-1;p>=0;p--)this.step(i[p]);return this},$a.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=l.Slice.empty);var r=function(e,t,n,r){if(void 0===n&&(n=t),void 0===r&&(r=l.Slice.empty),t==n&&!r.size)return null;var i=e.resolve(t),o=e.resolve(n);return il(i,o,r)?new Ka(t,n,r):new ol(i,o,r).fit()}(this.doc,e,t,n);return r&&this.step(r),this},$a.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new l.Slice(l.Fragment.from(n),0,0))},$a.prototype.delete=function(e,t){return this.replace(e,t,l.Slice.empty)},$a.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var ol=function(e,t,n){this.$to=t,this.$from=e,this.unplaced=n,this.frontier=[];for(var r=0;r<=e.depth;r++){var i=e.node(r);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(r))})}this.placed=l.Fragment.empty;for(var o=e.depth;o>0;o--)this.placed=l.Fragment.from(e.node(o).copy(this.placed))},al={depth:{configurable:!0}};function ll(e,t,n){return 0==t?e.cutByIndex(n):e.replaceChild(0,e.firstChild.copy(ll(e.firstChild.content,t-1,n)))}function sl(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(sl(e.lastChild.content,t-1,n)))}function cl(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function ul(e,t,n){if(t<=0)return e;var r=e.content;return t>1&&(r=r.replaceChild(0,ul(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(l.Fragment.empty,!0)))),e.copy(r)}function fl(e,t,n,r,i){var o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;var l=r.fillBefore(o.content,!0,a);return l&&!function(e,t,n){for(var r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,a)?l:null}function dl(e,t,n,r,i){if(t<n){var o=e.firstChild;e=e.replaceChild(0,o.copy(dl(o.content,t+1,n,r,o)))}if(t>r){var a=i.contentMatchAt(0),s=a.fillBefore(e).append(e);e=s.append(a.matchFragment(s).fillBefore(l.Fragment.empty,!0))}return e}function pl(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;i==t.start(r)&&n.push(r)}return n}function hl(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function ml(e,t){for(;e;e="start"==t?e.firstChild:e.lastChild)if(e.isTextblock)return!0;return!1}function gl(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function vl(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function yl(e){for(var t=0;t<e.edgeCount;t++){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function bl(e,t,n){var r,o,a=t.nodeBefore,s=t.nodeAfter;if(a.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){var r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!!(r&&i&&r.type.compatibleContent(i.type))&&(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(o,o+1)||!i.isTextblock&&!el(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;if(t.parent.canReplace(t.index(),t.index()+1)&&(r=(o=a.contentMatchAt(a.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){for(var c=t.pos+s.nodeSize,u=l.Fragment.empty,f=r.length-1;f>=0;f--)u=l.Fragment.from(r[f].create(null,u));u=l.Fragment.from(a.copy(u));var d=e.tr.step(new Ja(t.pos-1,c,t.pos,c,new l.Slice(u,1,0),r.length,!0)),p=c+2*r.length;el(d.doc,p)&&d.join(p),n(d.scrollIntoView())}return!0}var h=i.Selection.findFrom(t,1),m=h&&h.$from.blockRange(h.$to),g=m&&Qa(m);return null!=g&&g>=t.depth&&(n&&n(e.tr.lift(m,g).scrollIntoView()),!0)}function xl(e,t){return function(n,r){var i=n.selection,o=i.from,a=i.to,l=!1;return n.doc.nodesBetween(o,a,(function(r,i){if(l)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)l=!0;else{var o=n.doc.resolve(i),a=o.index();l=o.parent.canReplaceWith(a,a+1,e)}})),!!l&&(r&&r(n.tr.setBlockType(o,a,e,t).scrollIntoView()),!0)}}function wl(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(t,n,r){for(var i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}al.depth.get=function(){return this.frontier.length-1},ol.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;for(var o=this.placed,a=r.depth,s=i.depth;a&&s&&1==o.childCount;)o=o.firstChild.content,a--,s--;var c=new l.Slice(o,a,s);return t>-1?new Ja(r.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Ka(r.pos,i.pos,c):void 0},ol.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=void 0,r=(t?(n=cl(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,i=this.depth;i>=0;i--){var o=this.frontier[i],a=o.type,s=o.match,c=void 0,u=void 0;if(1==e&&(r?s.matchType(r.type)||(u=s.fillBefore(l.Fragment.from(r),!1)):a.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:i,parent:n,inject:u};if(2==e&&r&&(c=s.findWrapping(r.type)))return{sliceDepth:t,frontierDepth:i,parent:n,wrap:c};if(n&&s.matchType(n.type))break}},ol.prototype.openMore=function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,i=cl(t,n);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new l.Slice(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)},ol.prototype.dropNode=function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,i=cl(t,n);if(i.childCount<=1&&n>0){var o=t.size-n<=n+i.size;this.unplaced=new l.Slice(ll(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new l.Slice(ll(t,n,1),n,r)},ol.prototype.placeNodes=function(e){for(var t=e.sliceDepth,n=e.frontierDepth,r=e.parent,i=e.inject,o=e.wrap;this.depth>n;)this.closeFrontierNode();if(o)for(var a=0;a<o.length;a++)this.openFrontierNode(o[a]);var s=this.unplaced,c=r?r.content:s.content,u=s.openStart-t,f=0,d=[],p=this.frontier[n],h=p.match,m=p.type;if(i){for(var g=0;g<i.childCount;g++)d.push(i.child(g));h=h.matchFragment(i)}for(var v=c.size+t-(s.content.size-s.openEnd);f<c.childCount;){var y=c.child(f),b=h.matchType(y.type);if(!b)break;(++f>1||0==u||y.content.size)&&(h=b,d.push(ul(y.mark(m.allowedMarks(y.marks)),1==f?u:0,f==c.childCount?v:-1)))}var x=f==c.childCount;x||(v=-1),this.placed=sl(this.placed,n,l.Fragment.from(d)),this.frontier[n].match=h,x&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var w=0,k=c;w<v;w++){var S=k.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),k=S.content}this.unplaced=x?0==t?l.Slice.empty:new l.Slice(ll(s.content,t-1,1),t-1,v<0?s.openEnd:t-1):new l.Slice(ll(s.content,t,f),s.openStart,s.openEnd)},ol.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!fl(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r},ol.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,i=n.type,o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=fl(e,t,i,r,o);if(a){for(var l=t-1;l>=0;l--){var s=this.frontier[l],c=s.match,u=fl(e,l,s.type,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}},ol.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=sl(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),i=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,i)}return e},ol.prototype.openFrontierNode=function(e,t,n){var r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=sl(this.placed,this.depth,l.Fragment.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})},ol.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(l.Fragment.empty,!0);e.childCount&&(this.placed=sl(this.placed,this.frontier.length,e))},Object.defineProperties(ol.prototype,al),$a.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var r=this.doc.resolve(e),i=this.doc.resolve(t);if(il(r,i,n))return this.step(new Ka(e,t,n));var o=pl(r,this.doc.resolve(t));0==o[o.length-1]&&o.pop();var a=-(r.depth+1);o.unshift(a);for(var s=r.depth,c=r.pos-1;s>0;s--,c--){var u=r.node(s).type.spec;if(u.defining||u.isolating)break;o.indexOf(s)>-1?a=s:r.before(s)==c&&o.splice(1,0,-s)}for(var f=o.indexOf(a),d=[],p=n.openStart,h=n.content,m=0;;m++){var g=h.firstChild;if(d.push(g),m==n.openStart)break;h=g.content}p>0&&d[p-1].type.spec.defining&&r.node(f).type!=d[p-1].type?p-=1:p>=2&&d[p-1].isTextblock&&d[p-2].type.spec.defining&&r.node(f).type!=d[p-2].type&&(p-=2);for(var v=n.openStart;v>=0;v--){var y=(v+p+1)%(n.openStart+1),b=d[y];if(b)for(var x=0;x<o.length;x++){var w=o[(x+f)%o.length],k=!0;w<0&&(k=!1,w=-w);var S=r.node(w-1),C=r.index(w-1);if(S.canReplaceWith(C,C,b.type,b.marks))return this.replace(r.before(w),k?i.after(w):t,new l.Slice(dl(n.content,0,n.openStart,y),y,n.openEnd))}}for(var O=this.steps.length,_=o.length-1;_>=0&&(this.replace(e,t,n),!(this.steps.length>O));_--){var M=o[_];_<0||(e=r.before(M),t=i.after(M))}return this},$a.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var r=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var i=r.depth-1;i>=0;i--){var o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var l=r.indexAfter(a);if(r.node(a).canReplaceWith(l,l,n))return r.after(a+1);if(l<r.node(a).childCount)return null}}(this.doc,e,n.type);null!=r&&(e=t=r)}return this.replaceRange(e,t,new l.Slice(l.Fragment.from(n),0,0))},$a.prototype.deleteRange=function(e,t){for(var n=this.doc.resolve(e),r=this.doc.resolve(t),i=pl(n,r),o=0;o<i.length;o++){var a=i[o],l=o==i.length-1;if(l&&0==a||n.node(a).type.contentMatch.validEnd)return this.delete(n.start(a),r.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),r.indexAfter(a-1))))return this.delete(n.before(a),r.after(a))}for(var s=1;s<=n.depth&&s<=r.depth;s++)if(e-n.start(s)==n.depth-s&&t>n.end(s)&&r.end(s)-t!=r.depth-s)return this.delete(n.before(s),t);return this.delete(e,t)};var kl=wl(hl,(function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var o=gl(r);if(!o){var a=r.blockRange(),l=a&&Qa(a);return null!=l&&(t&&t(e.tr.lift(a,l).scrollIntoView()),!0)}var s=o.nodeBefore;if(!s.type.spec.isolating&&bl(e,o,t))return!0;if(0==r.parent.content.size&&(ml(s,"end")||i.NodeSelection.isSelectable(s))){if(t){var c=e.tr.deleteRange(r.before(),r.after());c.setSelection(ml(s,"end")?i.Selection.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):i.NodeSelection.create(c.doc,o.pos-s.nodeSize)),t(c.scrollIntoView())}return!0}return!(!s.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)}),(function(e,t,n){var r=e.selection,o=r.$head,a=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;a=gl(o)}var l=a&&a.nodeBefore;return!(!l||!i.NodeSelection.isSelectable(l))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,a.pos-l.nodeSize)).scrollIntoView()),!0)})),Sl=wl(hl,(function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;var o=vl(r);if(!o)return!1;var a=o.nodeAfter;if(bl(e,o,t))return!0;if(0==r.parent.content.size&&(ml(a,"start")||i.NodeSelection.isSelectable(a))){if(t){var l=e.tr.deleteRange(r.before(),r.after());l.setSelection(ml(a,"start")?i.Selection.findFrom(l.doc.resolve(l.mapping.map(o.pos)),1):i.NodeSelection.create(l.doc,l.mapping.map(o.pos))),t(l.scrollIntoView())}return!0}return!(!a.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+a.nodeSize).scrollIntoView()),!0)}),(function(e,t,n){var r=e.selection,o=r.$head,a=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):o.parentOffset<o.parent.content.size)return!1;a=vl(o)}var l=a&&a.nodeAfter;return!(!l||!i.NodeSelection.isSelectable(l))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,a.pos)).scrollIntoView()),!0)})),Cl={Enter:wl((function(e,t){var n=e.selection,r=n.$head,i=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(i))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)}),(function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(r.parent.inlineContent||o.parent.inlineContent)return!1;var a=yl(r.parent.contentMatchAt(o.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){var l=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(l,a.createAndFill());s.setSelection(i.TextSelection.create(s.doc,l+1)),t(s.scrollIntoView())}return!0}),(function(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var r=n.before();if(Za(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var i=n.blockRange(),o=i&&Qa(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)}),(function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(e.selection instanceof i.NodeSelection&&e.selection.node.isBlock)return!(!r.parentOffset||!Za(e.doc,r.pos))&&(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){var a=o.parentOffset==o.parent.content.size,s=e.tr;e.selection instanceof i.TextSelection&&s.deleteSelection();var c=0==r.depth?null:yl(r.node(-1).contentMatchAt(r.indexAfter(-1))),u=a&&c?[{type:c}]:null,f=Za(s.doc,s.mapping.map(r.pos),1,u);u||f||!Za(s.doc,s.mapping.map(r.pos),1,c&&[{type:c}])||(u=[{type:c}],f=!0),f&&(s.split(s.mapping.map(r.pos),1,u),a||r.parentOffset||r.parent.type==c||!r.node(-1).canReplace(r.index(-1),r.indexAfter(-1),l.Fragment.from(c.create(),r.parent))||s.setNodeMarkup(s.mapping.map(r.before()),c)),t(s.scrollIntoView())}return!0})),"Mod-Enter":function(e,t){var n=e.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var a=r.node(-1),l=r.indexAfter(-1),s=yl(a.contentMatchAt(l));if(!a.canReplaceWith(l,l,s))return!1;if(t){var c=r.after(),u=e.tr.replaceWith(c,c,s.createAndFill());u.setSelection(i.Selection.near(u.doc.resolve(c),1)),t(u.scrollIntoView())}return!0},Backspace:kl,"Mod-Backspace":kl,Delete:Sl,"Mod-Delete":Sl,"Mod-a":function(e,t){return t&&t(e.tr.setSelection(new i.AllSelection(e.doc))),!0}},Ol={"Ctrl-h":Cl.Backspace,"Alt-Backspace":Cl["Mod-Backspace"],"Ctrl-d":Cl.Delete,"Ctrl-Alt-Backspace":Cl["Mod-Delete"],"Alt-Delete":Cl["Mod-Delete"],"Alt-d":Cl["Mod-Delete"]};for(var _l in Cl)Ol[_l]=Cl[_l];"undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&os.platform();var Ml=function(e,t){var n;this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,i){var o=n;if(t[1]){var a=t[0].lastIndexOf(t[1]);o+=t[0].slice(a+t[1].length);var l=(r+=a)-i;l>0&&(o=t[0].slice(a-l,a)+o,r=i)}return e.tr.insertText(o,r,i)}):t};function Al(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ll(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tl(Object(n),!0).forEach((function(t){Al(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function El(e){return function(e){if(Array.isArray(e))return Dl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Dl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e||!t)return!1;var n=e.parent.childAfter(e.parentOffset);if(!n.node)return!1;var r=n.node.marks.find((function(e){return e.type===t}));if(!r)return!1;for(var i=e.index(),o=e.start()+n.offset,a=i+1,l=o+n.node.nodeSize;i>0&&r.isInSet(e.parent.child(i-1).marks);)i-=1,o-=e.parent.child(i).nodeSize;for(;a<e.parent.childCount&&r.isInSet(e.parent.child(a).marks);)l+=e.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function Nl(e){var t=e.types,n=e.node;return Array.isArray(t)&&t.includes(n.type)||n.type===t}function Rl(e,t,n){return new Ml(e,(e,r,i,o)=>{const a=n instanceof Function?n(r):n,{tr:l}=e,s=r.length-1;let c=o,u=i;if(r[s]){const n=i+r[0].indexOf(r[s-1]),a=n+r[s-1].length-1,f=n+r[s-1].lastIndexOf(r[s]),d=f+r[s].length;if(function(e,t,n){let r=[];return n.doc.nodesBetween(e,t,(e,t)=>{r=[...r,...e.marks.map(n=>({start:t,end:t+e.nodeSize,mark:n}))]}),r}(i,o,e).filter(e=>{const{excluded:n}=e.mark.type;return n.find(e=>e.name===t.name)}).filter(e=>e.end>n).length)return!1;d<a&&l.delete(d,a),f>n&&l.delete(n,f),u=n,c=u+r[s].length}return l.addMark(u,c,t.create(a)),l.removeStoredMark(t),l})}function Il(e,t,n={}){return(r,i,o)=>function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(e){return e.type===t},i=s.findSelectedNodeOfType(t)(e.selection)||s.findParentNode(r)(e.selection);return Object.keys(n).length&&i?i.node.hasMarkup(t,Ll(Ll({},i.node.attrs),n)):!!i}(r,e,n)?xl(t)(r,i,o):xl(e,n)(r,i,o)}function Pl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pl(Object(n),!0).forEach((function(t){ta(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}function Bl(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ql(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ql(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function ql(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $l=[1,2,3,4,5,6];function Hl(e){var t=Qo(e),n=e.getAttribute("id"),r=function(e){var t=parseInt(e.getAttribute("level"),10)||0;if(t>0)return t;var n,r=e.tagName.toLowerCase(),i=Bl($l);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(r==="h".concat(o)){t=o;break}}}catch(e){i.e(e)}finally{i.f()}return t}(e);return t.id=n,t.level=r,t}function Wl(e){var t=Xo(e),n=e.attrs.id||function(){for(var e=[],t=0;t<36;t++)e[t]="0123456789abcdef".substr(Math.floor(16*Math.random()),1);return e[14]="4",e[19]="0123456789abcdef".substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23]="",e.join("").substr(0,6)}(),r=e.attrs.level||1;return t[0]="h".concat(r),t[1].id=n,t[1].level=r,e.attrs.id=n,t}var Ul=function(e){Ro(n,e);var t=zl(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(e){var t=e.type,n=e.schema;return function(e){return Il(t,n.nodes.paragraph,e)}}},{key:"keys",value:function(e){var t=e.type;return this.options.levels.reduce((function(e,n){return jl(jl({},e),ta({},"Shift-Ctrl-".concat(n),xl(t,{level:n})))}),{})}},{key:"inputRules",value:function(e){var t=e.type;return this.options.levels.map((function(e){return function(e,t,n){return new Ml(e,(function(e,r,i,o){var a=e.doc.resolve(i),l=n instanceof Function?n(r):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?e.tr.delete(i,o).setBlockType(i,i,t,l):null}))}(new RegExp("^(#{1,".concat(e,"})\\s$")),t,(function(){return{level:e}}))}))}},{key:"name",get:function(){return"heading"}},{key:"defaultOptions",get:function(){return{levels:$l}}},{key:"schema",get:function(){return jl(jl({},Jo),{},{attrs:jl(jl({},Jo.attrs),{},{level:{default:1},id:{default:""}}),content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map((function(e){return{tag:"h".concat(e),getAttrs:Hl}})),toDOM:Wl})}}]),n}(n.Node);const Gl=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"o-iframe iframe"},[e.view.editable?n("div",{staticClass:"row col-12 o-toolbar"},[n("q-input",{staticClass:"col-9 input text-red",attrs:{placeholder:e.$t("link"),debounce:"300",standout:"",clearable:""},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"prepend",fn:function(){return[n("q-icon",{attrs:{name:"link"}})]},proxy:!0}],null,!1,2056884940),model:{value:e.src,callback:function(t){e.src=t},expression:"src"}}),e._v(" "),n("q-input",{staticClass:"col-3 input text-red",attrs:{placeholder:e.$t("height"),suffix:"px",standout:""},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"prepend",fn:function(){return[n("q-icon",{attrs:{name:"height"}})]},proxy:!0}],null,!1,1420319411),model:{value:e.height,callback:function(t){e.height=t},expression:"height"}})],1):e._e(),e._v(" "),n("iframe",{staticClass:"iframe",style:{height:e.height+"px"},attrs:{src:e.src}})])},staticRenderFns:[]},void 0,{name:"o-iframe",data:function(){return{}},props:["node","updateAttrs","view"],components:{},methods:{},computed:{src:{get:function(){return this.node.attrs.src},set:function(e){this.updateAttrs({src:e})}},height:{get:function(){return this.node.attrs.height||400},set:function(e){this.updateAttrs({height:e})}}}},void 0,!1,void 0,!1,void 0,void 0,void 0);function Vl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var Kl=function(e){Ro(n,e);var t=Vl(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(e){var t=e.type;return function(e){return function(n,r){var i=n.selection,o=i.$cursor?i.$cursor.pos:i.$to.pos,a=t.create(e);r(n.tr.insert(o,a))}}}},{key:"name",get:function(){return"iframe"}},{key:"schema",get:function(){return{attrs:{src:{default:null},height:{default:null}},group:"block",selectable:!1,parseDOM:[{tag:"iframe",getAttrs:function(e){return{src:e.getAttribute("src"),height:e.getAttribute("height")}}}],toDOM:function(e){return["iframe",{src:e.attrs.src,frameborder:0,allowfullscreen:"true"}]}}}},{key:"view",get:function(){return Gl}}]),n}(n.Node),Jl=Y("species"),Yl=function(e,t){var n,r=w(e).constructor;return void 0===r||null==(n=w(r)[Jl])?t:z(n)},Xl=Ut(!0),Ql=function(e,t,n){return t+(n?Xl(e,t).length:1)},Zl=RegExp.prototype.exec,es=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw new TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==en(e))throw new TypeError("RegExp#exec called on incompatible receiver");return Zl.call(e,t)},ts=RegExp.prototype.exec,ns=String.prototype.replace,rs=ts,is=function(){var e=/a/,t=/b*/g;return ts.call(e,"a"),ts.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),as=void 0!==/()??/.exec("")[1];(is||as)&&(rs=function(e){var t,n,r,i,o=this;return as&&(n=new RegExp("^"+o.source+"$(?!\\s)",fn.call(o))),is&&(t=o.lastIndex),r=ts.call(o,e),is&&r&&(o.lastIndex=o.global?r.index+r[0].length:t),as&&r&&r.length>1&&ns.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r});var ls=rs;$({target:"RegExp",proto:!0,forced:ls!==/./.exec},{exec:ls});var ss=Y("species"),cs=!k((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),us=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}(),fs=function(e,t,n){var r=Y(e),i=!k((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),o=i?!k((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[ss]=function(){return n}),n[r](""),!t})):void 0;if(!i||!o||"replace"===e&&!cs||"split"===e&&!us){var a=/./[r],l=n(oe,r,""[e],(function(e,t,n,r,o){return t.exec===ls?i&&!o?{done:!0,value:a.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),s=l[0],c=l[1];j(String.prototype,e,s),R(RegExp.prototype,r,2==t?function(e,t){return c.call(e,this,t)}:function(e){return c.call(e,this)})}},ds=Math.min,ps=[].push,hs="length",ms=!k((function(){RegExp(4294967295,"y")}));fs("split",2,(function(e,t,n,r){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[hs]||2!="ab".split(/(?:ab)*/)[hs]||4!=".".split(/(.?)(.?)/)[hs]||".".split(/()()/)[hs]>1||"".split(/.?/)[hs]?function(e,t){var r=String(this);if(void 0===e&&0===t)return[];if(!vn(e))return n.call(r,e,t);for(var i,o,a,l=[],s=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,u=void 0===t?4294967295:t>>>0,f=new RegExp(e.source,s+"g");(i=ls.call(f,r))&&!((o=f.lastIndex)>c&&(l.push(r.slice(c,i.index)),i[hs]>1&&i.index<r[hs]&&ps.apply(l,i.slice(1)),a=i[0][hs],c=o,l[hs]>=u));)f.lastIndex===i.index&&f.lastIndex++;return c===r[hs]?!a&&f.test("")||l.push(""):l.push(r.slice(c)),l[hs]>u?l.slice(0,u):l}:"0".split(void 0,0)[hs]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,o,r):i.call(String(o),n,r)},function(e,t){var o=r(i,e,this,t,i!==n);if(o.done)return o.value;var a=w(e),l=String(this),s=Yl(a,RegExp),c=a.unicode,u=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(ms?"y":"g"),f=new s(ms?a:"^(?:"+a.source+")",u),d=void 0===t?4294967295:t>>>0;if(0===d)return[];if(0===l.length)return null===es(f,l)?[l]:[];for(var p=0,h=0,m=[];h<l.length;){f.lastIndex=ms?h:0;var g,v=es(f,ms?l:l.slice(h));if(null===v||(g=ds(fe(f.lastIndex+(ms?0:h)),l.length))===p)h=Ql(l,h,c);else{if(m.push(l.slice(p,h)),m.length===d)return m;for(var y=1;y<=v.length-1;y++)if(m.push(v[y]),m.length===d)return m;h=p=g}}return m.push(l.slice(p)),m}]}));var gs="".startsWith;$($.P+$.F*xn("startsWith"),"String",{startsWith:function(e){var t=yn(this,e,"startsWith"),n=fe(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return gs?gs.call(t,r,n):t.slice(n,n+r.length)===r}});var vs,ys,bs,xs=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e},ws=m((function(e){var t={},n={},r=e.exports=function(e,r,i,o,a){var l,s,c,u,f=a?function(){return e}:nn(e),d=B(i,o,r?2:1),p=0;if("function"!=typeof f)throw TypeError(e+" is not iterable!");if(Yt(f)){for(l=fe(e.length);l>p;p++)if((u=r?d(w(s=e[p])[0],s[1]):d(e[p]))===t||u===n)return u}else for(c=f.call(e);!(s=c.next()).done;)if((u=Vt(c,d,s.value,r))===t||u===n)return u};r.BREAK=t,r.RETURN=n})),ks=C.process,Ss=C.setImmediate,Cs=C.clearImmediate,Os=C.MessageChannel,_s=C.Dispatch,Ms=0,As={},Ts=function(){var e=+this;if(As.hasOwnProperty(e)){var t=As[e];delete As[e],t()}},Ls=function(e){Ts.call(e.data)};Ss&&Cs||(Ss=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return As[++Ms]=function(){go("function"==typeof e?e:Function(e),t)},vs(Ms),Ms},Cs=function(e){delete As[e]},"process"==re(ks)?vs=function(e){ks.nextTick(B(Ts,e,1))}:_s&&_s.now?vs=function(e){_s.now(B(Ts,e,1))}:Os?(bs=(ys=new Os).port2,ys.port1.onmessage=Ls,vs=B(bs.postMessage,bs,1)):C.addEventListener&&"function"==typeof postMessage&&!C.importScripts?(vs=function(e){C.postMessage(e+"","*")},C.addEventListener("message",Ls,!1)):vs="onreadystatechange"in M("script")?function(e){Ce.appendChild(M("script")).onreadystatechange=function(){Ce.removeChild(this),Ts.call(e)}}:function(e){setTimeout(B(Ts,e,1),0)});var Es={set:Ss,clear:Cs},Ds=Es.set,Fs=C.MutationObserver||C.WebKitMutationObserver,Ns=C.process,Rs=C.Promise,Is="process"==re(Ns);function Ps(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=z(t),this.reject=z(n)}var js,zs,Bs,qs,$s={f:function(e){return new Ps(e)}},Hs=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}},Ws=C.navigator,Us=Ws&&Ws.userAgent||"",Gs=function(e,t,n){for(var r in t)j(e,r,t[r],n);return e},Vs=Es.set,Ks=function(){var e,t,n,r=function(){var r,i;for(Is&&(r=Ns.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(Is)n=function(){Ns.nextTick(r)};else if(!Fs||C.navigator&&C.navigator.standalone)if(Rs&&Rs.resolve){var i=Rs.resolve(void 0);n=function(){i.then(r)}}else n=function(){Ds.call(C,r)};else{var o=!0,a=document.createTextNode("");new Fs(r).observe(a,{characterData:!0}),n=function(){a.data=o=!o}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}(),Js=C.TypeError,Ys=C.process,Xs=Ys&&Ys.versions,Qs=Xs&&Xs.v8||"",Zs=C.Promise,ec="process"==en(Ys),tc=function(){},nc=zs=$s.f,rc=!!function(){try{var e=Zs.resolve(1),t=(e.constructor={})[Y("species")]=function(e){e(tc,tc)};return(ec||"function"==typeof PromiseRejectionEvent)&&e.then(tc)instanceof t&&0!==Qs.indexOf("6.6")&&-1===Us.indexOf("Chrome/66")}catch(e){}}(),ic=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},oc=function(e,t){if(!e._n){e._n=!0;var n=e._c;Ks((function(){for(var r=e._v,i=1==e._s,o=0,a=function(t){var n,o,a,l=i?t.ok:t.fail,s=t.resolve,c=t.reject,u=t.domain;try{l?(i||(2==e._h&&sc(e),e._h=1),!0===l?n=r:(u&&u.enter(),n=l(r),u&&(u.exit(),a=!0)),n===t.promise?c(Js("Promise-chain cycle")):(o=ic(n))?o.call(n,s,c):s(n)):c(r)}catch(e){u&&!a&&u.exit(),c(e)}};n.length>o;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&ac(e)}))}},ac=function(e){Vs.call(C,(function(){var t,n,r,i=e._v,o=lc(e);if(o&&(t=Hs((function(){ec?Ys.emit("unhandledRejection",i,e):(n=C.onunhandledrejection)?n({promise:e,reason:i}):(r=C.console)&&r.error&&r.error("Unhandled promise rejection",i)})),e._h=ec||lc(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},lc=function(e){return 1!==e._h&&0===(e._a||e._c).length},sc=function(e){Vs.call(C,(function(){var t;ec?Ys.emit("rejectionHandled",e):(t=C.onrejectionhandled)&&t({promise:e,reason:e._v})}))},cc=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),oc(t,!0))},uc=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw Js("Promise can't be resolved itself");(t=ic(e))?Ks((function(){var r={_w:n,_d:!1};try{t.call(e,B(uc,r,1),B(cc,r,1))}catch(e){cc.call(r,e)}})):(n._v=e,n._s=1,oc(n,!1))}catch(e){cc.call({_w:n,_d:!1},e)}}};rc||(Zs=function(e){xs(this,Zs,"Promise","_h"),z(e),js.call(this);try{e(B(uc,this,1),B(cc,this,1))}catch(e){cc.call(this,e)}},(js=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=Gs(Zs.prototype,{then:function(e,t){var n=nc(Yl(this,Zs));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=ec?Ys.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&oc(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),Bs=function(){var e=new js;this.promise=e,this.resolve=B(uc,e,1),this.reject=B(cc,e,1)},$s.f=nc=function(e){return e===Zs||e===qs?new Bs(e):zs(e)}),$($.G+$.W+$.F*!rc,{Promise:Zs}),Ee(Zs,"Promise"),Ca("Promise"),qs=F.Promise,$($.S+$.F*!rc,"Promise",{reject:function(e){var t=nc(this);return(0,t.reject)(e),t.promise}}),$($.S+$.F*!rc,"Promise",{resolve:function(e){return function(e,t){if(w(e),h(t)&&t.constructor===e)return t;var n=$s.f(e);return(0,n.resolve)(t),n.promise}(this,e)}}),$($.S+$.F*!(rc&&ln((function(e){Zs.all(e).catch(tc)}))),"Promise",{all:function(e){var t=this,n=nc(t),r=n.resolve,i=n.reject,o=Hs((function(){var n=[],o=0,a=1;ws(e,!1,(function(e){var l=o++,s=!1;n.push(void 0),a++,t.resolve(e).then((function(e){s||(s=!0,n[l]=e,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=nc(t),r=n.reject,i=Hs((function(){ws(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}});var fc="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff",dc="["+fc+"]",pc=RegExp("^"+dc+dc+"*"),hc=RegExp(dc+dc+"*$"),mc=function(e,t,n){var r={},i=k((function(){return!!fc[e]()||"​"!="​"[e]()})),o=r[e]=i?t(gc):fc[e];n&&(r[n]=o),$($.P+$.F*i,"String",r)},gc=mc.trim=function(e,t){return e=String(oe(e)),1&t&&(e=e.replace(pc,"")),2&t&&(e=e.replace(hc,"")),e},vc=mc,yc=lt.f,bc=pt.f,xc=E.f,wc=vc.trim,kc=C.Number,Sc=kc,Cc=kc.prototype,Oc="Number"==re(Ae(Cc)),_c="trim"in String.prototype,Mc=function(e){var t=T(e,!1);if("string"==typeof t&&t.length>2){var n,r,i,o=(t=_c?t.trim():wc(t,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+t}for(var a,l=t.slice(2),s=0,c=l.length;s<c;s++)if((a=l.charCodeAt(s))<48||a>i)return NaN;return parseInt(l,r)}}return+t};if(!kc(" 0o1")||!kc("0b1")||kc("+0x1")){kc=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof kc&&(Oc?k((function(){Cc.valueOf.call(n)})):"Number"!=re(n))?ka(new Sc(Mc(t)),n,kc):Mc(t)};for(var Ac,Tc=S?yc(Sc):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),Lc=0;Tc.length>Lc;Lc++)x(Sc,Ac=Tc[Lc])&&!x(kc,Ac)&&xc(kc,Ac,bc(Sc,Ac));kc.prototype=Cc,Cc.constructor=kc,j(C,"Number",kc)}function Ec(e,t,n){return e<t?t:e>n?n:e}function Dc(e){window.open(e,"_blank")}$($.S,"Number",{isNaN:function(e){return e!=e}});const Fc=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("o-block-card",{staticClass:"o-katex",class:e.contentClass,attrs:{view:e.view,selected:e.selected,"get-pos":e.getPos,toolbar:e.view.editable},on:{"toggle-screen":e.onToggleFullScreen}},[n("template",{slot:"toolbar-left"},[n("div",{staticClass:"row col items-center full-height q-px-sm providers"},[n("q-icon",{attrs:{name:"mdi-sigma"}}),e._v(" "+e._s(e.$o.lang.editor.blockFormula)+"\n    ")],1)]),e._v(" "),n("template",{slot:"toolbar-right"},[e._e(),e._v(" "),e.view.editable?n("q-btn",{staticClass:"text-blue",attrs:{label:e.toggleLabel,flat:""},on:{click:e.toggleMode}}):e._e(),e._v(" "),n("q-btn-dropdown",{staticClass:"dropdown-menu",attrs:{"dropdown-icon":"more_vert",flat:"",dense:""}},[n("q-list",{staticStyle:{"min-width":"120px"}},[n("o-common-item",{attrs:{icon:"delete",label:e.$o.lang.label.remove},nativeOn:{click:function(t){return e.onDelete(t)}}}),e._v(" "),n("o-common-item",{attrs:{icon:"help_outline",label:e.$o.lang.label.help},nativeOn:{click:function(t){return e.onHelp(t)}}})],1)],1)],1),e._v(" "),n("section",{staticClass:"row col-12 diagram"},["edit"===e.mode||e.fullScreen?n("section",{staticClass:"col source"},[n("codemirror",{ref:"codemirror",staticClass:"diagram-editor",attrs:{id:"codemirror",options:e.editorOption,hint:!0},on:{input:e.onEditorChanged},model:{value:e.src,callback:function(t){e.src=t},expression:"src"}}),e._v(" "),e.error?n("div",{staticClass:"text-red error"},[n("q-icon",{attrs:{name:"info"}}),e._v(" 语法错误")],1):e._e()],1):e._e(),e._v(" "),"preview"===e.mode||e.fullScreen?n("section",{staticClass:"col preview",class:e.error?"error":""},[n("div",{domProps:{innerHTML:e._s(e.html)}})]):e._e()])],2)},staticRenderFns:[]},void 0,{name:"o-katex",data:function(){return{fullScreen:!1,mode:"preview",provider:"mermaid",example:"",html:"",error:!1,timeout:0,editorOption:{tabSize:4,mode:{name:"markdown",json:!0},theme:"neat",line:!0,lineWrapping:!0,lineNumbers:!0,extraKeys:{Enter:"newlineAndIndentContinueMarkdownList"},foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],styleActiveLine:!0,styleSelectedText:!0,scrollbarStyle:"native",tabindex:1,autofocus:!1}}},props:["node","updateAttrs","view","selected","getPos"],components:{codemirror:o.codemirror,OBlockCard:pa,OCommonItem:ha},methods:{init:function(){var e=this;"mermaid"===this.provider&&(this.src?this.renderKatex():setTimeout((function(){e.src="E=mc^2",e.renderKatex()}),100))},renderKatex:function(){try{this.error=!1,this.html=p.default.renderToString(this.src)}catch(e){this.error=!0,this.html=e.message}},onToggleFullScreen:function(e){this.fullScreen=e},toggleMode:function(){var e=this;try{this.mode="edit"===this.mode?"preview":"edit","preview"===this.mode?this.renderKatex():setTimeout((function(){e.$refs.codemirror.codemirror.focus()}),100)}catch(e){console.error(e),this.error=!0}},onEditorChanged:function(){var e=this;this.fullScreen&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.renderKatex()}),300))},onSelectTemplate:function(e){console.log("template",e,ga[e.value]),"mermaid"===this.provider&&(this.src=ga[e.value],this.renderKatex())},onDelete:function(){var e=this.view.state.tr,t=this.getPos();e.delete(t,t+this.node.nodeSize),this.view.dispatch(e)},onHelp:function(){Dc("https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference")}},computed:{src:{get:function(){return this.node.attrs.src},set:function(e){this.updateAttrs({src:e})}},toggleLabel:function(){return"edit"===this.mode?this.$o.lang.label.preview:this.$o.lang.label.edit},contentClass:function(){return this.fullScreen?"full-screen":""},mermaidDiagrams:function(){return[{label:"流程图 (Flow)",value:"flow"},{label:"时序图 (Sequence)",value:"sequence"},{label:"类图 (Class)",value:"class"},{label:"状态图 (State)",value:"state"},{label:"甘特图 (Gantt)",value:"gantt"}]}},mounted:function(){this.init()}},void 0,!1,void 0,!1,void 0,void 0,void 0);function Nc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var Rc=function(e){Ro(n,e);var t=Nc(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(e){var t=e.type;return function(e){return function(n,r){var i=n.selection,o=i.$cursor?i.$cursor.pos:i.$to.pos,a=t.create(e);r(n.tr.insert(o,a))}}}},{key:"name",get:function(){return"katex_block"}},{key:"schema",get:function(){return{attrs:{src:{default:null}},group:"block",selectable:!1,parseDOM:[{tag:"katex",getAttrs:function(e){return{src:e.getAttribute("src")}}}],toDOM:function(e){return["katex",{src:e.attrs.src}]}}}},{key:"view",get:function(){return Fc}}]),n}(n.Node);const Ic=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{staticClass:"o-katex-inline"},[n("span",{domProps:{innerHTML:e._s(e.html)}}),e._v(" "),n("q-menu",{attrs:{"content-class":"o-katex-editor",offset:[0,8]}},[n("section",[n("codemirror",{ref:"codemirror",attrs:{options:e.editorOption},on:{input:e.onEditorChanged},model:{value:e.src,callback:function(t){e.src=t},expression:"src"}}),e._v(" "),n("div",{staticClass:"row col-12 justify-between o-toolbar"},[n("div",{staticClass:"row col items-center q-px-md"},[e._v(e._s(e.$o.lang.editor.inlineFormula))]),e._v(" "),n("div",{staticClass:"col-auto actions"},[n("q-btn",{attrs:{icon:"help_outline",flat:""},on:{click:e.onHelp}})],1)])],1)])],1)},staticRenderFns:[]},void 0,{name:"o-katex-inline",data:function(){return{example:"",html:"",error:!1,timeout:0,editorOption:{tabSize:4,mode:{name:"markdown",json:!0},theme:"neat",line:!0,lineWrapping:!0,lineNumbers:!0,extraKeys:{Enter:"newlineAndIndentContinueMarkdownList"},foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],styleActiveLine:!0,styleSelectedText:!0,scrollbarStyle:"native",tabindex:1,autofocus:!1}}},props:["node","updateAttrs","view"],components:{codemirror:o.codemirror},methods:{init:function(){var e=this;this.src?this.renderKatex():setTimeout((function(){e.src="E=mc^2",e.renderKatex()}),100)},renderKatex:function(){try{this.error=!1,this.html=p.default.renderToString(this.src)}catch(e){this.error=!0,this.html=e.message}},onEditorChanged:function(){var e=this;this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.renderKatex()}),300)},onSelectTemplate:function(e){},onHelp:function(){Dc("https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference")}},computed:{src:{get:function(){return this.node.attrs.src},set:function(e){this.updateAttrs({src:e})}}},mounted:function(){this.init()}},void 0,!1,void 0,!1,void 0,void 0,void 0);function Pc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var jc=function(e){Ro(n,e);var t=Pc(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(e){var t=e.type;return function(e){return function(n,r){var i=n.selection,o=i.$cursor?i.$cursor.pos:i.$to.pos,a=t.create(e);r(n.tr.insert(o,a))}}}},{key:"name",get:function(){return"katex_inline"}},{key:"schema",get:function(){return{attrs:{src:{default:null}},inline:!0,group:"inline",selectable:!0,parseDOM:[{tag:"ki",getAttrs:function(e){return{src:e.getAttribute("src")}}}],toDOM:function(e){return["ki",{src:e.attrs.src}]}}}},{key:"view",get:function(){return Ic}}]),n}(n.Node),zc=Y("species"),Bc=function(e,t){return new(function(e){var t;return ot(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!ot(t.prototype)||(t=void 0),h(t)&&null===(t=t[zc])&&(t=void 0)),void 0===t?Array:t}(e))(t)},qc=function(e,t){var n=1==e,r=2==e,i=3==e,o=4==e,a=6==e,l=5==e||a,s=t||Bc;return function(t,c,u){for(var f,d,p=Ne(t),h=ie(p),m=B(c,u,3),g=fe(h.length),v=0,y=n?s(t,g):r?s(t,0):void 0;g>v;v++)if((l||v in h)&&(d=m(f=h[v],v,p),e))if(n)y[v]=d;else if(d)switch(e){case 3:return!0;case 5:return f;case 6:return v;case 2:y.push(f)}else if(o)return!1;return a?-1:i||o?o:y}}(5),$c=!0;function Hc(e,t,n){if(!e.selection||!e.doc||!t)return e;var r=e.selection,i=r.empty,o=r.$cursor,a=r.ranges;if(i&&!o||!function(e,t,n){for(var r=function(r){var i=t[r],o=i.$from,a=i.$to,l=0===o.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(o.pos,a.pos,(function(e){return!l&&(l=e.inlineContent&&e.type.allowsMarkType(n),!0)})),l)return{v:!0}},i=0;i<t.length;i++){var o=r(i);if("object"===Po(o))return o.v}return!1}(e.doc,a,t))return e;if(o)return e=e.removeStoredMark(t),n?e.addStoredMark(t.create(n)):e;for(var l=!1,s=0;!l&&s<a.length;s++){var c=a[s],u=c.$from,f=c.$to;l=e.doc.rangeHasMark(u.pos,f.pos,t)}for(var d=0;d<a.length;d++){var p=a[d],h=p.$from,m=p.$to;l&&(e=e.removeMark(h.pos,m.pos,t)),n&&(e=e.addMark(h.pos,m.pos,t.create(n)))}return e}function Wc(e,t){var n=e.schema,r=e.selection,o=e.tr,a=n.marks[t];if(!a)return"";if(r.empty){var l=(o.storedMarks||e.storedMarks||r instanceof i.TextSelection&&r.$cursor&&r.$cursor.marks&&r.$cursor.marks()||[]).find((function(e){return e.type===a}));return l&&l.attrs[t]||""}var s=function(e,t){var n=e.selection,r=n.from,i=n.to,o=[];e.doc.nodesBetween(r,i,(function(e){o=[].concat(El(o),El(e.marks))}));var a=o.find((function(e){return e.type.name===t.name}));return a?a.attrs:{}}(e,a)[t];return s||""}function Uc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}"find"in[]&&Array(1).find((function(){$c=!1})),$($.P+$.F*$c,"Array",{find:function(e){return qc(this,e,arguments.length>1?arguments[1]:void 0)}}),Z("find");var Gc=function(e){Ro(n,e);var t=Uc(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(e){var t=e.type;return function(e){return function(n,r){var i=n.tr;if((i=Hc(n.tr.setSelection(n.selection),t,e)).docChanged||i.storedMarksSet)return r&&r(i),!0}}}},{key:"inputRules",value:function(e){return[Rl(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,e.type)]}},{key:"name",get:function(){return"backColor"}},{key:"schema",get:function(){return{attrs:{backColor:{default:"#000000"}},parseDOM:[{style:"background",getAttrs:function(e){return{backColor:e}}}],toDOM:function(e){return["span",{style:"background: ".concat(e.attrs.backColor)},0]}}}}]),n}(n.Mark);function Vc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var Kc=function(e){Ro(n,e);var t=Vc(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(e){var t=e.type;return function(e){return function(n,r){var i=n.tr;if((i=Hc(n.tr.setSelection(n.selection),t,e)).docChanged||i.storedMarksSet)return r&&r(i),!0}}}},{key:"inputRules",value:function(e){return[Rl(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,e.type)]}},{key:"name",get:function(){return"foreColor"}},{key:"schema",get:function(){return{attrs:{foreColor:{default:"#000000"}},parseDOM:[{style:"color",getAttrs:function(e){return{foreColor:e}}}],toDOM:function(e){return["span",{style:"color: ".concat(e.attrs.foreColor)},0]}}}}]),n}(n.Mark);function Jc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var Yc=function(e){Ro(n,e);var t=Jc(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(e){var t=e.type;return function(e){return function(n,r){var i=n.tr;if((i=Hc(n.tr.setSelection(n.selection),t,e)).docChanged||i.storedMarksSet)return r&&r(i),!0}}}},{key:"inputRules",value:function(e){return[Rl(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,e.type)]}},{key:"name",get:function(){return"fontFamily"}},{key:"schema",get:function(){return{attrs:{fontFamily:{default:""}},parseDOM:[{style:"font-family",getAttrs:function(e){return{fontFamily:e}}}],toDOM:function(e){return["span",{style:"font-family: ".concat(e.attrs.fontFamily)},0]}}}}]),n}(n.Mark);function Xc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xc(Object(n),!0).forEach((function(t){ta(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zc(e,t,n,r,i,o){if(!e.length)return!1;var a=r;return e.forEach((function(e){var r=e.cell,i=e.node,l=e.pos;if(r){var c=s.findChildrenByType(i,o,!1);if(c&&c.length>0){var u=c[0],f=Qc(Qc({},i.attrs),{},{textAlign:t});a=a.setNodeMarkup(l,u.type,f,i.marks)}}else{var d=Qc(Qc({},i.attrs),{},{textAlign:n?t:null});a=a.setNodeMarkup(l,i.type,d,i.marks)}})),i&&i(a),!0}function eu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var tu=function(e){Ro(n,e);var t=eu(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Co(this,n),(e=t.call(this,r))._alignment=r.alignment||"left",e}return Ao(n,[{key:"commands",value:function(e){var t=e.type;return function(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,n){var r=e.doc,i=e.selection;if(!i||!r)return!1;var o=e.schema.nodes,a=o.paragraph,l=o.heading,c=o.blockquote,u=o.list_item,f=o.todo_item,d=o.table_cell,p=o.table_header,h=i.ranges,m=e.tr,g=s.isCellSelection(i),v=t.textAlign||null;if(i.empty||1===h.length&&h[0].$from.parent.eq(h[0].$to.parent)&&!g){var y=i.$from,b=y.depth,x=y.parent,w=b>1&&Nl({node:x,types:a})?[c,u,f,a]:x.type,k=s.findParentNode((function(e){return Nl({node:e,types:w})}))(i),S=k.pos,C=k.node,O=C.type,_=C.attrs,M=C.marks;return m=m.setNodeMarkup(S,O,Qc(Qc({},_),{},{textAlign:v}),M),n&&n(m),!0}var A=[];if(g){var T=[p,d];return h.forEach((function(e){var t=e.$from.parent,n=e.$to.parent;if(t.eq(n)&&e.$from.sameParent(e.$to)&&Nl({node:t,types:T})&&Nl({node:n,types:T})){t.attrs.textAlign!==v&&A.push({node:t,pos:e.$from.pos,cell:s.findCellClosestToPos(e.$from)});s.findChildrenByAttr(t,(function(e){var t=e.textAlign;return null!=t}),!0).forEach((function(t){var n=t.node,r=t.pos;Nl({node:n,types:[a,l,c,u]})&&A.push({node:n,pos:e.$from.pos+r})}))}})),Zc(A,v,!0,m,n,a)}return r.nodesBetween(i.from,i.to,(function(e,t){return!Nl({node:e,types:[a,l,c,u]})||((e.attrs.textAlign||null)===v||(A.push({node:e,pos:t}),Nl({node:e,types:[c,u]})))})),Zc(A,v,!0,m,n,a)}}(t,e)}}},{key:"name",get:function(){return"alignment"}},{key:"defaultOptions",get:function(){return{alignments:["left","center","right","justify"]}}}]),n}(n.Extension);function nu(e){return function(e){return"bullet_list"===e.type.name}(e)||function(e){return"order_list"===e.type.name}(e)||function(e){return"todo_list"===e.type.name}(e)}function ru(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function iu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ru(Object(n),!0).forEach((function(t){ta(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ru(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ou(e,t){var n=e,r=n.doc,o=n.selection;if(!r||!o)return e;if(!(o instanceof i.TextSelection||o instanceof i.AllSelection))return e;var a=o.from,l=o.to;return r.nodesBetween(a,l,(function(n,r){var i=n.type;return"paragraph"===i.name||"heading"===i.name||"blockquote"===i.name?(e=function(e,t,n){if(!e.doc)return e;var r=e.doc.nodeAt(t);if(!r)return e;var i=Ec((r.attrs.indent||0)+n,0,7);if(i===r.attrs.indent)return e;var o=iu(iu({},r.attrs),{},{indent:i});return e.setNodeMarkup(t,r.type,o,r.marks)}(e,r,t),!1):!nu(n)})),e}function au(e){return function(t,n){var r=t.selection,i=t.tr;return!!(i=ou(i=i.setSelection(r),e)).docChanged&&(n&&n(i),!0)}}function lu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var su=function(e){Ro(n,e);var t=lu(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(){return{indent:function(){return au(1)},outdent:function(){return au(-1)}}}},{key:"keys",value:function(e){e.type,e.state,e.view;return{"Cmd-]":au(1),"Cmd-[":au(-1)}}},{key:"name",get:function(){return"indent"}},{key:"defaultOptions",get:function(){return{minIndent:0,maxIndent:7}}}]),n}(n.Extension);function cu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cu(Object(n),!0).forEach((function(t){ta(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}
/**
   * Utils: alignment
   * @author Leecason
   * @license MIT, https://github.com/Leecason/element-tiptap/blob/master/LICENSE
   * @see https://github.com/Leecason/element-tiptap/blob/master/src/extensions/line_height.ts
   * @todo Table
   */var fu=["paragraph","heading","list_item","todo_item"];function du(e,t){var n=e,r=n.selection,i=n.doc;if(!r||!i)return e;var o=r.from,a=r.to,l=[];return t=t||null,i.nodesBetween(o,a,(function(e,n){var r=e.type;if(fu.includes(r.name)&&(e.attrs.lineHeight||null)!==t)return l.push({node:e,pos:n,nodeType:r}),"list_item"!==r.name&&"todo_item"!==r.name;return!0})),l.length?(l.forEach((function(n){var r=n.node,i=n.pos,o=n.nodeType,a=r.attrs;a=uu(uu({},a),{},{lineHeight:t}),e=e.setNodeMarkup(i,o,a,r.marks)})),e):e}function pu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var hu=function(e){Ro(n,e);var t=pu(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(){return function(e){return function(t,n){var r=t.selection,i=du(t.tr.setSelection(r),e.lineHeight);return!!i.docChanged&&(n&&n(i),!0)}}}},{key:"name",get:function(){return"lineHeight"}}]),n}(n.Extension),mu=function(e,t){if(!h(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e},gu=E.f,vu=D.fastKey,yu=S?"_s":"size",bu=function(e,t){var n,r=vu(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n},xu={getConstructor:function(e,t,n,r){var i=e((function(e,o){xs(e,i,t,"_i"),e._t=t,e._i=Ae(null),e._f=void 0,e._l=void 0,e[yu]=0,null!=o&&ws(o,n,e[r],e)}));return Gs(i.prototype,{clear:function(){for(var e=mu(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[yu]=0},delete:function(e){var n=mu(this,t),r=bu(n,e);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[yu]--}return!!r},forEach:function(e){mu(this,t);for(var n,r=B(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!bu(mu(this,t),e)}}),S&&gu(i.prototype,"size",{get:function(){return mu(this,t)[yu]}}),i},def:function(e,t,n){var r,i,o=bu(e,t);return o?o.v=n:(e._l=o={i:i=vu(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=o),r&&(r.n=o),e[yu]++,"F"!==i&&(e._i[i]=o)),e},getEntry:bu,setStrong:function(e,t,n){qe(e,t,(function(e,n){this._t=mu(e,t),this._k=n,this._l=void 0}),(function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?ee(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,ee(1))}),n?"entries":"values",!n,!0),Ca(t)}},wu=(function(e,t,n,r,i,o){var a=C[e],l=a,s=i?"set":"add",c=l&&l.prototype,u={},f=function(e){var t=c[e];j(c,e,"delete"==e||"has"==e?function(e){return!(o&&!h(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return o&&!h(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof l&&(o||c.forEach&&!k((function(){(new l).entries().next()})))){var d=new l,p=d[s](o?{}:-0,1)!=d,m=k((function(){d.has(1)})),g=ln((function(e){new l(e)})),v=!o&&k((function(){for(var e=new l,t=5;t--;)e[s](t,t);return!e.has(-0)}));g||((l=t((function(t,n){xs(t,l,e);var r=ka(new a,t,l);return null!=n&&ws(n,i,r[s],r),r}))).prototype=c,c.constructor=l),(m||v)&&(f("delete"),f("has"),i&&f("get")),(v||p)&&f(s),o&&c.clear&&delete c.clear}else l=r.getConstructor(t,e,i,s),Gs(l.prototype,n),D.NEED=!0;Ee(l,e),u[e]=l,$($.G+$.W+$.F*(l!=a),u),o||r.setStrong(l,e,i)}("Set",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return xu.def(mu(this,"Set"),e=0===e?0:e,e)}},xu),["align","bold","italic","underline","strike","link","foreColor","backColor","fontFamily","indent"]);function ku(e,t,n){var r=e,o=r.doc,a=r.selection;if(!a||!o)return e;var l=a.from,s=a.to;if(a.empty)return e;var c=new Set(wu.map((function(e){return t.marks[e]})).filter(Boolean));if(!c.size)return e;var u=[];return o.nodesBetween(l,s,(function(e,t){return!e.marks||!e.marks.length||(e.marks.some((function(n){c.has(n.type)&&u.push({node:e,pos:t,mark:n})})),!0)})),u.forEach((function(t){var n=t.node,r=t.mark,i=t.pos;e=e.removeMark(i,i+n.nodeSize,r.type)})),e=function(e){var t=e.doc,n=e.selection;if(!t||!n)return e;if(!(n instanceof i.TextSelection||n instanceof i.AllSelection))return e;var r=n.from,o=n.to;return t.nodesBetween(r,o,(function(t,n){var r=t.type;if("paragraph"===r.name||"heading"===r.name||"blockquote"===r.name){var i=iu(iu({},t.attrs),{},{indent:0});return e.setNodeMarkup(n,t.type,i,t.marks)}return!nu(t)})),e}(e=du(e,null))}function Su(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}var Cu=function(e){Ro(n,e);var t=Su(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(e){e.type;return function(){return function(e,t){var n=ku(e.tr.setSelection(e.selection),e.schema);return!(!t||!n.docChanged)&&(t(n),!0)}}}},{key:"name",get:function(){return"formatClear"}}]),n}(n.Extension),Ou=Math.max,_u=Math.min,Mu=Math.floor,Au=/\$([$&`']|\d\d?|<[^>]*>)/g,Tu=/\$([$&`']|\d\d?)/g;function Lu(e){var t=Array.from(document.querySelectorAll("style, link")).reduce((function(e,t){return e+t.outerHTML}),""),n=(t=(t=(t=t.replace(new RegExp('<link href=".*.js" .*[ht]">',"g"),"")).replace(new RegExp('href="',"g"),'href="/')).replace(new RegExp("fonts/","g"),"/fonts/"))+'<section class="tiptap tiptap-editor quasar-tiptap">'.concat(e.outerHTML,"</section>"),r=document.createElement("iframe");r.id="quasar-tiptap-iframe",r.setAttribute("style","position: absolute; width: 0; height: 0; top: -10px; left: -10px;"),document.body.appendChild(r);var i=r.contentWindow,o=r.contentDocument||r.contentWindow&&r.contentWindow.document;o&&(o.open(),o.write(n),o.close()),i&&(r.onload=function(){try{setTimeout((function(){i.focus();try{i.document.execCommand("print",!1)||i.print()}catch(e){i.print()}i.close()}),10)}catch(e){console.error(e)}setTimeout((function(){document.body.removeChild(r)}),100)})}function Eu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}fs("replace",2,(function(e,t,n,r){return[function(r,i){var o=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(e,t){var o=r(n,e,this,t);if(o.done)return o.value;var a=w(e),l=String(this),s="function"==typeof t;s||(t=String(t));var c=a.global;if(c){var u=a.unicode;a.lastIndex=0}for(var f=[];;){var d=es(a,l);if(null===d)break;if(f.push(d),!c)break;""===String(d[0])&&(a.lastIndex=Ql(l,fe(a.lastIndex),u))}for(var p,h="",m=0,g=0;g<f.length;g++){d=f[g];for(var v=String(d[0]),y=Ou(_u(ce(d.index),l.length),0),b=[],x=1;x<d.length;x++)b.push(void 0===(p=d[x])?p:String(p));var k=d.groups;if(s){var S=[v].concat(b,y,l);void 0!==k&&S.push(k);var C=String(t.apply(void 0,S))}else C=i(v,l,y,b,k,t);y>=m&&(h+=l.slice(m,y)+C,m=y+v.length)}return h+l.slice(m)}];function i(e,t,r,i,o,a){var l=r+e.length,s=i.length,c=Tu;return void 0!==o&&(o=Ne(o),c=Au),n.call(a,c,(function(n,a){var c;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(l);case"<":c=o[a.slice(1,-1)];break;default:var u=+a;if(0===u)return n;if(u>s){var f=Mu(u/10);return 0===f?n:f<=s?void 0===i[f-1]?a.charAt(1):i[f-1]+a.charAt(1):n}c=i[u-1]}return void 0===c?"":c}))}}));var Du=function(e){Ro(n,e);var t=Eu(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(){return function(){return function(e,t,n){var r=n.dom.closest(".editor__content");return!!r&&(Lu(r),!0)}}}},{key:"keys",value:function(e){e.view;return{"Mod-p":function(e,t,n){var r=n.dom.closest(".editor__content");return!!r&&(Lu(r),!0)}}}},{key:"name",get:function(){return"print"}}]),n}(n.Extension);function Fu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fu(Object(n),!0).forEach((function(t){ta(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}
/**
   * Utils: image
   * @author Leecason
   * @license MIT, https://github.com/Leecason/element-tiptap/blob/master/LICENSE
   * @see https://github.com/Leecason/element-tiptap/blob/master/src/utils/image.ts
   */var Ru={};function Iu(e){return new Promise((function(t,n){var r={complete:!1,width:0,height:0,src:e};if(e)if(Ru[e])t(Nu({},Ru[e]));else{var i=new Image;i.onload=function(){r.width=i.width,r.height=i.height,r.complete=!0,Ru[e]=Nu({},r),t(r)},i.onerror=function(){n(r)},i.src=e}else n(r)}))}const Pu=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{staticClass:"o-image-view",class:{"full-screen":e.fullScreen}},[n("span",{staticClass:"image-container",class:{selected:e.selected||e.resizing},attrs:{"data-text-align":e.node.attrs.textAlign}},[n("img",{ref:e.node.attrs.ref,class:{selected:e.selected||e.resizing,"cursor-pointer":e.node.attrs.ref},attrs:{src:e.src,width:e.node.attrs.width,height:e.node.attrs.height,caption:e.node.attrs.caption},on:{click:e.selectImage}}),e._v(" "),e.view.editable?n("div",{directives:[{name:"show",rawName:"v-show",value:e.selected||e.resizing,expression:"selected || resizing"}],staticClass:"image-resizer"},e._l(e.resizeDirections,(function(t,r){return n("span",{key:r,staticClass:"image-resizer__handler",class:"image-resizer__handler--"+t.value,on:{mousedown:function(n){return e.onMouseDown(n,t.value)}}})})),0):e._e()]),e._v(" "),e.node.attrs.caption?n("div",{staticClass:"text-center text-grey caption"},[e._v("\n    "+e._s(e.node.attrs.caption)+"\n  ")]):e._e(),e._v(" "),n("div",{staticClass:"row col-12 justify-end items-center o-toolbar"},[n("div",{staticClass:"col-auto actions"},[n("q-btn",{attrs:{color:"blue",icon:"fullscreen",flat:""},on:{click:e.toggleFullScreen}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle"}},[e._v(e._s(e.$o.lang.editor.toggleFullscreen))])],1),e._v(" "),e.view.editable?n("q-btn",{attrs:{color:"blue",icon:"settings",flat:""}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle"}},[e._v(e._s(e.$o.lang.image.preferences))]),e._v(" "),n("q-menu",{ref:"imgRef",attrs:{anchor:"top right",self:"top left","content-class":"o-menu o-image-menu"}},[n("section",{staticClass:"q-px-md q-pb-sm"},[n("div",{staticClass:"row justify-between items-center text-bold q-py-sm"},[n("div",[e._v(e._s(e.$o.lang.image.preferences))]),e._v(" "),n("div",[n("q-btn",{attrs:{icon:"close",size:"0.7rem",flat:"",dense:""},on:{click:function(t){return e.$refs.imgRef.hide()}}})],1)]),e._v(" "),n("q-separator"),e._v(" "),n("div",{staticClass:"row col-12 items-start q-py-md"},[n("q-input",{attrs:{type:"number",debounce:"500",standout:"",hint:e.$o.lang.image.width,suffix:"px"},on:{input:function(t){return e.onInput(t,"width")}},model:{value:e.imgOption.width,callback:function(t){e.$set(e.imgOption,"width",t)},expression:"imgOption.width"}}),e._v(" "),n("div",{staticClass:"q-px-sm"},[n("q-btn",{attrs:{icon:e.keepRatio?"link":"link_off",dense:"",flat:""},on:{click:function(t){e.keepRatio=!e.keepRatio}}},[n("q-tooltip",[e._v(e._s(e.keepRatio?e.$o.lang.image.lockAspectRatio:e.$o.lang.image.unlockAspectRatio))])],1)],1),e._v(" "),n("q-input",{attrs:{type:"number",debounce:"500",standout:"",hint:e.$o.lang.image.height,suffix:"px"},on:{input:function(t){return e.onInput(t,"height")}},model:{value:e.imgOption.height,callback:function(t){e.$set(e.imgOption,"height",t)},expression:"imgOption.height"}})],1),e._v(" "),n("div",{staticClass:"row col-12 items-center q-py-sm"},[e._v("\n              "+e._s(e.$o.lang.image.src)+"\n              "),n("q-input",{staticClass:"col-12",attrs:{debounce:"500",standout:"",clearable:""},on:{input:function(t){return e.onInput(t,"src")}},model:{value:e.imgOption.src,callback:function(t){e.$set(e.imgOption,"src",t)},expression:"imgOption.src"}})],1),e._v(" "),n("div",{staticClass:"row col-12 items-center q-py-sm"},[e._v("\n              "+e._s(e.$o.lang.image.caption)+"\n              "),n("q-input",{staticClass:"col-12",attrs:{debounce:"500",standout:"",clearable:""},on:{input:function(t){return e.onInput(t,"caption")}},model:{value:e.imgOption.caption,callback:function(t){e.$set(e.imgOption,"caption",t)},expression:"imgOption.caption"}})],1),e._v(" "),n("div",{staticClass:"row col-12 items-center q-py-sm"},[e._v("\n              "+e._s(e.$o.lang.image.link)+"\n              "),n("q-input",{staticClass:"col-12",attrs:{debounce:"500",standout:"",clearable:""},on:{input:function(t){return e.onInput(t,"ref")}},model:{value:e.imgOption.ref,callback:function(t){e.$set(e.imgOption,"ref",t)},expression:"imgOption.ref"}})],1)],1)])],1):e._e()],1)])])},staticRenderFns:[]},void 0,{name:"o-image-view",data:function(){return{fullScreen:!1,imgOption:{src:"",caption:"",ref:"",width:0,height:0,originalWidth:0,originalHeight:0},keepRatio:!0,resizing:!1,resizerState:{x:0,y:0,w:0,h:0,dir:""},sizeRate:1,maxWidth:0}},props:["node","view","updateAttrs","getPos","selected"],components:{},methods:{getMaxSize:function(){var e=getComputedStyle(this.view.dom).width;this.maxWidth=parseInt(e,10)},toggleFullScreen:function(){this.fullScreen=!this.fullScreen},selectImage:function(){if(this.view.editable||!this.node.attrs.ref){var e=this.view.state,t=e.tr,n=i.NodeSelection.create(e.doc,this.getPos());t=t.setSelection(n),this.view.dispatch(t)}else window.open(this.node.attrs.ref,"_blank")},resolveImage:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Iu(this.src).then((function(n){n.complete||(n.width=20,n.height=20),e.imgOption={src:e.src,caption:e.node.attrs.caption,ref:e.node.attrs.ref,width:t?n.width:e.node.attrs.width||n.width,height:t?n.height:e.node.attrs.height||n.height,originalWidth:n.width,originalHeight:n.height},t&&e.resize(null,null)})).catch((function(t){console.warn("error",t),e.src="https://www.donote.info/statics/logo.png",e.resolveImage(!0)}))},onInput:function(e,t){switch(t){case"src":this.src=e,this.resolveImage(!0);break;case"caption":this.updateAttrs({caption:e});break;case"ref":this.updateAttrs({ref:e});break;case"width":e<20&&(this.imgOption.width=20),this.updateSize("width");break;case"height":e<20&&(this.imgOption.height=20),this.updateSize("height")}},updateSize:function(e){var t=this.imgOption.originalWidth/this.imgOption.originalHeight,n=this.imgOption.width,r=this.imgOption.height;"width"===e?(n=Math.min(n,this.maxWidth),r=parseInt(n/t,10)):(n=parseInt(r*t,10),n=Math.min(n,this.maxWidth),r=parseInt(n/t,10)),this.resize(n,r),this.imgOption.width=n,this.imgOption.height=r},onMouseDown:function(e,t){e.preventDefault(),e.stopPropagation(),this.resizerState.x=e.clientX,this.resizerState.y=e.clientY,this.resizerState.w=Math.min(this.imgOption.width,this.maxWidth),this.resizerState.h=this.imgOption.height,this.resizerState.direction=t,this.resizing=!0,this.onEvents()},onMouseMove:function(e){if(e.preventDefault(),e.stopPropagation(),this.resizing){var t=this.imgOption.originalWidth/this.imgOption.originalHeight,n=this.resizerState,r=n.x,i=n.y,o=n.w,a=n.h,l=n.direction,s=(e.clientX-r)*(/l/.test(l)?-1:1),c=(e.clientY-i)*(/t/.test(l)?-1:1),u=Ec(o+s,20,1e5),f=Math.max(a+c,20);if(this.keepRatio){var d=u/f;d>t?u=parseInt(f*t,10):d<t&&(f=parseInt(u/t,10))}this.resize(u,f),this.imgOption.width=u,this.imgOption.height=f}},resize:function(e,t){this.updateAttrs({width:e,height:t})},onMouseUp:function(e){e.preventDefault(),e.stopPropagation(),this.resizing&&(this.resizing=!1,this.resizerState={x:0,y:0,w:0,h:0,direction:""},this.offEvents(),this.selectImage())},onEvents:function(){document.addEventListener("mousemove",this.onMouseMove,!0),document.addEventListener("mouseup",this.onMouseUp,!0)},offEvents:function(){document.removeEventListener("mousemove",this.onMouseMove,!0),document.removeEventListener("mouseup",this.onMouseUp,!0)}},computed:{src:{get:function(){return this.node.attrs.src},set:function(e){this.updateAttrs({src:e})}},sizeOptions:function(){return[{label:"25%",value:.25},{label:"50%",value:.5},{label:"75%",value:.75},{label:"100%",value:1}]},resizeDirections:function(){return[{label:"",value:"tl"},{label:"",value:"tr"},{label:"",value:"bl"},{label:"",value:"br"}]}},created:function(){this.resolveImage()},mounted:function(){this.getMaxSize()}},void 0,!1,void 0,!1,void 0,void 0,void 0);function ju(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}function zu(e){var t=e.style,n=t.width,r=t.height;return n=n||e.getAttribute("width")||null,r=r||e.getAttribute("height")||null,{src:e.getAttribute("src")||"",caption:e.getAttribute("caption")||"",ref:e.getAttribute("ref")||"",width:null==n?null:parseInt(n,10),height:null==r?null:parseInt(r,10)}}function Bu(e){var t=e.attrs;return["img",{src:t.src,caption:t.caption,ref:t.ref,width:t.width,height:t.height}]}var qu=function(e){Ro(n,e);var t=ju(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"schema",get:function(){return{attrs:{src:{default:""},caption:{default:""},ref:{default:""},width:{default:null},height:{default:null}},inline:"true",group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:zu}],toDOM:Bu}}},{key:"view",get:function(){return Pu}}]),n}(r.Image),$u=/"/g,Hu=function(e,t,n,r){var i=String(oe(e)),o="<"+t;return""!==n&&(o+=" "+n+'="'+String(r).replace($u,"&quot;")+'"'),o+">"+i+"</"+t+">"},Wu=function(e,t){var n={};n[e]=t(Hu),$($.P+$.F*k((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)};function Uu(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Gu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gu(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function Gu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Wu("link",(function(e){return function(t){return e(this,"a","href",t)}})),fs("match",1,(function(e,t,n,r){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=r(n,e,this);if(t.done)return t.value;var i=w(e),o=String(this);if(!i.global)return es(i,o);var a=i.unicode;i.lastIndex=0;for(var l,s=[],c=0;null!==(l=es(i,o));){var u=String(l[0]);s[c]=u,""===u&&(i.lastIndex=Ql(o,fe(i.lastIndex),a)),c++}return 0===c?null:s}]}));var Vu=[{label:"Youtube",value:"youtube",icon:"mdi-youtube",color:"red",settings:{autoplay:!0}},{label:"Youku",value:"youku",icon:"",svgIcon:"youku",color:"blue"},{label:"Bilibili",value:"bilibili",icon:"",svgIcon:"bilibili",color:"blue"},{label:"QQ Video",value:"qqvideo",icon:"",svgIcon:"qqvideo",color:"green"}],Ku=[{label:"Google Map",value:"google_map",icon:"mdi-google-maps",color:"blue"},{label:"AMap",value:"amap",svgIcon:"amap"},{label:"Baidu Map",value:"baidu_map",svgIcon:"baidu-map"}],Ju=[{label:"Modao",value:"modao",svgIcon:"modao",color:"blue"},{label:"Lanhu",value:"lanhu",svgIcon:"lanhu",color:"blue"},{label:"Figma",value:"figma",svgIcon:"figma"},{label:"Canva",value:"canva",svgIcon:"canva"},{label:"ProcessOn",value:"processon",svgIcon:"processon"}],Yu=[{label:"CodePen",value:"codepen",icon:"mdi-codepen",color:"purple"}],Xu=[{label:"Google Forms",value:"google_forms",svgIcon:"google-forms",color:"blue"},{label:"Jinshuju",value:"jinshuju",svgIcon:"jinshuju",color:"blue"}],Qu=[{label:"IFrame",value:"iframe",icon:"mdi-iframe",color:"blue"}],Zu=[].concat(Vu,Ku,Ju,Yu,Xu,Qu),ef=function(e){var t,n=Uu(Zu);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.value===e)return r}}catch(e){n.e(e)}finally{n.f()}return{}},tf={youtube:{link:"https://www.youtube.com/watch?v=I4sMhHbHYXM",src:"https://www.youtube.com/embed/I4sMhHbHYXM",srcPrefix:"https://www.youtube.com/embed",linkRule:["www.youtube.com\\/watch\\?v=\\w+"]},youku:{link:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"https://player.youku.com/embed",linkRule:["v.youku.com\\/v_show\\/id_\\w+\\=*"],idRule:"id_\\w+\\=*"},bilibili:{link:"https://www.bilibili.com/video/BV1EJ411u7DN",src:"https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",srcPrefix:"https://player.bilibili.com/player.html?bvid",linkRule:["www.bilibili.com\\/video\\/\\w+"]},qqvideo:{link:"https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",src:"https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",srcPrefix:"https://v.qq.com/txp/iframe/player.html?vid",linkRule:["v.qq.com\\/x\\/cover\\/\\w+\\/\\w+"]},amap:{link:"https://www.amap.com/place/B000A45467",src:"https://www.amap.com/place/B000A45467",srcPrefix:"",linkRule:["\\.amap\\.com"]},baidu_map:{link:"https://j.map.baidu.com/15/fo",src:"https://j.map.baidu.com/15/fo",srcPrefix:"",linkRule:["map\\.baidu\\.com"]},google_map:{link:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3036.958958396003!2d116.5681862154775!3d40.43190767936344!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x35f121d7687f2ccf%3A0xd040259b950522df!2sGreat%20Wall%20of%20China!5e0!3m2!1sen!2sus!4v1588227850952!5m2!1sen!2sus",src:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3036.958958396003!2d116.5681862154775!3d40.43190767936344!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x35f121d7687f2ccf%3A0xd040259b950522df!2sGreat%20Wall%20of%20China!5e0!3m2!1sen!2sus!4v1588227850952!5m2!1sen!2sus",srcPrefix:"",linkRule:["https:\\/\\/www.google.com\\/maps\\/embed\\?pb=.+sus"],tips:"Google Map > select location > Share > Embed a map > COPY HTML"},modao:{link:"https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",src:"https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",srcPrefix:"",linkRule:["https:\\/\\/\\w+.modao.cc\\/app\\/\\w+\\/embed\\/v2"],tips:"Modao > More > Share > Embed > COPY"},lanhu:{link:"https://lanhuapp.com/url/evP7L",src:"https://lanhuapp.com/url/evP7L",srcPrefix:"",linkRule:["https:\\/\\/lanhuapp.com\\/url\\/\\w+"],tips:"Lanhu > Project > Share > Copy Link"},figma:{link:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",src:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",srcPrefix:"https://www.figma.com/embed?embed_host=share&url",linkRule:["https:\\/\\/www.figma.com\\/file\\/\\w+"]},canva:{link:"https://www.canva.cn/design/DAD61-t29UI/view",src:"https://www.canva.cn/design/DAD61-t29UI/view",srcPrefix:"",linkRule:["https:\\/\\/www.canva.cn\\/design\\/.+\\/view"]},processon:{link:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",src:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",srcPrefix:"",linkRule:["https:\\/\\/www.processon.com\\/embed\\/\\w+"]},codepen:{link:"https://codepen.io/mekery/embed/YzyrKOJ",src:"https://codepen.io/mekery/embed/YzyrKOJ",srcPrefix:"",linkRule:["https:\\/\\/codepen.io\\/.+\\/embed\\/\\w+"]},jinshuju:{link:"https://jinshuju.net/f/q9YvVf",src:"https://jinshuju.net/f/q9YvVf",srcPrefix:"",linkRule:["https:\\/\\/jinshuju.net\\/f\\/\\w+"]},google_forms:{link:"https://docs.google.com/forms/d/e/1FAIpQLSesQk_-5AGlkcI5PUdVIVqWbgKs39tEePBATL7Q8DNWT_lJYg/viewform?usp=sf_link",src:"https://docs.google.com/forms/d/e/1FAIpQLSesQk_-5AGlkcI5PUdVIVqWbgKs39tEePBATL7Q8DNWT_lJYg/viewform?embedded=true",srcPrefix:"",linkRule:["https:\\/\\/docs.google.com\\/forms\\/.+\\/viewform"],tips:"Google Forms > Send > Link or Embed HTML"},iframe:{link:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"",linkRule:[".+"]}};var nf=function(e,t){var n={validLink:!1,validId:!1,matchedUrl:"",originalLink:t,src:""};if(!(n=function(e,t,n){var r,i=Uu(tf[e].linkRule);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=new RegExp(o),l=t.match(a);if(l&&l.length>0)return n.validLink=!0,n.matchedUrl=l[0],n}}catch(e){i.e(e)}finally{i.f()}return n}(e,t,n)).validLink)return n;switch(e){case"youtube":return function(e,t){var n=tf.youtube,r=t.matchedUrl;t.validLink=!0;var i=r.split("="),o=i.length;if(o>0){var a=i[o-1];t.src="".concat(n.srcPrefix,"/").concat(a),t.validId=!0}return t}(0,n);case"youku":return function(e,t){var n=tf.youku,r=t.matchedUrl,i=n.idRule,o=new RegExp(i),a=r.match(o);if(a&&a.length>0){var l=a[0].substr(3);t.validId=!0,t.src="".concat(n.srcPrefix,"/").concat(l)}else t.validId=!1;return t}(0,n);case"bilibili":return function(e,t){var n=tf.bilibili,r=t.matchedUrl.split("/"),i=r.length;if(i>0){var o=r[i-1];t.src="".concat(n.srcPrefix,"=").concat(o),t.validId=!0}return t}(0,n);case"qqvideo":return function(e,t){var n=tf.qqvideo,r=t.matchedUrl.split("/"),i=r.length;if(i>0){var o=r[i-1];t.src="".concat(n.srcPrefix,"=").concat(o),t.validId=!0}return t}(0,n);case"amap":case"baidu_map":return function(e,t){return t.src=e,t.validId=!0,t}(t,n);case"google_map":case"modao":case"lanhu":return function(e,t){return t.src=t.matchedUrl,t.validId=!0,t.originalLink=t.src,t}(0,n);case"figma":return function(e,t){var n=tf.figma;return t.src="".concat(n.srcPrefix,"=").concat(encodeURIComponent(t.matchedUrl)),t.validId=!0,t.originalLink=t.matchedUrl,t}(0,n);case"canva":return function(e,t){return t.src="".concat(t.matchedUrl,"?embed"),t.validId=!0,t.originalLink=e,t}(t,n);case"processon":return function(e,t){return t.src="".concat(t.matchedUrl),t.validId=!0,t.originalLink=e,t}(t,n);case"codepen":return function(e,t){return t.src="".concat(t.matchedUrl),t.validId=!0,t.originalLink=t.src,t}(0,n);case"jinshuju":return function(e,t){return t.src="".concat(t.matchedUrl,"?background=white&banner=show&embedded=true"),t.validId=!0,t.originalLink=e,t}(t,n);case"google_forms":return function(e,t){return t.src="".concat(t.matchedUrl,"?embedded=true"),t.validId=!0,t.originalLink=t.matchedUrl,t}(0,n);case"iframe":return function(e,t){return t.src="".concat(t.matchedUrl),t.validId=!0,t.originalLink=e,t}(t,n)}return n},rf=function(e,t,n){if(!e||!n)return e;var r=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(r)?e.replace(r,"$1"+t+"="+n+"$2"):e+i+t+"="+n};const of=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("o-block-card",{staticClass:"o-embed",class:e.src?"":"no-data",attrs:{view:e.view,selected:e.selected,"get-pos":e.getPos,toolbar:e.view.editable}},[n("template",{slot:"toolbar-left"},[n("q-input",{ref:"link",attrs:{placeholder:e.$o.lang.embed.linkTips,standout:"bg-grey-3",autofocus:!0,clearable:""},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.onConfirm(t)}},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"prepend",fn:function(){return[n("div",{staticClass:"row items-center"},[e.service.svgIcon?n("svg",{staticClass:"icon",attrs:{"aria-hidden":"true"}},[n("use",{attrs:{"xlink:href":"#icon-"+e.service.svgIcon}})]):n("q-icon",{attrs:{name:e.service.icon||"apps",color:e.service.color}}),e._v(" "),n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle"}},[e._v(e._s(e.$o.lang.embed[e.service.value]))])],1)]},proxy:!0}]),model:{value:e.originalLink,callback:function(t){e.originalLink=t},expression:"originalLink"}})],1),e._v(" "),n("template",{slot:"toolbar-right"},[n("q-btn",{attrs:{label:e.$o.lang.label.example,dense:"",flat:""},on:{click:e.onViewExample}}),e._v(" "),n("q-btn-dropdown",{attrs:{"dropdown-icon":"more_vert",split:"",flat:""},on:{click:e.onConfirm}},[n("span",{staticClass:"text-blue",attrs:{slot:"label"},slot:"label"},[e._v(e._s(e.$o.lang.label.submit))]),e._v(" "),n("q-list",{staticStyle:{"min-width":"120px"}},[e.service.settings?n("o-common-item",{attrs:{icon:"settings",label:e.$o.lang.label.settings}},[n("q-menu",{ref:"imgRef",attrs:{anchor:"top right",self:"top left","content-class":"o-menu o-embed-settings-menu"}},[n("section",{staticClass:"q-px-md q-pb-sm",staticStyle:{"min-width":"300px"}},[n("div",{staticClass:"row justify-between items-center text-bold q-py-sm"},[n("div",[e._v("\n                  "+e._s(e.service.label)+" "+e._s(e.$o.lang.label.settings)+"\n                ")]),e._v(" "),n("div",[n("q-btn",{attrs:{icon:"close",size:"0.7rem",flat:"",dense:""},on:{click:function(t){return e.$refs.imgRef.hide()}}})],1)]),e._v(" "),n("q-separator"),e._v(" "),n("div",{staticClass:"row col-12 items-start q-py-md"},[n("q-toggle",{attrs:{label:"Autoplay"},on:{input:e.onAutoplaySet},model:{value:e.autoplayToggle,callback:function(t){e.autoplayToggle=t},expression:"autoplayToggle"}})],1)],1)])],1):e._e(),e._v(" "),n("o-common-item",{attrs:{icon:"delete",label:e.$o.lang.label.remove},nativeOn:{click:function(t){return e.onDelete(t)}}}),e._v(" "),n("o-common-item",{attrs:{icon:"help_outline",label:e.$o.lang.label.help},nativeOn:{click:function(t){return e.onHelp(t)}}})],1)],1)],1),e._v(" "),e.src?n("div",{staticClass:"o-embed-content"},[n("div",{staticClass:"cover"}),e._v(" "),n("iframe",{directives:[{name:"show",rawName:"v-show",value:!e.loading,expression:"!loading"}],staticClass:"iframe",style:{height:e.height+"px"},attrs:{src:e.src,frameborder:"0",allowfullscreen:"true"},on:{load:e.onLoaded}}),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"row justify-center items-center iframe"},[n("q-spinner",{attrs:{color:"primary",size:"3em"}})],1)]):e._e()],2)},staticRenderFns:[]},void 0,{name:"o-embed",data:function(){return{originalLink:"",autoplayToggle:!1,fullScreen:!1,loading:!0}},props:["node","updateAttrs","view","selected","getPos"],components:{OBlockCard:pa,OCommonItem:ha},methods:{onViewExample:function(){var e=tf[this.service.value];e&&(this.originalLink=e.link,this.link=e.link,this.src=e.src)},onConfirm:function(){var e=nf(this.service.value,this.originalLink);e.validLink&&e.validId?(this.originalLink=e.originalLink,this.link=e.originalLink,this.src=this.buildSrc(e.src),console.log("src",this.src)):this.$q.notify({color:"red",icon:"mdi-alert-circle",message:"".concat(this.$o.lang.embed[this.service.value],", ").concat(this.$o.lang.embed.linkWarning),position:"top",timeout:1500})},buildSrc:function(e){switch(this.service.value){case"youtube":e=rf(e,"autoplay",this.autoplay)}return e},onAutoplaySet:function(){this.autoplay=this.autoplayToggle?"1":"0",this.src=rf(this.src,"autoplay",this.autoplay)},onDelete:function(){var e=this.view.state.tr,t=this.getPos();e.delete(t,t+this.node.nodeSize),this.view.dispatch(e)},onHelp:function(){var e=this.service.value||"";e=e.replace("_","-");var t="https://github.com/donotebase/quasar-tiptap/wiki/Embed#".concat(e);window.open(t,"_blank")},onLoaded:function(){this.loading=!1}},computed:{service:function(){return ef(this.node.attrs.service)},link:{get:function(){return this.node.attrs.link},set:function(e){this.updateAttrs({link:e})}},src:{get:function(){return this.node.attrs.src},set:function(e){this.updateAttrs({src:e})}},height:{get:function(){return this.node.attrs.height||500},set:function(e){this.updateAttrs({height:e})}},autoplay:{get:function(){return this.node.attrs.autoplay},set:function(e){this.updateAttrs({autoplay:e})}}},mounted:function(){var e=this;this.link?this.originalLink=this.link:setTimeout((function(){e.$refs.link.focus()}),300),"amap"===this.service.value&&(this.loading=!1),this.autoplayToggle="1"===this.autoplay}},void 0,!1,void 0,!1,void 0,void 0,void 0);function af(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}function lf(e){return{src:e.getAttribute("src")||"",height:e.getAttribute("data-height")||500,service:e.getAttribute("data-service")||"iframe",link:decodeURIComponent(e.getAttribute("data-link")||""),autoplay:e.getAttribute("data-autoplay")||""}}function sf(e){var t=e.attrs,n=t.src,r=t.height,i=t.service,o=t.link,a=t.autoplay,l={};return r&&(l["data-height"]=r),i&&(l["data-service"]=i),o&&(l["data-link"]=encodeURIComponent(o)),a&&(l["data-autoplay"]=a),l.src=n,l.frameborder=0,l.allowfullscreen=!0,l.autoplay=a,["oembed",l]}var cf=function(e){Ro(n,e);var t=af(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(e){var t=e.type;return function(e){return function(n,r){var i=n.selection,o=i.$cursor?i.$cursor.pos:i.$to.pos,a=t.create(e);r(n.tr.insert(o,a))}}}},{key:"name",get:function(){return"embed"}},{key:"schema",get:function(){return{attrs:{src:{default:null},height:{default:null},service:{default:null},link:{default:null},autoplay:{default:null}},group:"block",selectable:!1,parseDOM:[{tag:"oembed",getAttrs:lf}],toDOM:sf}}},{key:"view",get:function(){return of}}]),n}(n.Node);function uf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}Wu("anchor",(function(e){return function(t){return e(this,"a","name",t)}}));var ff=function(e){Ro(n,e);var t=uf(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"commands",value:function(e){e.type;return{insertHTML:function(e){return function(t,n){var r=t.selection,i=document.createElement("div");i.innerHTML=e.trim();var o=l.DOMParser.fromSchema(t.schema).parseSlice(i);n(t.tr.insert(r.anchor,o.content))}}}}},{key:"name",get:function(){return"html"}},{key:"schema",get:function(){return{inline:!1,attrs:{},group:"block",draggable:!0,parseDOM:[]}}}]),n}(n.Node);function df(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zo(this,n)}}function pf(e){return{href:e.getAttribute("href"),openInNewTab:"_blank"===e.getAttribute("target")}}function hf(e){var t=e.attrs,n=t.href,r=t.openInNewTab,i={};i.href=n;var o="nofollow";return r&&(i.target="_blank",o+=" noopener noreferrer"),i.ref=o.trim(),["a",i,0]}var mf=function(e){Ro(n,e);var t=df(n);function n(){return Co(this,n),t.apply(this,arguments)}return Ao(n,[{key:"schema",get:function(){return{attrs:{href:{default:null},openInNewTab:{default:!0}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:pf}],toDOM:hf}}},{key:"plugins",get:function(){return[new i.Plugin({props:{handleClick:function(e,t){var n=e.state,r=n.schema,o=n.doc,a=n.tr,l=Fl(o.resolve(t),r.marks.link);if(!l)return!1;var s=o.resolve(l.from),c=o.resolve(l.to),u=a.setSelection(new i.TextSelection(s,c));return e.dispatch(u),!0}}})]}}]),n}(r.Link),gf=["Bold","Italic","Strike","Underline","Code","CodeBlock","CodeBlockHighlight","BulletList","OrderedList","ListItem","TodoList","HorizontalRule","Table","Link"],vf=["OTitle","ODoc","OParagraph","OBlockquote","OTodoItem","OHeading","OAlignment","OIndent","OLineHeight","OForeColor","OBackColor","OFontFamily","OIframe","ODiagram","OKatexBlock","OKatexInline","OFormatClear","OPrint","OImage","OEmbed","OInsertHtml","OLink"],yf=[].concat(gf,vf),bf={BulletList:r.BulletList,CodeBlock:r.CodeBlock,CodeBlockHighlight:r.CodeBlockHighlight,HardBreak:r.HardBreak,ListItem:r.ListItem,OrderedList:r.OrderedList,TodoList:r.TodoList,Bold:r.Bold,Code:r.Code,Italic:r.Italic,Strike:r.Strike,Underline:r.Underline,History:r.History,Table:r.Table,TableHeader:r.TableHeader,TableCell:r.TableCell,TableRow:r.TableRow,Placeholder:r.Placeholder,Focus:r.Focus,HorizontalRule:r.HorizontalRule,TrailingNode:r.TrailingNode,OTitle:Ho,ODoc:Uo,OParagraph:Yo,OBlockquote:aa,OTodoItem:da,OAlignment:tu,OIndent:su,OLineHeight:hu,OBackColor:Gc,OForeColor:Kc,OFontFamily:Yc,OHeading:Ul,OIframe:Kl,ODiagram:ba,OKatexBlock:Rc,OKatexInline:jc,OFormatClear:Cu,OPrint:Du,OImage:qu,OEmbed:cf,OInsertHtml:ff,OLink:mf},xf=function e(t,n){return Co(this,e),new bf[t](n)},wf={"add-more":"o-add-more-btn","font-family":"o-font-family-dropdown","fore-color":"o-fore-color-dropdown","back-color":"o-back-color-dropdown","align-dropdown":"o-align-dropdown","align-group":"o-align-group","line-height":"o-line-height-dropdown","list-dropdown":"o-list-dropdown","indent-dropdown":"o-indent-dropdown","text-format-dropdown":"o-text-format-dropdown",heading:"o-heading-dropdown",link:"o-link-btn",photo:"o-photo-btn",table:"o-table-btn","link-off":"o-link-off-btn","link-open":"o-link-open-btn","link-edit":"o-link-edit-btn"},kf=["add-more","separator","bold","italic","underline","strike","code","separator","heading","font-family","fore-color","back-color","format_clear","separator","align-dropdown","indent","outdent","line-height","separator","horizontal","bullet_list","ordered_list","todo_list","separator","blockquote","code_block","link","photo","table","separator","undo","redo","separator","print"],Sf=["add-more","separator","bold","italic","code","separator","font-family","fore-color","back-color","format_clear","separator","bullet_list","ordered_list","todo_list","separator","align-dropdown","separator","table"],Cf=["bold","italic","separator","font-family","fore-color","back-color","separator","link","separator","align-group"],Of=["link-open","link-edit","link-off"],_f={video:["youtube","youku","bilibili","qqvideo"],map:["google_map","amap","baidu_map"],design:["modao","lanhu","figma","canva","processon"],develop:["codepen"],data:["google_forms","jinshuju"],others:["iframe"]};const Mf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"o-color-board"},e._l(e.colorSet,(function(t,r){return n("div",{key:"row-"+r,staticClass:"row color-row"},e._l(t,(function(t,r){return n("div",{key:"col-"+r,staticClass:"row color-column"},[n("div",{staticClass:"row justify-center items-center cell-container",on:{click:function(n){return e.onSelect(t)}}},[n("div",{staticClass:"row justify-center items-center cell",class:{border:t.border},style:{backgroundColor:t.hex}},[e.isActive(t.hex)?n("q-icon",{style:{color:e.highlightColor(t.rgb)},attrs:{name:"done"}}):e._e()],1)])])})),0)})),0)},staticRenderFns:[]},void 0,{name:"o-color-board",data:function(){return{}},props:{activeColor:{type:String,default:""},closable:{type:Boolean,default:!1}},methods:{onSelect:function(e){this.$emit("select",e.hex)},isActive:function(e){return this.activeColor===e},highlightColor:function(e){return function(e){if(!e.startsWith("rgb"))return e;var t=e.split(","),n="#000000";return parseInt(t[0].split("(")[1],10)+parseInt(t[1],10)+parseInt(t[2].split(")")[0],10)<540&&(n="#ffffff"),n}(e)}},computed:{colorSet:function(){return[[{label:"color",rgb:"rgb(0, 0, 0)",hex:"#000000"},{label:"color",rgb:"rgb(38, 38, 38)",hex:"#262626"},{label:"color",rgb:"rgb(89, 89, 89)",hex:"#595959"},{label:"color",rgb:"rgb(140, 140, 140)",hex:"#8c8c8c"},{label:"color",rgb:"rgb(191, 191, 191)",hex:"#bfbfbf"},{label:"color",rgb:"rgb(217, 217, 217)",hex:"#d9d9d9"},{label:"color",rgb:"rgb(233, 233, 233)",hex:"#e9e9e9"},{label:"color",rgb:"rgb(245, 245, 245)",hex:"#f5f5f5"},{label:"color",rgb:"rgb(250, 250, 250)",hex:"#fafafa",border:!0},{label:"color",rgb:"rgb(255, 255, 255)",hex:"#ffffff",border:!0}],[{label:"color",rgb:"rgb(245, 34, 45)",hex:"#f5222d"},{label:"color",rgb:"rgb(250, 84, 28)",hex:"#fa541c"},{label:"color",rgb:"rgb(250, 140, 22)",hex:"#fa8c16"},{label:"color",rgb:"rgb(250, 219, 20)",hex:"#fadb14"},{label:"color",rgb:"rgb(82, 196, 26)",hex:"#52c41a"},{label:"color",rgb:"rgb(19, 194, 194)",hex:"#13c2c2"},{label:"color",rgb:"rgb(24, 144, 255)",hex:"#1890ff"},{label:"color",rgb:"rgb(47, 84, 235)",hex:"#2f54eb"},{label:"color",rgb:"rgb(114, 46, 209)",hex:"#722ed1"},{label:"color",rgb:"rgb(235, 47, 150)",hex:"#eb2f96"}],[{label:"color",rgb:"rgb(255, 232, 230)",hex:"#ffe8e6"},{label:"color",rgb:"rgb(255, 236, 224)",hex:"#ffece0"},{label:"color",rgb:"rgb(255, 239, 209)",hex:"#ffefd1"},{label:"color",rgb:"rgb(255, 248, 189)",hex:"#fff8bd"},{label:"color",rgb:"rgb(228, 247, 210)",hex:"#e4f7d2"},{label:"color",rgb:"rgb(211, 245, 240)",hex:"#d3f5f0"},{label:"color",rgb:"rgb(212, 238, 252)",hex:"#d4eefc"},{label:"color",rgb:"rgb(222, 232, 252)",hex:"#dee8fc"},{label:"color",rgb:"rgb(239, 225, 250)",hex:"#efe1fa"},{label:"color",rgb:"rgb(250, 225, 235)",hex:"#fae1eb"}],[{label:"color",rgb:"rgb(255, 163, 158)",hex:"#ffa39e"},{label:"color",rgb:"rgb(255, 187, 150)",hex:"#ffbb96"},{label:"color",rgb:"rgb(255, 213, 145)",hex:"#ffd591"},{label:"color",rgb:"rgb(255, 240, 143)",hex:"#fff08f"},{label:"color",rgb:"rgb(183, 235, 143)",hex:"#b7eb8f"},{label:"color",rgb:"rgb(135, 232, 222)",hex:"#87e8de"},{label:"color",rgb:"rgb(145, 213, 255)",hex:"#91d5ff"},{label:"color",rgb:"rgb(173, 198, 255)",hex:"#adc6ff"},{label:"color",rgb:"rgb(211, 173, 247)",hex:"#d3adf7"},{label:"color",rgb:"rgb(255, 173, 210)",hex:"#ffadd2"}],[{label:"color",rgb:"rgb(255, 77, 79)",hex:"#ff4d4f"},{label:"color",rgb:"rgb(255, 122, 69)",hex:"#ff7a45"},{label:"color",rgb:"rgb(255, 169, 64)",hex:"#ffa940"},{label:"color",rgb:"rgb(255, 236, 61)",hex:"#ffec3d"},{label:"color",rgb:"rgb(115, 209, 61)",hex:"#73d13d"},{label:"color",rgb:"rgb(54, 207, 201)",hex:"#36cfc9"},{label:"color",rgb:"rgb(64, 169, 255)",hex:"#40a9ff"},{label:"color",rgb:"rgb(89, 126, 247)",hex:"#597ef7"},{label:"color",rgb:"rgb(146, 84, 222)",hex:"#9254de"},{label:"color",rgb:"rgb(247, 89, 171)",hex:"#f759ab"}],[{label:"color",rgb:"rgb(207, 19, 34)",hex:"#cf1322"},{label:"color",rgb:"rgb(212, 56, 13)",hex:"#d4380d"},{label:"color",rgb:"rgb(212, 107, 8)",hex:"#d46b08"},{label:"color",rgb:"rgb(212, 177, 6)",hex:"#d4b106"},{label:"color",rgb:"rgb(56, 158, 13)",hex:"#389e0d"},{label:"color",rgb:"rgb(8, 151, 156)",hex:"#08979c"},{label:"color",rgb:"rgb(9, 109, 217)",hex:"#096dd9"},{label:"color",rgb:"rgb(29, 57, 196)",hex:"#1d39c4"},{label:"color",rgb:"rgb(83, 29, 171)",hex:"#531dab"},{label:"color",rgb:"rgb(196, 29, 127)",hex:"#c41d7f"}],[{label:"color",rgb:"rgb(130, 0, 20)",hex:"#820014"},{label:"color",rgb:"rgb(135, 20, 0)",hex:"#871400"},{label:"color",rgb:"rgb(135, 56, 0)",hex:"#873800"},{label:"color",rgb:"rgb(97, 71, 0)",hex:"#614700"},{label:"color",rgb:"rgb(19, 82, 0)",hex:"#135200"},{label:"color",rgb:"rgb(0, 71, 79)",hex:"#00474f"},{label:"color",rgb:"rgb(0, 58, 140)",hex:"#003a8c"},{label:"color",rgb:"rgb(6, 17, 120)",hex:"#061178"},{label:"color",rgb:"rgb(34, 7, 94)",hex:"#22075e"},{label:"color",rgb:"rgb(120, 6, 80)",hex:"#780650"}]]}}},void 0,!1,void 0,!1,void 0,void 0,void 0);const Af=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("q-btn-dropdown",{staticClass:"o-fore-color-dropdown",attrs:{"menu-anchor":"bottom left","menu-self":"top left","menu-offset":[20,0],"content-class":"o-fore-color-menu",split:"",flat:""},on:{click:e.onSelectCurrent}},[n("section",{staticClass:"row justify-center label",attrs:{slot:"label"},slot:"label"},[n("div",[n("q-icon",{attrs:{name:"mdi-format-color-text"}})],1),e._v(" "),n("div",{staticClass:"indicator",style:"background: "+e.hex})]),e._v(" "),n("o-color-board",{directives:[{name:"close-popup",rawName:"v-close-popup",value:e.closable,expression:"closable"}],attrs:{"active-color":e.activeColor},on:{select:e.onSelect}})],1),e._v(" "),n("q-tooltip",{attrs:{delay:500}},[e._v(e._s(e.$o.lang.editor.textColor))])],1)},staticRenderFns:[]},void 0,{name:"o-fore-color-dropdown",data:function(){return{hex:"#ff4d4f",closable:!1}},props:{editor:{type:Object},commands:{type:Object},getMarkAttrs:{type:Function}},components:{OColorBoard:Mf},methods:{onSelectCurrent:function(){this.onSelect(this.hex)},onSelect:function(e){this.closable=!0,this.hex=e,this.commands.foreColor({foreColor:e})}},computed:{activeColor:function(){return Wc(this.editor.state,"foreColor")}}},void 0,!1,void 0,!1,void 0,void 0,void 0);const Tf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("q-btn-dropdown",{staticClass:"o-back-color-dropdown",attrs:{"menu-anchor":"bottom left","menu-self":"top left","menu-offset":[20,0],"content-class":"o-back-color-menu",split:"",flat:""},on:{click:e.onSelectCurrent}},[n("section",{staticClass:"row justify-center label",attrs:{slot:"label"},slot:"label"},[n("div",[n("q-icon",{attrs:{name:"mdi-format-color-highlight"}})],1),e._v(" "),n("div",{staticClass:"indicator",style:"background: "+e.hex})]),e._v(" "),n("o-color-board",{directives:[{name:"close-popup",rawName:"v-close-popup",value:e.closable,expression:"closable"}],attrs:{"active-color":e.activeColor},on:{select:e.onSelect}})],1),e._v(" "),n("q-tooltip",{attrs:{delay:500}},[e._v(e._s(e.$o.lang.editor.highlightColor))])],1)},staticRenderFns:[]},void 0,{name:"o-back-color-dropdown",data:function(){return{hex:"#ffec3d",closable:!1}},props:{editor:{type:Object},commands:{type:Object}},components:{OColorBoard:Mf},methods:{onSelectCurrent:function(){this.onSelect(this.hex)},onSelect:function(e){this.closable=!0,this.hex=e,this.commands.backColor({backColor:e})}},computed:{activeColor:function(){return Wc(this.editor.state,"backColor")}}},void 0,!1,void 0,!1,void 0,void 0,void 0);const Lf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("q-btn-dropdown",{staticClass:"o-font-family",attrs:{icon:"mdi-format-font","menu-anchor":"bottom left","menu-self":"top left","content-class":"o-menu o-align-dropdown-menu",dense:"",flat:""}},[n("q-list",[e._l(e.fontFamilies,(function(t,r){return[t.separator?n("q-separator",{key:r}):n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],key:r,class:{"is-active":e.isActive(t.value)},attrs:{clickable:""},nativeOn:{click:function(n){return e.commands.fontFamily({fontFamily:t.value})}}},[n("q-item-section",{style:"font-family: "+t.value},[e._v(e._s(t.label))]),e._v(" "),n("q-item-section",{attrs:{side:""}},[n("q-icon",{staticClass:"checked",attrs:{name:"mdi-check"}})],1)],1)]}))],2)],1),e._v(" "),n("q-tooltip",{attrs:{delay:500}},[e._v(e._s(e.$o.lang.editor.fontFamily))])],1)},staticRenderFns:[]},void 0,{name:"o-font-family",data:function(){return{fontFamilies:[{label:this.$o.lang.editor.default,value:"Roboto"},{label:"Arial",value:"Arial",separator:!0},{label:"Arial Black",value:"Arial Black"},{label:"Georgia",value:"Georgia"},{label:"Impact",value:"Impact"},{label:"Helvetica",value:"Helvetica"},{label:"Roboto",value:"Roboto"},{label:"Tahoma",value:"Tahoma"},{label:"Times New Roman",value:"Times New Roman"},{label:"Verdana",value:"Verdana"},{label:"Courier New",value:"Courier New",separator:!0},{label:"Monaco",value:"Monaco"},{label:"Monospace",value:"monospace"}]}},props:{editor:{type:Object},commands:{type:Object}},methods:{isActive:function(e){return e===Wc(this.editor.state,"fontFamily")}},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);function Ef(e,t,n){var r=e.selection,i=e.doc,o=r.from,a=r.to,l=!0,s=!1;return i.nodesBetween(o,a,(function(e){return l&&e.attrs[t]===n&&(l=!1,s=!0),l})),s}const Df=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("q-btn-dropdown",{staticClass:"o-align-dropdown",attrs:{icon:"format_align_center","menu-anchor":"bottom left","menu-self":"top left","content-class":"o-menu o-align-dropdown-menu",dense:"",flat:""}},[n("q-list",e._l(e.alignments,(function(t,r){return n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],key:r,class:{"is-active":e.isActive(t.value)},attrs:{clickable:""},nativeOn:{click:function(e){return t.command({textAlign:t.value})}}},[n("q-item-section",{attrs:{side:""}},[n("q-icon",{attrs:{name:"format_align_"+t.value}})],1),e._v(" "),n("q-item-section",[e._v(e._s(t.label))]),e._v(" "),n("q-item-section",{attrs:{side:""}},[n("q-icon",{staticClass:"checked",attrs:{name:"mdi-check"}})],1)],1)})),1)],1),e._v(" "),n("q-tooltip",{attrs:{delay:500}},[e._v(e._s(e.$o.lang.editor.align))])],1)},staticRenderFns:[]},void 0,{name:"o-align-dropdown",data:function(){return{}},props:{editor:{type:Object},commands:{type:Object}},methods:{isActive:function(e){return Ef(this.editor.state,"textAlign",e)}},computed:{alignments:function(){return[{label:this.$o.lang.editor.left,value:"left",command:this.commands.alignment},{label:this.$o.lang.editor.center,value:"center",command:this.commands.alignment},{label:this.$o.lang.editor.right,value:"right",command:this.commands.alignment},{label:this.$o.lang.editor.justify,value:"justify",command:this.commands.alignment}]}}},void 0,!1,void 0,!1,void 0,void 0,void 0);const Ff=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{staticClass:"o-menubar-btn",attrs:{label:e.label,to:e.to,flat:""}},[e.icon?n("q-icon",{attrs:{name:e.icon}}):e._e(),e._v(" "),e.tooltip?n("q-tooltip",{attrs:{delay:e.tipDelay}},[e._v("\n    "+e._s(e.tooltip)+"\n  ")]):e._e(),e._v(" "),e.vtooltip?n("q-tooltip",{attrs:{anchor:"center right",self:"center left"}},[e._v("\n    "+e._s(e.vtooltip)+"\n  ")]):e._e(),e._v(" "),e._t("default")],2)},staticRenderFns:[]},void 0,{name:"o-menubar-btn",data:function(){return{}},props:{to:{type:String,default:""},color:{type:String,default:"primary"},icon:{type:String,default:""},label:{type:String,default:""},tooltip:{type:String,default:""},vtooltip:{type:String,default:""},tipDelay:{type:Number,default:500}},methods:{},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);const Nf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"o-align-group"},e._l(e.alignments,(function(t,r){return n("o-menubar-btn",{key:r,class:{"is-active":e.isActive(t.value)},attrs:{icon:"format_align_"+t.value,tooltip:t.label},nativeOn:{click:function(e){return t.command({textAlign:t.value})}}})})),1)},staticRenderFns:[]},void 0,{name:"o-align-group",data:function(){return{}},props:{editor:{type:Object},commands:{type:Object}},components:{OMenubarBtn:Ff},methods:{isActive:function(e){return Ef(this.editor.state,"textAlign",e)}},computed:{alignments:function(){return[{label:this.$o.lang.editor.left,value:"left",command:this.commands.alignment},{label:this.$o.lang.editor.center,value:"center",command:this.commands.alignment},{label:this.$o.lang.editor.right,value:"right",command:this.commands.alignment}]}}},void 0,!1,void 0,!1,void 0,void 0,void 0);const Rf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("q-btn-dropdown",{staticClass:"o-line-height-dropdown",attrs:{icon:"mdi-format-line-spacing","menu-anchor":"bottom left","menu-self":"top left","content-class":"o-menu o-line-height-dropdown-menu",dense:"",flat:""}},[n("q-list",[e._l(e.types,(function(t,r){return[t.separator?n("q-separator",{key:"s-"+r}):e._e(),e._v(" "),n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],key:r,class:{"is-active":e.isActive(t.value)},attrs:{clickable:""},nativeOn:{click:function(n){return e.commands.lineHeight({lineHeight:t.value})}}},[n("q-item-section",[e._v(e._s(t.label))]),e._v(" "),n("q-item-section",{attrs:{side:""}},[n("q-icon",{staticClass:"checked",attrs:{name:"mdi-check"}})],1)],1)]}))],2)],1),e._v(" "),n("q-tooltip",{attrs:{delay:500}},[e._v(e._s(e.$o.lang.editor.lineHeight))])],1)},staticRenderFns:[]},void 0,{name:"o-line-height-dropdown",data:function(){return{types:[{label:this.$o.lang.editor.default,value:"0"},{label:"1",value:"1",separator:!0},{label:"1.15",value:"1.15"},{label:"1.5",value:"1.5"},{label:"2",value:"2"},{label:"2.5",value:"2.5"},{label:"3",value:"3"}]}},props:{editor:{type:Object},commands:{type:Object}},methods:{isActive:function(e){return Ef(this.editor.state,"lineHeight",e)}},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);const If=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-list",{staticClass:"o-heading-list"},[n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{clickable:""},nativeOn:{click:function(t){return e.commands.paragraph(t)}}},[n("q-item-section",{attrs:{side:""}},[n("q-icon",{attrs:{name:"mdi-format-pilcrow"}})],1),e._v(" "),n("q-item-section",[e._v(e._s(e.$o.lang.editor.paragraph))])],1),e._v(" "),n("q-separator"),e._v(" "),e._l(e.headings,(function(t,r){return n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],key:r,class:{"is-active":e.isActive(t.value)},attrs:{clickable:""},nativeOn:{click:function(n){return e.commands.heading({level:t.value})}}},[n("q-item-section",{attrs:{side:""}},[e._v(e._s("H"+t.value))]),e._v(" "),n("q-item-section",[e._v(e._s(t.label))]),e._v(" "),n("q-item-section",{attrs:{side:""}},[n("q-icon",{staticClass:"checked",attrs:{name:"mdi-check"}})],1)],1)}))],2)},staticRenderFns:[]},void 0,{name:"o-heading-list",data:function(){return{}},props:{editor:{type:Object},commands:{type:Object}},methods:{isActive:function(e){return Ef(this.editor.state,"level",e)}},computed:{headings:function(){return[{label:this.$o.lang.editor.heading1,value:1},{label:this.$o.lang.editor.heading2,value:2},{label:this.$o.lang.editor.heading3,value:3},{label:this.$o.lang.editor.heading4,value:4},{label:this.$o.lang.editor.heading5,value:5}]}}},void 0,!1,void 0,!1,void 0,void 0,void 0);const Pf=la({render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("q-btn-dropdown",{staticClass:"o-heading-dropdown",attrs:{icon:"mdi-format-header-pound","menu-anchor":"bottom left","menu-self":"top left","content-class":"o-menu o-heading-dropdown-menu",flat:""}},[t("o-heading-list",{attrs:{editor:this.editor,commands:this.commands}})],1),this._v(" "),t("q-tooltip",{attrs:{delay:500}},[this._v(this._s(this.$o.lang.editor.headings))])],1)},staticRenderFns:[]},void 0,{name:"o-heading-dropdown",data:function(){return{}},props:{editor:{type:Object},commands:{type:Object}},components:{OHeadingList:If},methods:{},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);function jf(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return zf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zf(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function zf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Bf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("q-btn-dropdown",{staticClass:"o-list-dropdown",attrs:{icon:e.currentItem.icon,"menu-anchor":"bottom left","menu-self":"top left","menu-offset":[20,0],"content-class":"o-menu",split:"",flat:""},on:{click:e.selectCurrent}},[n("q-list",{},e._l(e.list,(function(t,r){return n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],key:r,class:{"is-active":t.isActive},attrs:{clickable:""},nativeOn:{click:function(n){return e.select(t)}}},[n("q-item-section",{attrs:{side:""}},[n("q-icon",{attrs:{name:t.icon}})],1),e._v(" "),n("q-item-section",[e._v(e._s(t.label))]),e._v(" "),n("q-item-section",{attrs:{side:""}},[n("q-icon",{staticClass:"checked",attrs:{name:"mdi-check"}})],1)],1)})),1)],1),e._v(" "),n("q-tooltip",{attrs:{delay:500}},[e._v(e._s(e.$o.lang.editor.list))])],1)},staticRenderFns:[]},void 0,{name:"o-list-dropdown",data:function(){return{current:"bullet_list"}},props:{editor:{type:Object},commands:{type:Object},isActive:{type:Object}},components:{},methods:{selectCurrent:function(){this.select(this.currentItem)},select:function(e){this.current=e.value,e.command()}},computed:{list:function(){return[{label:this.$o.lang.editor.unorderedList,value:"bullet_list",icon:"format_list_bulleted",isActive:this.isActive.bullet_list(),command:this.commands.bullet_list},{label:this.$o.lang.editor.orderedList,value:"ordered_list",icon:"format_list_numbered",isActive:this.isActive.ordered_list(),command:this.commands.ordered_list},{label:this.$o.lang.editor.todoList,value:"todo_list",icon:"mdi-check-box-outline",isActive:this.isActive.todo_list(),command:this.commands.todo_list}]},currentItem:function(){var e,t=jf(this.list);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(this.current===n.value)return n}}catch(e){t.e(e)}finally{t.f()}return{label:this.$o.lang.editor.unorderedList,value:"bullet_list",icon:"format_list_bulleted",isActive:this.isActive.bullet_list(),command:this.commands.bullet_list}}}},void 0,!1,void 0,!1,void 0,void 0,void 0);function qf(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return $f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $f(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function $f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Hf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("q-btn-dropdown",{staticClass:"o-indent-dropdown",attrs:{icon:e.currentItem.icon,"menu-anchor":"bottom left","menu-self":"top left","menu-offset":[20,0],"content-class":"o-menu",split:"",flat:""},on:{click:e.selectCurrent}},[n("q-list",{},e._l(e.list,(function(t,r){return n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],key:r,class:{"is-active":t.isActive},attrs:{clickable:""},nativeOn:{click:function(n){return e.select(t)}}},[n("q-item-section",{attrs:{side:""}},[n("q-icon",{attrs:{name:t.icon}})],1),e._v(" "),n("q-item-section",[e._v(e._s(t.label))]),e._v(" "),n("q-item-section",{attrs:{side:""}},[n("q-icon",{staticClass:"checked",attrs:{name:"mdi-check"}})],1)],1)})),1)],1),e._v(" "),n("q-tooltip",{attrs:{delay:500}},[e._v(e._s(e.$o.lang.editor.indentDropdown))])],1)},staticRenderFns:[]},void 0,{name:"o-indent-dropdown",data:function(){return{current:"indent"}},props:{editor:{type:Object},commands:{type:Object},isActive:{type:Object}},components:{},methods:{selectCurrent:function(){this.select(this.currentItem)},select:function(e){this.current=e.value,e.command()}},computed:{list:function(){return[{label:this.$o.lang.editor.indent,value:"indent",icon:"format_indent_increase",isActive:!1,command:this.commands.indent},{label:this.$o.lang.editor.outdent,value:"outdent",icon:"format_indent_decrease",isActive:!1,command:this.commands.outdent}]},currentItem:function(){var e,t=qf(this.list);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(this.current===n.value)return n}}catch(e){t.e(e)}finally{t.f()}return{label:this.$o.lang.editor.indent,value:"indent",icon:"format_indent_increase",isActive:!1,command:this.commands.indent}}}},void 0,!1,void 0,!1,void 0,void 0,void 0);function Wf(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Uf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uf(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function Uf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Wu("strike",(function(e){return function(){return e(this,"strike","","")}})),Wu("bold",(function(e){return function(){return e(this,"b","","")}}));const Gf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("q-btn-dropdown",{staticClass:"o-text-format-dropdown",attrs:{icon:"title","menu-anchor":"bottom left","menu-self":"top left","menu-offset":[0,0],"content-class":"o-menu",flat:""}},[n("q-list",e._l(e.customList,(function(t,r){return n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],key:r,class:{"is-active":t.isActive},attrs:{clickable:""},nativeOn:{click:function(n){return e.select(t)}}},[n("q-item-section",{attrs:{side:""}},[n("q-icon",{attrs:{name:t.icon}})],1),e._v(" "),n("q-item-section",[e._v(e._s(t.label))]),e._v(" "),n("q-item-section",{attrs:{side:""}},[n("q-icon",{staticClass:"checked",attrs:{name:"mdi-check"}})],1)],1)})),1)],1),e._v(" "),n("q-tooltip",{attrs:{delay:500}},[e._v(e._s(e.$o.lang.editor.textFormat))])],1)},staticRenderFns:[]},void 0,{name:"o-text-format-dropdown",data:function(){return{current:""}},props:{editor:{type:Object},commands:{type:Object},isActive:{type:Object},opt:{type:Object,default:function(){return{}}}},components:{},methods:{selectCurrent:function(){this.select(this.currentItem)},select:function(e){e&&(this.current=e.value,e.command())}},computed:{list:function(){return[{label:this.$o.lang.editor.bold,value:"bold",icon:"format_bold",isActive:this.isActive.bold(),command:this.commands.bold},{label:this.$o.lang.editor.italic,value:"italic",icon:"format_italic",isActive:this.isActive.italic(),command:this.commands.italic},{label:this.$o.lang.editor.strikethrough,value:"strike",icon:"format_strikethrough",isActive:this.isActive.strike(),command:this.commands.strike},{label:this.$o.lang.editor.underline,value:"underline",icon:"format_underline",isActive:this.isActive.underline(),command:this.commands.underline},{label:this.$o.lang.editor.code,value:"code",icon:"code",isActive:this.isActive.code(),command:this.commands.code}]},customList:function(){if(this.opt&&this.opt.list){var e,t=[],n=Wf(this.opt.list);try{for(n.s();!(e=n.n()).done;){var r,i=e.value,o=Wf(this.list);try{for(o.s();!(r=o.n()).done;){var a=r.value;i===a.value&&t.push(a)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}return t}return this.list},currentItem:function(){var e,t=Wf(this.list);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(this.current===n.value)return n}}catch(e){t.e(e)}finally{t.f()}return null}}},void 0,!1,void 0,!1,void 0,void 0,void 0);function Vf(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Kf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kf(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function Kf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Jf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"o-embed-menu"},e._l(e.services,(function(t,r){return n("section",{key:"group-"+r},[n("div",{staticClass:"group"},[e._v(e._s(e.$o.lang.embed[t.value]))]),e._v(" "),n("section",{staticClass:"row col-12 q-col-gutter-sm services"},e._l(t.children,(function(t,i){return n("div",{key:"service-"+r+"-"+i,staticClass:"row col-3"},[n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"col-12",attrs:{clickable:""},on:{click:function(n){return e.select(t)}}},[n("q-item-section",{attrs:{avatar:""}},[t.svgIcon?n("svg",{staticClass:"icon",attrs:{"aria-hidden":"true"}},[n("use",{attrs:{"xlink:href":"#icon-"+t.svgIcon}})]):n("q-icon",{attrs:{name:t.icon||"apps",color:t.color}})],1),e._v(" "),n("q-item-section",[e._v("\n            "+e._s(e.$o.lang.embed[t.value])+"\n          ")])],1)],1)})),0)])})),0)},staticRenderFns:[]},void 0,{name:"o-embed-menu",data:function(){return{}},props:{embedServices:{type:Object}},methods:{select:function(e){this.$emit("select",e)}},computed:{services2:function(){return[{label:"Video",value:"video",children:Vu},{label:"Map",value:"map",children:Ku},{label:"Design",value:"design",children:Ju},{label:"Develop",value:"develop",children:Yu},{label:"Data",value:"data",children:Xu},{label:"Others",value:"others",children:Qu}]},services:function(){var e=[],t=this.embedServices||_f;for(var n in t){var r,i={value:n,children:[]},o=Vf(t[n]);try{for(o.s();!(r=o.n()).done;){var a=r.value,l=ef(a);l.value&&i.children.push(l)}}catch(e){o.e(e)}finally{o.f()}e.push(i)}return e}},mounted:function(){}},void 0,!1,void 0,!1,void 0,void 0,void 0);const Yf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"o-meta-input"},[n("section",{staticClass:"row col-12 justify-between"},[n("div",{staticClass:"title"},[e._v(e._s(e.title))]),e._v(" "),n("div",[e._t("header-right")],2)]),e._v(" "),n("div",{staticClass:"fields"},[n("q-input",{ref:"input",attrs:{standout:"bg-blue",clearable:"",flat:"",autofocus:!0,placeholder:e.$o.lang.label.linkAddress},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.onConfirm(t)}},scopedSlots:e._u([{key:"prepend",fn:function(){return[n("q-icon",{attrs:{name:e.icon}})]},proxy:!0}]),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}})],1),e._v(" "),n("div",{staticClass:"actions row justify-between"},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"bg-grey-3",attrs:{flat:""},on:{click:function(t){return e.$emit("secondAction")}}},[e._v("\n      "+e._s(e.$o.lang.label.cancel)+"\n    ")]),e._v(" "),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"bg-blue text-white",attrs:{flat:""},on:{click:e.onConfirm}},[e._v("\n      "+e._s(e.$o.lang.label.ok)+"\n    ")])],1)])},staticRenderFns:[]},void 0,{name:"o-meta-input",data:function(){return{value:""}},props:{val:{type:String,default:""},title:{type:String,default:"超链接"},type:{type:String,default:"link"},icon:{type:String,default:"link"},secondIcon:{type:String,default:""},secondLabel:{type:String,default:""}},methods:{onConfirm:function(){this.$emit("primaryAction",this.value),this.value=""}},watch:{val:function(e,t){this.value=e}},mounted:function(){this.value=this.val}},void 0,!1,void 0,!1,void 0,void 0,void 0);const Xf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"o-table-grid"},[e._l(e.rows,(function(t,r){return n("div",{key:"row-"+r,staticClass:"row justify-start cursor-pointer"},e._l(e.columns,(function(r,i){return n("div",{key:"col-"+i},[n("div",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"cell",class:{selected:t<=e.selectedRows&&r<=e.selectedColumns},on:{mouseover:function(n){return e.select(t,r)},click:function(t){return e.onSelected()}}})])})),0)})),e._v(" "),n("footer",{staticClass:"row justify-center q-pt-md"},[e._v("\n    "+e._s(e.selectedRows)+" x "+e._s(e.selectedColumns)+"\n  ")])],2)},staticRenderFns:[]},void 0,{name:"o-table-grid",data:function(){return{rows:5,columns:5,selectedRows:2,selectedColumns:2}},props:{commands:{type:Object}},methods:{onHide:function(){this.rows=5,this.columns=5,this.selectedRows=2,this.selectedColumns=2},select:function(e,t){this.selectedRows=e,this.selectedColumns=t,this.rows===e&&this.rows<10&&(this.rows+=1),this.columns===t&&this.columns<10&&(this.columns+=1)},onSelected:function(){this.commands.createTable({rowsCount:this.selectedRows,colsCount:this.selectedColumns,withHeaderRow:!0})}},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);const Qf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("o-menubar-btn",{staticClass:"text-blue o-add-more-btn",attrs:{icon:"add",tooltip:e.$o.lang.editor.addMore}},[n("q-menu",{ref:"addPopover",attrs:{anchor:"bottom left",self:"top left","content-class":"o-menu"}},[n("section",[n("o-common-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{icon:"mdi-code-braces",label:e.$o.lang.editor.codeBlock},nativeOn:{click:function(t){return e.commands.code_block(t)}}}),e._v(" "),n("o-common-item",{attrs:{icon:"photo",label:e.$o.lang.editor.photo}},[n("q-menu",{ref:"photoPopover",attrs:{anchor:"top right",self:"top left",offset:[2,0]}},[n("o-meta-input",{attrs:{title:e.$o.lang.editor.photo,icon:"image"},on:{primaryAction:function(t){return e.insertImage(e.commands.image,t)}}})],1)],1),e._v(" "),n("o-common-item",{attrs:{icon:"mdi-table",label:e.$o.lang.editor.table}},[n("q-menu",{ref:"tablePopover",attrs:{anchor:"top right",self:"top left",offset:[2,0]}},[n("o-table-grid",{attrs:{commands:e.commands}})],1)],1),e._v(" "),n("o-common-item",{attrs:{icon:"mdi-sigma",label:e.$o.lang.editor.formula,"side-icon":"keyboard_arrow_right"}},[n("q-menu",{ref:"formulaPopover",attrs:{anchor:"top right",self:"top left","content-class":"o-menu",offset:[2,0]}},[n("div",{staticClass:"row col-12 justify-around q-pa-md"},[n("div",{staticClass:"o-button",on:{click:e.commands.katex_block}},[n("div",[n("q-icon",{attrs:{name:"mdi-sigma"}})],1),e._v(" "),n("div",[e._v(e._s(e.$o.lang.editor.blockFormula))])]),e._v(" "),n("div",{staticClass:"o-button",on:{click:e.commands.katex_inline}},[n("div",[n("q-icon",{attrs:{name:"mdi-sigma"}})],1),e._v(" "),n("div",[e._v(e._s(e.$o.lang.editor.inlineFormula))])])])])],1),e._v(" "),n("o-common-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{icon:"mdi-sitemap",label:e.$o.lang.diagram.name},nativeOn:{click:function(t){return e.commands.diagram(t)}}},[n("q-tooltip",{attrs:{anchor:"center right",self:"center left"}},[n("div",{staticClass:"text-bold"},[e._v("Mermaid")]),e._v(" "),n("div",{staticClass:"text-white"},[e._v(e._s(e.$o.lang.diagram.tips))])])],1),e._v(" "),n("q-separator"),e._v(" "),n("o-common-item",{attrs:{icon:"mdi-iframe-outline",label:e.$o.lang.editor.thirdPartyService,"side-icon":"keyboard_arrow_right"}},[n("q-menu",{ref:"formulaPopover",attrs:{anchor:"center right",self:"center left","content-class":"o-menu",offset:[2,0]}},[n("o-embed-menu",{attrs:{"embed-services":e.embedServices},on:{select:e.onSelectService}})],1)],1)],1)])],1)},staticRenderFns:[]},void 0,{name:"o-add-more-btn",data:function(){return{}},props:{commands:{type:Object},isActive:{type:Object},opt:{type:Object,default:function(){return{}}}},components:{OMenubarBtn:Ff,OEmbedMenu:Jf,OCommonItem:ha,OMetaInput:Yf,OTableGrid:Xf},methods:{insertIframe:function(e,t){t&&e({src:t})},insertImage:function(e,t){t&&(e({src:t}),this.$refs.addPopover.hide())},onSelectService:function(e){this.commands.embed({service:e.value})}},computed:{embedServices:function(){return this.opt&&this.opt.embed?this.opt.embed:null}},mounted:function(){}},void 0,!1,void 0,!1,void 0,void 0,void 0);const Zf=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("o-menubar-btn",{staticClass:"o-photo-btn",attrs:{icon:"photo",tooltip:e.$o.lang.editor.photo}},[n("q-menu",{ref:"photoPopover",staticClass:"shadow-5",attrs:{anchor:"bottom middle",self:"top middle"}},[n("o-meta-input",{attrs:{title:e.$o.lang.editor.photo,icon:"image"},on:{primaryAction:function(t){return e.insertImage(e.commands.image,t)}}})],1)],1)},staticRenderFns:[]},void 0,{name:"o-photo-btn",data:function(){return{}},props:{commands:{type:Object},isActive:{type:Object}},components:{OMenubarBtn:Ff,OMetaInput:Yf},methods:{insertImage:function(e,t){t&&e({src:t}),this.$refs.photoPopover.hide()}},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);const ed=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("o-menubar-btn",{staticClass:"o-link-btn",attrs:{icon:"link",tooltip:e.$o.lang.editor.hyperlink}},[n("q-menu",{ref:"linkPopover",staticClass:"shadow-5",attrs:{anchor:"bottom middle",self:"top middle"},on:{show:e.onShow}},[n("o-meta-input",{attrs:{val:e.href,title:e.$o.lang.editor.hyperlink,icon:"link"},on:{primaryAction:function(t){return e.insertLink(e.commands.link,t)}}},[n("div",{attrs:{slot:"header-right"},slot:"header-right"},[n("q-checkbox",{attrs:{label:e.$o.lang.link.open_in_new_tab},model:{value:e.openInNewTab,callback:function(t){e.openInNewTab=t},expression:"openInNewTab"}})],1)])],1)],1)},staticRenderFns:[]},void 0,{name:"o-link-btn",data:function(){return{href:"",openInNewTab:!0}},props:{commands:{type:Object},isActive:{type:Object},getMarkAttrs:{type:Function}},components:{OMenubarBtn:Ff,OMetaInput:Yf},methods:{onShow:function(){this.href="",this.openInNewTab=!0;var e=this.getMarkAttrs("link");e&&e.href&&(this.href=e.href,this.openInNewTab=e.openInNewTab)},insertLink:function(e,t){e({href:t,openInNewTab:this.openInNewTab})}},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);const td=la({render:function(){var e=this.$createElement,t=this._self._c||e;return t("o-menubar-btn",{staticClass:"o-table-btn",attrs:{icon:"mdi-table",tooltip:this.$o.lang.table.insert}},[t("q-menu",{ref:"tablePopover",attrs:{anchor:"bottom middle",self:"top middle","content-class":"o-menu o-table-btn-menu"},on:{hide:this.onHide}},[t("o-table-grid",{attrs:{commands:this.commands}})],1)],1)},staticRenderFns:[]},void 0,{name:"o-table-btn",data:function(){return{rows:5,columns:5,selectedRows:2,selectedColumns:2}},props:{commands:{type:Object},isActive:{type:Object}},components:{OMenubarBtn:Ff,OTableGrid:Xf},methods:{onHide:function(){this.rows=5,this.columns=5,this.selectedRows=2,this.selectedColumns=2},select:function(e,t){this.selectedRows=e,this.selectedColumns=t,this.rows===e&&this.rows<10&&(this.rows+=1),this.columns===t&&this.columns<10&&(this.columns+=1)},onSelected:function(){this.commands.createTable({rowsCount:this.selectedRows,colsCount:this.selectedColumns,withHeaderRow:!0})}},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);const nd=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"row o-table-group"},[n("o-menubar-btn",{attrs:{icon:"mdi-table-remove",tooltip:e.$o.lang.table.remove},nativeOn:{click:function(t){return e.commands.deleteTable(t)}}}),e._v(" "),n("q-separator",{attrs:{vertical:""}}),e._v(" "),n("o-menubar-btn",{attrs:{icon:"mdi-table-column-plus-before",tooltip:e.$o.lang.table.insertColumnLeft},nativeOn:{click:function(t){return e.commands.addColumnBefore(t)}}}),e._v(" "),n("o-menubar-btn",{attrs:{icon:"mdi-table-column-plus-after",tooltip:e.$o.lang.table.insertColumnRight},nativeOn:{click:function(t){return e.commands.addColumnAfter(t)}}}),e._v(" "),n("o-menubar-btn",{attrs:{icon:"mdi-table-column-remove",tooltip:e.$o.lang.table.removeColumns},nativeOn:{click:function(t){return e.commands.deleteColumn(t)}}}),e._v(" "),n("q-separator",{attrs:{vertical:""}}),e._v(" "),n("o-menubar-btn",{attrs:{icon:"mdi-table-row-plus-before",tooltip:e.$o.lang.table.insertRowUp},nativeOn:{click:function(t){return e.commands.addRowBefore(t)}}}),e._v(" "),n("o-menubar-btn",{attrs:{icon:"mdi-table-row-plus-after",tooltip:e.$o.lang.table.insertRowDown},nativeOn:{click:function(t){return e.commands.addRowAfter(t)}}}),e._v(" "),n("o-menubar-btn",{attrs:{icon:"mdi-table-row-remove",tooltip:e.$o.lang.table.removeRows},nativeOn:{click:function(t){return e.commands.deleteRow(t)}}}),e._v(" "),n("q-separator",{attrs:{vertical:""}}),e._v(" "),n("o-menubar-btn",{attrs:{icon:"mdi-table-merge-cells",tooltip:e.$o.lang.table.merge},nativeOn:{click:function(t){return e.commands.toggleCellMerge(t)}}})],1)},staticRenderFns:[]},void 0,{name:"o-table-group",data:function(){return{}},props:{commands:{type:Object},isActive:{type:Object}},components:{OMenubarBtn:Ff},methods:{},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);const rd=la({render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("o-menubar-btn",{class:{"is-active":e.config.isActive},attrs:{icon:e.config.icon,tooltip:e.config.tooltip},nativeOn:{click:function(t){return e.config.command(t)}}})},staticRenderFns:[]},void 0,{name:"o-simple-command-btn",data:function(){return{}},props:{name:{type:String,default:""},commands:{type:Object},isActive:{type:Object}},components:{OMenubarBtn:Ff},methods:{command:function(){this.name,this.config.command()}},computed:{configs:function(){return{bold:{icon:"format_bold",tooltip:this.$o.lang.editor.bold,isActive:this.isActive.bold(),command:this.commands.bold},italic:{icon:"format_italic",tooltip:this.$o.lang.editor.italic,isActive:this.isActive.italic(),command:this.commands.italic},strike:{icon:"format_strikethrough",tooltip:this.$o.lang.editor.strikethrough,isActive:this.isActive.strike(),command:this.commands.strike},underline:{icon:"format_underline",tooltip:this.$o.lang.editor.underline,isActive:this.isActive.underline(),command:this.commands.underline},code:{icon:"code",tooltip:this.$o.lang.editor.code,isActive:this.isActive.code(),command:this.commands.code},code_block:{icon:"mdi-code-braces",tooltip:this.$o.lang.editor.codeBlock,isActive:this.isActive.code_block(),command:this.commands.code_block},horizontal:{icon:"remove",tooltip:this.$o.lang.editor.hr,isActive:!1,command:this.commands.horizontal_rule},bullet_list:{icon:"format_list_bulleted",tooltip:this.$o.lang.editor.unorderedList,isActive:this.isActive.bullet_list(),command:this.commands.bullet_list},ordered_list:{icon:"format_list_numbered",tooltip:this.$o.lang.editor.orderedList,isActive:this.isActive.ordered_list(),command:this.commands.ordered_list},todo_list:{icon:"mdi-check-box-outline",tooltip:this.$o.lang.editor.todoList,isActive:this.isActive.todo_list(),command:this.commands.todo_list},blockquote:{icon:"format_quote",tooltip:this.$o.lang.editor.blockquote,isActive:this.isActive.blockquote(),command:this.commands.blockquote},table:{icon:"mdi-table",tooltip:this.$o.lang.editor.table,isActive:!1,command:this.commands.createTable},undo:{icon:"undo",tooltip:this.$o.lang.editor.undo,isActive:!1,command:this.commands.undo},redo:{icon:"redo",tooltip:this.$o.lang.editor.redo,isActive:!1,command:this.commands.redo},indent:{icon:"format_indent_increase",tooltip:this.$o.lang.editor.indent,isActive:!1,command:this.commands.indent},outdent:{icon:"format_indent_decrease",tooltip:this.$o.lang.editor.outdent,isActive:!1,command:this.commands.outdent},format_clear:{icon:"format_clear",tooltip:this.$o.lang.editor.removeFormat,isActive:!1,command:this.commands.formatClear},print:{icon:"print",tooltip:this.$o.lang.editor.print,isActive:!1,command:this.commands.print}}},config:function(){var e={icon:"",isActive:!1,command:function(){}};return e=this.configs[this.name]||e,e}},mounted:function(){}},void 0,!1,void 0,!1,void 0,void 0,void 0);const id=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("editor-menu-bar",{attrs:{editor:e.editor},scopedSlots:e._u([{key:"default",fn:function(t){return[n("section",{staticClass:"row col-12 justify-between items-center bg-light tiptap-menubar"},[n("section",{staticClass:"row q-px-xs menubar is-hidden",class:{"is-focused":t.focused}},[t.isActive.table&&t.isActive.table()?[e._l(e.tableToolbar,(function(r,i){return["separator"===r?n("q-separator",{key:i,attrs:{vertical:"",inset:""}}):"string"==typeof r?n(e.getName(r),e._b({key:i,tag:"component",attrs:{name:r,editor:e.editor}},"component",t,!1)):"object"==typeof r&&"menu"===r.type?n(e.getName(r.name),e._b({key:i,tag:"component",attrs:{name:r.name,opt:r.options,editor:e.editor}},"component",t,!1)):n(r,e._b({key:i,tag:"component",attrs:{editor:e.editor}},"component",t,!1)),e._v(" "),"table"===r?n("o-table-group",e._b({key:"table-"+i},"o-table-group",t,!1)):e._e()]}))]:[e._l(e.toolbar,(function(r,i){return["separator"===r?n("q-separator",{key:i,attrs:{vertical:"",inset:""}}):"string"==typeof r?n(e.getName(r),e._b({key:i,tag:"component",attrs:{name:r,editor:e.editor}},"component",t,!1)):"object"==typeof r&&"menu"===r.type?n(e.getName(r.name),e._b({key:i,tag:"component",attrs:{name:r.name,opt:r.options,editor:e.editor}},"component",t,!1)):n(r,e._b({key:i,tag:"component",attrs:{editor:e.editor}},"component",t,!1))]}))],e._v(" "),e._t("left")],2),e._v(" "),n("section",{staticClass:"row q-px-xs"},[e._t("right")],2)])]}}],null,!0)})},staticRenderFns:[]},void 0,{name:"o-editor-menu-bar",data:function(){return{pageView:"page",isSlideShow:!1}},props:{editor:{type:Object},toolbar:{type:Array,default:function(){return[]}},tableToolbar:{type:Array,default:function(){return[]}}},components:{EditorMenuBar:n.EditorMenuBar,OMenubarBtn:Ff,OSimpleCommandBtn:rd,OMetaInput:Yf,OForeColorDropdown:Af,OBackColorDropdown:Tf,OFontFamilyDropdown:Lf,OAlignDropdown:Df,OAlignGroup:Nf,OLineHeightDropdown:Rf,OHeadingDropdown:Pf,OHeadingList:If,OListDropdown:Bf,OIndentDropdown:Hf,OTextFormatDropdown:Gf,OAddMoreBtn:Qf,OPhotoBtn:Zf,OLinkBtn:ed,OTableBtn:td,OTableGroup:nd},methods:{getName:function(e){return wf[e]||"o-simple-command-btn"},showSidePanel:function(){},onSlideShow:function(){}},mounted:function(){},deactivated:function(){},beforeDestroy:function(){}},void 0,!1,void 0,!1,void 0,void 0,void 0);const od=la({render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("o-menubar-btn",{staticClass:"o-link-off-btn",attrs:{icon:"link_off",tooltip:e.$o.lang.link.off},nativeOn:{click:function(t){return e.onLinkOff(t)}}})},staticRenderFns:[]},void 0,{name:"o-link-off-btn",data:function(){return{href:""}},props:{commands:{type:Object},isActive:{type:Object},getMarkAttrs:{type:Function}},components:{OMenubarBtn:Ff,OMetaInput:Yf},methods:{onLinkOff:function(){this.commands.link({href:""})}},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);const ad=la({render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("o-menubar-btn",{staticClass:"o-link-open-btn",attrs:{icon:"open_in_new",tooltip:e.$o.lang.link.open},nativeOn:{click:function(t){return e.onLinkOpen(t)}}})},staticRenderFns:[]},void 0,{name:"o-link-open-btn",data:function(){return{href:""}},props:{commands:{type:Object},isActive:{type:Object},getMarkAttrs:{type:Function}},components:{OMenubarBtn:Ff},methods:{onLinkOpen:function(){var e=this.getMarkAttrs("link");e&&e.href&&Dc(e.href)}},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);const ld=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("o-menubar-btn",{staticClass:"o-link-edit-btn",attrs:{icon:"edit",tooltip:e.$o.lang.link.edit}},[n("q-menu",{ref:"linkPopover",staticClass:"shadow-5",attrs:{anchor:"bottom middle",self:"top middle"},on:{show:e.onShow}},[n("o-meta-input",{attrs:{val:e.href,title:e.$o.lang.link.edit,icon:"link"},on:{primaryAction:function(t){return e.insertLink(e.commands.link,t)}}},[n("div",{attrs:{slot:"header-right"},slot:"header-right"},[n("q-checkbox",{attrs:{label:e.$o.lang.link.open_in_new_tab},model:{value:e.openInNewTab,callback:function(t){e.openInNewTab=t},expression:"openInNewTab"}})],1)])],1)],1)},staticRenderFns:[]},void 0,{name:"o-link-edit-btn",data:function(){return{href:"",openInNewTab:!0}},props:{commands:{type:Object},isActive:{type:Object},getMarkAttrs:{type:Function}},components:{OMenubarBtn:Ff,OMetaInput:Yf},methods:{onShow:function(){this.href="";var e=this.getMarkAttrs("link");e&&e.href&&(this.href=e.href,this.openInNewTab=e.openInNewTab)},insertLink:function(e,t){e({href:t,openInNewTab:this.openInNewTab})}},computed:{}},void 0,!1,void 0,!1,void 0,void 0,void 0);const sd=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("editor-menu-bubble",{attrs:{editor:e.editor},scopedSlots:e._u([{key:"default",fn:function(t){return[n("section",{staticClass:"tiptap-menububble",class:{"is-active":t.menu.isActive&&0===e.selectedCellSize&&!(t.isActive.image&&t.isActive.image())&&!(t.isActive.embed&&t.isActive.embed())&&!(t.isActive.katex_block&&t.isActive.katex_block())},style:"left: "+t.menu.left+"px; bottom: "+(t.menu.bottom+8)+"px;"},[e.showBack?[n("o-menubar-btn",{attrs:{icon:"arrow_back",tooltip:e.$o.lang.link.back},nativeOn:{click:function(t){return e.onBackToMain(t)}}}),e._v(" "),n("q-separator",{attrs:{vertical:"",inset:""}})]:e._e(),e._v(" "),e._l(e.bubbleToolbar,(function(r,i){return["separator"===r?n("q-separator",{key:i,attrs:{vertical:"",inset:""}}):"string"==typeof r?n(e.getName(r),e._b({key:i,tag:"component",attrs:{name:r,editor:e.editor}},"component",t,!1)):n(r,e._b({key:i,tag:"component",attrs:{editor:e.editor}},"component",t,!1))]}))],2)]}}])})},staticRenderFns:[]},void 0,{name:"o-editor-menu-bubble",data:function(){return{backToMain:!1}},props:{editor:{type:Object},toolbar:{type:Array,default:function(){return[]}},selectedCellSize:{type:Number,default:0},imgSelected:{type:Boolean,default:!1}},components:{EditorMenuBubble:n.EditorMenuBubble,OMenubarBtn:Ff,OSimpleCommandBtn:rd,OMetaInput:Yf,OForeColorDropdown:Af,OBackColorDropdown:Tf,OFontFamilyDropdown:Lf,OAlignDropdown:Df,OAlignGroup:Nf,OLineHeightDropdown:Rf,OHeadingDropdown:Pf,OHeadingList:If,OListDropdown:Bf,OIndentDropdown:Hf,OTextFormatDropdown:Gf,OAddMoreBtn:Qf,OLinkBtn:ed,OLinkOffBtn:od,OLinkOpenBtn:ad,OLinkEditBtn:ld,OPhotoBtn:Zf,OTableBtn:td,OTableGroup:nd},methods:{getName:function(e){return wf[e]||"o-simple-command-btn"},isLinkSelection:function(e){var t=this.editor.schema.marks.link;if(!t)return!1;if(!e)return!1;var n=e.$from,r=e.$to,i=Fl(n,t);return!!i&&i.to===r.pos},onBackToMain:function(){this.backToMain=!0}},computed:{bubbleToolbar:function(){var e=this.toolbar;return this.backToMain||this.isLinkSelected&&(e=Of),e},showBack:function(){return!this.backToMain&&this.isLinkSelected},isLinkSelected:function(){if(this.editor){var e=this.editor.state.tr.selection;return this.isLinkSelection(e)}return!1}},watch:{isLinkSelected:function(e,t){this.backToMain=!1}},mounted:function(){},deactivated:function(){},beforeDestroy:function(){}},void 0,!1,void 0,!1,void 0,void 0,void 0);function cd(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ud(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ud(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function ud(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const fd=la({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"tiptap tiptap-editor quasar-tiptap"},[e.showToolbar?n("o-editor-menu-bar",{attrs:{editor:e.editor,toolbar:e.editorMenuBar,tableToolbar:e.editorMenuTable}},[n("template",{slot:"left"},[e._t("toolbar-left")],2),e._v(" "),n("template",{slot:"right"},[e._t("toolbar-right")],2)],2):e._e(),e._v(" "),e.editable&&e.showBubble?n("o-editor-menu-bubble",{attrs:{editor:e.editor,toolbar:e.editorMenuBubble,"selected-cell-size":e.selectedCellSize}}):e._e(),e._v(" "),e.scrollable?n("q-scroll-area",{ref:"editorScroll",staticClass:"editor-scroll-area",class:"view-"+e.pageView},[n("q-scroll-observer",{on:{scroll:e.onScroll}}),e._v(" "),n("editor-content",{staticClass:"editor__content o--note-preview note-step-side-editor",attrs:{editor:e.editor}}),e._v(" "),e._t("footer")],2):n("div",[n("editor-content",{staticClass:"editor__content o--note-preview note-step-side-editor",attrs:{editor:e.editor}}),e._v(" "),e._t("footer")],2)],1)},staticRenderFns:[]},void 0,{name:"quasar-tiptap",data:function(){return{editor:null,selectedCellSize:0}},props:{content:{type:[String,Object],default:""},editable:{type:Boolean,default:!0},showToolbar:{type:Boolean,default:!0},showBubble:{type:Boolean,default:!0},scrollable:{type:Boolean,default:!1},editorProps:{type:Object,default:function(){return{}}},extensions:{type:Array,default:function(){return[]}},toolbar:{type:Array,default:function(){return[]}},tableToolbar:{type:Array,default:function(){return[]}},bubble:{type:Array,default:function(){return[]}},pageView:{type:String,default:"page"},options:{type:Object,default:function(){return{}}}},components:{EditorContent:n.EditorContent,OEditorMenuBar:id,OEditorMenuBubble:sd},computed:{editorMenuBar:function(){return this.toolbar.length>0?this.toolbar:kf},editorMenuTable:function(){return this.tableToolbar.length>0?this.tableToolbar:Sf},editorMenuBubble:function(){return this.bubble.length>0?this.bubble:Cf}},methods:{initEditor:function(){var e=this,t=this.generateExtensions(),i=[].concat(no(t),[new r.HardBreak,new r.History,new r.Focus({className:"has-focus",nested:!0}),new r.TrailingNode({node:"paragraph",notAfter:["paragraph"]})]);this.editor=new n.Editor({editorProps:this.editorProps,extensions:i,autoFocus:!0,editable:this.editable,content:this.getContent(),onInit:function(t){var n=t.state,r=t.view;e.$emit("init",{state:n,view:r})},onFocus:function(t){var n=t.event,r=t.state,i=t.view;e.$emit("focus",{event:n,state:r,view:i})},onBlur:function(t){var n=t.event,r=t.state,i=t.view;e.$emit("blur",{event:n,state:r,view:i})},onUpdate:function(t){var n=t.getJSON,r=t.getHTML,i=t.state,o=t.transaction;e.$emit("update",{getJSON:n,getHTML:r,state:i,transaction:o})},onTransaction:function(t){var n=t.getJSON,r=t.getHTML,i=t.state,o=t.transaction,a=e.editor.view.dom.querySelectorAll(".selectedCell");e.selectedCellSize=a.length,e.$emit("transaction",{getJSON:n,getHTML:r,state:i,transaction:o})}})},generateExtensions:function(){var e,t=[],n=cd(this.extensions);try{for(n.s();!(e=n.n()).done;){var i=e.value;if("string"==typeof i){if(!yf.includes(i))continue;switch(i){case"CodeBlockHighlight":i=new r.CodeBlockHighlight({languages:{java:lo,javascript:ho,css:mo}});break;case"Table":i=new r.Table({resizable:!0}),t.push(i),t.push(new r.TableHeader),t.push(new r.TableCell),t.push(new r.TableRow);continue;case"OTodoItem":i=new da({nested:!0});break;case"OHeading":i=new Ul({levels:[1,2,3,4,5]});break;case"Link":i=new xf("OLink");break;default:try{i=new xf(i)}catch(e){console.error(e.message)}}}t.push(i)}}catch(e){n.e(e)}finally{n.f()}return t},getContent:function(){var e=this.content||"";if(e&&e.type)return e;if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}},setContent:function(){this.editor.setContent(this.getContent(),!0),this.editor.focus()},cleanContent:function(){this.editor.clearContent(!1),this.editor.focus()},onScroll:function(e){this.$emit("scroll",e)},showSidePanel:function(){},onSlideShow:function(){}},watch:{editable:function(e,t){this.editor.options.editable=e},content:function(e,t){this.setContent()}},mounted:function(){this.initEditor()},deactivated:function(){},beforeDestroy:function(){this.editor.destroy()}},void 0,!1,void 0,!1,void 0,void 0,void 0);f.default.use({install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};J.config=Object.freeze(t.config||{}),K.install(J,t.language),e.prototype.$o=J}},{});var dd={installed:!1,spellcheck:!0,install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.spellcheck=null===t.spellcheck||t.spellcheck,e.prototype.$o.lang.set(t.language),e.component("quasar-tiptap",fd),e.prototype.$quasarTiptapPlugin=this,this.installed=!0}};e.OAlignment=tu,e.OBackColor=Gc,e.OBlockquote=aa,e.OCommonItem=ha,e.ODiagram=ba,e.ODoc=Uo,e.OEmbed=cf,e.OFontFamily=Yc,e.OForeColor=Kc,e.OFormatClear=Cu,e.OHeading=Ul,e.OIframe=Kl,e.OImage=qu,e.OIndent=su,e.OInsertHtml=ff,e.OKatexBlock=Rc,e.OKatexInline=jc,e.OLineHeight=hu,e.OLink=mf,e.OMenubarBtn=Ff,e.OParagraph=Yo,e.OPrint=Du,e.OTitle=Ho,e.OTodoItem=da,e.QuasarTipTapExtensions=vf,e.QuasarTiptap=fd,e.QuasarTiptapPlugin=dd,e.RecommendedExtensions=yf,e.TipTapExtensions=gf,Object.defineProperty(e,"__esModule",{value:!0})}));
