diff --git a/docs/assets/403.ade5ebed.js b/docs/assets/403.7583899e.js
similarity index 95%
rename from docs/assets/403.ade5ebed.js
rename to docs/assets/403.7583899e.js
index 8c8cf39..e5a9f6c 100644
--- a/docs/assets/403.ade5ebed.js
+++ b/docs/assets/403.7583899e.js
@@ -1 +1 @@
-import{_,r as o,o as i,c as d,a as s,b as n,w as l,d as r,e as p,p as h,f as v}from"./index.50eb5827.js";const u="/vue-admin-perfect/assets/403.359d32ca.png",t="/vue-admin-perfect/assets/404_cloud.98e7ac66.png";const m={},a=c=>(h("data-v-c78ca612"),c=c(),v(),c),f={class:"app-container"},g={class:"app-container-inner"},x={class:"wscn-http403-container"},b={class:"wscn-http403"},w=p('
',1),k={class:"bullshit"},I=a(()=>s("div",{class:"bullshit__oops"},"\u60A8\u6CA1\u6709\u8BBF\u95EE\u6743\u9650\uFF01",-1)),N=a(()=>s("div",{class:"bullshit__info"}," \u8BF7\u68C0\u67E5URL\u5730\u5740\u662F\u5426\u6B63\u786E, \u6216\u70B9\u51FB\u56DE\u5230\u9996\u9875\u3002 ",-1));function S(c,V){const e=o("router-link");return i(),d("div",f,[s("div",g,[s("div",x,[s("div",b,[w,s("div",k,[I,N,n(e,{to:"/",class:"bullshit__return-home"},{default:l(()=>[r("\u56DE\u5230\u9996\u9875")]),_:1})])])])])])}const y=_(m,[["render",S],["__scopeId","data-v-c78ca612"]]);export{y as default};
+import{_,r as o,o as i,c as d,a as s,b as n,w as l,d as r,e as p,p as h,f as v}from"./index.c36787b1.js";const u="/vue-admin-perfect/assets/403.359d32ca.png",t="/vue-admin-perfect/assets/404_cloud.98e7ac66.png";const m={},a=c=>(h("data-v-c78ca612"),c=c(),v(),c),f={class:"app-container"},g={class:"app-container-inner"},x={class:"wscn-http403-container"},b={class:"wscn-http403"},w=p('',1),k={class:"bullshit"},I=a(()=>s("div",{class:"bullshit__oops"},"\u60A8\u6CA1\u6709\u8BBF\u95EE\u6743\u9650\uFF01",-1)),N=a(()=>s("div",{class:"bullshit__info"}," \u8BF7\u68C0\u67E5URL\u5730\u5740\u662F\u5426\u6B63\u786E, \u6216\u70B9\u51FB\u56DE\u5230\u9996\u9875\u3002 ",-1));function S(c,V){const e=o("router-link");return i(),d("div",f,[s("div",g,[s("div",x,[s("div",b,[w,s("div",k,[I,N,n(e,{to:"/",class:"bullshit__return-home"},{default:l(()=>[r("\u56DE\u5230\u9996\u9875")]),_:1})])])])])])}const y=_(m,[["render",S],["__scopeId","data-v-c78ca612"]]);export{y as default};
diff --git a/docs/assets/404.3c60c3aa.js b/docs/assets/404.0178bc37.js
similarity index 95%
rename from docs/assets/404.3c60c3aa.js
rename to docs/assets/404.0178bc37.js
index cad67f6..b3be1f5 100644
--- a/docs/assets/404.3c60c3aa.js
+++ b/docs/assets/404.0178bc37.js
@@ -1 +1 @@
-import{_,r as o,o as i,c as d,a as s,t as n,b as l,w as r,d as p,e as h,p as v,f as u}from"./index.50eb5827.js";const m="/vue-admin-perfect/assets/404_bg.79e0e553.png",e="/vue-admin-perfect/assets/404_cloud.98e7ac66.png";const f={},a=t=>(v("data-v-648266d8"),t=t(),u(),t),g={class:"app-container"},b={class:"app-container-inner"},w={class:"wscn-http404-container"},x={class:"wscn-http404"},S=h('',1),k={class:"bullshit"},I=a(()=>s("div",{class:"bullshit__oops"},"\u9875\u9762\u4E0D\u5B58\u5728\uFF01",-1)),N={class:"bullshit__headline"},V=a(()=>s("div",{class:"bullshit__info"},"\u8BF7\u68C0\u67E5URL\u5730\u5740\u662F\u5426\u6B63\u786E, \u6216\u70B9\u51FB\u56DE\u5230\u9996\u9875\u3002",-1));function y(t,B){const c=o("router-link");return i(),d("div",g,[s("div",b,[s("div",w,[s("div",x,[S,s("div",k,[I,s("div",N,n(t.message),1),V,l(c,{to:"/",class:"bullshit__return-home"},{default:r(()=>[p("\u56DE\u5230\u9996\u9875")]),_:1})])])])])])}const D=_(f,[["render",y],["__scopeId","data-v-648266d8"]]);export{D as default};
+import{_,r as o,o as i,c as d,a as s,t as n,b as l,w as r,d as p,e as h,p as v,f as u}from"./index.c36787b1.js";const m="/vue-admin-perfect/assets/404_bg.79e0e553.png",e="/vue-admin-perfect/assets/404_cloud.98e7ac66.png";const f={},a=t=>(v("data-v-648266d8"),t=t(),u(),t),g={class:"app-container"},b={class:"app-container-inner"},w={class:"wscn-http404-container"},x={class:"wscn-http404"},S=h('',1),k={class:"bullshit"},I=a(()=>s("div",{class:"bullshit__oops"},"\u9875\u9762\u4E0D\u5B58\u5728\uFF01",-1)),N={class:"bullshit__headline"},V=a(()=>s("div",{class:"bullshit__info"},"\u8BF7\u68C0\u67E5URL\u5730\u5740\u662F\u5426\u6B63\u786E, \u6216\u70B9\u51FB\u56DE\u5230\u9996\u9875\u3002",-1));function y(t,B){const c=o("router-link");return i(),d("div",g,[s("div",b,[s("div",w,[s("div",x,[S,s("div",k,[I,s("div",N,n(t.message),1),V,l(c,{to:"/",class:"bullshit__return-home"},{default:r(()=>[p("\u56DE\u5230\u9996\u9875")]),_:1})])])])])])}const D=_(f,[["render",y],["__scopeId","data-v-648266d8"]]);export{D as default};
diff --git a/docs/assets/bar.vue_vue_type_script_setup_true_lang.e3362b7f.js b/docs/assets/bar.vue_vue_type_script_setup_true_lang.1f1e37d5.js
similarity index 93%
rename from docs/assets/bar.vue_vue_type_script_setup_true_lang.e3362b7f.js
rename to docs/assets/bar.vue_vue_type_script_setup_true_lang.1f1e37d5.js
index fe5ee84..736334f 100644
--- a/docs/assets/bar.vue_vue_type_script_setup_true_lang.e3362b7f.js
+++ b/docs/assets/bar.vue_vue_type_script_setup_true_lang.1f1e37d5.js
@@ -1 +1 @@
-import{i as s}from"./index.201c3aba.js";import{g as o,x as r,o as c,c as d,y as l,z as h}from"./index.50eb5827.js";const m=["id"],g=o({__name:"bar",props:{className:{type:String,default:"chart"},config:{type:Object,default:()=>{}},id:{type:String,default:"chart"},width:{type:String,default:"200px"},height:{type:String,default:"200px"}},setup(t){const a=t,n={grid:{top:10,left:"2%",right:"2%",bottom:"2%",containLabel:!0},xAxis:{type:"category",data:["\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D","\u661F\u671F\u65E5"]},yAxis:{type:"value"},series:[{data:[150,230,150,80,70,110,130],type:"bar"}]};let e;const u=()=>{let i=s(document.getElementById(a.id));return i.setOption(n),i};return r(()=>{e=u(),window.addEventListener("resize",function(){e&&e.resize()})}),(i,p)=>(c(),d("div",{id:t.id,class:l(t.className),style:h({height:t.height,width:t.width})},null,14,m))}});export{g as _};
+import{i as s}from"./index.201c3aba.js";import{g as o,x as r,o as c,c as d,y as l,z as h}from"./index.c36787b1.js";const m=["id"],g=o({__name:"bar",props:{className:{type:String,default:"chart"},config:{type:Object,default:()=>{}},id:{type:String,default:"chart"},width:{type:String,default:"200px"},height:{type:String,default:"200px"}},setup(t){const a=t,n={grid:{top:10,left:"2%",right:"2%",bottom:"2%",containLabel:!0},xAxis:{type:"category",data:["\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D","\u661F\u671F\u65E5"]},yAxis:{type:"value"},series:[{data:[150,230,150,80,70,110,130],type:"bar"}]};let e;const u=()=>{let i=s(document.getElementById(a.id));return i.setOption(n),i};return r(()=>{e=u(),window.addEventListener("resize",function(){e&&e.resize()})}),(i,p)=>(c(),d("div",{id:t.id,class:l(t.className),style:h({height:t.height,width:t.width})},null,14,m))}});export{g as _};
diff --git a/docs/assets/exceljs.min.2c2604a6.js.gz b/docs/assets/exceljs.min.2c2604a6.js.gz
deleted file mode 100644
index d8df3bb..0000000
Binary files a/docs/assets/exceljs.min.2c2604a6.js.gz and /dev/null differ
diff --git a/docs/assets/exceljs.min.2c2604a6.js b/docs/assets/exceljs.min.4a739ad8.js
similarity index 99%
rename from docs/assets/exceljs.min.2c2604a6.js
rename to docs/assets/exceljs.min.4a739ad8.js
index 2970845..c42b9b9 100644
--- a/docs/assets/exceljs.min.2c2604a6.js
+++ b/docs/assets/exceljs.min.4a739ad8.js
@@ -1,4 +1,4 @@
-import{S as Qe,T as Vt}from"./index.50eb5827.js";function Bt(Ft){throw new Error('Could not dynamically require "'+Ft+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ht={exports:{}};/*! ExcelJS 21-08-2021 */(function(Ft,qt){(function(d){Ft.exports=d()})(function(){return function d(I,T,b){function m(p,c){if(!T[p]){if(!I[p]){var l=typeof Bt=="function"&&Bt;if(!c&&l)return l(p,!0);if(v)return v(p,!0);var s=new Error("Cannot find module '"+p+"'");throw s.code="MODULE_NOT_FOUND",s}var i=T[p]={exports:{}};I[p][0].call(i.exports,function(e){return m(I[p][1][e]||e)},i,i.exports,d,I,T,b)}return T[p].exports}for(var v=typeof Bt=="function"&&Bt,h=0;h2&&arguments[2]!==void 0?arguments[2]:0;if(b(this,p),e)if(typeof e=="string"){var r=v.decodeAddress(e);this.nativeCol=r.col+t,this.nativeColOff=0,this.nativeRow=r.row+t,this.nativeRowOff=0}else e.nativeCol!==void 0?(this.nativeCol=e.nativeCol||0,this.nativeColOff=e.nativeColOff||0,this.nativeRow=e.nativeRow||0,this.nativeRowOff=e.nativeRowOff||0):e.col!==void 0?(this.col=e.col+t,this.row=e.row+t):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;this.worksheet=i}var c,l,s;return c=p,s=[{key:"asInstance",value:function(i){return i instanceof p||i==null?i:new p(i)}}],(l=[{key:"col",get:function(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth},set:function(i){this.nativeCol=Math.floor(i),this.nativeColOff=Math.floor((i-this.nativeCol)*this.colWidth)}},{key:"row",get:function(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight},set:function(i){this.nativeRow=Math.floor(i),this.nativeRowOff=Math.floor((i-this.nativeRow)*this.rowHeight)}},{key:"colWidth",get:function(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}},{key:"rowHeight",get:function(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}},{key:"model",get:function(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}},set:function(i){this.nativeCol=i.nativeCol,this.nativeColOff=i.nativeColOff,this.nativeRow=i.nativeRow,this.nativeRowOff=i.nativeRowOff}}])&&m(c.prototype,l),s&&m(c,s),p}();I.exports=h},{"../utils/col-cache":19}],3:[function(d,I,T){function b(O,P){if(!(O instanceof P))throw new TypeError("Cannot call a class as a function")}function m(O,P){for(var _=0;_0||this.type===O.Types.Merge}},{key:"master",get:function(){return this.type===O.Types.Merge?this._value.master:this}},{key:"isHyperlink",get:function(){return this._value.type===O.Types.Hyperlink}},{key:"hyperlink",get:function(){return this._value.hyperlink}},{key:"value",get:function(){return this._value.value},set:function(P){this.type!==O.Types.Merge?(this._value.release(),this._value=M.create(M.getType(P),this,P)):this._value.master.value=P}},{key:"note",get:function(){return this._comment&&this._comment.note},set:function(P){this._comment=new s(P)}},{key:"text",get:function(){return this._value.toString()}},{key:"html",get:function(){return p.escapeHtml(this.text)}},{key:"formula",get:function(){return this._value.formula}},{key:"result",get:function(){return this._value.result}},{key:"formulaType",get:function(){return this._value.formulaType}},{key:"fullAddress",get:function(){return{sheetName:this._row.worksheet.name,address:this.address,row:this.row,col:this.col}}},{key:"name",get:function(){return this.names[0]},set:function(P){this.names=[P]}},{key:"names",get:function(){return this.workbook.definedNames.getNamesEx(this.fullAddress)},set:function(P){var _=this,S=this.workbook.definedNames;S.removeAllNames(this.fullAddress),P.forEach(function(g){S.addEx(_.fullAddress,g)})}},{key:"_dataValidations",get:function(){return this.worksheet.dataValidations}},{key:"dataValidation",get:function(){return this._dataValidations.find(this.address)},set:function(P){this._dataValidations.add(this.address,P)}},{key:"model",get:function(){var P=this._value.model;return P.style=this.style,this._comment&&(P.comment=this._comment.model),P},set:function(P){if(this._value.release(),this._value=M.create(P.type,this),this._value.model=P,P.comment)switch(P.comment.type){case"note":this._comment=s.fromModel(P.comment)}P.style?this.style=P.style:this.style={}}}]),O}();i.Types=c.ValueType;var e=function(){function O(P){b(this,O),this.model={address:P.address,type:i.Types.Null}}return v(O,[{key:"toCsvString",value:function(){return""}},{key:"release",value:function(){}},{key:"toString",value:function(){return""}},{key:"value",get:function(){return null},set:function(P){}},{key:"type",get:function(){return i.Types.Null}},{key:"effectiveType",get:function(){return i.Types.Null}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),t=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Number,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value.toString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Number}},{key:"effectiveType",get:function(){return i.Types.Number}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),r=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.String,value:_}}return v(O,[{key:"toCsvString",value:function(){return'"'.concat(this.model.value.replace(/"/g,'""'),'"')}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.String}},{key:"effectiveType",get:function(){return i.Types.String}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),o=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.String,value:_}}return v(O,[{key:"toString",value:function(){return this.model.value.richText.map(function(P){return P.text}).join("")}},{key:"toCsvString",value:function(){return'"'.concat(this.text.replace(/"/g,'""'),'"')}},{key:"release",value:function(){}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.RichText}},{key:"effectiveType",get:function(){return i.Types.RichText}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),n=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Date,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value.toISOString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Date}},{key:"effectiveType",get:function(){return i.Types.Date}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),a=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Hyperlink,text:_?_.text:void 0,hyperlink:_?_.hyperlink:void 0},_&&_.tooltip&&(this.model.tooltip=_.tooltip)}return v(O,[{key:"toCsvString",value:function(){return this.model.hyperlink}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.text}},{key:"value",get:function(){var P={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(P.tooltip=this.model.tooltip),P},set:function(P){this.model={text:P.text,hyperlink:P.hyperlink},P.tooltip&&(this.model.tooltip=P.tooltip)}},{key:"text",get:function(){return this.model.text},set:function(P){this.model.text=P}},{key:"hyperlink",get:function(){return this.model.hyperlink},set:function(P){this.model.hyperlink=P}},{key:"type",get:function(){return i.Types.Hyperlink}},{key:"effectiveType",get:function(){return i.Types.Hyperlink}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),u=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Merge,master:_?_.address:void 0},this._master=_,_&&_.addMergeRef()}return v(O,[{key:"isMergedTo",value:function(P){return P===this._master}},{key:"toCsvString",value:function(){return""}},{key:"release",value:function(){this._master.releaseMergeRef()}},{key:"toString",value:function(){return this.value.toString()}},{key:"value",get:function(){return this._master.value},set:function(P){P instanceof i?(this._master&&this._master.releaseMergeRef(),P.addMergeRef(),this._master=P):this._master.value=P}},{key:"master",get:function(){return this._master}},{key:"type",get:function(){return i.Types.Merge}},{key:"effectiveType",get:function(){return this._master.effectiveType}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),f=function(){function O(P,_){b(this,O),this.cell=P,this.model={address:P.address,type:i.Types.Formula,shareType:_?_.shareType:void 0,ref:_?_.ref:void 0,formula:_?_.formula:void 0,sharedFormula:_?_.sharedFormula:void 0,result:_?_.result:void 0}}return v(O,[{key:"_copyModel",value:function(P){var _={},S=function(g){var j=P[g];j&&(_[g]=j)};return S("formula"),S("result"),S("ref"),S("shareType"),S("sharedFormula"),_}},{key:"validate",value:function(P){switch(M.getType(P)){case i.Types.Null:case i.Types.String:case i.Types.Number:case i.Types.Date:break;case i.Types.Hyperlink:case i.Types.Formula:default:throw new Error("Cannot process that type of result value")}}},{key:"_getTranslatedFormula",value:function(){if(!this._translatedFormula&&this.model.sharedFormula){var P=this.cell.worksheet.findCell(this.model.sharedFormula);this._translatedFormula=P&&l(P.formula,P.address,this.model.address)}return this._translatedFormula}},{key:"toCsvString",value:function(){return"".concat(this.model.result||"")}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.result?this.model.result.toString():""}},{key:"value",get:function(){return this._copyModel(this.model)},set:function(P){this.model=this._copyModel(P)}},{key:"dependencies",get:function(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}},{key:"formula",get:function(){return this.model.formula||this._getTranslatedFormula()},set:function(P){this.model.formula=P}},{key:"formulaType",get:function(){return this.model.formula?c.FormulaType.Master:this.model.sharedFormula?c.FormulaType.Shared:c.FormulaType.None}},{key:"result",get:function(){return this.model.result},set:function(P){this.model.result=P}},{key:"type",get:function(){return i.Types.Formula}},{key:"effectiveType",get:function(){var P=this.model.result;return P==null?c.ValueType.Null:P instanceof String||typeof P=="string"?c.ValueType.String:typeof P=="number"?c.ValueType.Number:P instanceof Date?c.ValueType.Date:P.text&&P.hyperlink?c.ValueType.Hyperlink:P.formula?c.ValueType.Formula:c.ValueType.Null}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),y=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.SharedString,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value.toString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.SharedString}},{key:"effectiveType",get:function(){return i.Types.SharedString}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),w=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Boolean,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value?1:0}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Boolean}},{key:"effectiveType",get:function(){return i.Types.Boolean}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),R=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Error,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.toString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.error.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Error}},{key:"effectiveType",get:function(){return i.Types.Error}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),E=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.String,value:JSON.stringify(_),rawValue:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value}},{key:"value",get:function(){return this.model.rawValue},set:function(P){this.model.rawValue=P,this.model.value=JSON.stringify(P)}},{key:"type",get:function(){return i.Types.String}},{key:"effectiveType",get:function(){return i.Types.String}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),M={getType:function(O){return O==null?i.Types.Null:O instanceof String||typeof O=="string"?i.Types.String:typeof O=="number"?i.Types.Number:typeof O=="boolean"?i.Types.Boolean:O instanceof Date?i.Types.Date:O.text&&O.hyperlink?i.Types.Hyperlink:O.formula||O.sharedFormula?i.Types.Formula:O.richText?i.Types.RichText:O.sharedString?i.Types.SharedString:O.error?i.Types.Error:i.Types.JSON},types:[{t:i.Types.Null,f:e},{t:i.Types.Number,f:t},{t:i.Types.String,f:r},{t:i.Types.Date,f:n},{t:i.Types.Hyperlink,f:a},{t:i.Types.Formula,f},{t:i.Types.Merge,f:u},{t:i.Types.JSON,f:E},{t:i.Types.SharedString,f:y},{t:i.Types.RichText,f:o},{t:i.Types.Boolean,f:w},{t:i.Types.Error,f:R}].reduce(function(O,P){return O[P.t]=P.f,O},[]),create:function(O,P,_){var S=this.types[O];if(!S)throw new Error("Could not create Value of type ".concat(O));return new S(P,_)}};I.exports=i},{"../utils/col-cache":19,"../utils/shared-formula":22,"../utils/under-dash":25,"./enums":7,"./note":9}],4:[function(d,I,T){function b(c,l){for(var s=0;s=this._worksheet.properties.outlineLevelCol)}},{key:"isDefault",get:function(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;var e=this.style;return!e||!(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection)}},{key:"headerCount",get:function(){return this.headers.length}},{key:"values",get:function(){var e=[];return this.eachCell(function(t,r){t&&t.type!==v.ValueType.Null&&(e[r]=t.value)}),e},set:function(e){var t=this;if(e){var r=this.number,o=0;e.hasOwnProperty("0")&&(o=1),e.forEach(function(n,a){t._worksheet.getCell(a+o,r).value=n})}}},{key:"numFmt",get:function(){return this.style.numFmt},set:function(e){this._applyStyle("numFmt",e)}},{key:"font",get:function(){return this.style.font},set:function(e){this._applyStyle("font",e)}},{key:"alignment",get:function(){return this.style.alignment},set:function(e){this._applyStyle("alignment",e)}},{key:"protection",get:function(){return this.style.protection},set:function(e){this._applyStyle("protection",e)}},{key:"border",get:function(){return this.style.border},set:function(e){this._applyStyle("border",e)}},{key:"fill",get:function(){return this.style.fill},set:function(e){this._applyStyle("fill",e)}}])&&b(l.prototype,s),i&&b(l,i),c}();I.exports=p},{"../utils/col-cache":19,"../utils/under-dash":25,"./enums":7}],5:[function(d,I,T){function b(v,h){for(var p=0;pthis.bottom)&&(this.bottom=e),(!this.model.right||t>this.right)&&(this.right=t)}},{key:"expandRow",value:function(s){if(s){var i=s.dimensions,e=s.number;i&&this.expand(e,i.min,e,i.max)}}},{key:"expandToAddress",value:function(s){var i=v.decodeEx(s);this.expand(i.row,i.col,i.row,i.col)}},{key:"toString",value:function(){return this.range}},{key:"intersects",value:function(s){return!(s.sheetName&&this.sheetName&&s.sheetName!==this.sheetName||s.bottomthis.bottom||s.rightthis.right)}},{key:"contains",value:function(s){var i=v.decodeEx(s);return this.containsEx(i)}},{key:"containsEx",value:function(s){return(!s.sheetName||!this.sheetName||s.sheetName===this.sheetName)&&s.row>=this.top&&s.row<=this.bottom&&s.col>=this.left&&s.col<=this.right}},{key:"forEachAddress",value:function(s){for(var i=this.left;i<=this.right;i++)for(var e=this.top;e<=this.bottom;e++)s(v.encodeAddress(e,i),e,i)}},{key:"top",get:function(){return this.model.top||1},set:function(s){this.model.top=s}},{key:"left",get:function(){return this.model.left||1},set:function(s){this.model.left=s}},{key:"bottom",get:function(){return this.model.bottom||1},set:function(s){this.model.bottom=s}},{key:"right",get:function(){return this.model.right||1},set:function(s){this.model.right=s}},{key:"sheetName",get:function(){return this.model.sheetName},set:function(s){this.model.sheetName=s}},{key:"_serialisedSheetName",get:function(){var s=this.model.sheetName;return s?/^[a-zA-Z0-9]*$/.test(s)?"".concat(s,"!"):"'".concat(s,"'!"):""}},{key:"tl",get:function(){return v.n2l(this.left)+this.top}},{key:"$t$l",get:function(){return"$".concat(v.n2l(this.left),"$").concat(this.top)}},{key:"br",get:function(){return v.n2l(this.right)+this.bottom}},{key:"$b$r",get:function(){return"$".concat(v.n2l(this.right),"$").concat(this.bottom)}},{key:"range",get:function(){return"".concat(this._serialisedSheetName+this.tl,":").concat(this.br)}},{key:"$range",get:function(){return"".concat(this._serialisedSheetName+this.$t$l,":").concat(this.$b$r)}},{key:"shortRange",get:function(){return this.count>1?this.range:this._serialisedSheetName+this.tl}},{key:"$shortRange",get:function(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}},{key:"count",get:function(){return(1+this.bottom-this.top)*(1+this.right-this.left)}}])&&m(c.prototype,l),p}();I.exports=h},{"../utils/col-cache":19}],11:[function(d,I,T){function b(l,s){for(var i=0;i2?o-2:0),a=2;a0)for(u=R;u>=r;u--)(f=this._cells[u-1])?((y=this.getCell(u+w)).value=f.value,y.style=f.style,y._comment=f._comment):this._cells[u+w-1]=void 0;for(u=0;ur.col)&&(e=r.col),t0?{min:e,max:t}:null}},{key:"numFmt",get:function(){return this.style.numFmt},set:function(e){this._applyStyle("numFmt",e)}},{key:"font",get:function(){return this.style.font},set:function(e){this._applyStyle("font",e)}},{key:"alignment",get:function(){return this.style.alignment},set:function(e){this._applyStyle("alignment",e)}},{key:"protection",get:function(){return this.style.protection},set:function(e){this._applyStyle("protection",e)}},{key:"border",get:function(){return this.style.border},set:function(e){this._applyStyle("border",e)}},{key:"fill",get:function(){return this.style.fill},set:function(e){this._applyStyle("fill",e)}},{key:"hidden",get:function(){return!!this._hidden},set:function(e){this._hidden=e}},{key:"outlineLevel",get:function(){return this._outlineLevel||0},set:function(e){this._outlineLevel=e}},{key:"collapsed",get:function(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}},{key:"model",get:function(){var e=[],t=0,r=0;return this._cells.forEach(function(o){if(o){var n=o.model;n&&((!t||t>o.col)&&(t=o.col),r0,"Table must be on valid row"),t(n>0,"Table must be on valid col");var a=this.width,u=this.filterHeight,f=this.tableHeight;i.autoFilterRef=h.encode(o,n,o+u-1,n+a-1),i.tableRef=h.encode(o,n,o+f-1,n+a-1),i.columns.forEach(function(y,w){t(y.name,"Column ".concat(w," must have a name")),w===0?e(y,"totalsRowLabel","Total"):(e(y,"totalsRowFunction","none"),y.totalsRowFormula=s.getFormula(y))})}},{key:"store",value:function(){var s=this,i=function(y,w){w&&Object.keys(w).forEach(function(R){y[R]=w[R]})},e=this.worksheet,t=this.table,r=t.tl,o=r.row,n=r.col,a=0;if(t.headerRow){var u=e.getRow(o+a++);t.columns.forEach(function(y,w){var R=y.style,E=y.name,M=u.getCell(n+w);M.value=E,i(M,R)})}if(t.rows.forEach(function(y){var w=e.getRow(o+a++);y.forEach(function(R,E){var M=w.getCell(n+E);M.value=R,i(M,t.columns[E].style)})}),t.totalsRow){var f=e.getRow(o+a++);t.columns.forEach(function(y,w){var R=f.getCell(n+w);if(w===0)R.value=y.totalsRowLabel;else{var E=s.getFormula(y);R.value=E?{formula:y.totalsRowFormula,result:y.totalsRowResult}:null}i(R,y.style)})}}},{key:"load",value:function(s){var i=this,e=this.table,t=e.tl,r=t.row,o=t.col,n=0;if(e.headerRow){var a=s.getRow(r+n++);e.columns.forEach(function(f,y){a.getCell(o+y).value=f.name})}if(e.rows.forEach(function(f){var y=s.getRow(r+n++);f.forEach(function(w,R){y.getCell(o+R).value=w})}),e.totalsRow){var u=s.getRow(r+n++);e.columns.forEach(function(f,y){var w=u.getCell(o+y);y===0?w.value=f.totalsRowLabel:i.getFormula(f)&&(w.value={formula:f.totalsRowFormula,result:f.totalsRowResult})})}}},{key:"cacheState",value:function(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}},{key:"commit",value:function(){if(this._cache){this.validate();var s=h.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(var i=0;i1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(s,i)}},{key:"getColumn",value:function(s){var i=this.table.columns[s];return new p(this,i,s)}},{key:"addColumn",value:function(s,i,e){this.cacheState(),e===void 0?(this.table.columns.push(s),this.table.rows.forEach(function(t,r){t.push(i[r])})):(this.table.columns.splice(e,0,s),this.table.rows.forEach(function(t,r){t.splice(e,0,i[r])}))}},{key:"removeColumns",value:function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(s,i),this.table.rows.forEach(function(e){e.splice(s,i)})}},{key:"_assign",value:function(s,i,e){this.cacheState(),s[i]=e}},{key:"width",get:function(){return this.table.columns.length}},{key:"height",get:function(){return this.table.rows.length}},{key:"filterHeight",get:function(){return this.height+(this.table.headerRow?1:0)}},{key:"tableHeight",get:function(){return this.filterHeight+(this.table.totalsRow?1:0)}},{key:"model",get:function(){return this.table},set:function(s){this.table=s}},{key:"ref",get:function(){return this.table.ref},set:function(s){this._assign(this.table,"ref",s)}},{key:"name",get:function(){return this.table.name},set:function(s){this.table.name=s}},{key:"displayName",get:function(){return this.table.displyName||this.table.name}},{key:"displayNamename",set:function(s){this.table.displayName=s}},{key:"headerRow",get:function(){return this.table.headerRow},set:function(s){this._assign(this.table,"headerRow",s)}},{key:"totalsRow",get:function(){return this.table.totalsRow},set:function(s){this._assign(this.table,"totalsRow",s)}},{key:"theme",get:function(){return this.table.style.name},set:function(s){this.table.style.name=s}},{key:"showFirstColumn",get:function(){return this.table.style.showFirstColumn},set:function(s){this.table.style.showFirstColumn=s}},{key:"showLastColumn",get:function(){return this.table.style.showLastColumn},set:function(s){this.table.style.showLastColumn=s}},{key:"showRowStripes",get:function(){return this.table.style.showRowStripes},set:function(s){this.table.style.showRowStripes=s}},{key:"showColumnStripes",get:function(){return this.table.style.showColumnStripes},set:function(s){this.table.style.showColumnStripes=s}}]),l}();I.exports=c},{"../utils/col-cache":19}],13:[function(d,I,T){function b(l,s){for(var i=0;i31&&console.warn("Worksheet name ".concat(e," exceeds 31 chars. This will be truncated")),/[*?:/\\[\]]/.test(e))throw new Error("Worksheet name ".concat(e," cannot include any of the following characters: * ? : \\ / [ ]"));if(/(^')|('$)/.test(e))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: ".concat(e));if(e=(e||"sheet".concat(r)).substring(0,31),this._worksheets.find(function(u){return u&&u.name.toLowerCase()===e.toLowerCase()}))throw new Error("Worksheet name already exists: ".concat(e));t&&(typeof t=="string"?(console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'),t={properties:{tabColor:{argb:t}}}):(t.argb||t.theme||t.indexed)&&(console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"),t={properties:{tabColor:t}}));var o=this._worksheets.reduce(function(u,f){return(f&&f.orderNo)>u?f.orderNo:u},0),n=Object.assign({},t,{id:r,name:e,orderNo:o+1,workbook:this}),a=new m(n);return this._worksheets[r]=a,a}},{key:"removeWorksheetEx",value:function(e){delete this._worksheets[e.id]}},{key:"removeWorksheet",value:function(e){var t=this.getWorksheet(e);t&&t.destroy()}},{key:"getWorksheet",value:function(e){return e===void 0?this._worksheets.find(Boolean):typeof e=="number"?this._worksheets[e]:typeof e=="string"?this._worksheets.find(function(t){return t&&t.name===e}):void 0}},{key:"eachSheet",value:function(e){this.worksheets.forEach(function(t){e(t,t.id)})}},{key:"clearThemes",value:function(){this._themes=void 0}},{key:"addImage",value:function(e){var t=this.media.length;return this.media.push(Object.assign({},e,{type:"image"})),t}},{key:"getImage",value:function(e){return this.media[e]}},{key:"xlsx",get:function(){return this._xlsx||(this._xlsx=new h(this)),this._xlsx}},{key:"csv",get:function(){return this._csv||(this._csv=new p(this)),this._csv}},{key:"nextId",get:function(){for(var e=1;e2&&arguments[2]!==void 0?arguments[2]:0;if(b(this,p),e)if(typeof e=="string"){var r=v.decodeAddress(e);this.nativeCol=r.col+t,this.nativeColOff=0,this.nativeRow=r.row+t,this.nativeRowOff=0}else e.nativeCol!==void 0?(this.nativeCol=e.nativeCol||0,this.nativeColOff=e.nativeColOff||0,this.nativeRow=e.nativeRow||0,this.nativeRowOff=e.nativeRowOff||0):e.col!==void 0?(this.col=e.col+t,this.row=e.row+t):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;this.worksheet=i}var c,l,s;return c=p,s=[{key:"asInstance",value:function(i){return i instanceof p||i==null?i:new p(i)}}],(l=[{key:"col",get:function(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth},set:function(i){this.nativeCol=Math.floor(i),this.nativeColOff=Math.floor((i-this.nativeCol)*this.colWidth)}},{key:"row",get:function(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight},set:function(i){this.nativeRow=Math.floor(i),this.nativeRowOff=Math.floor((i-this.nativeRow)*this.rowHeight)}},{key:"colWidth",get:function(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}},{key:"rowHeight",get:function(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}},{key:"model",get:function(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}},set:function(i){this.nativeCol=i.nativeCol,this.nativeColOff=i.nativeColOff,this.nativeRow=i.nativeRow,this.nativeRowOff=i.nativeRowOff}}])&&m(c.prototype,l),s&&m(c,s),p}();I.exports=h},{"../utils/col-cache":19}],3:[function(d,I,T){function b(O,P){if(!(O instanceof P))throw new TypeError("Cannot call a class as a function")}function m(O,P){for(var _=0;_0||this.type===O.Types.Merge}},{key:"master",get:function(){return this.type===O.Types.Merge?this._value.master:this}},{key:"isHyperlink",get:function(){return this._value.type===O.Types.Hyperlink}},{key:"hyperlink",get:function(){return this._value.hyperlink}},{key:"value",get:function(){return this._value.value},set:function(P){this.type!==O.Types.Merge?(this._value.release(),this._value=M.create(M.getType(P),this,P)):this._value.master.value=P}},{key:"note",get:function(){return this._comment&&this._comment.note},set:function(P){this._comment=new s(P)}},{key:"text",get:function(){return this._value.toString()}},{key:"html",get:function(){return p.escapeHtml(this.text)}},{key:"formula",get:function(){return this._value.formula}},{key:"result",get:function(){return this._value.result}},{key:"formulaType",get:function(){return this._value.formulaType}},{key:"fullAddress",get:function(){return{sheetName:this._row.worksheet.name,address:this.address,row:this.row,col:this.col}}},{key:"name",get:function(){return this.names[0]},set:function(P){this.names=[P]}},{key:"names",get:function(){return this.workbook.definedNames.getNamesEx(this.fullAddress)},set:function(P){var _=this,S=this.workbook.definedNames;S.removeAllNames(this.fullAddress),P.forEach(function(g){S.addEx(_.fullAddress,g)})}},{key:"_dataValidations",get:function(){return this.worksheet.dataValidations}},{key:"dataValidation",get:function(){return this._dataValidations.find(this.address)},set:function(P){this._dataValidations.add(this.address,P)}},{key:"model",get:function(){var P=this._value.model;return P.style=this.style,this._comment&&(P.comment=this._comment.model),P},set:function(P){if(this._value.release(),this._value=M.create(P.type,this),this._value.model=P,P.comment)switch(P.comment.type){case"note":this._comment=s.fromModel(P.comment)}P.style?this.style=P.style:this.style={}}}]),O}();i.Types=c.ValueType;var e=function(){function O(P){b(this,O),this.model={address:P.address,type:i.Types.Null}}return v(O,[{key:"toCsvString",value:function(){return""}},{key:"release",value:function(){}},{key:"toString",value:function(){return""}},{key:"value",get:function(){return null},set:function(P){}},{key:"type",get:function(){return i.Types.Null}},{key:"effectiveType",get:function(){return i.Types.Null}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),t=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Number,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value.toString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Number}},{key:"effectiveType",get:function(){return i.Types.Number}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),r=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.String,value:_}}return v(O,[{key:"toCsvString",value:function(){return'"'.concat(this.model.value.replace(/"/g,'""'),'"')}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.String}},{key:"effectiveType",get:function(){return i.Types.String}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),o=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.String,value:_}}return v(O,[{key:"toString",value:function(){return this.model.value.richText.map(function(P){return P.text}).join("")}},{key:"toCsvString",value:function(){return'"'.concat(this.text.replace(/"/g,'""'),'"')}},{key:"release",value:function(){}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.RichText}},{key:"effectiveType",get:function(){return i.Types.RichText}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),n=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Date,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value.toISOString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Date}},{key:"effectiveType",get:function(){return i.Types.Date}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),a=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Hyperlink,text:_?_.text:void 0,hyperlink:_?_.hyperlink:void 0},_&&_.tooltip&&(this.model.tooltip=_.tooltip)}return v(O,[{key:"toCsvString",value:function(){return this.model.hyperlink}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.text}},{key:"value",get:function(){var P={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(P.tooltip=this.model.tooltip),P},set:function(P){this.model={text:P.text,hyperlink:P.hyperlink},P.tooltip&&(this.model.tooltip=P.tooltip)}},{key:"text",get:function(){return this.model.text},set:function(P){this.model.text=P}},{key:"hyperlink",get:function(){return this.model.hyperlink},set:function(P){this.model.hyperlink=P}},{key:"type",get:function(){return i.Types.Hyperlink}},{key:"effectiveType",get:function(){return i.Types.Hyperlink}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),u=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Merge,master:_?_.address:void 0},this._master=_,_&&_.addMergeRef()}return v(O,[{key:"isMergedTo",value:function(P){return P===this._master}},{key:"toCsvString",value:function(){return""}},{key:"release",value:function(){this._master.releaseMergeRef()}},{key:"toString",value:function(){return this.value.toString()}},{key:"value",get:function(){return this._master.value},set:function(P){P instanceof i?(this._master&&this._master.releaseMergeRef(),P.addMergeRef(),this._master=P):this._master.value=P}},{key:"master",get:function(){return this._master}},{key:"type",get:function(){return i.Types.Merge}},{key:"effectiveType",get:function(){return this._master.effectiveType}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),f=function(){function O(P,_){b(this,O),this.cell=P,this.model={address:P.address,type:i.Types.Formula,shareType:_?_.shareType:void 0,ref:_?_.ref:void 0,formula:_?_.formula:void 0,sharedFormula:_?_.sharedFormula:void 0,result:_?_.result:void 0}}return v(O,[{key:"_copyModel",value:function(P){var _={},S=function(g){var j=P[g];j&&(_[g]=j)};return S("formula"),S("result"),S("ref"),S("shareType"),S("sharedFormula"),_}},{key:"validate",value:function(P){switch(M.getType(P)){case i.Types.Null:case i.Types.String:case i.Types.Number:case i.Types.Date:break;case i.Types.Hyperlink:case i.Types.Formula:default:throw new Error("Cannot process that type of result value")}}},{key:"_getTranslatedFormula",value:function(){if(!this._translatedFormula&&this.model.sharedFormula){var P=this.cell.worksheet.findCell(this.model.sharedFormula);this._translatedFormula=P&&l(P.formula,P.address,this.model.address)}return this._translatedFormula}},{key:"toCsvString",value:function(){return"".concat(this.model.result||"")}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.result?this.model.result.toString():""}},{key:"value",get:function(){return this._copyModel(this.model)},set:function(P){this.model=this._copyModel(P)}},{key:"dependencies",get:function(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}},{key:"formula",get:function(){return this.model.formula||this._getTranslatedFormula()},set:function(P){this.model.formula=P}},{key:"formulaType",get:function(){return this.model.formula?c.FormulaType.Master:this.model.sharedFormula?c.FormulaType.Shared:c.FormulaType.None}},{key:"result",get:function(){return this.model.result},set:function(P){this.model.result=P}},{key:"type",get:function(){return i.Types.Formula}},{key:"effectiveType",get:function(){var P=this.model.result;return P==null?c.ValueType.Null:P instanceof String||typeof P=="string"?c.ValueType.String:typeof P=="number"?c.ValueType.Number:P instanceof Date?c.ValueType.Date:P.text&&P.hyperlink?c.ValueType.Hyperlink:P.formula?c.ValueType.Formula:c.ValueType.Null}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),y=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.SharedString,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value.toString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.SharedString}},{key:"effectiveType",get:function(){return i.Types.SharedString}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),w=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Boolean,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value?1:0}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Boolean}},{key:"effectiveType",get:function(){return i.Types.Boolean}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),R=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Error,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.toString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.error.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Error}},{key:"effectiveType",get:function(){return i.Types.Error}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),E=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.String,value:JSON.stringify(_),rawValue:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value}},{key:"value",get:function(){return this.model.rawValue},set:function(P){this.model.rawValue=P,this.model.value=JSON.stringify(P)}},{key:"type",get:function(){return i.Types.String}},{key:"effectiveType",get:function(){return i.Types.String}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),M={getType:function(O){return O==null?i.Types.Null:O instanceof String||typeof O=="string"?i.Types.String:typeof O=="number"?i.Types.Number:typeof O=="boolean"?i.Types.Boolean:O instanceof Date?i.Types.Date:O.text&&O.hyperlink?i.Types.Hyperlink:O.formula||O.sharedFormula?i.Types.Formula:O.richText?i.Types.RichText:O.sharedString?i.Types.SharedString:O.error?i.Types.Error:i.Types.JSON},types:[{t:i.Types.Null,f:e},{t:i.Types.Number,f:t},{t:i.Types.String,f:r},{t:i.Types.Date,f:n},{t:i.Types.Hyperlink,f:a},{t:i.Types.Formula,f},{t:i.Types.Merge,f:u},{t:i.Types.JSON,f:E},{t:i.Types.SharedString,f:y},{t:i.Types.RichText,f:o},{t:i.Types.Boolean,f:w},{t:i.Types.Error,f:R}].reduce(function(O,P){return O[P.t]=P.f,O},[]),create:function(O,P,_){var S=this.types[O];if(!S)throw new Error("Could not create Value of type ".concat(O));return new S(P,_)}};I.exports=i},{"../utils/col-cache":19,"../utils/shared-formula":22,"../utils/under-dash":25,"./enums":7,"./note":9}],4:[function(d,I,T){function b(c,l){for(var s=0;s=this._worksheet.properties.outlineLevelCol)}},{key:"isDefault",get:function(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;var e=this.style;return!e||!(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection)}},{key:"headerCount",get:function(){return this.headers.length}},{key:"values",get:function(){var e=[];return this.eachCell(function(t,r){t&&t.type!==v.ValueType.Null&&(e[r]=t.value)}),e},set:function(e){var t=this;if(e){var r=this.number,o=0;e.hasOwnProperty("0")&&(o=1),e.forEach(function(n,a){t._worksheet.getCell(a+o,r).value=n})}}},{key:"numFmt",get:function(){return this.style.numFmt},set:function(e){this._applyStyle("numFmt",e)}},{key:"font",get:function(){return this.style.font},set:function(e){this._applyStyle("font",e)}},{key:"alignment",get:function(){return this.style.alignment},set:function(e){this._applyStyle("alignment",e)}},{key:"protection",get:function(){return this.style.protection},set:function(e){this._applyStyle("protection",e)}},{key:"border",get:function(){return this.style.border},set:function(e){this._applyStyle("border",e)}},{key:"fill",get:function(){return this.style.fill},set:function(e){this._applyStyle("fill",e)}}])&&b(l.prototype,s),i&&b(l,i),c}();I.exports=p},{"../utils/col-cache":19,"../utils/under-dash":25,"./enums":7}],5:[function(d,I,T){function b(v,h){for(var p=0;pthis.bottom)&&(this.bottom=e),(!this.model.right||t>this.right)&&(this.right=t)}},{key:"expandRow",value:function(s){if(s){var i=s.dimensions,e=s.number;i&&this.expand(e,i.min,e,i.max)}}},{key:"expandToAddress",value:function(s){var i=v.decodeEx(s);this.expand(i.row,i.col,i.row,i.col)}},{key:"toString",value:function(){return this.range}},{key:"intersects",value:function(s){return!(s.sheetName&&this.sheetName&&s.sheetName!==this.sheetName||s.bottomthis.bottom||s.rightthis.right)}},{key:"contains",value:function(s){var i=v.decodeEx(s);return this.containsEx(i)}},{key:"containsEx",value:function(s){return(!s.sheetName||!this.sheetName||s.sheetName===this.sheetName)&&s.row>=this.top&&s.row<=this.bottom&&s.col>=this.left&&s.col<=this.right}},{key:"forEachAddress",value:function(s){for(var i=this.left;i<=this.right;i++)for(var e=this.top;e<=this.bottom;e++)s(v.encodeAddress(e,i),e,i)}},{key:"top",get:function(){return this.model.top||1},set:function(s){this.model.top=s}},{key:"left",get:function(){return this.model.left||1},set:function(s){this.model.left=s}},{key:"bottom",get:function(){return this.model.bottom||1},set:function(s){this.model.bottom=s}},{key:"right",get:function(){return this.model.right||1},set:function(s){this.model.right=s}},{key:"sheetName",get:function(){return this.model.sheetName},set:function(s){this.model.sheetName=s}},{key:"_serialisedSheetName",get:function(){var s=this.model.sheetName;return s?/^[a-zA-Z0-9]*$/.test(s)?"".concat(s,"!"):"'".concat(s,"'!"):""}},{key:"tl",get:function(){return v.n2l(this.left)+this.top}},{key:"$t$l",get:function(){return"$".concat(v.n2l(this.left),"$").concat(this.top)}},{key:"br",get:function(){return v.n2l(this.right)+this.bottom}},{key:"$b$r",get:function(){return"$".concat(v.n2l(this.right),"$").concat(this.bottom)}},{key:"range",get:function(){return"".concat(this._serialisedSheetName+this.tl,":").concat(this.br)}},{key:"$range",get:function(){return"".concat(this._serialisedSheetName+this.$t$l,":").concat(this.$b$r)}},{key:"shortRange",get:function(){return this.count>1?this.range:this._serialisedSheetName+this.tl}},{key:"$shortRange",get:function(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}},{key:"count",get:function(){return(1+this.bottom-this.top)*(1+this.right-this.left)}}])&&m(c.prototype,l),p}();I.exports=h},{"../utils/col-cache":19}],11:[function(d,I,T){function b(l,s){for(var i=0;i2?o-2:0),a=2;a0)for(u=R;u>=r;u--)(f=this._cells[u-1])?((y=this.getCell(u+w)).value=f.value,y.style=f.style,y._comment=f._comment):this._cells[u+w-1]=void 0;for(u=0;ur.col)&&(e=r.col),t0?{min:e,max:t}:null}},{key:"numFmt",get:function(){return this.style.numFmt},set:function(e){this._applyStyle("numFmt",e)}},{key:"font",get:function(){return this.style.font},set:function(e){this._applyStyle("font",e)}},{key:"alignment",get:function(){return this.style.alignment},set:function(e){this._applyStyle("alignment",e)}},{key:"protection",get:function(){return this.style.protection},set:function(e){this._applyStyle("protection",e)}},{key:"border",get:function(){return this.style.border},set:function(e){this._applyStyle("border",e)}},{key:"fill",get:function(){return this.style.fill},set:function(e){this._applyStyle("fill",e)}},{key:"hidden",get:function(){return!!this._hidden},set:function(e){this._hidden=e}},{key:"outlineLevel",get:function(){return this._outlineLevel||0},set:function(e){this._outlineLevel=e}},{key:"collapsed",get:function(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}},{key:"model",get:function(){var e=[],t=0,r=0;return this._cells.forEach(function(o){if(o){var n=o.model;n&&((!t||t>o.col)&&(t=o.col),r0,"Table must be on valid row"),t(n>0,"Table must be on valid col");var a=this.width,u=this.filterHeight,f=this.tableHeight;i.autoFilterRef=h.encode(o,n,o+u-1,n+a-1),i.tableRef=h.encode(o,n,o+f-1,n+a-1),i.columns.forEach(function(y,w){t(y.name,"Column ".concat(w," must have a name")),w===0?e(y,"totalsRowLabel","Total"):(e(y,"totalsRowFunction","none"),y.totalsRowFormula=s.getFormula(y))})}},{key:"store",value:function(){var s=this,i=function(y,w){w&&Object.keys(w).forEach(function(R){y[R]=w[R]})},e=this.worksheet,t=this.table,r=t.tl,o=r.row,n=r.col,a=0;if(t.headerRow){var u=e.getRow(o+a++);t.columns.forEach(function(y,w){var R=y.style,E=y.name,M=u.getCell(n+w);M.value=E,i(M,R)})}if(t.rows.forEach(function(y){var w=e.getRow(o+a++);y.forEach(function(R,E){var M=w.getCell(n+E);M.value=R,i(M,t.columns[E].style)})}),t.totalsRow){var f=e.getRow(o+a++);t.columns.forEach(function(y,w){var R=f.getCell(n+w);if(w===0)R.value=y.totalsRowLabel;else{var E=s.getFormula(y);R.value=E?{formula:y.totalsRowFormula,result:y.totalsRowResult}:null}i(R,y.style)})}}},{key:"load",value:function(s){var i=this,e=this.table,t=e.tl,r=t.row,o=t.col,n=0;if(e.headerRow){var a=s.getRow(r+n++);e.columns.forEach(function(f,y){a.getCell(o+y).value=f.name})}if(e.rows.forEach(function(f){var y=s.getRow(r+n++);f.forEach(function(w,R){y.getCell(o+R).value=w})}),e.totalsRow){var u=s.getRow(r+n++);e.columns.forEach(function(f,y){var w=u.getCell(o+y);y===0?w.value=f.totalsRowLabel:i.getFormula(f)&&(w.value={formula:f.totalsRowFormula,result:f.totalsRowResult})})}}},{key:"cacheState",value:function(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}},{key:"commit",value:function(){if(this._cache){this.validate();var s=h.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(var i=0;i1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(s,i)}},{key:"getColumn",value:function(s){var i=this.table.columns[s];return new p(this,i,s)}},{key:"addColumn",value:function(s,i,e){this.cacheState(),e===void 0?(this.table.columns.push(s),this.table.rows.forEach(function(t,r){t.push(i[r])})):(this.table.columns.splice(e,0,s),this.table.rows.forEach(function(t,r){t.splice(e,0,i[r])}))}},{key:"removeColumns",value:function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(s,i),this.table.rows.forEach(function(e){e.splice(s,i)})}},{key:"_assign",value:function(s,i,e){this.cacheState(),s[i]=e}},{key:"width",get:function(){return this.table.columns.length}},{key:"height",get:function(){return this.table.rows.length}},{key:"filterHeight",get:function(){return this.height+(this.table.headerRow?1:0)}},{key:"tableHeight",get:function(){return this.filterHeight+(this.table.totalsRow?1:0)}},{key:"model",get:function(){return this.table},set:function(s){this.table=s}},{key:"ref",get:function(){return this.table.ref},set:function(s){this._assign(this.table,"ref",s)}},{key:"name",get:function(){return this.table.name},set:function(s){this.table.name=s}},{key:"displayName",get:function(){return this.table.displyName||this.table.name}},{key:"displayNamename",set:function(s){this.table.displayName=s}},{key:"headerRow",get:function(){return this.table.headerRow},set:function(s){this._assign(this.table,"headerRow",s)}},{key:"totalsRow",get:function(){return this.table.totalsRow},set:function(s){this._assign(this.table,"totalsRow",s)}},{key:"theme",get:function(){return this.table.style.name},set:function(s){this.table.style.name=s}},{key:"showFirstColumn",get:function(){return this.table.style.showFirstColumn},set:function(s){this.table.style.showFirstColumn=s}},{key:"showLastColumn",get:function(){return this.table.style.showLastColumn},set:function(s){this.table.style.showLastColumn=s}},{key:"showRowStripes",get:function(){return this.table.style.showRowStripes},set:function(s){this.table.style.showRowStripes=s}},{key:"showColumnStripes",get:function(){return this.table.style.showColumnStripes},set:function(s){this.table.style.showColumnStripes=s}}]),l}();I.exports=c},{"../utils/col-cache":19}],13:[function(d,I,T){function b(l,s){for(var i=0;i31&&console.warn("Worksheet name ".concat(e," exceeds 31 chars. This will be truncated")),/[*?:/\\[\]]/.test(e))throw new Error("Worksheet name ".concat(e," cannot include any of the following characters: * ? : \\ / [ ]"));if(/(^')|('$)/.test(e))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: ".concat(e));if(e=(e||"sheet".concat(r)).substring(0,31),this._worksheets.find(function(u){return u&&u.name.toLowerCase()===e.toLowerCase()}))throw new Error("Worksheet name already exists: ".concat(e));t&&(typeof t=="string"?(console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'),t={properties:{tabColor:{argb:t}}}):(t.argb||t.theme||t.indexed)&&(console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"),t={properties:{tabColor:t}}));var o=this._worksheets.reduce(function(u,f){return(f&&f.orderNo)>u?f.orderNo:u},0),n=Object.assign({},t,{id:r,name:e,orderNo:o+1,workbook:this}),a=new m(n);return this._worksheets[r]=a,a}},{key:"removeWorksheetEx",value:function(e){delete this._worksheets[e.id]}},{key:"removeWorksheet",value:function(e){var t=this.getWorksheet(e);t&&t.destroy()}},{key:"getWorksheet",value:function(e){return e===void 0?this._worksheets.find(Boolean):typeof e=="number"?this._worksheets[e]:typeof e=="string"?this._worksheets.find(function(t){return t&&t.name===e}):void 0}},{key:"eachSheet",value:function(e){this.worksheets.forEach(function(t){e(t,t.id)})}},{key:"clearThemes",value:function(){this._themes=void 0}},{key:"addImage",value:function(e){var t=this.media.length;return this.media.push(Object.assign({},e,{type:"image"})),t}},{key:"getImage",value:function(e){return this.media[e]}},{key:"xlsx",get:function(){return this._xlsx||(this._xlsx=new h(this)),this._xlsx}},{key:"csv",get:function(){return this._csv||(this._csv=new p(this)),this._csv}},{key:"nextId",get:function(){for(var e=1;ey.length)&&(w=y.length);for(var R=0,E=new Array(w);Rthis._columns.length)for(var O=this._columns.length+1;O<=E;)this._columns.push(new t(this,O++));return this._columns[E-1]}},{key:"spliceColumns",value:function(E,M){for(var O=this,P=this._rows,_=P.length,S=arguments.length,g=new Array(S>2?S-2:0),j=2;j0)for(var k=function(V){var q=[E,M];g.forEach(function(L){q.push(L[V]||null)});var $=O.getRow(V+1);$.splice.apply($,q)},x=0;x<_;x++)k(x);else this._rows.forEach(function(V){V&&V.splice(E,M)});var C=g.length-M,D=E+M,F=this._columns.length;if(C<0)for(var B=E+g.length;B<=F;B++)this.getColumn(B).defn=this.getColumn(B-C).defn;else if(C>0)for(var U=F;U>=D;U--)this.getColumn(U+C).defn=this.getColumn(U).defn;for(var H=E;H1&&arguments[1]!==void 0?arguments[1]:"n",O=this._nextRow,P=this.getRow(O);return P.values=E,this._setStyleOption(O,M[0]==="i"?M:"n"),P}},{key:"addRows",value:function(E){var M=this,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n",P=[];return E.forEach(function(_){P.push(M.addRow(_,O))}),P}},{key:"insertRow",value:function(E,M){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(E,0,M),this._setStyleOption(E,O),this.getRow(E)}},{key:"insertRows",value:function(E,M){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows.apply(this,[E,0].concat(h(M))),O!=="n")for(var P=0;P1&&arguments[1]!==void 0?arguments[1]:"n";M[0]==="o"&&this.findRow(E+1)!==void 0?this._copyStyle(E+1,E,M[1]==="+"):M[0]==="i"&&this.findRow(E-1)!==void 0&&this._copyStyle(E-1,E,M[1]==="+")}},{key:"_copyStyle",value:function(E,M){var O=arguments.length>2&&arguments[2]!==void 0&&arguments[2],P=this.getRow(E),_=this.getRow(M);_.style=Object.freeze(m({},P.style)),P.eachCell({includeEmpty:O},function(S,g){_.getCell(g).style=Object.freeze(m({},S.style))}),_.height=P.height}},{key:"duplicateRow",value:function(E,M){var O=this,P=arguments.length>2&&arguments[2]!==void 0&&arguments[2],_=this._rows[E-1],S=new Array(M).fill(_.values);this.spliceRows.apply(this,[E+1,P?0:M].concat(h(S)));for(var g=function(k){var x=O._rows[E+k];x.style=_.style,x.height=_.height,_.eachCell({includeEmpty:!0},function(C,D){x.getCell(D).style=C.style})},j=0;j2?_-2:0),g=2;g<_;g++)S[g-2]=arguments[g];var j,k,x=S.length,C=x-M,D=this._rows.length;if(C<0)for(j=P;j<=D;j++)(k=this._rows[j-1])?function(){var B=O.getRow(j+C);B.values=k.values,B.style=k.style,B.height=k.height,k.eachCell({includeEmpty:!0},function(U,H){B.getCell(H).style=U.style}),O._rows[j-1]=void 0}():this._rows[j+C-1]=void 0;else if(C>0)for(j=D;j>=P;j--)(k=this._rows[j-1])?function(){var B=O.getRow(j+C);B.values=k.values,B.style=k.style,B.height=k.height,k.eachCell({includeEmpty:!0},function(U,H){if(B.getCell(H).style=U.style,U._value.constructor.name==="MergeValue"){var V=O.getRow(U._row._number+x).getCell(H),q=U._value._master,$=O.getRow(q._row._number+x).getCell(q._column._number);V.merge($)}})}():this._rows[j+C-1]=void 0;for(j=0;jE.top||_>E.left)&&this.getCell(P,_).merge(O,M);this._merges[O.address]=E}},{key:"_unMergeMaster",value:function(E){var M=this._merges[E.address];if(M){for(var O=M.top;O<=M.bottom;O++)for(var P=M.left;P<=M.right;P++)this.getCell(O,P).unmerge();delete this._merges[E.address]}}},{key:"unMergeCells",value:function(){for(var E=arguments.length,M=new Array(E),O=0;O3&&arguments[3]!==void 0?arguments[3]:"shared",S=s.decode(E),g=S.top,j=S.left,k=S.bottom,x=S.right,C=x-j+1,D=s.encodeAddress(g,j),F=_==="shared";P=typeof O=="function"?O:Array.isArray(O)?Array.isArray(O[0])?function(V,q){return O[V-g][q-j]}:function(V,q){return O[(V-g)*C+(q-j)]}:function(){};for(var B=!0,U=g;U<=k;U++)for(var H=j;H<=x;H++)B?(this.getCell(U,H).value={shareType:_,formula:M,ref:E,result:P(U,H)},B=!1):this.getCell(U,H).value=F?{sharedFormula:D,result:P(U,H)}:P(U,H)}},{key:"addImage",value:function(E,M){var O={type:"image",imageId:E,range:M};this._media.push(new o(this,O))}},{key:"getImages",value:function(){return this._media.filter(function(E){return E.type==="image"})}},{key:"addBackgroundImage",value:function(E){var M={type:"background",imageId:E};this._media.push(new o(this,M))}},{key:"getBackgroundImageId",value:function(){var E=this._media.find(function(M){return M.type==="background"});return E&&E.imageId}},{key:"protect",value:function(E,M){var O=this;return new Promise(function(P){O.sheetProtection={sheet:!0},M&&"spinCount"in M&&(M.spinCount=Number.isFinite(M.spinCount)?Math.round(Math.max(0,M.spinCount)):1e5),E&&(O.sheetProtection.algorithmName="SHA-512",O.sheetProtection.saltValue=u.randomBytes(16).toString("base64"),O.sheetProtection.spinCount=M&&"spinCount"in M?M.spinCount:1e5,O.sheetProtection.hashValue=u.convertPasswordToHash(E,"SHA512",O.sheetProtection.saltValue,O.sheetProtection.spinCount)),M&&(O.sheetProtection=Object.assign(O.sheetProtection,M),!E&&"spinCount"in M&&delete O.sheetProtection.spinCount),P()})}},{key:"unprotect",value:function(){this.sheetProtection=null}},{key:"addTable",value:function(E){var M=new n(this,E);return this.tables[E.name]=M,M}},{key:"getTable",value:function(E){return this.tables[E]}},{key:"removeTable",value:function(E){delete this.tables[E]}},{key:"getTables",value:function(){return Object.values(this.tables)}},{key:"addConditionalFormatting",value:function(E){this.conditionalFormattings.push(E)}},{key:"removeConditionalFormatting",value:function(E){typeof E=="number"?this.conditionalFormattings.splice(E,1):this.conditionalFormattings=E instanceof Function?this.conditionalFormattings.filter(E):[]}},{key:"_parseRows",value:function(E){var M=this;this._rows=[],E.rows.forEach(function(O){var P=new e(M,O.number);M._rows[P.number-1]=P,P.model=O})}},{key:"_parseMergeCells",value:function(E){var M=this;l.each(E.mergeCells,function(O){M.mergeCellsWithoutStyle(O)})}},{key:"workbook",get:function(){return this._workbook}},{key:"dimensions",get:function(){var E=new i;return this._rows.forEach(function(M){if(M){var O=M.dimensions;O&&E.expand(M.number,O.min,M.number,O.max)}}),E}},{key:"columns",get:function(){return this._columns},set:function(E){var M=this;this._headerRowCount=E.reduce(function(_,S){var g=(S.header?1:S.headers&&S.headers.length)||0;return Math.max(_,g)},0);var O=1,P=this._columns=[];E.forEach(function(_){var S=new t(M,O++,!1);P.push(S),S.defn=_})}},{key:"lastColumn",get:function(){return this.getColumn(this.columnCount)}},{key:"columnCount",get:function(){var E=0;return this.eachRow(function(M){E=Math.max(E,M.cellCount)}),E}},{key:"actualColumnCount",get:function(){var E=[],M=0;return this.eachRow(function(O){O.eachCell(function(P){var _=P.col;E[_]||(E[_]=!0,M++)})}),M}},{key:"_lastRowNumber",get:function(){for(var E=this._rows,M=E.length;M>0&&E[M-1]===void 0;)M--;return M}},{key:"_nextRow",get:function(){return this._lastRowNumber+1}},{key:"lastRow",get:function(){if(this._rows.length)return this._rows[this._rows.length-1]}},{key:"rowCount",get:function(){return this._lastRowNumber}},{key:"actualRowCount",get:function(){var E=0;return this.eachRow(function(){E++}),E}},{key:"hasMerges",get:function(){return l.some(this._merges,Boolean)}},{key:"tabColor",get:function(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor},set:function(E){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=E}},{key:"model",get:function(){var E={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(function(P){return P.model}),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(function(P){return P.model}),conditionalFormattings:this.conditionalFormattings};E.cols=t.toModel(this.columns);var M=E.rows=[],O=E.dimensions=new i;return this._rows.forEach(function(P){var _=P&&P.model;_&&(O.expand(_.number,_.min,_.number,_.max),M.push(_))}),E.merges=[],l.each(this._merges,function(P){E.merges.push(P.range)}),E},set:function(E){var M=this;this.name=E.name,this._columns=t.fromModel(this,E.cols),this._parseRows(E),this._parseMergeCells(E),this.dataValidations=new a(E.dataValidations),this.properties=E.properties,this.pageSetup=E.pageSetup,this.headerFooter=E.headerFooter,this.views=E.views,this.autoFilter=E.autoFilter,this._media=E.media.map(function(O){return new o(M,O)}),this.sheetProtection=E.sheetProtection,this.tables=E.tables.reduce(function(O,P){var _=new n;return _.model=P,O[P.name]=_,O},{}),this.conditionalFormattings=E.conditionalFormattings}}])&&c(w.prototype,R),y}();I.exports=f},{"../utils/col-cache":19,"../utils/encryptor":20,"../utils/under-dash":25,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(d,I,T){d("core-js/modules/es.promise"),d("core-js/modules/es.object.assign"),d("core-js/modules/es.object.keys"),d("core-js/modules/es.object.values"),d("core-js/modules/es.symbol"),d("core-js/modules/es.symbol.async-iterator"),d("core-js/modules/es.array.iterator"),d("core-js/modules/es.array.includes"),d("core-js/modules/es.array.find-index"),d("core-js/modules/es.array.find"),d("core-js/modules/es.string.from-code-point"),d("core-js/modules/es.string.includes"),d("core-js/modules/es.number.is-nan"),d("regenerator-runtime/runtime");var b={Workbook:d("./doc/workbook")},m=d("./doc/enums");Object.keys(m).forEach(function(v){b[v]=m[v]}),I.exports=b},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":316,"core-js/modules/es.array.find-index":315,"core-js/modules/es.array.includes":317,"core-js/modules/es.array.iterator":318,"core-js/modules/es.number.is-nan":319,"core-js/modules/es.object.assign":320,"core-js/modules/es.object.keys":321,"core-js/modules/es.object.values":322,"core-js/modules/es.promise":323,"core-js/modules/es.string.from-code-point":324,"core-js/modules/es.string.includes":325,"core-js/modules/es.symbol":327,"core-js/modules/es.symbol.async-iterator":326,"regenerator-runtime/runtime":492}],16:[function(d,I,T){var b=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");T.bufferToString=function(m){return typeof m=="string"?m:b?b.decode(m):m.toString()}},{}],17:[function(d,I,T){var b=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),m=d("buffer").Buffer;T.stringToBuffer=function(v){return typeof v!="string"?v:b?m.from(b.encode(v).buffer):m.from(v)}},{buffer:216}],18:[function(d,I,T){function b(p,c){for(var l=0;l"u"||!(Symbol.iterator in Object(i)))){var t=[],r=!0,o=!1,n=void 0;try{for(var a,u=i[Symbol.iterator]();!(r=(a=u.next()).done)&&(t.push(a.value),!e||t.length!==e);r=!0);}catch(f){o=!0,n=f}finally{try{r||u.return==null||u.return()}finally{if(o)throw n}}return t}}(l,s)||function(i,e){if(!!i){if(typeof i=="string")return m(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(i,e)}}(l,s)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function m(l,s){(s==null||s>l.length)&&(s=l.length);for(var i=0,e=new Array(s);i=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&l>=1){for(;o<=26;)s=this._dictionary[o-1],this._n2l[o]=s,this._l2n[s]=o,o++;this._l2nFill=1}if(this._l2nFill<2&&l>=2){for(o=27;o<=702;)e=(i=o-27)%26,t=Math.floor(i/26),s=this._dictionary[t]+this._dictionary[e],this._n2l[o]=s,this._l2n[s]=o,o++;this._l2nFill=2}if(this._l2nFill<3&&l>=3){for(o=703;o<=16384;)e=(i=o-703)%26,t=Math.floor(i/26)%26,r=Math.floor(i/676),s=this._dictionary[r]+this._dictionary[t]+this._dictionary[e],this._n2l[o]=s,this._l2n[s]=o,o++;this._l2nFill=3}},l2n:function(l){if(this._l2n[l]||this._fill(l.length),!this._l2n[l])throw new Error("Out of bounds. Invalid column letter: ".concat(l));return this._l2n[l]},n2l:function(l){if(l<1||l>16384)throw new Error("".concat(l," is out of bounds. Excel supports columns from 1 to 16384"));return this._n2l[l]||this._fill(this._level(l)),this._n2l[l]},_hash:{},validateAddress:function(l){if(!p.test(l))throw new Error("Invalid Address: ".concat(l));return!0},decodeAddress:function(l){var s=l.length<5&&this._hash[l];if(s)return s;for(var i,e=!1,t="",r=0,o=!1,n="",a=0,u=0;u=65&&i<=90)e=!0,t+=l[u],r=26*r+i-64;else if(i>=48&&i<=57)o=!0,n+=l[u],a=10*a+i-48;else if(o&&e&&i!==36)break;if(e){if(r>16384)throw new Error("Out of bounds. Invalid column letter: ".concat(t))}else r=void 0;o||(a=void 0);var f={address:l=t+n,col:r,row:a,$col$row:"$".concat(t,"$").concat(n)};return r<=100&&a<=100&&(this._hash[l]=f,this._hash[f.$col$row]=f),f},getAddress:function(l,s){if(s){var i=this.n2l(s)+l;return this.decodeAddress(i)}return this.decodeAddress(l)},decode:function(l){var s=l.split(":");if(s.length===2){var i=this.decodeAddress(s[0]),e=this.decodeAddress(s[1]),t={top:Math.min(i.row,e.row),left:Math.min(i.col,e.col),bottom:Math.max(i.row,e.row),right:Math.max(i.col,e.col)};return t.tl=this.n2l(t.left)+t.top,t.br=this.n2l(t.right)+t.bottom,t.dimensions="".concat(t.tl,":").concat(t.br),t}return this.decodeAddress(l)},decodeEx:function(l){var s=l.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),i=s[1]||s[2],e=s[3],t=e.split(":");if(t.length>1){var r=this.decodeAddress(t[0]),o=this.decodeAddress(t[1]),n=Math.min(r.row,o.row),a=Math.min(r.col,o.col),u=Math.max(r.row,o.row),f=Math.max(r.col,o.col);return r=this.n2l(a)+n,o=this.n2l(f)+u,{top:n,left:a,bottom:u,right:f,sheetName:i,tl:{address:r,col:a,row:n,$col$row:"$".concat(this.n2l(a),"$").concat(n),sheetName:i},br:{address:o,col:f,row:u,$col$row:"$".concat(this.n2l(f),"$").concat(u),sheetName:i},dimensions:"".concat(r,":").concat(o)}}if(e.startsWith("#"))return i?{sheetName:i,error:e}:{error:e};var y=this.decodeAddress(e);return i?function(w){for(var R=1;R=e&&a<=r&&u>=t&&u<=o}};I.exports=c},{}],20:[function(d,I,T){(function(b){var m=d("crypto"),v={hash:function(h){for(var p=m.createHash(h),c=arguments.length,l=new Array(c>1?c-1:0),s=1;s3||u.length===3&&u>"XFD")return i;var w=b.l2n(u),R=parseInt(y,10);return a||(w+=s.col-l.col),f||(R+=s.row-l.row),(e||"")+(a||"")+b.n2l(w)+(f||"")+R}return i})}}},{"./col-cache":19}],23:[function(d,I,T){(function(b,m){function v(u,f,y,w,R,E,M){try{var O=u[E](M),P=O.value}catch(_){return void y(_)}O.done?f(P):Promise.resolve(P).then(w,R)}function h(u){return function(){var f=this,y=arguments;return new Promise(function(w,R){var E=u.apply(f,y);function M(P){v(E,w,R,M,O,"next",P)}function O(P){v(E,w,R,M,O,"throw",P)}M(void 0)})}}function p(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}function c(u,f){for(var y=0;y=this.length?(y=this.toBuffer(),this.iRead=this.iWrite,y):(y=m.alloc(f),this.buffer.copy(y,0,this.iRead,f),this.iRead+=f,y)}},{key:"write",value:function(f,y,w){var R=Math.min(w,this.size-this.iWrite);return f.copy(this.buffer,this.iWrite,y,y+R),this.iWrite+=R,R}},{key:"length",get:function(){return this.iWrite-this.iRead}},{key:"eod",get:function(){return this.iRead===this.iWrite}},{key:"full",get:function(){return this.iWrite===this.size}}]),u}(),a=function(u){u=u||{},this.bufSize=u.bufSize||1048576,this.buffers=[],this.batch=u.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};i.inherits(a,s.Duplex,{toBuffer:function(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return m.concat(this.buffers.map(function(u){return u.toBuffer()}))}},_getWritableBuffer:function(){if(this.buffers.length){var u=this.buffers[this.buffers.length-1];if(!u.full)return u}var f=new n(this.bufSize);return this.buffers.push(f),f},_pipe:function(u){var f=this;return h(regeneratorRuntime.mark(function y(){var w;return regeneratorRuntime.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return w=function(E){return new Promise(function(M){E.write(u.toBuffer(),function(){M()})})},R.next=3,Promise.all(f.pipes.map(w));case 3:case"end":return R.stop()}},y)}))()},_writeToBuffers:function(u){for(var f=0,y=u.length;f1;)w._pipe(w.buffers.shift());M.next=29;break;case 21:if(w.corked){M.next=27;break}return M.next=24,w._pipe(E);case 24:y(),M.next=29;break;case 27:w._writeToBuffers(E),b.nextTick(y);case 29:M.next=34;break;case 31:w.paused||w.emit("data",E.toBuffer()),w._writeToBuffers(E),w.emit("readable");case 34:return M.abrupt("return",!0);case 35:case"end":return M.stop()}},R)}))()},cork:function(){this.corked=!0},_flush:function(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork:function(){this.corked=!1,this._flush()},end:function(u,f,y){var w=this,R=function(E){E?y(E):(w._flush(),w.pipes.forEach(function(M){M.end()}),w.emit("finish"))};u?this.write(u,f,R):R()},read:function(u){var f;if(u){for(f=[];u&&this.buffers.length&&!this.buffers[0].eod;){var y=this.buffers[0],w=y.read(u);u-=w.length,f.push(w),y.eod&&y.full&&this.buffers.shift()}return m.concat(f)}return f=this.buffers.map(function(R){return R.toBuffer()}).filter(Boolean),this.buffers=[],m.concat(f)},setEncoding:function(u){this.encoding=u},pause:function(){this.paused=!0},resume:function(){this.paused=!1},isPaused:function(){return!!this.paused},pipe:function(u){this.pipes.push(u),!this.paused&&this.buffers.length&&this.end()},unpipe:function(u){this.pipes=this.pipes.filter(function(f){return f!==u})},unshift:function(){throw new Error("Not Implemented")},wrap:function(){throw new Error("Not Implemented")}}),I.exports=a}).call(this,d("_process"),d("buffer").Buffer)},{"./string-buf":24,"./utils":26,_process:467,buffer:216,"readable-stream":491}],24:[function(d,I,T){(function(b){function m(h,p){for(var c=0;c=this._buf.length-4;)this._grow(this._inPos+l.length),s=this._inPos+this._buf.write(l,this._inPos,this._encoding);this._inPos=s}},{key:"addStringBuf",value:function(l){l.length&&(this._buffer=void 0,this.length+l.length>this.capacity&&this._grow(this.length+l.length),l._buf.copy(this._buf,this._inPos,0,l.length),this._inPos+=l.length)}},{key:"length",get:function(){return this._inPos}},{key:"capacity",get:function(){return this._buf.length}},{key:"buffer",get:function(){return this._buf}}])&&m(p.prototype,c),h}();I.exports=v}).call(this,d("buffer").Buffer)},{buffer:216}],25:[function(d,I,T){function b(p){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(p)}var m=Object.prototype.toString,v=/["&<>]/,h={each:function(p,c){p&&(Array.isArray(p)?p.forEach(c):Object.keys(p).forEach(function(l){c(p[l],l)}))},some:function(p,c){return!!p&&(Array.isArray(p)?p.some(c):Object.keys(p).some(function(l){return c(p[l],l)}))},every:function(p,c){return!p||(Array.isArray(p)?p.every(c):Object.keys(p).every(function(l){return c(p[l],l)}))},map:function(p,c){return p?Array.isArray(p)?p.map(c):Object.keys(p).map(function(l){return c(p[l],l)}):[]},keyBy:function(p,c){return p.reduce(function(l,s){return l[s[c]]=s,l},{})},isEqual:function(p,c){var l=b(p),s=b(c),i=Array.isArray(p),e=Array.isArray(c);if(l!==s)return!1;switch(b(p)){case"object":return i||e?!(!i||!e)&&p.length===c.length&&p.every(function(t,r){var o=c[r];return h.isEqual(t,o)}):h.every(p,function(t,r){var o=c[r];return h.isEqual(t,o)});default:return p===c}},escapeHtml:function(p){var c=v.exec(p);if(!c)return p;for(var l="",s="",i=0,e=c.index;e":s=">";break;default:continue}i!==e&&(l+=p.substring(i,e)),i=e+1,l+=s}return i!==e?l+p.substring(i,e):l},strcmp:function(p,c){return pc?1:0},isUndefined:function(p){return m.call(p)==="[object Undefined]"},isObject:function(p){return m.call(p)==="[object Object]"},deepMerge:function(){var p,c,l,s=arguments[0]||{},i=arguments.length;function e(r,o){p=s[o],l=Array.isArray(r),h.isObject(r)||l?(l?(l=!1,c=p&&Array.isArray(p)?p:[]):c=p&&h.isObject(p)?p:{},s[o]=h.deepMerge(c,r)):h.isUndefined(r)||(s[o]=r)}for(var t=0;t&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,p={nop:function(){},promiseImmediate:function(c){return new Promise(function(l){b.setImmediate?m(function(){l(c)}):setTimeout(function(){l(c)},1)})},inherits:function(c,l,s,i){c.super_=l,i||(i=s,s=null),s&&Object.keys(s).forEach(function(t){Object.defineProperty(c,t,Object.getOwnPropertyDescriptor(s,t))});var e={constructor:{value:c,enumerable:!1,writable:!1,configurable:!0}};i&&Object.keys(i).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(i,t)}),c.prototype=Object.create(l.prototype,e)},dateToExcel:function(c,l){return 25569+c.getTime()/864e5-(l?1462:0)},excelToDate:function(c,l){var s=Math.round(24*(c-25569+(l?1462:0))*3600*1e3);return new Date(s)},parsePath:function(c){var l=c.lastIndexOf("/");return{path:c.substring(0,l),name:c.substring(l+1)}},getRelsPath:function(c){var l=p.parsePath(c);return"".concat(l.path,"/_rels/").concat(l.name,".rels")},xmlEncode:function(c){var l=h.exec(c);if(!l)return c;for(var s="",i="",e=0,t=l.index;t=11&&r!==13)){i="";break}continue}e!==t&&(s+=c.substring(e,t)),e=t+1,i&&(s+=i)}return e!==t?s+c.substring(e,t):s},xmlDecode:function(c){return c.replace(/&([a-z]*);/g,function(l){switch(l){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return l}})},validInt:function(c){var l=parseInt(c,10);return Number.isNaN(l)?0:l},isDateFmt:function(c){return!!c&&(c=(c=c.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null},fs:{exists:function(c){return new Promise(function(l){v.access(c,v.constants.F_OK,function(s){l(!s)})})}},toIsoDateString:function(c){return c.toIsoString().subsstr(0,10)}};I.exports=p}).call(this,typeof Qe<"u"?Qe:typeof self<"u"?self:typeof window<"u"?window:{},d("timers").setImmediate)},{fs:215,timers:521}],27:[function(d,I,T){function b(l,s){for(var i=0;i
`)}},{key:"openNode",value:function(e,t){var r=this.tos,o=this._xml;r&&this.open&&o.push(">"),this._stack.push(e),o.push("<"),o.push(e),p(o,t),this.leaf=!0,this.open=!0}},{key:"addAttribute",value:function(e,t){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");t!==void 0&&h(this._xml,e,t)}},{key:"addAttributes",value:function(e){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");p(this._xml,e)}},{key:"writeText",value:function(e){var t=this._xml;this.open&&(t.push(">"),this.open=!1),this.leaf=!1,t.push(v.xmlEncode(e.toString()))}},{key:"writeXml",value:function(e){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(e)}},{key:"closeNode",value:function(){var e=this._stack.pop(),t=this._xml;this.leaf?t.push("/>"):(t.push(""),t.push(e),t.push(">")),this.open=!1,this.leaf=!1}},{key:"leafNode",value:function(e,t,r){this.openNode(e,t),r!==void 0&&this.writeText(r),this.closeNode()}},{key:"closeAll",value:function(){for(;this._stack.length;)this.closeNode()}},{key:"addRollback",value:function(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}},{key:"commit",value:function(){this._rollbacks.pop()}},{key:"rollback",value:function(){var e=this._rollbacks.pop();this._xml.length>e.xml&&this._xml.splice(e.xml,this._xml.length-e.xml),this._stack.length>e.stack&&this._stack.splice(e.stack,this._stack.length-e.stack),this.leaf=e.leaf,this.open=e.open}},{key:"tos",get:function(){return this._stack.length?this._stack[this._stack.length-1]:void 0}},{key:"cursor",get:function(){return this._xml.length}},{key:"xml",get:function(){return this.closeAll(),this._xml.join("")}}])&&b(s.prototype,i),l}();c.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},I.exports=c},{"./under-dash":25,"./utils":26}],28:[function(d,I,T){(function(b){function m(n){return(m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a})(n)}function v(n,a,u,f,y,w,R){try{var E=n[w](R),M=E.value}catch(O){return void u(O)}E.done?a(M):Promise.resolve(M).then(f,y)}function h(n,a){for(var u=0;u"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var u,f=s(n);if(a){var y=s(this).constructor;u=Reflect.construct(f,arguments,y)}else u=f.apply(this,arguments);return l(this,u)}}function l(n,a){return!a||m(a)!=="object"&&typeof a!="function"?function(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}(n):a}function s(n){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)})(n)}var i=d("events"),e=d("jszip"),t=d("./stream-buf"),r=d("./browser-buffer-encode").stringToBuffer,o=function(n){(function(E,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(M&&M.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),M&&p(E,M)})(R,n);var a,u,f,y,w=c(R);function R(E){var M;return function(O,P){if(!(O instanceof P))throw new TypeError("Cannot call a class as a function")}(this,R),(M=w.call(this)).options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},E),M.zip=new e,M.stream=new t,M}return a=R,(u=[{key:"append",value:function(E,M){M.hasOwnProperty("base64")&&M.base64?this.zip.file(M.name,E,{base64:!0}):(b.browser&&typeof E=="string"&&(E=r(E)),this.zip.file(M.name,E))}},{key:"finalize",value:(f=regeneratorRuntime.mark(function E(){var M;return regeneratorRuntime.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,this.zip.generateAsync(this.options);case 2:M=O.sent,this.stream.end(M),this.emit("finish");case 5:case"end":return O.stop()}},E,this)}),y=function(){var E=this,M=arguments;return new Promise(function(O,P){var _=f.apply(E,M);function S(j){v(_,O,P,S,g,"next",j)}function g(j){v(_,O,P,S,g,"throw",j)}S(void 0)})},function(){return y.apply(this,arguments)})},{key:"read",value:function(E){return this.stream.read(E)}},{key:"setEncoding",value:function(E){return this.stream.setEncoding(E)}},{key:"pause",value:function(){return this.stream.pause()}},{key:"resume",value:function(){return this.stream.resume()}},{key:"isPaused",value:function(){return this.stream.isPaused()}},{key:"pipe",value:function(E,M){return this.stream.pipe(E,M)}},{key:"unpipe",value:function(E){return this.stream.unpipe(E)}},{key:"unshift",value:function(E){return this.stream.unshift(E)}},{key:"wrap",value:function(E){return this.stream.wrap(E)}}])&&h(a.prototype,u),R}(i.EventEmitter);I.exports={ZipWriter:o}}).call(this,d("_process"))},{"./browser-buffer-encode":17,"./stream-buf":23,_process:467,events:367,jszip:399}],29:[function(d,I,T){I.exports={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5E74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5E74" mm"\u6708" dd"\u65E5"'},28:{"zh-tw":'[$-404]e"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'[$-411]ggge"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'[$-411]ggge"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'yyyy"\u5E74"m"\u6708"d"\u65E5"',"ja-jp":'yyyy"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":'yyyy"\uB144" mm"\uC6D4" dd"\uC77C"'},32:{"zh-tw":'hh"\u6642"mm"\u5206"',"zh-cn":'h"\u65F6"mm"\u5206"',"ja-jp":'h"\u6642"mm"\u5206"',"ko-kr":'h"\uC2DC" mm"\uBD84"'},33:{"zh-tw":'hh"\u6642"mm"\u5206"ss"\u79D2"',"zh-cn":'h"\u65F6"mm"\u5206"ss"\u79D2"',"ja-jp":'h"\u6642"mm"\u5206"ss"\u79D2"',"ko-kr":'h"\uC2DC" mm"\uBD84" ss"\uCD08"'},34:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"',"zh-cn":'\u4E0A\u5348/\u4E0B\u5348 h"\u65F6"mm"\u5206"',"ja-jp":'yyyy"\u5E74"m"\u6708"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"ss"\u79D2"',"zh-cn":'\u4E0A\u5348/\u4E0B\u5348 h"\u65F6"mm"\u5206"ss"\u79D2"',"ja-jp":'m"\u6708"d"\u65E5"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5E74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5E74" mm"\u6708" dd"\u65E5"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5E74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5E74" mm"\u6708" dd"\u65E5"'},51:{"zh-tw":'[$-404]e"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'[$-411]ggge"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":"mm-dd"},52:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"',"zh-cn":'yyyy"\u5E74"m"\u6708"',"ja-jp":'yyyy"\u5E74"m"\u6708"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"ss"\u79D2"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'m"\u6708"d"\u65E5"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'[$-411]ggge"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":"mm-dd"},55:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"',"zh-cn":'\u4E0A\u5348/\u4E0B\u5348 h"\u65F6"mm"\u5206"',"ja-jp":'yyyy"\u5E74"m"\u6708"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"ss"\u79D2"',"zh-cn":'\u4E0A\u5348/\u4E0B\u5348 h"\u65F6"mm"\u5206"ss"\u79D2"',"ja-jp":'m"\u6708"d"\u65E5"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5E74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5E74" mm"\u6708" dd"\u65E5"'},58:{"zh-tw":'[$-404]e"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'[$-411]ggge"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}}},{}],30:[function(d,I,T){I.exports={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"}},{}],31:[function(d,I,T){function b(e,t){var r;if(typeof Symbol>"u"||e[Symbol.iterator]==null){if(Array.isArray(e)||(r=function(y,w){if(!!y){if(typeof y=="string")return m(y,w);var R=Object.prototype.toString.call(y).slice(8,-1);if(R==="Object"&&y.constructor&&(R=y.constructor.name),R==="Map"||R==="Set")return Array.from(y);if(R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R))return m(y,w)}}(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var o=0,n=function(){};return{s:n,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(y){throw y},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
diff --git a/docs/assets/exceljs.min.4a739ad8.js.gz b/docs/assets/exceljs.min.4a739ad8.js.gz
new file mode 100644
index 0000000..6a9df94
Binary files /dev/null and b/docs/assets/exceljs.min.4a739ad8.js.gz differ
diff --git a/docs/assets/exprotExcel.ab502b2a.js b/docs/assets/exprotExcel.11e45c33.js
similarity index 97%
rename from docs/assets/exprotExcel.ab502b2a.js
rename to docs/assets/exprotExcel.11e45c33.js
index 754a0c4..80be4a4 100644
--- a/docs/assets/exprotExcel.ab502b2a.js
+++ b/docs/assets/exprotExcel.11e45c33.js
@@ -1 +1 @@
-import{E as k}from"./exceljs.min.2c2604a6.js";const h=(a,n=10)=>(a==null?n=10:a.toString().charCodeAt(0)>255?n=a.toString().length*2:n=a.toString().length,n),g=async({column:a,data:n,filename:s,autoWidth:u,format:c})=>{const e=new k.Workbook;e.creator="Me",e.title=s,e.created=new Date,e.modified=new Date;const i=e.addWorksheet(s),l=[];a.forEach((o,t)=>{const w={header:o.label,key:o.name,width:null};if(u){const d=[h(o.label)];n.forEach(f=>{const x=f[o.name]||"";x&&d.push(h(x))}),w.width=Math.max(...d)+5}l.push(w)}),i.columns=l,i.addRows(n);const b=c==="xlsx"?await e.xlsx.writeBuffer():await e.csv.writeBuffer(),r=new Blob([b],{type:"application/octet-binary"});if(window.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(r,s+`.${c}`);else{const o=document.createElement("a");o.href=window.URL.createObjectURL(r),o.download=s+`.${c}`,o.click(),window.URL.revokeObjectURL(o.href)}};function E(a,n){const{color:s,fontSize:u,horizontal:c,bold:e}=n||{};a.fill={type:"pattern",pattern:"solid",fgColor:{argb:s}},a.font={bold:e!=null?e:!0,size:u!=null?u:11,color:{argb:"ff0000"}},a.alignment={vertical:"middle",wrapText:!0,horizontal:c!=null?c:"left"}}const R=async({column:a,data:n,filename:s,autoWidth:u,format:c})=>{const e=new k.Workbook;e.creator="Me",e.title=s,e.created=new Date,e.modified=new Date;const i=e.addWorksheet(s),l=[];a.forEach((t,w)=>{const d={header:t.label,key:t.name,width:null};if(u){const f=[h(t.label)];n.forEach(x=>{const p=x[t.name]||"";p&&f.push(h(p))}),d.width=Math.max(...f)+5}l.push(d)}),i.columns=l,i.addRows(n),i.getRow(1).eachCell(t=>E(t,{color:"dff8ff",fontSize:12,horizontal:"left"}));const r=c==="xlsx"?await e.xlsx.writeBuffer():await e.csv.writeBuffer(),o=new Blob([r],{type:"application/octet-binary"});if(window.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(o,s+`.${c}`);else{const t=document.createElement("a");t.href=window.URL.createObjectURL(o),t.download=s+`.${c}`,t.click(),window.URL.revokeObjectURL(t.href)}},v=({column:a,data:n,filename:s,autoWidth:u})=>{const c=new k.Workbook,e=c.addWorksheet("sheet1");e.getRow(1).values=["\u5E8F\u53F7","\u65E5\u671F","\u5730\u5740","\u914D\u9001\u6D88\u606F",,,],e.getRow(2).values=["\u5E8F\u53F7","\u65E5\u671F","\u5730\u5740","\u7701\u4EFD","\u57CE\u5E02","\u90AE\u7F16"];const i=[];a.forEach((l,b)=>{if(l.children)l.children.forEach(r=>{const o={key:r.name,width:null},t=[h(r.label)];n.forEach(w=>{const d=w[r.name]||"";d&&t.push(h(d))}),o.width=Math.max(...t)+5,i.push(o)});else{const r={key:l.name,width:null},o=[h(l.label)];n.forEach(t=>{const w=t[l.name]||"";w&&o.push(h(w))}),r.width=Math.max(...o)+5,i.push(r)}}),e.columns=i,e.addRows(n),e.mergeCells("D1:F1"),e.mergeCells("A1:A2"),e.mergeCells("B1:B2"),e.mergeCells("C1:C2"),c.xlsx.writeBuffer().then(l=>{const b=new Blob([l,{type:"application/vnd.ms-excel"}]);if(window.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(b,s+".xlsx");else{const r=document.createElement("a");r.href=window.URL.createObjectURL(b),r.download=s+".xlsx",r.click(),window.URL.revokeObjectURL(r.href)}})};export{v as a,R as b,g as e};
+import{E as k}from"./exceljs.min.4a739ad8.js";const h=(a,n=10)=>(a==null?n=10:a.toString().charCodeAt(0)>255?n=a.toString().length*2:n=a.toString().length,n),g=async({column:a,data:n,filename:s,autoWidth:u,format:c})=>{const e=new k.Workbook;e.creator="Me",e.title=s,e.created=new Date,e.modified=new Date;const i=e.addWorksheet(s),l=[];a.forEach((o,t)=>{const w={header:o.label,key:o.name,width:null};if(u){const d=[h(o.label)];n.forEach(f=>{const x=f[o.name]||"";x&&d.push(h(x))}),w.width=Math.max(...d)+5}l.push(w)}),i.columns=l,i.addRows(n);const b=c==="xlsx"?await e.xlsx.writeBuffer():await e.csv.writeBuffer(),r=new Blob([b],{type:"application/octet-binary"});if(window.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(r,s+`.${c}`);else{const o=document.createElement("a");o.href=window.URL.createObjectURL(r),o.download=s+`.${c}`,o.click(),window.URL.revokeObjectURL(o.href)}};function E(a,n){const{color:s,fontSize:u,horizontal:c,bold:e}=n||{};a.fill={type:"pattern",pattern:"solid",fgColor:{argb:s}},a.font={bold:e!=null?e:!0,size:u!=null?u:11,color:{argb:"ff0000"}},a.alignment={vertical:"middle",wrapText:!0,horizontal:c!=null?c:"left"}}const R=async({column:a,data:n,filename:s,autoWidth:u,format:c})=>{const e=new k.Workbook;e.creator="Me",e.title=s,e.created=new Date,e.modified=new Date;const i=e.addWorksheet(s),l=[];a.forEach((t,w)=>{const d={header:t.label,key:t.name,width:null};if(u){const f=[h(t.label)];n.forEach(x=>{const p=x[t.name]||"";p&&f.push(h(p))}),d.width=Math.max(...f)+5}l.push(d)}),i.columns=l,i.addRows(n),i.getRow(1).eachCell(t=>E(t,{color:"dff8ff",fontSize:12,horizontal:"left"}));const r=c==="xlsx"?await e.xlsx.writeBuffer():await e.csv.writeBuffer(),o=new Blob([r],{type:"application/octet-binary"});if(window.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(o,s+`.${c}`);else{const t=document.createElement("a");t.href=window.URL.createObjectURL(o),t.download=s+`.${c}`,t.click(),window.URL.revokeObjectURL(t.href)}},v=({column:a,data:n,filename:s,autoWidth:u})=>{const c=new k.Workbook,e=c.addWorksheet("sheet1");e.getRow(1).values=["\u5E8F\u53F7","\u65E5\u671F","\u5730\u5740","\u914D\u9001\u6D88\u606F",,,],e.getRow(2).values=["\u5E8F\u53F7","\u65E5\u671F","\u5730\u5740","\u7701\u4EFD","\u57CE\u5E02","\u90AE\u7F16"];const i=[];a.forEach((l,b)=>{if(l.children)l.children.forEach(r=>{const o={key:r.name,width:null},t=[h(r.label)];n.forEach(w=>{const d=w[r.name]||"";d&&t.push(h(d))}),o.width=Math.max(...t)+5,i.push(o)});else{const r={key:l.name,width:null},o=[h(l.label)];n.forEach(t=>{const w=t[l.name]||"";w&&o.push(h(w))}),r.width=Math.max(...o)+5,i.push(r)}}),e.columns=i,e.addRows(n),e.mergeCells("D1:F1"),e.mergeCells("A1:A2"),e.mergeCells("B1:B2"),e.mergeCells("C1:C2"),c.xlsx.writeBuffer().then(l=>{const b=new Blob([l,{type:"application/vnd.ms-excel"}]);if(window.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(b,s+".xlsx");else{const r=document.createElement("a");r.href=window.URL.createObjectURL(b),r.download=s+".xlsx",r.click(),window.URL.revokeObjectURL(r.href)}})};export{v as a,R as b,g as e};
diff --git a/docs/assets/index.01705423.js b/docs/assets/index.01705423.js
deleted file mode 100644
index 954bdcf..0000000
--- a/docs/assets/index.01705423.js
+++ /dev/null
@@ -1 +0,0 @@
-import{g,h as y,i as W,r as o,o as d,c as k,b as l,w as e,y as U,F as Y,D as M,G as j,j as B,H as O,I as z,a as f,d as h,t as G,_ as E,s as C,N as J,p as L,f as T}from"./index.50eb5827.js";const q={class:"advancedForm"},K={class:"search-btn"},P=g({__name:"index",props:{labelWidth:{default:"100px"},gutterWidth:{type:Number,default:24},showRow:{type:Number,default:1},columns:{type:Array,default:()=>[]},byHeight:{type:Boolean,default:!1}},emits:["submit","reset"],setup(a,{emit:i}){const b=a,m=y(),u=y(!1),n=W({});for(let s of b.columns)n[s.name]=null;const r=()=>{i("submit",n)},p=s=>{if(console.log("formEl",s),!s)return;s.resetFields(),Object.keys(n).forEach(_=>{n[_]=null}),i("reset",n)};return(s,c)=>{const _=o("el-input"),x=o("el-form-item"),A=o("el-date-picker"),N=o("el-col"),S=o("el-row"),D=o("el-form"),v=o("el-button"),R=o("arrow-down"),$=o("arrow-up"),I=o("el-icon");return d(),k("div",q,[l(D,{ref_key:"ruleFormRef",ref:m,inline:!0,"label-position":"right",model:n,class:"form-inline"},{default:e(()=>[l(S,{class:U({"not-show":a.byHeight&&!u.value}),gutter:a.gutterWidth},{default:e(()=>[(d(!0),k(Y,null,M(a.columns,(t,H)=>j((d(),B(N,{span:t.span,key:t.name},{default:e(()=>[t.type==="input"?(d(),B(x,{key:0,label:t.title,"label-width":a.labelWidth},{default:e(()=>[l(_,{clearable:"",modelValue:n[t.name],"onUpdate:modelValue":w=>n[t.name]=w,placeholder:t.placeholder},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label","label-width"])):t.type==="date"?(d(),B(x,{key:1,label:t.title,"label-width":a.labelWidth},{default:e(()=>[l(A,{"value-format":"YYYY-MM-DD",modelValue:n[t.name],"onUpdate:modelValue":w=>n[t.name]=w,type:"date",placeholder:t.placeholder},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label","label-width"])):O("",!0)]),_:2},1032,["span"])),[[z,a.byHeight?!0:H[h("\u67E5\u8BE2")]),_:1}),l(v,{onClick:c[0]||(c[0]=t=>p(m.value))},{default:e(()=>[h("\u91CD\u7F6E")]),_:1}),l(v,{link:"",type:"primary",onClick:c[1]||(c[1]=t=>u.value=!u.value)},{default:e(()=>[h(G(u.value?"\u5408\u5E76":"\u5C55\u5F00"),1),l(I,null,{default:e(()=>[u.value?(d(),B($,{key:1})):(d(),B(R,{key:0}))]),_:1})]),_:1})])])}}});const F=E(P,[["__scopeId","data-v-b96f41c8"]]),V=a=>(L("data-v-62da83b9"),a=a(),T(),a),Q={class:"advancedForm"},X={class:"card-header"},Z=V(()=>f("span",{style:{"margin-right":"100px"}},"\u6536\u7F29\u8868\u5355 \u901A\u8FC7v-show\u6765\u63A7\u5236\u663E\u9690\u85CF",-1)),ee=V(()=>f("div",{class:"card-header"},[f("span",null,"\u6536\u7F29\u8868\u5355 \u901A\u8FC7\u9AD8\u5EA6\u6765\u63A7\u5236\u663E\u9690\u85CF")],-1)),te=g({name:"advancedForm"}),le=g({...te,setup(a){let i=[{type:"input",name:"name1",title:"\u5B57\u6BB51",placeholder:"\u5B57\u6BB51",span:8},{type:"date",name:"name2",title:"\u5B57\u6BB52",placeholder:"\u5B57\u6BB52",span:8},{type:"input",name:"name3",title:"\u5B57\u6BB53",placeholder:"\u5B57\u6BB53",span:8},{type:"input",name:"name4",title:"\u5B57\u6BB54",placeholder:"\u5B57\u6BB54",span:8},{type:"input",name:"name5",title:"\u5B57\u6BB55",placeholder:"\u5B57\u6BB55",span:8},{type:"input",name:"name6",title:"\u5B57\u6BB56",placeholder:"\u5B57\u6BB56",span:8},{type:"input",name:"name7",title:"\u5B57\u6BB57",placeholder:"\u5B57\u6BB57",span:8},{type:"input",name:"name8",title:"\u5B57\u6BB58",placeholder:"\u5B57\u6BB58",span:8},{type:"input",name:"name9",title:"\u5B57\u6BB59",placeholder:"\u5B57\u6BB59",span:8}];const b=y({}),m=y(1),u=r=>{b.value=r,J.success(JSON.stringify(r))},n=r=>{m.value=r};return(r,p)=>{const s=o("el-button"),c=o("el-card");return d(),k("div",Q,[l(c,{class:"box-card"},{header:e(()=>[f("div",X,[Z,l(s,{onClick:p[0]||(p[0]=_=>n(2)),type:"primary",link:""},{default:e(()=>[h("\u663E\u793A\u4E24\u884C")]),_:1}),l(s,{onClick:p[1]||(p[1]=_=>n(1)),type:"primary",link:""},{default:e(()=>[h("\u663E\u793A\u4E00\u884C")]),_:1})])]),default:e(()=>[l(F,{columns:C(i),onSubmit:u,showRow:m.value},null,8,["columns","showRow"])]),_:1}),l(c,{class:"box-card",style:{"margin-top":"20px"}},{header:e(()=>[ee]),default:e(()=>[l(F,{columns:C(i),onSubmit:u,byHeight:!0},null,8,["columns"])]),_:1})])}}});const ne=E(le,[["__scopeId","data-v-62da83b9"]]);export{ne as default};
diff --git a/docs/assets/index.e5b8209f.js b/docs/assets/index.01ad63ef.js
similarity index 96%
rename from docs/assets/index.e5b8209f.js
rename to docs/assets/index.01ad63ef.js
index 56ba2b4..0648163 100644
--- a/docs/assets/index.e5b8209f.js
+++ b/docs/assets/index.01ad63ef.js
@@ -1 +1 @@
-import{g as t,r as e,o as u,j as _,w as f,a as n,b as s,bN as o,p,f as d,_ as m}from"./index.50eb5827.js";const i=c=>(p("data-v-709f7efc"),c=c(),d(),c),r={class:"content-box"},x=i(()=>n("br",null,null,-1)),y=i(()=>n("div",{class:"icon-list"},[n("span",{class:"iconfont icon-dabaoyu"}),n("span",{class:"iconfont icon-yin"}),n("span",{class:"iconfont icon-dabaoyu"}),n("span",{class:"iconfont icon-shuaxin1"}),n("span",{class:"iconfont icon-shuaxin"}),n("span",{class:"iconfont icon-duoyun-2-copy"}),n("span",{class:"iconfont icon-duoyun-1"}),n("span",{class:"iconfont icon-daxue"}),n("span",{class:"iconfont icon-dayu"}),n("span",{class:"iconfont icon-feng"})],-1)),h={class:"icon-list"},g=t({name:"svgIcon"}),v=t({...g,setup(c){return(b,F)=>{const a=e("el-alert"),l=e("u-container-layout");return u(),_(l,{class:"components-container"},{default:f(()=>[n("div",r,[s(a,{title:"\u666E\u901A\u5F15\u5165\u65B9\u5F0F Font Class",type:"warning",closable:!1}),x,y,s(a,{title:"Symbol \u7684\u65B9\u5F0F\u6E32\u67D3\u56FE\u6807 \u652F\u6301\u591A\u8272",type:"warning",closable:!1}),n("div",h,[s(o,{"icon-class":"feng","class-name":"iconfont"}),s(o,{"icon-class":"zhongxue","class-name":"iconfont"}),s(o,{"icon-class":"yangchen","class-name":"iconfont"}),s(o,{"icon-class":"yujiaxue","class-name":"iconfont"}),s(o,{"icon-class":"qing","class-name":"iconfont"}),s(o,{"icon-class":"mai","class-name":"iconfont"}),s(o,{"icon-class":"wu","class-name":"iconfont"}),s(o,{"icon-class":"xiaoyu","class-name":"iconfont"}),s(o,{"icon-class":"xiaoxue","class-name":"iconfont"}),s(o,{"icon-class":"shandian","class-name":"iconfont"}),s(o,{"icon-class":"xue","class-name":"iconfont"})])])]),_:1})}}});const I=m(v,[["__scopeId","data-v-709f7efc"]]);export{I as default};
+import{g as t,r as e,o as u,j as _,w as f,a as n,b as s,bN as o,p,f as d,_ as m}from"./index.c36787b1.js";const i=c=>(p("data-v-709f7efc"),c=c(),d(),c),r={class:"content-box"},x=i(()=>n("br",null,null,-1)),y=i(()=>n("div",{class:"icon-list"},[n("span",{class:"iconfont icon-dabaoyu"}),n("span",{class:"iconfont icon-yin"}),n("span",{class:"iconfont icon-dabaoyu"}),n("span",{class:"iconfont icon-shuaxin1"}),n("span",{class:"iconfont icon-shuaxin"}),n("span",{class:"iconfont icon-duoyun-2-copy"}),n("span",{class:"iconfont icon-duoyun-1"}),n("span",{class:"iconfont icon-daxue"}),n("span",{class:"iconfont icon-dayu"}),n("span",{class:"iconfont icon-feng"})],-1)),h={class:"icon-list"},g=t({name:"svgIcon"}),v=t({...g,setup(c){return(b,F)=>{const a=e("el-alert"),l=e("u-container-layout");return u(),_(l,{class:"components-container"},{default:f(()=>[n("div",r,[s(a,{title:"\u666E\u901A\u5F15\u5165\u65B9\u5F0F Font Class",type:"warning",closable:!1}),x,y,s(a,{title:"Symbol \u7684\u65B9\u5F0F\u6E32\u67D3\u56FE\u6807 \u652F\u6301\u591A\u8272",type:"warning",closable:!1}),n("div",h,[s(o,{"icon-class":"feng","class-name":"iconfont"}),s(o,{"icon-class":"zhongxue","class-name":"iconfont"}),s(o,{"icon-class":"yangchen","class-name":"iconfont"}),s(o,{"icon-class":"yujiaxue","class-name":"iconfont"}),s(o,{"icon-class":"qing","class-name":"iconfont"}),s(o,{"icon-class":"mai","class-name":"iconfont"}),s(o,{"icon-class":"wu","class-name":"iconfont"}),s(o,{"icon-class":"xiaoyu","class-name":"iconfont"}),s(o,{"icon-class":"xiaoxue","class-name":"iconfont"}),s(o,{"icon-class":"shandian","class-name":"iconfont"}),s(o,{"icon-class":"xue","class-name":"iconfont"})])])]),_:1})}}});const I=m(v,[["__scopeId","data-v-709f7efc"]]);export{I as default};
diff --git a/docs/assets/index.071b703c.css b/docs/assets/index.071b703c.css
deleted file mode 100644
index cac8be0..0000000
--- a/docs/assets/index.071b703c.css
+++ /dev/null
@@ -1 +0,0 @@
-@charset "UTF-8";[data-v-7bde180c]:export{menuText:#bfcbd9;menuActiveText:#409eff;subMenuActiveText:#f4f4f5;menuBg:#304156;menuHover:#263445;subMenuBg:#1f2d3d;subMenuHover:#001528;sideBarWidth:210px;primaryColor:var(--el-color-primary)}.layout-vertical .main-container[data-v-7bde180c]{min-height:100%;transition:margin-left .28s;margin-left:210px;position:relative}.layout-vertical .hideSliderLayout[data-v-7bde180c]{margin-left:0}.layout-vertical .hideSliderLayout .el-menu--horizontal[data-v-7bde180c]{border-bottom:none}.layout-vertical .sidebar-container[data-v-7bde180c]{transition:width .28s;width:210px!important;background-color:#304156;height:100%;position:fixed;font-size:0px;top:0;bottom:0;left:0;z-index:98;overflow:hidden}.layout-vertical .sidebar-container .horizontal-collapse-transition[data-v-7bde180c]{transition:0s width ease-in-out,0s padding-left ease-in-out,0s padding-right ease-in-out}.layout-vertical .sidebar-container .scrollbar-wrapper[data-v-7bde180c]{overflow-x:hidden!important}.layout-vertical .sidebar-container .el-scrollbar__bar.is-vertical[data-v-7bde180c]{right:0px}.layout-vertical .sidebar-container .el-scrollbar[data-v-7bde180c]{height:100%}.layout-vertical .sidebar-container.has-logo .el-scrollbar[data-v-7bde180c]{height:calc(100% - 50px)}.layout-vertical .sidebar-container .is-horizontal[data-v-7bde180c]{display:none}.layout-vertical .sidebar-container a[data-v-7bde180c]{width:100%;overflow:hidden}.layout-vertical .sidebar-container .sub-el-icon[data-v-7bde180c]{margin-right:12px;margin-left:-2px}.layout-vertical .sidebar-container .el-menu[data-v-7bde180c]{border:none;height:100%;width:100%!important;background:none}.layout-vertical .sidebar-container .sub-menu-title-noDropdown[data-v-7bde180c]:hover,.layout-vertical .sidebar-container .el-sub-menu__title[data-v-7bde180c]:hover{background-color:#263445!important}.layout-vertical .sidebar-container .is-active>.el-sub-menu__title[data-v-7bde180c]{color:#f4f4f5!important}.layout-vertical .sidebar-container .el-menu-item.is-active[data-v-7bde180c]:before{position:absolute;top:0;bottom:0;left:0;width:4px;content:"";background:var(--el-color-primary)}.layout-vertical .sidebar-container .nest-menu .el-sub-menu>.el-sub-menu__title[data-v-7bde180c],.layout-vertical .sidebar-container .el-sub-menu .el-menu-item[data-v-7bde180c]{min-width:210px!important;background-color:#1f2d3d!important}.layout-vertical .sidebar-container .el-menu-item[data-v-7bde180c]:not(.is-active):hover{background-color:#001528!important}.layout-vertical .sidebar-container .el-menu-item.is-active[data-v-7bde180c]{background-color:#001528!important}.layout-vertical .hideSidebar .sidebar-container[data-v-7bde180c]{width:60px!important}.layout-vertical .hideSidebar .main-container[data-v-7bde180c]{margin-left:60px}.layout-vertical .hideSidebar .sub-menu-title-noDropdown[data-v-7bde180c]{padding:0!important;position:relative}.layout-vertical .hideSidebar .sub-menu-title-noDropdown .el-tooltip[data-v-7bde180c]{padding:0!important}.layout-vertical .hideSidebar .sub-menu-title-noDropdown .el-tooltip .svg-icon[data-v-7bde180c]{margin-left:20px}.layout-vertical .hideSidebar .sub-menu-title-noDropdown .el-tooltip .sub-el-icon[data-v-7bde180c]{margin-left:19px}.layout-vertical .hideSidebar .el-submenu[data-v-7bde180c]{overflow:hidden}.layout-vertical .hideSidebar .el-submenu>.el-submenu__title[data-v-7bde180c]{padding:0!important}.layout-vertical .hideSidebar .el-submenu>.el-submenu__title .svg-icon[data-v-7bde180c]{margin-left:20px}.layout-vertical .hideSidebar .el-submenu>.el-submenu__title .sub-el-icon[data-v-7bde180c]{margin-left:19px}.layout-vertical .hideSidebar .el-submenu>.el-submenu__title .el-sub-menu__icon-arrow[data-v-7bde180c]{display:none}.layout-vertical .hideSidebar .el-menu--collapse .el-sub-menu>.el-sub-menu__title>span[data-v-7bde180c]{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.layout-vertical .el-menu--collapse .el-menu .el-sub-menu[data-v-7bde180c]{min-width:210px!important}.layout-vertical .mobile .main-container[data-v-7bde180c]{margin-left:0}.layout-vertical .mobile .sidebar-container[data-v-7bde180c]{transition:transform .28s;width:210px!important}.layout-vertical .mobile.hideSidebar .sidebar-container[data-v-7bde180c]{pointer-events:none;transition-duration:.3s;transform:translate3d(-210px,0,0)}.layout-vertical .withoutAnimation .main-container[data-v-7bde180c],.layout-vertical .withoutAnimation .sidebar-container[data-v-7bde180c]{transition:none}.layout-vertical .el-menu--vertical>.el-menu .svg-icon[data-v-7bde180c]{margin-right:16px}.layout-vertical .el-menu--vertical>.el-menu .sub-el-icon[data-v-7bde180c]{margin-right:12px;margin-left:-2px}.layout-vertical .el-menu--vertical .nest-menu .el-sub-menu>.el-sub-menu__title[data-v-7bde180c]:hover,.layout-vertical .el-menu--vertical .el-menu-item[data-v-7bde180c]:hover{background-color:#263445!important}.layout-vertical .el-menu--vertical>.el-menu--popup[data-v-7bde180c]{max-height:100vh;overflow-y:auto}.layout-vertical .el-menu--vertical>.el-menu--popup[data-v-7bde180c]::-webkit-scrollbar-track-piece{background:#d3dce6}.layout-vertical .el-menu--vertical>.el-menu--popup[data-v-7bde180c]::-webkit-scrollbar{width:6px}.layout-vertical .el-menu--vertical>.el-menu--popup[data-v-7bde180c]::-webkit-scrollbar-thumb{background:#99a9bf;border-radius:20px}.fade-enter-active[data-v-7bde180c],.fade-leave-active[data-v-7bde180c]{transition:opacity .28s}.fade-enter[data-v-7bde180c],.fade-leave-active[data-v-7bde180c]{opacity:0}.fade-slide-leave-active[data-v-7bde180c],.fade-slide-enter-active[data-v-7bde180c]{transition:all .3s}.fade-slide-enter-from[data-v-7bde180c]{opacity:0;transform:translate(-30px)}.fade-slide-leave-to[data-v-7bde180c]{opacity:0;transform:translate(30px)}.sidebarLogoFade-enter-active[data-v-7bde180c]{transition:opacity 1.5s}.sidebarLogoFade-enter-from[data-v-7bde180c],.sidebarLogoFade-leave-to[data-v-7bde180c]{opacity:0}.breadcrumb-enter-active[data-v-7bde180c]{transition:all .25s}.breadcrumb-enter-from[data-v-7bde180c],.breadcrumb-leave-active[data-v-7bde180c]{opacity:0;transform:translate(10px) skew(-10deg)}html[data-v-7bde180c],body[data-v-7bde180c]{height:100%;width:100%;overflow:visible;overflow-x:hidden;margin:0;padding:0}body[data-v-7bde180c]{background:#f0f2f5}.flex-center[data-v-7bde180c]{display:flex;align-items:center;justify-content:center}.flex-justify-between[data-v-7bde180c]{display:flex;align-items:center;justify-content:space-between}.flex-align-center[data-v-7bde180c]{display:flex;align-items:center}@media screen and (max-width: 540px){.app-breadcrumb[data-v-7bde180c]{display:none!important}}[data-v-7bde180c]::-webkit-scrollbar{width:7px;height:8px}[data-v-7bde180c]::-webkit-scrollbar-track{background-color:#0000000d}[data-v-7bde180c]::-webkit-scrollbar-thumb{background-color:#9093994d;border-radius:2px;box-shadow:inset 0 0 6px #0003}#nprogress .bar[data-v-7bde180c]{background:var(--el-color-primary)!important}#nprogress .spinner-icon[data-v-7bde180c]{border-top-color:var(--el-color-primary)!important;border-left-color:var(--el-color-primary)!important}#nprogress .peg[data-v-7bde180c]{box-shadow:0 0 10px var(--el-color-primary),0 0 5px var(--el-color-primary)!important}.app-container[data-v-7bde180c]{height:100%;width:100%;padding:10px 12px;box-sizing:border-box;display:flex;flex-direction:column}.app-container-inner[data-v-7bde180c]{height:100%;width:100%;box-shadow:0 2px 12px #0000001a;background:white;padding:20px;box-sizing:border-box}.layout-horizontal .header-icon[data-v-7bde180c],.layout-horizontal .el-dropdown-link[data-v-7bde180c]{color:#bfcbd9!important}.el-table__header th[data-v-7bde180c]{font-weight:700;color:#252525;background:#fafafa}.el-table .el-table__header th[data-v-7bde180c]{background:var(--el-fill-color-light)!important}.personal .name[data-v-7bde180c]{margin-top:15px;font-size:24px;font-weight:500;color:#262626}.personal .description[data-v-7bde180c]{margin-top:8px}.personal .list[data-v-7bde180c]{margin-top:18px;line-height:30px;text-align:left}.card-header[data-v-7bde180c]{display:flex;justify-content:space-between;align-items:center}.text[data-v-7bde180c]{font-size:14px}.grid-content[data-v-7bde180c]{display:flex}.grid-content .left[data-v-7bde180c]{width:40%;height:100px;display:flex;align-items:center;justify-content:center;background:#2d8cf0}.grid-content .right[data-v-7bde180c]{display:flex;flex-direction:column;padding-left:20px;justify-content:center}.grid-content .right .h2[data-v-7bde180c]{font-size:24px;margin-bottom:10px}.custom[data-v-7bde180c] .el-card__body{padding:0}.item[data-v-7bde180c]{margin-bottom:18px}.box-card[data-v-7bde180c]{position:relative;margin-bottom:10px;width:100%}.box-card .wechat[data-v-7bde180c]{position:absolute;width:150px;right:0;top:0}.card-item[data-v-7bde180c]{background:linear-gradient(50deg,#1890ff,#77e19d)}.home-container[data-v-7bde180c]{width:100%;height:100%;display:flex;padding:16px;box-sizing:border-box;font-size:14px}
diff --git a/docs/assets/index.42b7aa7c.js b/docs/assets/index.08e91dcf.js
similarity index 83%
rename from docs/assets/index.42b7aa7c.js
rename to docs/assets/index.08e91dcf.js
index d952005..f471f9a 100644
--- a/docs/assets/index.42b7aa7c.js
+++ b/docs/assets/index.08e91dcf.js
@@ -1,31 +1,31 @@
-import{S as Ou,_ as Cl,g as kl,a4 as Nu,h as Mu,P as pl,x as Au,R as Du,o as Ll,c as Tl,r as Hu,a as Nn,b as vl,w as Eu,p as Wu,f as Fu}from"./index.50eb5827.js";var ho={exports:{}},gl;function tt(){return gl||(gl=1,function(Oe,Be){(function(m,U){Oe.exports=U()})(Ou,function(){var m=navigator.userAgent,U=navigator.platform,I=/gecko\/\d/i.test(m),G=/MSIE \d/.test(m),A=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(m),w=/Edge\/(\d+)/.exec(m),S=G||A||w,x=S&&(G?document.documentMode||6:+(w||A)[1]),C=!w&&/WebKit\//.test(m),W=C&&/Qt\/\d+\.\d+/.test(m),P=!w&&/Chrome\/(\d+)/.exec(m),j=P&&+P[1],O=/Opera\//.test(m),R=/Apple Computer/.test(navigator.vendor),D=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(m),H=/PhantomJS/.test(m),k=R&&(/Mobile\/\w+/.test(m)||navigator.maxTouchPoints>2),L=/Android/.test(m),B=k||L||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(m),z=k||/Mac/.test(U),q=/\bCrOS\b/.test(m),Q=/win/i.test(U),g=O&&m.match(/Version\/(\d*\.\d*)/);g&&(g=Number(g[1])),g&&g>=15&&(O=!1,C=!0);var F=z&&(W||O&&(g==null||g<12.11)),ne=I||S&&x>=9;function V(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ee=function(e,t){var n=e.className,r=V(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 T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function K(e,t){return T(e).appendChild(t)}function d(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}var ue=function(){this.id=null,this.f=null,this.time=0,this.handler=rt(this.onTimeout,this)};ue.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ue.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var pt=[""];function Lt(e){for(;pt.length<=e;)pt.push(pe(pt)+" ");return pt[e]}function pe(e){return e[e.length-1]}function wr(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||vi.test(e))}function Sr(e,t){return t?t.source.indexOf("\\w")>-1&&qr(e)?!0:t.test(e):qr(e)}function Hn(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Cr=/[\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 Zr(e){return e.charCodeAt(0)>=768&&Cr.test(e)}function Tt(e,t,n){for(;(n<0?t>0:tn?-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}}function ur(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),a.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var Ot=null;function vt(e,t,n){var r;Ot=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:Ot=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:Ot=i)}return r!=null?r:Ot}var gi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(u,h,c){this.level=u,this.from=h,this.to=c}return function(u,h){var c=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var b=u.length,y=[],M=0;M-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ke(e,t){var n=Qr(e,t);if(!!n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Ve(e){e.prototype.on=function(t,n){Z(this,t,n)},e.prototype.off=function(t,n){qe(this,t,n)}}function Ze(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function fr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Jr(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function It(e){Ze(e),fr(e)}function nt(e){return e.target||e.srcElement}function jr(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),z&&e.ctrlKey&&t==1&&(t=3),t}var yi=function(){if(S&&x<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),yt;function mi(e){if(yt==null){var t=d("span","\u200B");K(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(S&&x<8))}var n=yt?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var kr;function Fn(e){if(kr!=null)return kr;var t=K(e,document.createTextNode("A\u062EA")),n=be(t,0,1).getBoundingClientRect(),r=be(t,1,2).getBoundingClientRect();return T(e),!n||n.left==n.right?!1:kr=r.right-n.right<3}var Vr=`
+import{S as ku,_ as wl,g as Sl,a4 as Lu,h as Tu,P as pl,x as Ou,R as Nu,o as Cl,c as kl,r as Au,a as Nn,b as vl,w as Mu,p as Du,f as Hu}from"./index.c36787b1.js";var ho={exports:{}},gl;function tt(){return gl||(gl=1,function(Oe,Be){(function(m,U){Oe.exports=U()})(ku,function(){var m=navigator.userAgent,U=navigator.platform,I=/gecko\/\d/i.test(m),G=/MSIE \d/.test(m),M=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(m),w=/Edge\/(\d+)/.exec(m),S=G||M||w,x=S&&(G?document.documentMode||6:+(w||M)[1]),C=!w&&/WebKit\//.test(m),W=C&&/Qt\/\d+\.\d+/.test(m),P=!w&&/Chrome\/(\d+)/.exec(m),j=P&&+P[1],O=/Opera\//.test(m),R=/Apple Computer/.test(navigator.vendor),D=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(m),H=/PhantomJS/.test(m),k=R&&(/Mobile\/\w+/.test(m)||navigator.maxTouchPoints>2),L=/Android/.test(m),B=k||L||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(m),z=k||/Mac/.test(U),q=/\bCrOS\b/.test(m),Q=/win/i.test(U),g=O&&m.match(/Version\/(\d*\.\d*)/);g&&(g=Number(g[1])),g&&g>=15&&(O=!1,C=!0);var F=z&&(W||O&&(g==null||g<12.11)),ne=I||S&&x>=9;function V(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ee=function(e,t){var n=e.className,r=V(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 T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function K(e,t){return T(e).appendChild(t)}function d(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}var ue=function(){this.id=null,this.f=null,this.time=0,this.handler=rt(this.onTimeout,this)};ue.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ue.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var pt=[""];function Lt(e){for(;pt.length<=e;)pt.push(pe(pt)+" ");return pt[e]}function pe(e){return e[e.length-1]}function wr(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||vi.test(e))}function Sr(e,t){return t?t.source.indexOf("\\w")>-1&&qr(e)?!0:t.test(e):qr(e)}function Hn(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Cr=/[\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 Zr(e){return e.charCodeAt(0)>=768&&Cr.test(e)}function Tt(e,t,n){for(;(n<0?t>0:tn?-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}}function ur(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),a.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var Ot=null;function vt(e,t,n){var r;Ot=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:Ot=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:Ot=i)}return r!=null?r:Ot}var gi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(u,h,c){this.level=u,this.from=h,this.to=c}return function(u,h){var c=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var b=u.length,y=[],A=0;A-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ke(e,t){var n=Qr(e,t);if(!!n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Ve(e){e.prototype.on=function(t,n){Z(this,t,n)},e.prototype.off=function(t,n){qe(this,t,n)}}function Ze(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function fr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Jr(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function It(e){Ze(e),fr(e)}function nt(e){return e.target||e.srcElement}function jr(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),z&&e.ctrlKey&&t==1&&(t=3),t}var yi=function(){if(S&&x<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),yt;function mi(e){if(yt==null){var t=d("span","\u200B");K(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(S&&x<8))}var n=yt?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var kr;function Fn(e){if(kr!=null)return kr;var t=K(e,document.createTextNode("A\u062EA")),n=be(t,0,1).getBoundingClientRect(),r=be(t,1,2).getBoundingClientRect();return T(e),!n||n.left==n.right?!1:kr=r.right-n.right<3}var Vr=`
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
-`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(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/)},Zt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Nt=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Mt=null;function Pn(e){if(Mt!=null)return Mt;var t=K(e,d("span","x")),n=t.getBoundingClientRect(),r=be(t,0,1).getBoundingClientRect();return Mt=Math.abs(n.left-r.left)>1}var bt={},Qt={};function In(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),bt[e]=t}function Lr(e,t){Qt[e]=t}function ut(e){if(typeof e=="string"&&Qt.hasOwnProperty(e))e=Qt[e];else if(e&&typeof e.name=="string"&&Qt.hasOwnProperty(e.name)){var t=Qt[e.name];typeof t=="string"&&(t={name:t}),e=Dn(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ut("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ut("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Rt(e,t){t=ut(t);var n=bt[t.name];if(!n)return Rt(e,"text/plain");var r=n(e,t);if(Jt.hasOwnProperty(t.name)){var i=Jt[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 Jt={};function Rn(e,t){var n=Jt.hasOwnProperty(e)?Jt[e]:Jt[e]={};ae(t,n)}function Bt(e,t){if(t===!0)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 jt(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function $r(e,t,n){return e.startState?e.startState(t,n):!0}var He=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};He.prototype.eol=function(){return this.pos>=this.string.length},He.prototype.sol=function(){return this.pos==this.lineStart},He.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},He.prototype.next=function(){if(this.post},He.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},He.prototype.skipToEnd=function(){this.pos=this.string.length},He.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},He.prototype.backUp=function(e){this.pos-=e},He.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},He.prototype.current=function(){return this.string.slice(this.start,this.pos)},He.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},He.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},He.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function te(e,t){if(t-=e.first,t<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=e.first&&tn?v(n,te(e,n).text.length):Nl(t,te(e,t.line).text.length)}function Nl(e,t){var n=e.ch;return n==null||n>t?v(e.line,t):n<0?v(e.line,0):e}function vo(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Dt.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}},Dt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Dt.fromSaved=function(e,t,n){return t instanceof Bn?new Dt(e,Bt(e.mode,t.state),n,t.lookAhead):new Dt(e,Bt(e.mode,t),n)},Dt.prototype.save=function(e){var t=e!==!1?Bt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Bn(t,this.maxLookAhead):t};function go(e,t,n,r){var i=[e.state.modeGen],o={};So(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var a=n.state,l=function(u){n.baseTokens=i;var h=e.state.overlays[u],c=1,b=0;n.state=!0,So(e,t.text,h.mode,n,function(y,M){for(var E=c;by&&i.splice(c,1,y,i[c+1],_),c+=2,b=Math.min(y,_)}if(!!M)if(h.opaque)i.splice(E,c-E,y,"overlay "+M),c=E+2;else for(;Ee.options.maxHighlightLength&&Bt(e.doc.mode,r.state),o=go(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 en(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Dt(r,!0,t);var o=Ml(e,t,n),a=o>r.first&&te(r,o-1).stateAfter,l=a?Dt.fromSaved(r,a,o):new Dt(r,$r(r.mode),o);return r.iter(o,t,function(s){bi(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&ut.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var bo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function xo(e,t,n,r){var i=e.doc,o=i.mode,a;t=se(i,t);var l=te(i,t.line),s=en(e,t.line,n),u=new He(l.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pose.options.maxHighlightLength?(l=!1,a&&bi(e,t,r,h.pos),h.pos=t.length,c=null):c=wo(xi(n,h,r.state,b),o),b){var y=b[0].name;y&&(c="m-"+(c?y+" "+c:y))}if(!l||u!=c){for(;sa;--l){if(l<=o.first)return o.first;var s=te(o,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof Bn?u.lookAhead:0)<=o.modeFrontier))return l;var h=ie(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=l-1,r=h)}return i}function Al(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=te(e,r).stateAfter;if(i&&(!(i instanceof Bn)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new zn(a,o.from,s?null:o.to))}}return r}function Pl(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t);if(l||o.from==t&&a.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(a.inclusiveLeft?o.from<=t:o.from0&&l)for(var $=0;$0)){var h=[s,1],c=N(u.from,l.from),b=N(u.to,l.to);(c<0||!a.inclusiveLeft&&!c)&&h.push({from:u.from,to:l.from}),(b>0||!a.inclusiveRight&&!b)&&h.push({from:l.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function Lo(e){var t=e.markedSpans;if(!!t){for(var n=0;nt)&&(!r||Si(r,o.marker)<0)&&(r=o.marker)}return r}function Mo(e,t,n,r,i){var o=te(e,t),a=_t&&o.markedSpans;if(a)for(var l=0;l=0&&c<=0||h<=0&&c>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?N(u.to,n)>=0:N(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?N(u.from,r)<=0:N(u.from,r)<0)))return!0}}}function xt(e){for(var t;t=No(e);)e=t.find(-1,!0).line;return e}function Bl(e){for(var t;t=Un(e);)e=t.find(1,!0).line;return e}function zl(e){for(var t,n;t=Un(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ci(e,t){var n=te(e,t),r=xt(n);return n==r?t:ge(r)}function Ao(e,t){if(t>e.lastLine())return t;var n=te(e,t),r;if(!Vt(e,n))return t;for(;r=Un(n);)n=r.find(1,!0).line;return ge(n)+1}function Vt(e,t){var n=_t&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Or=function(e,t,n){this.text=e,To(this,t),this.height=n?n(this):1};Or.prototype.lineNo=function(){return ge(this)},Ve(Or);function _l(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Lo(e),To(e,n);var i=r?r(e):1;i!=e.height&&mt(e,i)}function Gl(e){e.parent=null,Lo(e)}var Ul={},Kl={};function Do(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Kl:Ul;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Ho(e,t){var n=ce("span",null,null,C?"padding-right: .1px":null),r={pre:ce("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=Yl,Fn(e.display.measure)&&(a=gt(o,e.doc.direction))&&(r.addToken=Zl(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&ge(o);Ql(o,r,yo(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Ft(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Ft(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(mi(e.display.measure))),i==0?(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(C){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ke(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Ft(r.pre.className,r.textClass||"")),r}function Xl(e){var t=d("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Yl(e,t,n,r,i,o,a){if(!!t){var l=e.splitSpaces?ql(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,h),S&&x<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var c=0;;){s.lastIndex=c;var b=s.exec(t),y=b?b.index-c:t.length-c;if(y){var M=document.createTextNode(l.slice(c,c+y));S&&x<9?h.appendChild(d("span",[M])):h.appendChild(M),e.map.push(e.pos,e.pos+y,M),e.col+=y,e.pos+=y}if(!b)break;c+=y+1;var E=void 0;if(b[0]==" "){var _=e.cm.options.tabSize,X=_-e.col%_;E=h.appendChild(d("span",Lt(X),"cm-tab")),E.setAttribute("role","presentation"),E.setAttribute("cm-text"," "),e.col+=X}else b[0]=="\r"||b[0]==`
-`?(E=h.appendChild(d("span",b[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),E.setAttribute("cm-text",b[0]),e.col+=1):(E=e.cm.options.specialCharPlaceholder(b[0]),E.setAttribute("cm-text",b[0]),S&&x<9?h.appendChild(d("span",[E])):h.appendChild(E),e.col+=1);e.map.push(e.pos,e.pos+1,E),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var J=n||"";r&&(J+=r),i&&(J+=i);var Y=d("span",[h],J,o);if(a)for(var $ in a)a.hasOwnProperty($)&&$!="style"&&$!="class"&&Y.setAttribute($,a[$]);return e.content.appendChild(Y)}e.content.appendChild(h)}}function ql(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&c.from<=u));b++);if(c.to>=h)return e(n,r,i,o,a,l,s);e(n,r.slice(0,c.to-u),i,o,null,l,s),o=null,r=r.slice(c.to-u),u=c.to}}}function Eo(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 Ql(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;as||fe.collapsed&&re.to==s&&re.from==s)){if(re.to!=null&&re.to!=s&&y>re.to&&(y=re.to,E=""),fe.className&&(M+=" "+fe.className),fe.css&&(b=(b?b+";":"")+fe.css),fe.startStyle&&re.from==s&&(_+=" "+fe.startStyle),fe.endStyle&&re.to==y&&($||($=[])).push(fe.endStyle,re.to),fe.title&&((J||(J={})).title=fe.title),fe.attributes)for(var Se in fe.attributes)(J||(J={}))[Se]=fe.attributes[Se];fe.collapsed&&(!X||Si(X.marker,fe)<0)&&(X=re)}else re.from>s&&y>re.from&&(y=re.from)}if($)for(var Ke=0;Ke<$.length;Ke+=2)$[Ke+1]==y&&(E+=" "+$[Ke]);if(!X||X.from==s)for(var Me=0;Me=l)break;for(var ht=Math.min(l,y);;){if(h){var at=s+h.length;if(!X){var Fe=at>ht?h.slice(0,ht-s):h;t.addToken(t,Fe,c?c+M:M,_,s+Fe.length==y?E:"",b,J)}if(at>=ht){h=h.slice(ht-s),s=ht;break}s=at,_=""}h=i.slice(o,o=n[u++]),c=Do(n[u++],t.cm.options)}}}function Wo(e,t,n){this.line=t,this.rest=zl(t),this.size=this.rest?ge(pe(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Vt(e,t)}function Xn(e,t,n){for(var r=[],i,o=t;o2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function _o(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function as(e,t){t=xt(t);var n=ge(t),r=e.display.externalMeasured=new Wo(e.doc,t,n);r.lineN=n;var i=r.built=Ho(e,r);return r.text=i.pre,K(e.display.lineMeasure,i.pre),r}function Go(e,t,n,r){return Et(e,Mr(e,t),n,r)}function Mi(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=s-l,i=o-1,t>=s&&(a="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],a="left";if(n=="right"&&i==s-l)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function ss(e,t,n,r){var i=Ko(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;a&&Zr(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l0&&(s=r="right");var c;e.options.lineWrapping&&(c=o.getClientRects()).length>1?u=c[r=="right"?c.length-1:0]:u=o.getBoundingClientRect()}if(S&&x<9&&!a&&(!u||!u.left&&!u.right)){var b=o.parentNode.getClientRects()[0];b?u={left:b.left,right:b.left+Dr(e.display),top:b.top,bottom:b.bottom}:u=Uo}for(var y=u.top-t.rect.top,M=u.bottom-t.rect.top,E=(y+M)/2,_=t.view.measure.heights,X=0;X<_.length-1&&!(E<_[X]);X++);var J=X?_[X-1]:0,Y=_[X],$={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:J,bottom:Y};return!u.left&&!u.right&&($.bogus=!0),e.options.singleCursorHeightPerLine||($.rtop=y,$.rbottom=M),$}function us(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Pn(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}}function Xo(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a(u=="before"?s-1:s,u=="before");function h(M,E,_){var X=l[E],J=X.level==1;return a(_?M-1:M,J!=_)}var c=vt(l,s,u),b=Ot,y=h(s,c,u=="before");return b!=null&&(y.other=h(s,b,u!="before")),y}function Jo(e,t){var n=0;t=se(e.doc,t),e.options.lineWrapping||(n=Dr(e.display)*t.ch);var r=te(e.doc,t.line),i=Gt(r)+Yn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Di(e,t,n,r,i){var o=v(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Hi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Di(r.first,0,null,-1,-1);var i=At(r,n),o=r.first+r.size-1;if(i>o)return Di(r.first+r.size-1,te(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=te(r,i);;){var l=fs(e,a,i,t,n),s=Rl(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=te(r,i=u.line)}}function jo(e,t,n,r){r-=Ai(t);var i=t.text.length,o=Ae(function(a){return Et(e,n,a-1).bottom<=r},i,0);return i=Ae(function(a){return Et(e,n,a).top>r},o,i),{begin:o,end:i}}function Vo(e,t,n,r){n||(n=Mr(e,t));var i=qn(e,t,Et(e,n,r),"line").top;return jo(e,t,n,i)}function Ei(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function fs(e,t,n,r,i){i-=Gt(t);var o=Mr(e,t),a=Ai(t),l=0,s=t.text.length,u=!0,h=gt(t,e.doc.direction);if(h){var c=(e.options.lineWrapping?cs:hs)(e,t,n,o,h,r,i);u=c.level!=1,l=u?c.from:c.to-1,s=u?c.to:c.from-1}var b=null,y=null,M=Ae(function(oe){var re=Et(e,o,oe);return re.top+=a,re.bottom+=a,Ei(re,r,i,!1)?(re.top<=i&&re.left<=r&&(b=oe,y=re),!0):!1},l,s),E,_,X=!1;if(y){var J=r-y.left=$.bottom?1:0}return M=Tt(t.text,M,1),Di(n,M,_,X,r-E)}function hs(e,t,n,r,i,o,a){var l=Ae(function(c){var b=i[c],y=b.level!=1;return Ei(wt(e,v(n,y?b.to:b.from,y?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,h=wt(e,v(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Ei(h,o,a,!0)&&h.top>a&&(s=i[l-1])}return s}function cs(e,t,n,r,i,o,a){var l=jo(e,t,r,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,c=null,b=0;b=u||y.to<=s)){var M=y.level!=1,E=Et(e,r,M?Math.min(u,y.to)-1:Math.max(s,y.from)).right,_=E_)&&(h=y,c=_)}}return h||(h=i[i.length-1]),h.fromu&&(h={from:h.from,to:u,level:h.level}),h}var cr;function Ar(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(cr==null){cr=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)cr.appendChild(document.createTextNode("x")),cr.appendChild(d("br"));cr.appendChild(document.createTextNode("x"))}K(e.measure,cr);var n=cr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function Dr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),n=d("pre",[t],"CodeMirror-line-like");K(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Wi(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:Fi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Fi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function $o(e){var t=Ar(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Dr(e.display)-3);return function(i){if(Vt(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(u=te(e.doc,s.line).text).length==s.ch){var h=ie(u,u.length,e.options.tabSize)-u.length;s=v(s.line,Math.max(0,Math.round((o-zo(e.display).left)/Dr(e.display))-h))}return s}function pr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)_t&&Ci(e.doc,t)i.viewFrom?er(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)er(e);else if(t<=i.viewFrom){var o=Qn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):er(e)}else if(n>=i.viewTo){var a=Qn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):er(e)}else{var l=Qn(e,t,t,-1),s=Qn(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Xn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):er(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[pr(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);de(a,n)==-1&&a.push(n)}}}function er(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,n,r){var i=pr(e,t),o,a=e.display.view;if(!_t||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s0){if(i==a.length-1)return null;o=l+a[i].size-t,i++}else o=l-t;t+=o,n+=o}for(;Ci(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function ds(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Xn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Xn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,pr(e,n)))),r.viewTo=n}function ea(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(d("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Jn(e,t){return e.top-t.top||e.left-t.left}function ps(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=zo(e.display),l=a.left,s=Math.max(r.sizerWidth,hr(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function h(Y,$,oe,re){$<0&&($=0),$=Math.round($),re=Math.round(re),o.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+Y+`px;
+`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(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/)},Zt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Nt=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),At=null;function Pn(e){if(At!=null)return At;var t=K(e,d("span","x")),n=t.getBoundingClientRect(),r=be(t,0,1).getBoundingClientRect();return At=Math.abs(n.left-r.left)>1}var bt={},Qt={};function In(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),bt[e]=t}function Lr(e,t){Qt[e]=t}function ut(e){if(typeof e=="string"&&Qt.hasOwnProperty(e))e=Qt[e];else if(e&&typeof e.name=="string"&&Qt.hasOwnProperty(e.name)){var t=Qt[e.name];typeof t=="string"&&(t={name:t}),e=Dn(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ut("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ut("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Rt(e,t){t=ut(t);var n=bt[t.name];if(!n)return Rt(e,"text/plain");var r=n(e,t);if(Jt.hasOwnProperty(t.name)){var i=Jt[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 Jt={};function Rn(e,t){var n=Jt.hasOwnProperty(e)?Jt[e]:Jt[e]={};ae(t,n)}function Bt(e,t){if(t===!0)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 jt(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function $r(e,t,n){return e.startState?e.startState(t,n):!0}var He=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};He.prototype.eol=function(){return this.pos>=this.string.length},He.prototype.sol=function(){return this.pos==this.lineStart},He.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},He.prototype.next=function(){if(this.post},He.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},He.prototype.skipToEnd=function(){this.pos=this.string.length},He.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},He.prototype.backUp=function(e){this.pos-=e},He.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},He.prototype.current=function(){return this.string.slice(this.start,this.pos)},He.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},He.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},He.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function te(e,t){if(t-=e.first,t<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=e.first&&tn?v(n,te(e,n).text.length):Ll(t,te(e,t.line).text.length)}function Ll(e,t){var n=e.ch;return n==null||n>t?v(e.line,t):n<0?v(e.line,0):e}function vo(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Dt.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}},Dt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Dt.fromSaved=function(e,t,n){return t instanceof Bn?new Dt(e,Bt(e.mode,t.state),n,t.lookAhead):new Dt(e,Bt(e.mode,t),n)},Dt.prototype.save=function(e){var t=e!==!1?Bt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Bn(t,this.maxLookAhead):t};function go(e,t,n,r){var i=[e.state.modeGen],o={};So(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var a=n.state,l=function(u){n.baseTokens=i;var h=e.state.overlays[u],c=1,b=0;n.state=!0,So(e,t.text,h.mode,n,function(y,A){for(var E=c;by&&i.splice(c,1,y,i[c+1],_),c+=2,b=Math.min(y,_)}if(!!A)if(h.opaque)i.splice(E,c-E,y,"overlay "+A),c=E+2;else for(;Ee.options.maxHighlightLength&&Bt(e.doc.mode,r.state),o=go(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 en(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Dt(r,!0,t);var o=Tl(e,t,n),a=o>r.first&&te(r,o-1).stateAfter,l=a?Dt.fromSaved(r,a,o):new Dt(r,$r(r.mode),o);return r.iter(o,t,function(s){bi(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&ut.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var bo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function xo(e,t,n,r){var i=e.doc,o=i.mode,a;t=se(i,t);var l=te(i,t.line),s=en(e,t.line,n),u=new He(l.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pose.options.maxHighlightLength?(l=!1,a&&bi(e,t,r,h.pos),h.pos=t.length,c=null):c=wo(xi(n,h,r.state,b),o),b){var y=b[0].name;y&&(c="m-"+(c?y+" "+c:y))}if(!l||u!=c){for(;sa;--l){if(l<=o.first)return o.first;var s=te(o,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof Bn?u.lookAhead:0)<=o.modeFrontier))return l;var h=ie(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=l-1,r=h)}return i}function Ol(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=te(e,r).stateAfter;if(i&&(!(i instanceof Bn)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new zn(a,o.from,s?null:o.to))}}return r}function El(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t);if(l||o.from==t&&a.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(a.inclusiveLeft?o.from<=t:o.from0&&l)for(var $=0;$0)){var h=[s,1],c=N(u.from,l.from),b=N(u.to,l.to);(c<0||!a.inclusiveLeft&&!c)&&h.push({from:u.from,to:l.from}),(b>0||!a.inclusiveRight&&!b)&&h.push({from:l.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function Lo(e){var t=e.markedSpans;if(!!t){for(var n=0;nt)&&(!r||Si(r,o.marker)<0)&&(r=o.marker)}return r}function Ao(e,t,n,r,i){var o=te(e,t),a=_t&&o.markedSpans;if(a)for(var l=0;l=0&&c<=0||h<=0&&c>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?N(u.to,n)>=0:N(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?N(u.from,r)<=0:N(u.from,r)<0)))return!0}}}function xt(e){for(var t;t=No(e);)e=t.find(-1,!0).line;return e}function Pl(e){for(var t;t=Un(e);)e=t.find(1,!0).line;return e}function Il(e){for(var t,n;t=Un(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ci(e,t){var n=te(e,t),r=xt(n);return n==r?t:ge(r)}function Mo(e,t){if(t>e.lastLine())return t;var n=te(e,t),r;if(!Vt(e,n))return t;for(;r=Un(n);)n=r.find(1,!0).line;return ge(n)+1}function Vt(e,t){var n=_t&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Or=function(e,t,n){this.text=e,To(this,t),this.height=n?n(this):1};Or.prototype.lineNo=function(){return ge(this)},Ve(Or);function Rl(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Lo(e),To(e,n);var i=r?r(e):1;i!=e.height&&mt(e,i)}function Bl(e){e.parent=null,Lo(e)}var zl={},_l={};function Do(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?_l:zl;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Ho(e,t){var n=ce("span",null,null,C?"padding-right: .1px":null),r={pre:ce("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=Ul,Fn(e.display.measure)&&(a=gt(o,e.doc.direction))&&(r.addToken=Xl(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&ge(o);Yl(o,r,yo(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Ft(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Ft(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(mi(e.display.measure))),i==0?(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(C){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ke(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Ft(r.pre.className,r.textClass||"")),r}function Gl(e){var t=d("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ul(e,t,n,r,i,o,a){if(!!t){var l=e.splitSpaces?Kl(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,h),S&&x<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var c=0;;){s.lastIndex=c;var b=s.exec(t),y=b?b.index-c:t.length-c;if(y){var A=document.createTextNode(l.slice(c,c+y));S&&x<9?h.appendChild(d("span",[A])):h.appendChild(A),e.map.push(e.pos,e.pos+y,A),e.col+=y,e.pos+=y}if(!b)break;c+=y+1;var E=void 0;if(b[0]==" "){var _=e.cm.options.tabSize,X=_-e.col%_;E=h.appendChild(d("span",Lt(X),"cm-tab")),E.setAttribute("role","presentation"),E.setAttribute("cm-text"," "),e.col+=X}else b[0]=="\r"||b[0]==`
+`?(E=h.appendChild(d("span",b[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),E.setAttribute("cm-text",b[0]),e.col+=1):(E=e.cm.options.specialCharPlaceholder(b[0]),E.setAttribute("cm-text",b[0]),S&&x<9?h.appendChild(d("span",[E])):h.appendChild(E),e.col+=1);e.map.push(e.pos,e.pos+1,E),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var J=n||"";r&&(J+=r),i&&(J+=i);var Y=d("span",[h],J,o);if(a)for(var $ in a)a.hasOwnProperty($)&&$!="style"&&$!="class"&&Y.setAttribute($,a[$]);return e.content.appendChild(Y)}e.content.appendChild(h)}}function Kl(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&c.from<=u));b++);if(c.to>=h)return e(n,r,i,o,a,l,s);e(n,r.slice(0,c.to-u),i,o,null,l,s),o=null,r=r.slice(c.to-u),u=c.to}}}function Eo(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 Yl(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;as||fe.collapsed&&re.to==s&&re.from==s)){if(re.to!=null&&re.to!=s&&y>re.to&&(y=re.to,E=""),fe.className&&(A+=" "+fe.className),fe.css&&(b=(b?b+";":"")+fe.css),fe.startStyle&&re.from==s&&(_+=" "+fe.startStyle),fe.endStyle&&re.to==y&&($||($=[])).push(fe.endStyle,re.to),fe.title&&((J||(J={})).title=fe.title),fe.attributes)for(var Se in fe.attributes)(J||(J={}))[Se]=fe.attributes[Se];fe.collapsed&&(!X||Si(X.marker,fe)<0)&&(X=re)}else re.from>s&&y>re.from&&(y=re.from)}if($)for(var Ke=0;Ke<$.length;Ke+=2)$[Ke+1]==y&&(E+=" "+$[Ke]);if(!X||X.from==s)for(var Ae=0;Ae=l)break;for(var ht=Math.min(l,y);;){if(h){var at=s+h.length;if(!X){var Fe=at>ht?h.slice(0,ht-s):h;t.addToken(t,Fe,c?c+A:A,_,s+Fe.length==y?E:"",b,J)}if(at>=ht){h=h.slice(ht-s),s=ht;break}s=at,_=""}h=i.slice(o,o=n[u++]),c=Do(n[u++],t.cm.options)}}}function Wo(e,t,n){this.line=t,this.rest=Il(t),this.size=this.rest?ge(pe(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Vt(e,t)}function Xn(e,t,n){for(var r=[],i,o=t;o2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function _o(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function ns(e,t){t=xt(t);var n=ge(t),r=e.display.externalMeasured=new Wo(e.doc,t,n);r.lineN=n;var i=r.built=Ho(e,r);return r.text=i.pre,K(e.display.lineMeasure,i.pre),r}function Go(e,t,n,r){return Et(e,Ar(e,t),n,r)}function Ai(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=s-l,i=o-1,t>=s&&(a="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],a="left";if(n=="right"&&i==s-l)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function os(e,t,n,r){var i=Ko(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;a&&Zr(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l0&&(s=r="right");var c;e.options.lineWrapping&&(c=o.getClientRects()).length>1?u=c[r=="right"?c.length-1:0]:u=o.getBoundingClientRect()}if(S&&x<9&&!a&&(!u||!u.left&&!u.right)){var b=o.parentNode.getClientRects()[0];b?u={left:b.left,right:b.left+Dr(e.display),top:b.top,bottom:b.bottom}:u=Uo}for(var y=u.top-t.rect.top,A=u.bottom-t.rect.top,E=(y+A)/2,_=t.view.measure.heights,X=0;X<_.length-1&&!(E<_[X]);X++);var J=X?_[X-1]:0,Y=_[X],$={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:J,bottom:Y};return!u.left&&!u.right&&($.bogus=!0),e.options.singleCursorHeightPerLine||($.rtop=y,$.rbottom=A),$}function as(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Pn(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}}function Xo(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a(u=="before"?s-1:s,u=="before");function h(A,E,_){var X=l[E],J=X.level==1;return a(_?A-1:A,J!=_)}var c=vt(l,s,u),b=Ot,y=h(s,c,u=="before");return b!=null&&(y.other=h(s,b,u!="before")),y}function Jo(e,t){var n=0;t=se(e.doc,t),e.options.lineWrapping||(n=Dr(e.display)*t.ch);var r=te(e.doc,t.line),i=Gt(r)+Yn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Di(e,t,n,r,i){var o=v(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Hi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Di(r.first,0,null,-1,-1);var i=Mt(r,n),o=r.first+r.size-1;if(i>o)return Di(r.first+r.size-1,te(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=te(r,i);;){var l=ls(e,a,i,t,n),s=Fl(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=te(r,i=u.line)}}function jo(e,t,n,r){r-=Mi(t);var i=t.text.length,o=Me(function(a){return Et(e,n,a-1).bottom<=r},i,0);return i=Me(function(a){return Et(e,n,a).top>r},o,i),{begin:o,end:i}}function Vo(e,t,n,r){n||(n=Ar(e,t));var i=qn(e,t,Et(e,n,r),"line").top;return jo(e,t,n,i)}function Ei(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function ls(e,t,n,r,i){i-=Gt(t);var o=Ar(e,t),a=Mi(t),l=0,s=t.text.length,u=!0,h=gt(t,e.doc.direction);if(h){var c=(e.options.lineWrapping?us:ss)(e,t,n,o,h,r,i);u=c.level!=1,l=u?c.from:c.to-1,s=u?c.to:c.from-1}var b=null,y=null,A=Me(function(oe){var re=Et(e,o,oe);return re.top+=a,re.bottom+=a,Ei(re,r,i,!1)?(re.top<=i&&re.left<=r&&(b=oe,y=re),!0):!1},l,s),E,_,X=!1;if(y){var J=r-y.left=$.bottom?1:0}return A=Tt(t.text,A,1),Di(n,A,_,X,r-E)}function ss(e,t,n,r,i,o,a){var l=Me(function(c){var b=i[c],y=b.level!=1;return Ei(wt(e,v(n,y?b.to:b.from,y?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,h=wt(e,v(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Ei(h,o,a,!0)&&h.top>a&&(s=i[l-1])}return s}function us(e,t,n,r,i,o,a){var l=jo(e,t,r,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,c=null,b=0;b=u||y.to<=s)){var A=y.level!=1,E=Et(e,r,A?Math.min(u,y.to)-1:Math.max(s,y.from)).right,_=E_)&&(h=y,c=_)}}return h||(h=i[i.length-1]),h.fromu&&(h={from:h.from,to:u,level:h.level}),h}var cr;function Mr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(cr==null){cr=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)cr.appendChild(document.createTextNode("x")),cr.appendChild(d("br"));cr.appendChild(document.createTextNode("x"))}K(e.measure,cr);var n=cr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function Dr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),n=d("pre",[t],"CodeMirror-line-like");K(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Wi(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:Fi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Fi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function $o(e){var t=Mr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Dr(e.display)-3);return function(i){if(Vt(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(u=te(e.doc,s.line).text).length==s.ch){var h=ie(u,u.length,e.options.tabSize)-u.length;s=v(s.line,Math.max(0,Math.round((o-zo(e.display).left)/Dr(e.display))-h))}return s}function pr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)_t&&Ci(e.doc,t)i.viewFrom?er(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)er(e);else if(t<=i.viewFrom){var o=Qn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):er(e)}else if(n>=i.viewTo){var a=Qn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):er(e)}else{var l=Qn(e,t,t,-1),s=Qn(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Xn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):er(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[pr(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);de(a,n)==-1&&a.push(n)}}}function er(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,n,r){var i=pr(e,t),o,a=e.display.view;if(!_t||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s0){if(i==a.length-1)return null;o=l+a[i].size-t,i++}else o=l-t;t+=o,n+=o}for(;Ci(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function fs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Xn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Xn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,pr(e,n)))),r.viewTo=n}function ea(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(d("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Jn(e,t){return e.top-t.top||e.left-t.left}function hs(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=zo(e.display),l=a.left,s=Math.max(r.sizerWidth,hr(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function h(Y,$,oe,re){$<0&&($=0),$=Math.round($),re=Math.round(re),o.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+Y+`px;
top: `+$+"px; width: "+(oe==null?s-Y:oe)+`px;
- height: `+(re-$)+"px"))}function c(Y,$,oe){var re=te(i,Y),fe=re.text.length,Se,Ke;function Me(Fe,lt){return Zn(e,v(Y,Fe),"div",re,lt)}function ht(Fe,lt,Ye){var Re=Vo(e,re,null,Fe),Pe=lt=="ltr"==(Ye=="after")?"left":"right",Ee=Ye=="after"?Re.begin:Re.end-(/\s/.test(re.text.charAt(Re.end-1))?2:1);return Me(Ee,Pe)[Pe]}var at=gt(re,i.direction);return ur(at,$||0,oe==null?fe:oe,function(Fe,lt,Ye,Re){var Pe=Ye=="ltr",Ee=Me(Fe,Pe?"left":"right"),st=Me(lt-1,Pe?"right":"left"),Kr=$==null&&Fe==0,ar=oe==null&<==fe,Je=Re==0,Wt=!at||Re==at.length-1;if(st.top-Ee.top<=3){var Xe=(u?Kr:ar)&&Je,uo=(u?ar:Kr)&&Wt,Yt=Xe?l:(Pe?Ee:st).left,br=uo?s:(Pe?st:Ee).right;h(Yt,Ee.top,br-Yt,Ee.bottom)}else{var xr,et,Xr,fo;Pe?(xr=u&&Kr&&Je?l:Ee.left,et=u?s:ht(Fe,Ye,"before"),Xr=u?l:ht(lt,Ye,"after"),fo=u&&ar&&Wt?s:st.right):(xr=u?ht(Fe,Ye,"before"):l,et=!u&&Kr&&Je?s:Ee.right,Xr=!u&&ar&&Wt?l:st.left,fo=u?ht(lt,Ye,"after"):s),h(xr,Ee.top,et-xr,Ee.bottom),Ee.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Hr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ra(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||zi(e))}function Bi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Hr(e))},100)}function zi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,Ce(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),C&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ri(e))}function Hr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,ee(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function jn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a.005||y<-.005)&&(ie.display.sizerWidth){var E=Math.ceil(h/Dr(e.display));E>e.display.maxLineLength&&(e.display.maxLineLength=E,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function na(e){if(e.widgets)for(var t=0;t=a&&(o=At(t,Gt(te(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function vs(e,t){if(!De(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!H){var a=d("div","\u200B",null,`position: absolute;
+ height: `+(re-$)+"px"))}function c(Y,$,oe){var re=te(i,Y),fe=re.text.length,Se,Ke;function Ae(Fe,lt){return Zn(e,v(Y,Fe),"div",re,lt)}function ht(Fe,lt,Ye){var Re=Vo(e,re,null,Fe),Pe=lt=="ltr"==(Ye=="after")?"left":"right",Ee=Ye=="after"?Re.begin:Re.end-(/\s/.test(re.text.charAt(Re.end-1))?2:1);return Ae(Ee,Pe)[Pe]}var at=gt(re,i.direction);return ur(at,$||0,oe==null?fe:oe,function(Fe,lt,Ye,Re){var Pe=Ye=="ltr",Ee=Ae(Fe,Pe?"left":"right"),st=Ae(lt-1,Pe?"right":"left"),Kr=$==null&&Fe==0,ar=oe==null&<==fe,Je=Re==0,Wt=!at||Re==at.length-1;if(st.top-Ee.top<=3){var Xe=(u?Kr:ar)&&Je,uo=(u?ar:Kr)&&Wt,Yt=Xe?l:(Pe?Ee:st).left,br=uo?s:(Pe?st:Ee).right;h(Yt,Ee.top,br-Yt,Ee.bottom)}else{var xr,et,Xr,fo;Pe?(xr=u&&Kr&&Je?l:Ee.left,et=u?s:ht(Fe,Ye,"before"),Xr=u?l:ht(lt,Ye,"after"),fo=u&&ar&&Wt?s:st.right):(xr=u?ht(Fe,Ye,"before"):l,et=!u&&Kr&&Je?s:Ee.right,Xr=!u&&ar&&Wt?l:st.left,fo=u?ht(lt,Ye,"after"):s),h(xr,Ee.top,et-xr,Ee.bottom),Ee.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Hr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ra(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||zi(e))}function Bi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Hr(e))},100)}function zi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,Ce(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),C&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ri(e))}function Hr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,ee(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function jn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a.005||y<-.005)&&(ie.display.sizerWidth){var E=Math.ceil(h/Dr(e.display));E>e.display.maxLineLength&&(e.display.maxLineLength=E,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function na(e){if(e.widgets)for(var t=0;t=a&&(o=Mt(t,Gt(te(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function cs(e,t){if(!De(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!H){var a=d("div","\u200B",null,`position: absolute;
top: `+(t.top-n.viewOffset-Yn(e.display))+`px;
height: `+(t.bottom-t.top+Ht(e)+n.barHeight)+`px;
- left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function gs(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?v(t.line,t.ch+1,"before"):t,t=t.ch?v(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=wt(e,t),s=!n||n==t?l:wt(e,n);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};var u=_i(e,i),h=e.doc.scrollTop,c=e.doc.scrollLeft;if(u.scrollTop!=null&&(un(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(a=!0)),u.scrollLeft!=null&&(vr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(a=!0)),!a)break}return i}function ys(e,t){var n=_i(e,t);n.scrollTop!=null&&un(e,n.scrollTop),n.scrollLeft!=null&&vr(e,n.scrollLeft)}function _i(e,t){var n=e.display,r=Ar(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Ni(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Oi(n),s=t.topl-r;if(t.topi+o){var h=Math.min(t.top,(u?l:t.bottom)-o);h!=i&&(a.scrollTop=h)}var c=e.options.fixedGutter?0:n.gutters.offsetWidth,b=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-c,y=hr(e)-n.gutters.offsetWidth,M=t.right-t.left>y;return M&&(t.right=t.left+y),t.left<10?a.scrollLeft=0:t.lefty+b-3&&(a.scrollLeft=t.right+(M?0:10)-y),a}function Gi(e,t){t!=null&&($n(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Er(e){$n(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function sn(e,t,n){(t!=null||n!=null)&&$n(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function ms(e,t){$n(e),e.curOp.scrollToPos=t}function $n(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Jo(e,t.from),r=Jo(e,t.to);ia(e,n,r,t.margin)}}function ia(e,t,n,r){var i=_i(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});sn(e,i.scrollLeft,i.scrollTop)}function un(e,t){Math.abs(e.doc.scrollTop-t)<2||(I||Ki(e,{top:t}),oa(e,t,!0),I&&Ki(e),cn(e,100))}function oa(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 vr(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,fa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function fn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Oi(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+Ht(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var gr=function(e,t,n){this.cm=n;var r=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Z(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Z(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,S&&x<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};gr.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.scrollTop=0,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&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},gr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gr.prototype.zeroWidthHack=function(){var e=z&&!D?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new ue,this.disableVert=new ue},gr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},gr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var hn=function(){};hn.prototype.update=function(){return{bottom:0,right:0}},hn.prototype.setScrollLeft=function(){},hn.prototype.setScrollTop=function(){},hn.prototype.clear=function(){};function Wr(e,t){t||(t=fn(e));var n=e.display.barWidth,r=e.display.barHeight;aa(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&jn(e),aa(e,fn(e)),n=e.display.barWidth,r=e.display.barHeight}function aa(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=""}var la={native:gr,null:hn};function sa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ee(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new la[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Z(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?vr(e,t):un(e,t)},e),e.display.scrollbars.addClass&&Ce(e.display.wrapper,e.display.scrollbars.addClass)}var bs=0;function yr(e){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:++bs,markArrays:null},Jl(e.curOp)}function mr(e){var t=e.curOp;t&&Vl(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ei(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ss(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function Cs(e){var t=e.cm,n=t.display;e.updatedDisplay&&jn(t),e.barMeasure=fn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Go(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+Ht(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-hr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ks(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=en(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?Bt(t.mode,r.state):null,s=go(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var u=o.styleClasses,h=s.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var c=!a||a.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),b=0;!c&&bn)return cn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&ft(e,function(){for(var o=0;o=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&ea(e)==0)return!1;ha(e)&&(er(e),t.dims=Wi(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.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),_t&&(o=Ci(e.doc,o),a=Ao(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;ds(e,o,a),n.viewOffset=Gt(te(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=ea(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=Ns(e);return s>4&&(n.lineDiv.style.display="none"),As(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ms(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,cn(e,400)),n.updateLineNumbers=null,!0}function ua(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==hr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Oi(e.display)-Ni(e),n.top)}),t.visible=Vn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vn(e.display,e.doc,n));if(!Ui(e,t))break;jn(e);var i=fn(e);ln(e),Wr(e,i),Yi(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 Ki(e,t){var n=new ei(e,t);if(Ui(e,n)){jn(e),ua(e,n);var r=fn(e);ln(e),Wr(e,r),Yi(e,r),n.finish()}}function As(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(M){var E=M.nextSibling;return C&&z&&e.display.currentWheelTarget==M?M.style.display="none":M.parentNode.removeChild(M),E}for(var s=r.view,u=r.viewFrom,h=0;h-1&&(y=!1),Fo(e,c,u,n)),y&&(T(c.lineNumber),c.lineNumber.appendChild(document.createTextNode(p(e.options,u)))),a=c.node.nextSibling}u+=c.size}for(;a;)a=l(a)}function Xi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",_e(e,"gutterChanged",e)}function Yi(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+Ht(e)+"px"}function fa(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Fi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),S&&x<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!C&&!(I&&B)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=qi(r.gutters,r.lineNumbers),ca(i),n.init(i)}var ti=0,Kt=null;S?Kt=-.53:I?Kt=15:P?Kt=-.7:R&&(Kt=-1/3);function da(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function Hs(e){var t=da(e);return t.x*=Kt,t.y*=Kt,t}function pa(e,t){P&&j==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=da(t),r=n.x,i=n.y,o=Kt;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(!!(r&&s||i&&u)){if(i&&z&&C){e:for(var h=t.target,c=a.view;h!=l;h=h.parentNode)for(var b=0;b=0&&N(e,r.to())<=0)return n}return-1};var ye=function(e,t){this.anchor=e,this.head=t};ye.prototype.from=function(){return Ie(this.anchor,this.head)},ye.prototype.to=function(){return ve(this.anchor,this.head)},ye.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function St(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(b,y){return N(b.from(),y.from())}),n=de(t,i);for(var o=1;o0:s>=0){var u=Ie(l.from(),a.from()),h=ve(l.to(),a.to()),c=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new ye(c?h:u,c?u:h))}}return new dt(t,n)}function tr(e,t){return new dt([new ye(e,t||e)],0)}function rr(e){return e.text?v(e.from.line+e.text.length-1,pe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function va(e,t){if(N(e,t.from)<0)return e;if(N(e,t.to)<=0)return rr(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+=rr(t).ch-t.to.ch),v(n,r)}function Zi(e,t){for(var n=[],r=0;r1&&e.remove(l.line+1,M-1),e.insert(l.line+1,X)}_e(e,"change",e,t)}function nr(e,t,n){function r(i,o,a){if(i.linked)for(var l=0;l1&&!e.done[e.done.length-2].ranges)return e.done.pop(),pe(e.done)}function wa(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a,l;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(a=Fs(i,i.lastOp==r)))l=pe(a.changes),N(t.from,t.to)==0&&N(t.from,l.to)==0?l.to=rr(t):a.changes.push(ji(e,t));else{var s=pe(i.done);for((!s||!s.ranges)&&ni(e.sel,i.done),a={changes:[ji(e,t)],generation:i.generation},i.done.push(a);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=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||ke(e,"historyAdded")}function Ps(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)}function Is(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||Ps(e,o,pe(i.done),t))?i.done[i.done.length-1]=t:ni(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&xa(i.undone)}function ni(e,t){var n=pe(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Sa(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(a){a.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=a.markedSpans),++o})}function Rs(e){if(!e)return null;for(var t,n=0;n-1&&(pe(l)[c]=u[c],delete u[c])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=N(t,i)<0;o!=N(n,i)<0?(i=t,t=n):o!=N(t,n)<0&&(t=n)}return new ye(i,t)}else return new ye(n||t,t)}function ii(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qe(e,new dt([Vi(e.sel.primary(),t,n,i)],0),r)}function ka(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:l.to>t.ch))){if(i&&(ke(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var c=s.find(r<0?1:-1),b=void 0;if((r<0?h:u)&&(c=Aa(e,c,-r,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(b=N(c,n))&&(r<0?b<0:b>0))return Pr(e,c,t,r,i)}var y=s.find(r<0?-1:1);return(r<0?u:h)&&(y=Aa(e,y,r,y.line==t.line?o:null)),y?Pr(e,y,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,a=Pr(e,t,n,o,i)||!i&&Pr(e,t,n,o,!0)||Pr(e,t,n,-o,i)||!i&&Pr(e,t,n,-o,!0);return a||(e.cantEdit=!0,v(e.first,0))}function Aa(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?se(e,v(t.line-1)):null:n>0&&t.ch==(r||te(e,t.line)).text.length?t.line=0;--i)Ea(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Ea(e,t)}}function Ea(e,t){if(!(t.text.length==1&&t.text[0]==""&&N(t.from,t.to)==0)){var n=Zi(e,t);wa(e,t,n,e.cm?e.cm.curOp.id:NaN),vn(e,t,n,wi(e,t));var r=[];nr(e,function(i,o){!o&&de(r,i.history)==-1&&(Ia(i.history,t),r.push(i.history)),vn(i,t,null,wi(i,t))})}}function li(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,a=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u=0;--y){var M=b(y);if(M)return M.v}}}}function Wa(e,t){if(t!=0&&(e.first+=t,e.sel=new dt(wr(e.sel.ranges,function(i){return new ye(v(i.anchor.line+t,i.anchor.ch),v(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){it(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:v(o,te(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=zt(e,t.from,t.to),n||(n=Zi(e,t)),e.cm?_s(e.cm,t,r):Ji(e,t,r),oi(e,n,Ne),e.cantEdit&&ai(e,v(e.firstLine(),0))&&(e.cantEdit=!1)}}function _s(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=ge(xt(te(r,o.line))),r.iter(s,a.line+1,function(y){if(y==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Wn(e),Ji(r,t,n,$o(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(y){var M=Kn(y);M>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=M,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Al(r,o.line),cn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?it(e):o.line==a.line&&t.text.length==1&&!ya(e.doc,t)?$t(e,o.line,"text"):it(e,o.line,a.line+1,u);var h=je(e,"changes"),c=je(e,"change");if(c||h){var b={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};c&&_e(e,"change",e,b),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(b)}e.display.selForContextMenu=null}function Rr(e,t,n,r,i){var o;r||(r=n),N(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Ir(e,{from:n,to:r,text:t,origin:i})}function Fa(e,t,n,r){n1||!(this.children[0]instanceof yn))){var l=[];this.collapse(l),this.children=[new yn(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,l=a;l10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&it(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Na(e.doc)),e&&_e(e,"markerCleared",e,this,r,i),t&&mr(e),this.parent&&this.parent.clear()}},ir.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=ce("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Mo(e,t.line,t,n,o)||t.line!=n.line&&Mo(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Hl()}o.addToHistory&&wa(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,n.line+1,function(c){s&&o.collapsed&&!s.options.lineWrapping&&xt(c)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&mt(c,0),Wl(c,new zn(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(c){Vt(e,c)&&mt(c,0)}),o.clearOnEnter&&Z(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Dl(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Ba,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)it(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)$t(s,h,"text");o.atomic&&Na(s.doc),_e(s,"markerAdded",s,o)}return o}var xn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;s--)Ir(this,r[s]);l?Ta(this,l):this.cm&&Er(this.cm)}),undo:Ue(function(){li(this,"undo")}),redo:Ue(function(){li(this,"redo")}),undoSelection:Ue(function(){li(this,"undo",!0)}),redoSelection:Ue(function(){li(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.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=se(this,e),t=se(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=s.to||s.from==null&&i!=e.line||s.from!=null&&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;re)return t=e,!0;e-=o,++n}),se(this,v(n,t))},indexFromPos:function(e){e=se(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var h=e.dataTransfer.getData("Text");if(h){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),oi(t.doc,tr(n,n)),c)for(var b=0;b=0;l--)Rr(e.doc,"",r[l].from,r[l].to,"+delete");Er(e)})}function eo(e,t,n){var r=Tt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function to(e,t,n){var r=eo(e,t.ch,n);return r==null?null:new v(t.line,r,n<0?"after":"before")}function ro(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=gt(n,t.doc.direction);if(o){var a=i<0?pe(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var h=Mr(t,n);u=i<0?n.text.length-1:0;var c=Et(t,h,u).top;u=Ae(function(b){return Et(t,h,b).top==c},i<0==(a.level==1)?a.from:a.to-1,u),s=="before"&&(u=eo(n,u,1))}else u=i<0?a.to:a.from;return new v(r,u,s)}}return new v(r,i<0?n.text.length:0,i<0?"before":"after")}function tu(e,t,n,r){var i=gt(t,e.doc.direction);if(!i)return to(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=vt(i,n.ch,n.sticky),a=i[o];if(e.doc.direction=="ltr"&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&b>=h.begin)){var y=c?"before":"after";return new v(n.line,b,y)}}var M=function(X,J,Y){for(var $=function(Se,Ke){return Ke?new v(n.line,l(Se,1),"before"):new v(n.line,Se,"after")};X>=0&&X0==(oe.level!=1),fe=re?Y.begin:l(Y.end,-1);if(oe.from<=fe&&fe0?h.end:l(h.begin,-1);return _!=null&&!(r>0&&_==t.text.length)&&(E=M(r>0?0:i.length-1,r,u(_)),E)?E:null}var Cn={selectAll:Da,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ne)},killLine:function(e){return _r(e,function(t){if(t.empty()){var n=te(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new v(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),v(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=te(e.doc,i.line-1).text;a&&(i=new v(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),v(i.line-1,a.length-1),i,"+transpose"))}}n.push(new ye(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return ft(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;re&&N(t,this.pos)==0&&n==this.button};var Ln,Tn;function su(e,t){var n=+new Date;return Tn&&Tn.compare(n,e,t)?(Ln=Tn=null,"triple"):Ln&&Ln.compare(n,e,t)?(Tn=new io(n,e,t),Ln=null,"double"):(Ln=new io(n,e,t),Tn=null,"single")}function tl(e){var t=this,n=t.display;if(!(De(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Ut(n,e)){C||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!oo(t,e)){var r=dr(t,e),i=jr(e),o=r?su(r,i):"single";Pt(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&uu(t,i,r,o,e))&&(i==1?r?hu(t,r,o,e):nt(e)==n.scroller&&Ze(e):i==2?(r&&ii(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(ne?t.display.input.onContextMenu(e):Bi(t)))}}}function uu(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,kn(e,Ya(o,i),i,function(a){if(typeof a=="string"&&(a=Cn[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=xe}finally{e.state.suppressEdits=!1}return l})}function fu(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=q?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=z?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(z?n.altKey:n.ctrlKey)),i}function hu(e,t,n,r){S?setTimeout(rt(ra,e),0):e.curOp.focus=we(ze(e));var i=fu(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&yi&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(N((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(N(a.to(),t)>0||t.xRel<0)?cu(e,r,t,i):du(e,r,t,i)}function cu(e,t,n,r){var i=e.display,o=!1,a=Ge(e,function(u){C&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Bi(e)),qe(i.wrapper.ownerDocument,"mouseup",a),qe(i.wrapper.ownerDocument,"mousemove",l),qe(i.scroller,"dragstart",s),qe(i.scroller,"drop",a),o||(Ze(u),r.addNew||ii(e.doc,n,null,null,r.extend),C&&!R||S&&x==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};C&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,Z(i.wrapper.ownerDocument,"mouseup",a),Z(i.wrapper.ownerDocument,"mousemove",l),Z(i.scroller,"dragstart",s),Z(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function rl(e,t,n){if(n=="char")return new ye(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new ye(v(t.line,0),se(e.doc,v(t.line+1,0)));var r=n(e,t);return new ye(r.from,r.to)}function du(e,t,n,r){S&&Bi(e);var i=e.display,o=e.doc;Ze(t);var a,l,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=u[l]:a=new ye(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new ye(n,n)),n=dr(e,t,!0,!0),l=-1;else{var h=rl(e,n,r.unit);r.extend?a=Vi(a,h.anchor,h.head,r.extend):a=h}r.addNew?l==-1?(l=u.length,Qe(o,St(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(Qe(o,St(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):$i(o,l,a,sr):(l=0,Qe(o,new dt([a],0),sr),s=o.sel);var c=n;function b(Y){if(N(c,Y)!=0)if(c=Y,r.unit=="rectangle"){for(var $=[],oe=e.options.tabSize,re=ie(te(o,n.line).text,n.ch,oe),fe=ie(te(o,Y.line).text,Y.ch,oe),Se=Math.min(re,fe),Ke=Math.max(re,fe),Me=Math.min(n.line,Y.line),ht=Math.min(e.lastLine(),Math.max(n.line,Y.line));Me<=ht;Me++){var at=te(o,Me).text,Fe=kt(at,Se,oe);Se==Ke?$.push(new ye(v(Me,Fe),v(Me,Fe))):at.length>Fe&&$.push(new ye(v(Me,Fe),v(Me,kt(at,Ke,oe))))}$.length||$.push(new ye(n,n)),Qe(o,St(e,s.ranges.slice(0,l).concat($),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Y)}else{var lt=a,Ye=rl(e,Y,r.unit),Re=lt.anchor,Pe;N(Ye.anchor,Re)>0?(Pe=Ye.head,Re=Ie(lt.from(),Ye.anchor)):(Pe=Ye.anchor,Re=ve(lt.to(),Ye.head));var Ee=s.ranges.slice(0);Ee[l]=pu(e,new ye(se(o,Re),Pe)),Qe(o,St(e,Ee,l),sr)}}var y=i.wrapper.getBoundingClientRect(),M=0;function E(Y){var $=++M,oe=dr(e,Y,!0,r.unit=="rectangle");if(!!oe)if(N(oe,c)!=0){e.curOp.focus=we(ze(e)),b(oe);var re=Vn(i,o);(oe.line>=re.to||oe.liney.bottom?20:0;fe&&setTimeout(Ge(e,function(){M==$&&(i.scroller.scrollTop+=fe,E(Y))}),50)}}function _(Y){e.state.selectingText=!1,M=1/0,Y&&(Ze(Y),i.input.focus()),qe(i.wrapper.ownerDocument,"mousemove",X),qe(i.wrapper.ownerDocument,"mouseup",J),o.history.lastSelOrigin=null}var X=Ge(e,function(Y){Y.buttons===0||!jr(Y)?_(Y):E(Y)}),J=Ge(e,_);e.state.selectingText=J,Z(i.wrapper.ownerDocument,"mousemove",X),Z(i.wrapper.ownerDocument,"mouseup",J)}function pu(e,t){var n=t.anchor,r=t.head,i=te(e.doc,n.line);if(N(n,r)==0&&n.sticky==r.sticky)return t;var o=gt(i);if(!o)return t;var a=vt(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=a+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=vt(o,r.ch,r.sticky),c=h-a||(r.ch-n.ch)*(l.level==1?-1:1);h==s-1||h==s?u=c<0:u=c>0}var b=o[s+(u?-1:0)],y=u==(b.level==1),M=y?b.from:b.to,E=y?"after":"before";return n.ch==M&&n.sticky==E?t:new ye(new v(n.line,M,E),r)}function nl(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{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ze(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!je(e,n))return Jr(t);o-=l.top-a.viewOffset;for(var s=0;s=i){var h=At(e.doc,o),c=e.display.gutterSpecs[s];return ke(e,n,e,h,c.className,t),Jr(t)}}}function oo(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){Ut(e.display,t)||vu(e,t)||De(e,t,"contextmenu")||ne||e.display.input.onContextMenu(t)}function vu(e,t){return je(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function ol(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),an(e)}var Gr={toString:function(){return"CodeMirror.Init"}},al={},hi={};function gu(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,u){u!=Gr&&o(l,s,u)}:o)}e.defineOption=n,e.Init=Gr,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Qi(r)},!0),n("indentUnit",2,Qi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){pn(r),an(r),it(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],a=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var h=s.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(v(a,h))}a++});for(var l=o.length-1;l>=0;l--)Rr(r.doc,i,o[l],v(o[l].line,o[l].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=Gr&&r.refresh()}),n("specialCharPlaceholder",Xl,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",B?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!Q),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){ol(r),dn(r)},!0),n("keyMap","default",function(r,i,o){var a=ui(i),l=o!=Gr&&ui(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,mu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=qi(i,r.options.lineNumbers),dn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Fi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Wr(r)},!0),n("scrollbarStyle","native",function(r){sa(r),Wr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=qi(r.options.gutters,i),dn(r)},!0),n("firstLineNumber",1,dn,!0),n("lineNumberFormatter",function(r){return r},dn,!0),n("showCursorWhenSelecting",!1,ln,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Hr(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,yu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ln,!0),n("singleCursorHeightPerLine",!0,ln,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,pn,!0),n("addModeClass",!1,pn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,pn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function yu(e,t,n){var r=n&&n!=Gr;if(!t!=!r){var i=e.display.dragFunctions,o=t?Z:qe;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function mu(e){e.options.lineWrapping?(Ce(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ee(e.display.wrapper,"CodeMirror-wrap"),Li(e)),Pi(e),it(e),an(e),setTimeout(function(){return Wr(e)},100)}function Te(e,t){var n=this;if(!(this instanceof Te))return new Te(e,t);this.options=t=t?ae(t):{},ae(al,t,!1);var r=t.value;typeof r=="string"?r=new ot(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Te.inputStyles[t.inputStyle](this),o=this.display=new Ds(e,r,i,t);o.wrapper.CodeMirror=this,ol(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),sa(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 ue,keySeq:null,specialChars:null},t.autofocus&&!B&&o.input.focus(),S&&x<11&&setTimeout(function(){return n.display.input.reset(!0)},20),bu(this),Js(),yr(this),this.curOp.forceUpdate=!0,ma(this,r),t.autofocus&&!B||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&zi(n)},20):Hr(this);for(var a in hi)hi.hasOwnProperty(a)&&hi[a](this,t[a],Gr);ha(this),t.finishInit&&t.finishInit(this);for(var l=0;l20*20}Z(t.scroller,"touchstart",function(s){if(!De(e,s)&&!o(s)&&!oo(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),Z(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Z(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Ut(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),c;!u.prev||a(u,u.prev)?c=new ye(h,h):!u.prev.prev||a(u,u.prev.prev)?c=e.findWordAt(h):c=new ye(v(h.line,0),se(e.doc,v(h.line+1,0))),e.setSelection(c.anchor,c.head),e.focus(),Ze(s)}i()}),Z(t.scroller,"touchcancel",i),Z(t.scroller,"scroll",function(){t.scroller.clientHeight&&(un(e,t.scroller.scrollTop),vr(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),Z(t.scroller,"mousewheel",function(s){return pa(e,s)}),Z(t.scroller,"DOMMouseScroll",function(s){return pa(e,s)}),Z(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){De(e,s)||It(s)},over:function(s){De(e,s)||(Qs(e,s),It(s))},start:function(s){return Zs(e,s)},drop:Ge(e,qs),leave:function(s){De(e,s)||Ga(e)}};var l=t.input.getField();Z(l,"keyup",function(s){return $a.call(e,s)}),Z(l,"keydown",Ge(e,Va)),Z(l,"keypress",Ge(e,el)),Z(l,"focus",function(s){return zi(e,s)}),Z(l,"blur",function(s){return Hr(e,s)})}var ao=[];Te.defineInitHook=function(e){return ao.push(e)};function On(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=en(e,t).state:n="prev");var a=e.options.tabSize,l=te(i,t),s=ie(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(l.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,l.text.slice(u.length),l.text),h==xe||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=ie(te(i,t-1).text,null,a):h=0:n=="add"?h=s+e.options.indentUnit:n=="subtract"?h=s-e.options.indentUnit:typeof n=="number"&&(h=s+n),h=Math.max(0,h);var c="",b=0;if(e.options.indentWithTabs)for(var y=Math.floor(h/a);y;--y)b+=a,c+=" ";if(ba,s=Vr(t),u=null;if(l&&r.ranges.length>1)if(Ct&&Ct.text.join(`
-`)==t){if(r.ranges.length%Ct.text.length==0){u=[];for(var h=0;h=0;b--){var y=r.ranges[b],M=y.from(),E=y.to();y.empty()&&(n&&n>0?M=v(M.line,M.ch-n):e.state.overwrite&&!l?E=v(E.line,Math.min(te(o,E.line).text.length,E.ch+pe(s).length)):l&&Ct&&Ct.lineWise&&Ct.text.join(`
+ left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function ds(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?v(t.line,t.ch+1,"before"):t,t=t.ch?v(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=wt(e,t),s=!n||n==t?l:wt(e,n);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};var u=_i(e,i),h=e.doc.scrollTop,c=e.doc.scrollLeft;if(u.scrollTop!=null&&(un(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(a=!0)),u.scrollLeft!=null&&(vr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(a=!0)),!a)break}return i}function ps(e,t){var n=_i(e,t);n.scrollTop!=null&&un(e,n.scrollTop),n.scrollLeft!=null&&vr(e,n.scrollLeft)}function _i(e,t){var n=e.display,r=Mr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Ni(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Oi(n),s=t.topl-r;if(t.topi+o){var h=Math.min(t.top,(u?l:t.bottom)-o);h!=i&&(a.scrollTop=h)}var c=e.options.fixedGutter?0:n.gutters.offsetWidth,b=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-c,y=hr(e)-n.gutters.offsetWidth,A=t.right-t.left>y;return A&&(t.right=t.left+y),t.left<10?a.scrollLeft=0:t.lefty+b-3&&(a.scrollLeft=t.right+(A?0:10)-y),a}function Gi(e,t){t!=null&&($n(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Er(e){$n(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function sn(e,t,n){(t!=null||n!=null)&&$n(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function vs(e,t){$n(e),e.curOp.scrollToPos=t}function $n(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Jo(e,t.from),r=Jo(e,t.to);ia(e,n,r,t.margin)}}function ia(e,t,n,r){var i=_i(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});sn(e,i.scrollLeft,i.scrollTop)}function un(e,t){Math.abs(e.doc.scrollTop-t)<2||(I||Ki(e,{top:t}),oa(e,t,!0),I&&Ki(e),cn(e,100))}function oa(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 vr(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,fa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function fn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Oi(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+Ht(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var gr=function(e,t,n){this.cm=n;var r=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Z(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Z(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,S&&x<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};gr.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.scrollTop=0,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&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},gr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gr.prototype.zeroWidthHack=function(){var e=z&&!D?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new ue,this.disableVert=new ue},gr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},gr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var hn=function(){};hn.prototype.update=function(){return{bottom:0,right:0}},hn.prototype.setScrollLeft=function(){},hn.prototype.setScrollTop=function(){},hn.prototype.clear=function(){};function Wr(e,t){t||(t=fn(e));var n=e.display.barWidth,r=e.display.barHeight;aa(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&jn(e),aa(e,fn(e)),n=e.display.barWidth,r=e.display.barHeight}function aa(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=""}var la={native:gr,null:hn};function sa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ee(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new la[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Z(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?vr(e,t):un(e,t)},e),e.display.scrollbars.addClass&&Ce(e.display.wrapper,e.display.scrollbars.addClass)}var gs=0;function yr(e){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:++gs,markArrays:null},ql(e.curOp)}function mr(e){var t=e.curOp;t&&Ql(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ei(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function bs(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function xs(e){var t=e.cm,n=t.display;e.updatedDisplay&&jn(t),e.barMeasure=fn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Go(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+Ht(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-hr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ws(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=en(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?Bt(t.mode,r.state):null,s=go(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var u=o.styleClasses,h=s.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var c=!a||a.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),b=0;!c&&bn)return cn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&ft(e,function(){for(var o=0;o=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&ea(e)==0)return!1;ha(e)&&(er(e),t.dims=Wi(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.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),_t&&(o=Ci(e.doc,o),a=Mo(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;fs(e,o,a),n.viewOffset=Gt(te(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=ea(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=Ls(e);return s>4&&(n.lineDiv.style.display="none"),Os(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ts(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,cn(e,400)),n.updateLineNumbers=null,!0}function ua(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==hr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Oi(e.display)-Ni(e),n.top)}),t.visible=Vn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vn(e.display,e.doc,n));if(!Ui(e,t))break;jn(e);var i=fn(e);ln(e),Wr(e,i),Yi(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 Ki(e,t){var n=new ei(e,t);if(Ui(e,n)){jn(e),ua(e,n);var r=fn(e);ln(e),Wr(e,r),Yi(e,r),n.finish()}}function Os(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(A){var E=A.nextSibling;return C&&z&&e.display.currentWheelTarget==A?A.style.display="none":A.parentNode.removeChild(A),E}for(var s=r.view,u=r.viewFrom,h=0;h-1&&(y=!1),Fo(e,c,u,n)),y&&(T(c.lineNumber),c.lineNumber.appendChild(document.createTextNode(p(e.options,u)))),a=c.node.nextSibling}u+=c.size}for(;a;)a=l(a)}function Xi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",_e(e,"gutterChanged",e)}function Yi(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+Ht(e)+"px"}function fa(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Fi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),S&&x<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!C&&!(I&&B)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=qi(r.gutters,r.lineNumbers),ca(i),n.init(i)}var ti=0,Kt=null;S?Kt=-.53:I?Kt=15:P?Kt=-.7:R&&(Kt=-1/3);function da(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function As(e){var t=da(e);return t.x*=Kt,t.y*=Kt,t}function pa(e,t){P&&j==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=da(t),r=n.x,i=n.y,o=Kt;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(!!(r&&s||i&&u)){if(i&&z&&C){e:for(var h=t.target,c=a.view;h!=l;h=h.parentNode)for(var b=0;b=0&&N(e,r.to())<=0)return n}return-1};var ye=function(e,t){this.anchor=e,this.head=t};ye.prototype.from=function(){return Ie(this.anchor,this.head)},ye.prototype.to=function(){return ve(this.anchor,this.head)},ye.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function St(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(b,y){return N(b.from(),y.from())}),n=de(t,i);for(var o=1;o0:s>=0){var u=Ie(l.from(),a.from()),h=ve(l.to(),a.to()),c=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new ye(c?h:u,c?u:h))}}return new dt(t,n)}function tr(e,t){return new dt([new ye(e,t||e)],0)}function rr(e){return e.text?v(e.from.line+e.text.length-1,pe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function va(e,t){if(N(e,t.from)<0)return e;if(N(e,t.to)<=0)return rr(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+=rr(t).ch-t.to.ch),v(n,r)}function Zi(e,t){for(var n=[],r=0;r1&&e.remove(l.line+1,A-1),e.insert(l.line+1,X)}_e(e,"change",e,t)}function nr(e,t,n){function r(i,o,a){if(i.linked)for(var l=0;l1&&!e.done[e.done.length-2].ranges)return e.done.pop(),pe(e.done)}function wa(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a,l;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(a=Hs(i,i.lastOp==r)))l=pe(a.changes),N(t.from,t.to)==0&&N(t.from,l.to)==0?l.to=rr(t):a.changes.push(ji(e,t));else{var s=pe(i.done);for((!s||!s.ranges)&&ni(e.sel,i.done),a={changes:[ji(e,t)],generation:i.generation},i.done.push(a);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=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||ke(e,"historyAdded")}function Es(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)}function Ws(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||Es(e,o,pe(i.done),t))?i.done[i.done.length-1]=t:ni(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&xa(i.undone)}function ni(e,t){var n=pe(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Sa(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(a){a.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=a.markedSpans),++o})}function Fs(e){if(!e)return null;for(var t,n=0;n-1&&(pe(l)[c]=u[c],delete u[c])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=N(t,i)<0;o!=N(n,i)<0?(i=t,t=n):o!=N(t,n)<0&&(t=n)}return new ye(i,t)}else return new ye(n||t,t)}function ii(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qe(e,new dt([Vi(e.sel.primary(),t,n,i)],0),r)}function ka(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:l.to>t.ch))){if(i&&(ke(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var c=s.find(r<0?1:-1),b=void 0;if((r<0?h:u)&&(c=Ma(e,c,-r,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(b=N(c,n))&&(r<0?b<0:b>0))return Pr(e,c,t,r,i)}var y=s.find(r<0?-1:1);return(r<0?u:h)&&(y=Ma(e,y,r,y.line==t.line?o:null)),y?Pr(e,y,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,a=Pr(e,t,n,o,i)||!i&&Pr(e,t,n,o,!0)||Pr(e,t,n,-o,i)||!i&&Pr(e,t,n,-o,!0);return a||(e.cantEdit=!0,v(e.first,0))}function Ma(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?se(e,v(t.line-1)):null:n>0&&t.ch==(r||te(e,t.line)).text.length?t.line=0;--i)Ea(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Ea(e,t)}}function Ea(e,t){if(!(t.text.length==1&&t.text[0]==""&&N(t.from,t.to)==0)){var n=Zi(e,t);wa(e,t,n,e.cm?e.cm.curOp.id:NaN),vn(e,t,n,wi(e,t));var r=[];nr(e,function(i,o){!o&&de(r,i.history)==-1&&(Ia(i.history,t),r.push(i.history)),vn(i,t,null,wi(i,t))})}}function li(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,a=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u=0;--y){var A=b(y);if(A)return A.v}}}}function Wa(e,t){if(t!=0&&(e.first+=t,e.sel=new dt(wr(e.sel.ranges,function(i){return new ye(v(i.anchor.line+t,i.anchor.ch),v(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){it(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:v(o,te(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=zt(e,t.from,t.to),n||(n=Zi(e,t)),e.cm?Rs(e.cm,t,r):Ji(e,t,r),oi(e,n,Ne),e.cantEdit&&ai(e,v(e.firstLine(),0))&&(e.cantEdit=!1)}}function Rs(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=ge(xt(te(r,o.line))),r.iter(s,a.line+1,function(y){if(y==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Wn(e),Ji(r,t,n,$o(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(y){var A=Kn(y);A>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=A,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Ol(r,o.line),cn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?it(e):o.line==a.line&&t.text.length==1&&!ya(e.doc,t)?$t(e,o.line,"text"):it(e,o.line,a.line+1,u);var h=je(e,"changes"),c=je(e,"change");if(c||h){var b={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};c&&_e(e,"change",e,b),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(b)}e.display.selForContextMenu=null}function Rr(e,t,n,r,i){var o;r||(r=n),N(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Ir(e,{from:n,to:r,text:t,origin:i})}function Fa(e,t,n,r){n1||!(this.children[0]instanceof yn))){var l=[];this.collapse(l),this.children=[new yn(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,l=a;l10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&it(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Na(e.doc)),e&&_e(e,"markerCleared",e,this,r,i),t&&mr(e),this.parent&&this.parent.clear()}},ir.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=ce("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ao(e,t.line,t,n,o)||t.line!=n.line&&Ao(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Al()}o.addToHistory&&wa(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,n.line+1,function(c){s&&o.collapsed&&!s.options.lineWrapping&&xt(c)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&mt(c,0),Dl(c,new zn(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(c){Vt(e,c)&&mt(c,0)}),o.clearOnEnter&&Z(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Nl(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Ba,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)it(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)$t(s,h,"text");o.atomic&&Na(s.doc),_e(s,"markerAdded",s,o)}return o}var xn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;s--)Ir(this,r[s]);l?Ta(this,l):this.cm&&Er(this.cm)}),undo:Ue(function(){li(this,"undo")}),redo:Ue(function(){li(this,"redo")}),undoSelection:Ue(function(){li(this,"undo",!0)}),redoSelection:Ue(function(){li(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.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=se(this,e),t=se(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=s.to||s.from==null&&i!=e.line||s.from!=null&&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;re)return t=e,!0;e-=o,++n}),se(this,v(n,t))},indexFromPos:function(e){e=se(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var h=e.dataTransfer.getData("Text");if(h){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),oi(t.doc,tr(n,n)),c)for(var b=0;b=0;l--)Rr(e.doc,"",r[l].from,r[l].to,"+delete");Er(e)})}function eo(e,t,n){var r=Tt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function to(e,t,n){var r=eo(e,t.ch,n);return r==null?null:new v(t.line,r,n<0?"after":"before")}function ro(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=gt(n,t.doc.direction);if(o){var a=i<0?pe(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var h=Ar(t,n);u=i<0?n.text.length-1:0;var c=Et(t,h,u).top;u=Me(function(b){return Et(t,h,b).top==c},i<0==(a.level==1)?a.from:a.to-1,u),s=="before"&&(u=eo(n,u,1))}else u=i<0?a.to:a.from;return new v(r,u,s)}}return new v(r,i<0?n.text.length:0,i<0?"before":"after")}function Vs(e,t,n,r){var i=gt(t,e.doc.direction);if(!i)return to(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=vt(i,n.ch,n.sticky),a=i[o];if(e.doc.direction=="ltr"&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&b>=h.begin)){var y=c?"before":"after";return new v(n.line,b,y)}}var A=function(X,J,Y){for(var $=function(Se,Ke){return Ke?new v(n.line,l(Se,1),"before"):new v(n.line,Se,"after")};X>=0&&X0==(oe.level!=1),fe=re?Y.begin:l(Y.end,-1);if(oe.from<=fe&&fe0?h.end:l(h.begin,-1);return _!=null&&!(r>0&&_==t.text.length)&&(E=A(r>0?0:i.length-1,r,u(_)),E)?E:null}var Cn={selectAll:Da,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ne)},killLine:function(e){return _r(e,function(t){if(t.empty()){var n=te(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new v(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),v(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=te(e.doc,i.line-1).text;a&&(i=new v(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),v(i.line-1,a.length-1),i,"+transpose"))}}n.push(new ye(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return ft(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;re&&N(t,this.pos)==0&&n==this.button};var Ln,Tn;function ou(e,t){var n=+new Date;return Tn&&Tn.compare(n,e,t)?(Ln=Tn=null,"triple"):Ln&&Ln.compare(n,e,t)?(Tn=new io(n,e,t),Ln=null,"double"):(Ln=new io(n,e,t),Tn=null,"single")}function tl(e){var t=this,n=t.display;if(!(De(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Ut(n,e)){C||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!oo(t,e)){var r=dr(t,e),i=jr(e),o=r?ou(r,i):"single";Pt(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&au(t,i,r,o,e))&&(i==1?r?su(t,r,o,e):nt(e)==n.scroller&&Ze(e):i==2?(r&&ii(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(ne?t.display.input.onContextMenu(e):Bi(t)))}}}function au(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,kn(e,Ya(o,i),i,function(a){if(typeof a=="string"&&(a=Cn[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=xe}finally{e.state.suppressEdits=!1}return l})}function lu(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=q?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=z?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(z?n.altKey:n.ctrlKey)),i}function su(e,t,n,r){S?setTimeout(rt(ra,e),0):e.curOp.focus=we(ze(e));var i=lu(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&yi&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(N((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(N(a.to(),t)>0||t.xRel<0)?uu(e,r,t,i):fu(e,r,t,i)}function uu(e,t,n,r){var i=e.display,o=!1,a=Ge(e,function(u){C&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Bi(e)),qe(i.wrapper.ownerDocument,"mouseup",a),qe(i.wrapper.ownerDocument,"mousemove",l),qe(i.scroller,"dragstart",s),qe(i.scroller,"drop",a),o||(Ze(u),r.addNew||ii(e.doc,n,null,null,r.extend),C&&!R||S&&x==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};C&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,Z(i.wrapper.ownerDocument,"mouseup",a),Z(i.wrapper.ownerDocument,"mousemove",l),Z(i.scroller,"dragstart",s),Z(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function rl(e,t,n){if(n=="char")return new ye(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new ye(v(t.line,0),se(e.doc,v(t.line+1,0)));var r=n(e,t);return new ye(r.from,r.to)}function fu(e,t,n,r){S&&Bi(e);var i=e.display,o=e.doc;Ze(t);var a,l,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=u[l]:a=new ye(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new ye(n,n)),n=dr(e,t,!0,!0),l=-1;else{var h=rl(e,n,r.unit);r.extend?a=Vi(a,h.anchor,h.head,r.extend):a=h}r.addNew?l==-1?(l=u.length,Qe(o,St(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(Qe(o,St(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):$i(o,l,a,sr):(l=0,Qe(o,new dt([a],0),sr),s=o.sel);var c=n;function b(Y){if(N(c,Y)!=0)if(c=Y,r.unit=="rectangle"){for(var $=[],oe=e.options.tabSize,re=ie(te(o,n.line).text,n.ch,oe),fe=ie(te(o,Y.line).text,Y.ch,oe),Se=Math.min(re,fe),Ke=Math.max(re,fe),Ae=Math.min(n.line,Y.line),ht=Math.min(e.lastLine(),Math.max(n.line,Y.line));Ae<=ht;Ae++){var at=te(o,Ae).text,Fe=kt(at,Se,oe);Se==Ke?$.push(new ye(v(Ae,Fe),v(Ae,Fe))):at.length>Fe&&$.push(new ye(v(Ae,Fe),v(Ae,kt(at,Ke,oe))))}$.length||$.push(new ye(n,n)),Qe(o,St(e,s.ranges.slice(0,l).concat($),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Y)}else{var lt=a,Ye=rl(e,Y,r.unit),Re=lt.anchor,Pe;N(Ye.anchor,Re)>0?(Pe=Ye.head,Re=Ie(lt.from(),Ye.anchor)):(Pe=Ye.anchor,Re=ve(lt.to(),Ye.head));var Ee=s.ranges.slice(0);Ee[l]=hu(e,new ye(se(o,Re),Pe)),Qe(o,St(e,Ee,l),sr)}}var y=i.wrapper.getBoundingClientRect(),A=0;function E(Y){var $=++A,oe=dr(e,Y,!0,r.unit=="rectangle");if(!!oe)if(N(oe,c)!=0){e.curOp.focus=we(ze(e)),b(oe);var re=Vn(i,o);(oe.line>=re.to||oe.liney.bottom?20:0;fe&&setTimeout(Ge(e,function(){A==$&&(i.scroller.scrollTop+=fe,E(Y))}),50)}}function _(Y){e.state.selectingText=!1,A=1/0,Y&&(Ze(Y),i.input.focus()),qe(i.wrapper.ownerDocument,"mousemove",X),qe(i.wrapper.ownerDocument,"mouseup",J),o.history.lastSelOrigin=null}var X=Ge(e,function(Y){Y.buttons===0||!jr(Y)?_(Y):E(Y)}),J=Ge(e,_);e.state.selectingText=J,Z(i.wrapper.ownerDocument,"mousemove",X),Z(i.wrapper.ownerDocument,"mouseup",J)}function hu(e,t){var n=t.anchor,r=t.head,i=te(e.doc,n.line);if(N(n,r)==0&&n.sticky==r.sticky)return t;var o=gt(i);if(!o)return t;var a=vt(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=a+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=vt(o,r.ch,r.sticky),c=h-a||(r.ch-n.ch)*(l.level==1?-1:1);h==s-1||h==s?u=c<0:u=c>0}var b=o[s+(u?-1:0)],y=u==(b.level==1),A=y?b.from:b.to,E=y?"after":"before";return n.ch==A&&n.sticky==E?t:new ye(new v(n.line,A,E),r)}function nl(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{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ze(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!je(e,n))return Jr(t);o-=l.top-a.viewOffset;for(var s=0;s=i){var h=Mt(e.doc,o),c=e.display.gutterSpecs[s];return ke(e,n,e,h,c.className,t),Jr(t)}}}function oo(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){Ut(e.display,t)||cu(e,t)||De(e,t,"contextmenu")||ne||e.display.input.onContextMenu(t)}function cu(e,t){return je(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function ol(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),an(e)}var Gr={toString:function(){return"CodeMirror.Init"}},al={},hi={};function du(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,u){u!=Gr&&o(l,s,u)}:o)}e.defineOption=n,e.Init=Gr,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Qi(r)},!0),n("indentUnit",2,Qi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){pn(r),an(r),it(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],a=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var h=s.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(v(a,h))}a++});for(var l=o.length-1;l>=0;l--)Rr(r.doc,i,o[l],v(o[l].line,o[l].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=Gr&&r.refresh()}),n("specialCharPlaceholder",Gl,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",B?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!Q),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){ol(r),dn(r)},!0),n("keyMap","default",function(r,i,o){var a=ui(i),l=o!=Gr&&ui(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,vu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=qi(i,r.options.lineNumbers),dn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Fi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Wr(r)},!0),n("scrollbarStyle","native",function(r){sa(r),Wr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=qi(r.options.gutters,i),dn(r)},!0),n("firstLineNumber",1,dn,!0),n("lineNumberFormatter",function(r){return r},dn,!0),n("showCursorWhenSelecting",!1,ln,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Hr(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,pu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ln,!0),n("singleCursorHeightPerLine",!0,ln,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,pn,!0),n("addModeClass",!1,pn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,pn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function pu(e,t,n){var r=n&&n!=Gr;if(!t!=!r){var i=e.display.dragFunctions,o=t?Z:qe;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function vu(e){e.options.lineWrapping?(Ce(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ee(e.display.wrapper,"CodeMirror-wrap"),Li(e)),Pi(e),it(e),an(e),setTimeout(function(){return Wr(e)},100)}function Te(e,t){var n=this;if(!(this instanceof Te))return new Te(e,t);this.options=t=t?ae(t):{},ae(al,t,!1);var r=t.value;typeof r=="string"?r=new ot(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Te.inputStyles[t.inputStyle](this),o=this.display=new Ns(e,r,i,t);o.wrapper.CodeMirror=this,ol(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),sa(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 ue,keySeq:null,specialChars:null},t.autofocus&&!B&&o.input.focus(),S&&x<11&&setTimeout(function(){return n.display.input.reset(!0)},20),gu(this),qs(),yr(this),this.curOp.forceUpdate=!0,ma(this,r),t.autofocus&&!B||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&zi(n)},20):Hr(this);for(var a in hi)hi.hasOwnProperty(a)&&hi[a](this,t[a],Gr);ha(this),t.finishInit&&t.finishInit(this);for(var l=0;l20*20}Z(t.scroller,"touchstart",function(s){if(!De(e,s)&&!o(s)&&!oo(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),Z(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Z(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Ut(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),c;!u.prev||a(u,u.prev)?c=new ye(h,h):!u.prev.prev||a(u,u.prev.prev)?c=e.findWordAt(h):c=new ye(v(h.line,0),se(e.doc,v(h.line+1,0))),e.setSelection(c.anchor,c.head),e.focus(),Ze(s)}i()}),Z(t.scroller,"touchcancel",i),Z(t.scroller,"scroll",function(){t.scroller.clientHeight&&(un(e,t.scroller.scrollTop),vr(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),Z(t.scroller,"mousewheel",function(s){return pa(e,s)}),Z(t.scroller,"DOMMouseScroll",function(s){return pa(e,s)}),Z(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){De(e,s)||It(s)},over:function(s){De(e,s)||(Ys(e,s),It(s))},start:function(s){return Xs(e,s)},drop:Ge(e,Ks),leave:function(s){De(e,s)||Ga(e)}};var l=t.input.getField();Z(l,"keyup",function(s){return $a.call(e,s)}),Z(l,"keydown",Ge(e,Va)),Z(l,"keypress",Ge(e,el)),Z(l,"focus",function(s){return zi(e,s)}),Z(l,"blur",function(s){return Hr(e,s)})}var ao=[];Te.defineInitHook=function(e){return ao.push(e)};function On(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=en(e,t).state:n="prev");var a=e.options.tabSize,l=te(i,t),s=ie(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(l.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,l.text.slice(u.length),l.text),h==xe||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=ie(te(i,t-1).text,null,a):h=0:n=="add"?h=s+e.options.indentUnit:n=="subtract"?h=s-e.options.indentUnit:typeof n=="number"&&(h=s+n),h=Math.max(0,h);var c="",b=0;if(e.options.indentWithTabs)for(var y=Math.floor(h/a);y;--y)b+=a,c+=" ";if(ba,s=Vr(t),u=null;if(l&&r.ranges.length>1)if(Ct&&Ct.text.join(`
+`)==t){if(r.ranges.length%Ct.text.length==0){u=[];for(var h=0;h=0;b--){var y=r.ranges[b],A=y.from(),E=y.to();y.empty()&&(n&&n>0?A=v(A.line,A.ch-n):e.state.overwrite&&!l?E=v(E.line,Math.min(te(o,E.line).text.length,E.ch+pe(s).length)):l&&Ct&&Ct.lineWise&&Ct.text.join(`
`)==s.join(`
-`)&&(M=E=v(M.line,0)));var _={from:M,to:E,text:u?u[b%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};Ir(e.doc,_),_e(e,"inputRead",e,_)}t&&!l&&sl(e,t),Er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=c),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ll(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ft(t,function(){return lo(t,n,0,null,"paste")}),!0}function sl(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-1){a=On(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(te(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=On(e,i.head.line,"smart"));a&&_e(e,"electricInput",e,i.head.line)}}}function ul(e){for(var t=[],n=[],r=0;ro&&(On(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&Er(this));else{var s=l.from(),u=l.to(),h=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var c=h;c0&&$i(this.doc,a,new ye(s,b[a].to()),Ne)}}}),getTokenAt:function(r,i){return xo(this,r,i)},getLineTokens:function(r,i){return xo(this,v(r),i,!0)},getTokenTypeAt:function(r){r=se(this.doc,r);var i=yo(this,te(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=o+a>>1;if((u?i[u*2-1]:0)>=l)a=u;else if(i[u*2+1]s&&(r=s,a=!0),l=te(this.doc,r)}else l=r;return qn(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-Gt(l):0)},defaultTextHeight:function(){return Ar(this.display)},defaultCharWidth:function(){return Dr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,a,l){var s=this.display;r=wt(this,se(this.doc,r));var u=r.bottom,h=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),a=="over")u=r.top;else if(a=="above"||a=="near"){var c=Math.max(s.wrapper.clientHeight,this.doc.height),b=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>c)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=c&&(u=r.bottom),h+i.offsetWidth>b&&(h=b-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(h=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?h=0:l=="middle"&&(h=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&ys(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:$e(Va),triggerOnKeyPress:$e(el),triggerOnKeyUp:$a,triggerOnMouseDown:$e(tl),execCommand:function(r){if(Cn.hasOwnProperty(r))return Cn[r].call(null,this)},triggerElectric:$e(function(r){sl(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=se(this.doc,r),u=0;u0&&h(o.charAt(a-1));)--a;for(;l.5||this.options.lineWrapping)&&Pi(this),ke(this,"refresh",this)}),swapDoc:$e(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ma(this,r),an(this),this.display.input.reset(),sn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,_e(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},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}},Ve(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,a){e.registerHelper(r,i,a),n[r]._global.push({pred:o,val:a})}}function so(e,t,n,r,i){var o=t,a=n,l=te(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var J=t.line+s;return J=e.first+e.size?!1:(t=new v(J,t.ch,t.sticky),l=te(e,J))}function h(J){var Y;if(r=="codepoint"){var $=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN($))Y=null;else{var oe=n>0?$>=55296&&$<56320:$>=56320&&$<57343;Y=new v(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(oe?2:1))),-n)}}else i?Y=tu(e.cm,l,t,n):Y=to(l,t,n);if(Y==null)if(!J&&u())t=ro(i,e.cm,l,t.line,s);else return!1;else t=Y;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var c=null,b=r=="group",y=e.cm&&e.cm.getHelper(t,"wordChars"),M=!0;!(n<0&&!h(!M));M=!1){var E=l.text.charAt(t.ch)||`
+`)&&(A=E=v(A.line,0)));var _={from:A,to:E,text:u?u[b%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};Ir(e.doc,_),_e(e,"inputRead",e,_)}t&&!l&&sl(e,t),Er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=c),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ll(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ft(t,function(){return lo(t,n,0,null,"paste")}),!0}function sl(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-1){a=On(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(te(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=On(e,i.head.line,"smart"));a&&_e(e,"electricInput",e,i.head.line)}}}function ul(e){for(var t=[],n=[],r=0;ro&&(On(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&Er(this));else{var s=l.from(),u=l.to(),h=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var c=h;c0&&$i(this.doc,a,new ye(s,b[a].to()),Ne)}}}),getTokenAt:function(r,i){return xo(this,r,i)},getLineTokens:function(r,i){return xo(this,v(r),i,!0)},getTokenTypeAt:function(r){r=se(this.doc,r);var i=yo(this,te(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=o+a>>1;if((u?i[u*2-1]:0)>=l)a=u;else if(i[u*2+1]s&&(r=s,a=!0),l=te(this.doc,r)}else l=r;return qn(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-Gt(l):0)},defaultTextHeight:function(){return Mr(this.display)},defaultCharWidth:function(){return Dr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,a,l){var s=this.display;r=wt(this,se(this.doc,r));var u=r.bottom,h=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),a=="over")u=r.top;else if(a=="above"||a=="near"){var c=Math.max(s.wrapper.clientHeight,this.doc.height),b=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>c)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=c&&(u=r.bottom),h+i.offsetWidth>b&&(h=b-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(h=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?h=0:l=="middle"&&(h=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&ps(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:$e(Va),triggerOnKeyPress:$e(el),triggerOnKeyUp:$a,triggerOnMouseDown:$e(tl),execCommand:function(r){if(Cn.hasOwnProperty(r))return Cn[r].call(null,this)},triggerElectric:$e(function(r){sl(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=se(this.doc,r),u=0;u0&&h(o.charAt(a-1));)--a;for(;l.5||this.options.lineWrapping)&&Pi(this),ke(this,"refresh",this)}),swapDoc:$e(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ma(this,r),an(this),this.display.input.reset(),sn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,_e(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},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}},Ve(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,a){e.registerHelper(r,i,a),n[r]._global.push({pred:o,val:a})}}function so(e,t,n,r,i){var o=t,a=n,l=te(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var J=t.line+s;return J=e.first+e.size?!1:(t=new v(J,t.ch,t.sticky),l=te(e,J))}function h(J){var Y;if(r=="codepoint"){var $=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN($))Y=null;else{var oe=n>0?$>=55296&&$<56320:$>=56320&&$<57343;Y=new v(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(oe?2:1))),-n)}}else i?Y=Vs(e.cm,l,t,n):Y=to(l,t,n);if(Y==null)if(!J&&u())t=ro(i,e.cm,l,t.line,s);else return!1;else t=Y;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var c=null,b=r=="group",y=e.cm&&e.cm.getHelper(t,"wordChars"),A=!0;!(n<0&&!h(!A));A=!1){var E=l.text.charAt(t.ch)||`
`,_=Sr(E,y)?"w":b&&E==`
-`?"n":!b||/\s/.test(E)?null:"p";if(b&&!M&&!_&&(_="s"),c&&c!=_){n<0&&(n=1,h(),t.sticky="after");break}if(_&&(c=_),n>0&&!h(!M))break}var X=ai(e,t,o,a,!0);return le(o,X)&&(X.hitSide=!0),X}function cl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,Pt(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*Ar(e.display),3);a=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var u;u=Hi(e,o,a),!!u.outside;){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var me=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ue,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};me.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,fl(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(l){for(var s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}Z(i,"paste",function(l){!o(l)||De(r,l)||ll(l,r)||x<=11&&setTimeout(Ge(r,function(){return t.updateFromDOM()}),20)}),Z(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),Z(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),Z(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Z(i,"touchstart",function(){return n.forceCompositionEnd()}),Z(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||De(r,l))){if(r.somethingSelected())ci({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=ul(r);ci({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Ne),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=Ct.text.join(`
+`?"n":!b||/\s/.test(E)?null:"p";if(b&&!A&&!_&&(_="s"),c&&c!=_){n<0&&(n=1,h(),t.sticky="after");break}if(_&&(c=_),n>0&&!h(!A))break}var X=ai(e,t,o,a,!0);return le(o,X)&&(X.hitSide=!0),X}function cl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,Pt(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*Mr(e.display),3);a=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var u;u=Hi(e,o,a),!!u.outside;){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var me=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ue,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};me.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,fl(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(l){for(var s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}Z(i,"paste",function(l){!o(l)||De(r,l)||ll(l,r)||x<=11&&setTimeout(Ge(r,function(){return t.updateFromDOM()}),20)}),Z(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),Z(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),Z(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Z(i,"touchstart",function(){return n.forceCompositionEnd()}),Z(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||De(r,l))){if(r.somethingSelected())ci({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=ul(r);ci({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Ne),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=Ct.text.join(`
`);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var h=hl(),c=h.firstChild;r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),c.value=Ct.text.join(`
-`);var b=we(i.ownerDocument);lr(c),setTimeout(function(){r.display.lineSpace.removeChild(h),b.focus(),b==i&&n.showPrimarySelection()},50)}}Z(i,"copy",a),Z(i,"cut",a)},me.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},me.prototype.prepareSelection=function(){var e=ta(this.cm,!1);return e.focus=we(this.div.ownerDocument)==this.div,e},me.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},me.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},me.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line