3 lines
269 KiB
JavaScript
3 lines
269 KiB
JavaScript
!function e(t,n,r){function i(a,l){if(!n[a]){if(!t[a]){var s="function"==typeof require&&require;if(!l&&s)return s(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){return i(t[a][1][e]||e)}),u,u.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";var r=e("./lib");window.PaydayAdapter=r.PaydayAdapter,window.PayrollAdapter=r.PayrollAdapter,window.PayrollDataAdapter=r.PayrollDataAdapter,window.PayrollColumnAdapter=r.PayrollColumnAdapter,window.PayrollColumnTemplateAdapter=r.PayrollColumnTemplateAdapter,window.PayrollEmployeeAdapter=r.PayrollEmployeeAdapter,window.DeductionAdapter=r.DeductionAdapter,window.DeductionGroupAdapter=r.DeductionGroupAdapter,window.PayslipTemplateAdapter=r.PayslipTemplateAdapter},{"./lib":2}],2:[function(e,t,n){"use strict";var r=o(e("../../../api/AdapterBase")),i=o(e("../../../api/TableEditAdapter"));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(e,t,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=m(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m(e);if(t){var i=m(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p(this,n)}}function p(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}e("codemirror/mode/javascript/javascript"),e("codemirror/addon/edit/closebrackets"),e("codemirror/addon/display/autorefresh");var v=e("codemirror"),g=function(e){d(n,e);var t=h(n);function n(){return l(this,n),t.apply(this,arguments)}return c(n,[{key:"getDataMapping",value:function(){return["id","name"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Select Pay Frequency"}]}},{key:"getFormFields",value:function(){return[["name",{label:"Name",type:"text",validation:""}]]}},{key:"getAddNewLabel",value:function(){return"Run Payroll"}},{key:"createTable",value:function(e){$("#payday_all").off(),u(m(n.prototype),"createTable",this).call(this,e),$("#payday_all").off().on("click",(function(){$(this).is(":checked")?$(".paydayCheck").prop("checked",!0):$(".paydayCheck").prop("checked",!1)}))}},{key:"getActionButtonsHtml",value:function(e,t){var n='<div style="width:130px;">_edit_</div>';return n=(n=(n=n.replace("_edit_",'<input type="checkbox" class="paydayCheck" id="payday__id_" name="payday__id_" value="checkbox_payday__id_"/>')).replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}},{key:"getActionButtonHeader",value:function(){return{sTitle:'<input type="checkbox" id="payday_all" name="payday_all" value="checkbox_payday_all"/>',sClass:"center"}}}]),n}(r.default),y=function(e){d(n,e);var t=h(n);function n(){return l(this,n),t.apply(this,arguments)}return c(n,[{key:"getDataMapping",value:function(){return["id","name","pay_period","department","date_start","date_end","status"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Pay Frequency"},{sTitle:"Department"},{sTitle:"Date Start"},{sTitle:"Date End"},{sTitle:"Status"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"text"}],["pay_period",{label:"Pay Frequency",type:"select","remote-source":["PayFrequency","id","name"],sort:"none"}],["deduction_group",{label:"Payroll Group",type:"select","remote-source":["DeductionGroup","id","name"],sort:"none"}],["payslipTemplate",{label:"Payslip Template",type:"select","remote-source":["PayslipTemplate","id","name"]}],["department",{label:"Department",type:"select2","remote-source":["CompanyStructure","id","title"],sort:"none"}],["date_start",{label:"Start Date",type:"date",validation:""}],["date_end",{label:"End Date",type:"date",validation:""}],["columns",{label:"Payroll Columns",type:"select2multi","remote-source":["PayrollColumn","id","name"]}],["status",{label:"Status",type:"select",source:[["Draft","Draft"],["Completed","Completed"]],sort:"none"}]]}},{key:"postRenderForm",value:function(e,t){null!=e&&void 0!==e&&void 0!==e.id&&null!=e.id&&(t.find("#pay_period").attr("disabled","disabled"),t.find("#department").attr("disabled","disabled"))}},{key:"process",value:function(e,t){modJs=modJsList.tabPayrollData,modJs.setCurrentPayroll(e),$("#Payroll").hide(),$("#PayrollData").show(),$("#PayrollDataButtons").show(),"Completed"===t?($(".completeBtnTable").hide(),$(".saveBtnTable").hide()):($(".completeBtnTable").show(),$(".saveBtnTable").show()),modJs.get([])}},{key:"getActionButtonsHtml",value:function(e,t){var n='<div style="width:130px;">_edit__process__clone__delete_</div>';return n=this.showAddNew?n.replace("_clone_",'<img class="tableActionButton" src="_BASE_images/clone.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Copy" onclick="modJs.copyRow(_id_);return false;"></img>'):n.replace("_clone_",""),n=this.showDelete?n.replace("_delete_",'<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img>'):n.replace("_delete_",""),n=(n=(n=(n=(n=this.showEdit?n.replace("_edit_",'<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>'):n.replace("_edit_","")).replace("_process_",'<img class="tableActionButton" src="_BASE_images/run.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Process" onclick="modJs.process(_id_,\'_status_\');return false;"></img>')).replace(/_id_/g,e)).replace(/_status_/g,t[6])).replace(/_BASE_/g,this.baseUrl)}},{key:"get",value:function(e){$("#PayrollData").hide(),$("#PayrollForm").hide(),$("#PayrollDataButtons").hide(),$("#Payroll").show(),modJsList.tabPayrollData.setCurrentPayroll(null),u(m(n.prototype),"get",this).call(this,e)}},{key:"getHelpLink",value:function(){return"https://icehrm.gitbook.io/icehrm/payroll-and-expenses/payroll-management"}}]),n}(r.default),b=function(e){d(n,e);var t=h(n);function n(e,r,i,o){var a;return l(this,n),(a=t.call(this,e,r,i,o)).cellDataUpdates={},a.payrollId=null,a}return c(n,[{key:"validateCellValue",value:function(e,t,n){return modJs.addCellDataUpdate(e.data("colId"),e.data("rowId"),n),!0}},{key:"setCurrentPayroll",value:function(e){this.payrollId=e}},{key:"addAdditionalRequestData",value:function(e,t){return("updateData"===e||"updateAllData"===e||"getAllData"===e)&&(t.payrollId=this.payrollId),t}},{key:"modifyCSVHeader",value:function(e){return e.unshift(""),e}},{key:"getCSVData",value:function(){for(var e="",t=0;t<this.csvData.length;t++)e+=this.csvData[t].join(","),t<this.csvData.length-1&&(e+="\r\n");return e}},{key:"downloadPayroll",value:function(){var e=document.createElement("a");e.setAttribute("href","data:text/plain;charset=utf-8,".concat(encodeURIComponent(this.getCSVData()))),e.setAttribute("download","payroll_".concat(this.payrollId,".csv")),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}},{key:"getHelpLink",value:function(){return"https://icehrm.gitbook.io/icehrm/payroll-and-expenses/payroll-management"}}]),n}(i.default),w=function(e){d(n,e);var t=h(n);function n(e,r,i,o){var a;return l(this,n),(a=t.call(this,e,r,i,o)).codeMirror=v,a}return c(n,[{key:"getDataMapping",value:function(){return["id","name","colorder","calculation_hook","deduction_group","editable","enabled"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Column Order"},{sTitle:"Calculation Method"},{sTitle:"Payroll Group"},{sTitle:"Editable"},{sTitle:"Enabled"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"text",validation:""}],["calculation_hook",{label:"Predefined Calculations",type:"select2","allow-null":!0,"null-label":"None","remote-source":["CalculationHook","code","name"]}],["deduction_group",{label:"Payroll Group",type:"select2","allow-null":!0,"null-label":"Common","remote-source":["DeductionGroup","id","name"]}],["salary_components",{label:"Salary Components",type:"select2multi","remote-source":["SalaryComponent","id","name"]}],["deductions",{label:"Calculation Method",type:"select2multi","remote-source":["Deduction","id","name"]}],["add_columns",{label:"Columns to Add",type:"select2multi","remote-source":["PayrollColumn","id","name"]}],["sub_columns",{label:"Columns to Subtract",type:"select2multi","remote-source":["PayrollColumn","id","name"]}],["colorder",{label:"Column Order",type:"text",validation:"number"}],["editable",{label:"Editable",type:"select",source:[["Yes","Yes"],["No","No"]]}],["enabled",{label:"Enabled",type:"select",source:[["Yes","Yes"],["No","No"]]}],["default_value",{label:"Default Value",type:"text",validation:""}],["calculation_columns",{label:"Calculation Columns",type:"datagroup",form:[["name",{label:"Name",type:"text",validation:""}],["column",{label:"Column",type:"select2","remote-source":["PayrollColumn","id","name"]}]],html:'<div id="#_id_#" class="panel panel-default">#_delete_##_edit_#<div class="panel-body">#_renderFunction_#</div></div>',validation:"none",render:function(e){return"Variable:".concat(e.name)}}],["function_type",{label:"Function Type",type:"select",source:[["Advanced","Advanced"],["Simple","Simple"]]}],["calculation_function",{label:"Function",type:"code",validation:"none"}]]}},{key:"getFilters",value:function(){return[["deduction_group",{label:"Payroll Group",type:"select2","allow-null":!1,"remote-source":["DeductionGroup","id","name"]}]]}},{key:"getHelpLink",value:function(){return"https://icehrm.gitbook.io/icehrm/payroll-and-expenses/payroll-management"}}]),n}(r.default),k=function(e){d(n,e);var t=h(n);function n(){return l(this,n),t.apply(this,arguments)}return c(n,[{key:"getDataMapping",value:function(){return["id","name"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!0},{sTitle:"Name"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"text",validation:""}],["columns",{label:"Payroll Columns",type:"select2multi","remote-source":["PayrollColumn","id","name"]}]]}}]),n}(r.default),x=function(e){d(n,e);var t=h(n);function n(){return l(this,n),t.apply(this,arguments)}return c(n,[{key:"getDataMapping",value:function(){return["id","employee","pay_frequency","deduction_group","currency"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Pay Frequency"},{sTitle:"Payroll Group"},{sTitle:"Currency"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"select2","remote-source":["Employee","id","first_name+last_name"]}],["pay_frequency",{label:"Pay Frequency",type:"select2","remote-source":["PayFrequency","id","name"]}],["currency",{label:"Currency",type:"select2","remote-source":["CurrencyType","id","code"]}],["deduction_group",{label:"Payroll Group",type:"select2","allow-null":!0,"null-label":"None","remote-source":["DeductionGroup","id","name"]}],["deduction_exemptions",{label:"Calculation Exemptions",type:"select2multi","remote-source":["Deduction","id","name"],validation:"none"}],["deduction_allowed",{label:"Calculations Assigned",type:"select2multi","remote-source":["Deduction","id","name"],validation:"none"}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2","remote-source":["Employee","id","first_name+last_name"]}]]}}]),n}(r.default),C=function(e){d(n,e);var t=h(n);function n(){return l(this,n),t.apply(this,arguments)}return c(n,[{key:"getDataMapping",value:function(){return["id","name","deduction_group"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Payroll Group"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"text",validation:""}],["componentType",{label:"Salary Component Type",type:"select2multi","allow-null":!0,"remote-source":["SalaryComponentType","id","name"]}],["component",{label:"Salary Component",type:"select2multi","allow-null":!0,"remote-source":["SalaryComponent","id","name"]}],["payrollColumn",{label:"Payroll Report Column",type:"select2","allow-null":!0,"remote-source":["PayrollColumn","id","name"]}],["rangeAmounts",{label:"Calculation Process",type:"datagroup",form:[["lowerCondition",{label:"Lower Limit Condition",type:"select",source:[["No Lower Limit","No Lower Limit"],["gt","Greater than"],["gte","Greater than or Equal"]]}],["lowerLimit",{label:"Lower Limit",type:"text",validation:"float"}],["upperCondition",{label:"Upper Limit Condition",type:"select",source:[["No Upper Limit","No Upper Limit"],["lt","Less than"],["lte","Less than or Equal"]]}],["upperLimit",{label:"Upper Limit",type:"text",validation:"float"}],["amount",{label:"Value",type:"text",validation:""}]],html:'<div id="#_id_#" class="panel panel-default">#_delete_##_edit_#<div class="panel-body">#_renderFunction_#</div></div>',validation:"none","custom-validate-function":function(e){var t={valid:!0};return"No Lower Limit"===e.lowerCondition&&(e.lowerLimit=0),"No Upper Limit"===e.upperCondition&&(e.upperLimit=0),t.params=e,t},render:function(e){var t="",n=function(e){var t={gt:">",gte:">=",lt:"<",lte:"<="};return t[e]};return"No Lower Limit"!==e.lowerCondition&&(t+="".concat(e.lowerLimit," ").concat(n(e.lowerCondition)," ")),"No Upper Limit"!==e.upperCondition&&(t+=" and ",t+="".concat(n(e.upperCondition)," ").concat(e.upperLimit," ")),""===t?"Deduction is ".concat(e.amount," for all ranges"):"If salary component ".concat(t," deduction is ").concat(e.amount)}}],["deduction_group",{label:"Payroll Group",type:"select2","allow-null":!1,"remote-source":["DeductionGroup","id","name"]}]]}}]),n}(r.default),S=function(e){d(n,e);var t=h(n);function n(){return l(this,n),t.apply(this,arguments)}return c(n,[{key:"getDataMapping",value:function(){return["id","name","description"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Details"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"text",validation:""}],["description",{label:"Details",type:"textarea",validation:"none"}]]}},{key:"getActionButtonsHtml",value:function(e){var t='<div style="width:150px;"><img class="tableActionButton" src="_BASE_images/edit.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deletePayrollGroup(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/clone.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Duplicate" onclick="modJs.copyRow(_id_);return false;"></img></div>';return t=(t=t.replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}},{key:"deletePayrollGroup",value:function(e){if(confirm("Are you sure you want to delete this payroll group? Deleting the payroll group will delete all the Payroll columns and Saved calculations attached to this Payroll Group")){var t={};t.id=e;var n=JSON.stringify(t),r=[];r.callBackData=[],r.callBackSuccess="deletePayrollGroupSuccessCallback",r.callBackFail="deletePayrollGroupFailCallback",this.customAction("deletePayrollGroup","admin=payroll",n,r)}}},{key:"deletePayrollGroupSuccessCallback",value:function(e){this.showMessage("Success","Payroll Group Deleted "),this.get([])}},{key:"deletePayrollGroupFailCallback",value:function(e){this.showMessage("Error occured while deleting Payroll Group",e)}}]),n}(r.default),T=function(e){d(n,e);var t=h(n);function n(){return l(this,n),t.apply(this,arguments)}return c(n,[{key:"getDataMapping",value:function(){return["id","name"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"text",validation:""}],["data",{label:"Payslip Fields",type:"datagroup",form:[["type",{label:"Type",type:"select",sort:"none",source:[["Payroll Column","Payroll Column"],["Text","Text"],["Company Name","Company Name"],["Company Logo","Company Logo"],["Separators","Separators"]]}],["payrollColumn",{label:"Payroll Column",type:"select2",sort:"none","allow-null":!0,"null-label":"None","remote-source":["PayrollColumn","id","name"]}],["label",{label:"Label",type:"text",validation:"none"}],["text",{label:"Text",type:"textarea",validation:"none"}],["status",{label:"Status",type:"select",sort:"none",source:[["Show","Show"],["Hide","Hide"]]}]],html:'<div id="#_id_#" class="panel panel-default">#_delete_##_edit_#<div class="panel-body">#_type_# #_label_# <br/> #_text_#</div></div>',validation:"none","custom-validate-function":function(e){var t={valid:!0};return"Payroll Column"===e.type?"NULL"===e.payrollColumn&&(t.valid=!1,t.message="Please select payroll column"):e.payrollColumn="NULL","Text"===e.type&&""===e.text&&(t.valid=!1,t.message="Text can not be empty"),t.params=e,t}}]]}}]),n}(r.default);t.exports={PaydayAdapter:g,PayrollAdapter:y,PayrollDataAdapter:b,PayrollColumnAdapter:w,PayrollColumnTemplateAdapter:k,PayrollEmployeeAdapter:x,DeductionAdapter:C,DeductionGroupAdapter:S,PayslipTemplateAdapter:T}},{"../../../api/AdapterBase":4,"../../../api/TableEditAdapter":7,codemirror:10,"codemirror/addon/display/autorefresh":8,"codemirror/addon/edit/closebrackets":9,"codemirror/mode/javascript/javascript":11}],3:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"getKey",value:function(e,t){var n="".concat(e,"|");for(var r in t)n+="".concat(r,"=").concat(t[r],"|");return n}},{key:"invalidateTable",value:function(e){for(var t,n=0;n<localStorage.length;n++)(t=localStorage.key(n)).indexOf("t=".concat(e))>0&&localStorage.removeItem(t)}},{key:"getData",value:function(e){var t;if("undefined"==typeof Storage)return null;var n=localStorage.getItem(e);return void 0!==n&&null!=n&&""!==n?void 0===(t=JSON.parse(n))||null==t||void 0!==t.status&&null!=t.status&&"SUCCESS"!==t.status?null:t:null}},{key:"setData",value:function(e,t){if("undefined"==typeof Storage)return null;if(void 0!==t.status&&null!=t.status&&"SUCCESS"!==t.status)return null;var n=JSON.stringify(t);return localStorage.setItem(e,n),n}}])&&r(t.prototype,n),i&&r(t,i),e}();n.default=i},{}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./ModuleBase")),i=o(e("../api-common/RequestCache"));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(a,e);var t,n,r,o=c(a);function a(e,t,n,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(i=o.call(this)).moduleRelativeURL=null,i.tableData=[],i.sourceData=[],i.filter=null,i.origFilter=null,i.orderBy=null,i.currentElement=null,i.initAdapter(e,t,n,r),i}return t=a,(n=[{key:"initAdapter",value:function(e,t,n,r){this.moduleRelativeURL=baseUrl,this.table=e,this.tab=null==t?e:t,this.filter=null==n?null:n,this.origFilter=this.filter,this.orderBy=null==r?null:r,this.trackEvent("initAdapter",t),this.requestCache=new i.default}},{key:"setFilter",value:function(e){this.filter=e}},{key:"preSetFilterExternal",value:function(e){this.initialFilter=e}},{key:"setFilterExternal",value:function(e){var t=e;null==t&&(t=this.initialFilter),null!=t&&(this.setFilter(t),this.filtersAlreadySet=!0,$("#".concat(this.getTableName(),"_resetFilters")).show(),this.currentFilterString=this.getFilterString(t))}},{key:"getFilter",value:function(){return this.filter}},{key:"setOrderBy",value:function(e){this.orderBy=e}},{key:"getOrderBy",value:function(){return this.orderBy}},{key:"add",value:function(e,t,n,r){var i=this;null==n&&(n=!0),$(e).attr("a","add"),$(e).attr("t",this.table),i.showLoader(),this.requestCache.invalidateTable(this.table),$.post(this.moduleRelativeURL,e,(function(e){"SUCCESS"===e.status?i.addSuccessCallBack(t,e.object,n,r,i):i.addFailCallBack(t,e.object)}),"json").always((function(){i.hideLoader()})),this.trackEvent("add",this.tab,this.table)}},{key:"addSuccessCallBack",value:function(e,t,n,r,i){n&&this.get(e),this.initFieldMasterData(),null!=r&&r.apply(i,[t]),this.trackEvent("addSuccess",this.tab,this.table)}},{key:"addFailCallBack",value:function(e,t){try{this.closePlainMessage()}catch(e){}this.showMessage("Error saving",t),this.trackEvent("addFailed",this.tab,this.table)}},{key:"deleteObj",value:function(e,t){var n=this;n.showLoader(),this.requestCache.invalidateTable(this.table),$.post(this.moduleRelativeURL,{t:this.table,a:"delete",id:e},(function(e){"SUCCESS"===e.status?n.deleteSuccessCallBack(t,e.object):n.deleteFailCallBack(t,e.object)}),"json").always((function(){n.hideLoader()})),this.trackEvent("delete",this.tab,this.table)}},{key:"deleteSuccessCallBack",value:function(e,t){this.get(e),this.clearDeleteParams()}},{key:"deleteFailCallBack",value:function(e,t){this.clearDeleteParams(),this.showMessage("Error Occurred while Deleting Item",t)}},{key:"get",value:function(e){var t=this;if(this.getRemoteTable())return this.createTableServer(this.getTableName()),$("#".concat(this.getTableName(),"Form")).hide(),void $("#".concat(this.getTableName())).show();var n=JSON.stringify(this.getSourceMapping()),r="";null!==this.getFilter()&&(r=JSON.stringify(this.getFilter()));var i="";null!==this.getOrderBy()&&(i=this.getOrderBy()),n=this.fixJSON(n),r=this.fixJSON(r),t.showLoader(),$.post(this.moduleRelativeURL,{t:this.table,a:"get",sm:n,ft:r,ob:i},(function(n){"SUCCESS"===n.status?t.getSuccessCallBack(e,n.object):t.getFailCallBack(e,n.object)}),"json").always((function(){t.hideLoader()})),t.initFieldMasterData(),this.trackEvent("get",this.tab,this.table)}},{key:"getDataUrl",value:function(e){var t=JSON.stringify(this.getSourceMapping()),n=JSON.stringify(e),r="";null!==this.getFilter()&&(r=JSON.stringify(this.getFilter()));var i="";null!==this.getOrderBy()&&(i=this.getOrderBy());var o=this.moduleRelativeURL.replace("service.php","data.php");return o="".concat(o,"?t=").concat(this.table),o="".concat(o,"&sm=").concat(this.fixJSON(t)),o="".concat(o,"&cl=").concat(this.fixJSON(n)),o="".concat(o,"&ft=").concat(this.fixJSON(r)),o="".concat(o,"&ob=").concat(i),this.isSubProfileTable()&&(o="".concat(o,"&type=sub")),this.remoteTableSkipProfileRestriction()&&(o="".concat(o,"&skip=1")),o}},{key:"isSubProfileTable",value:function(){return!1}},{key:"remoteTableSkipProfileRestriction",value:function(){return!1}},{key:"preProcessTableData",value:function(e){return e}},{key:"getSuccessCallBack",value:function(e,t){for(var n=[],r=this.getDataMapping(),i=0;i<t.length;i++){for(var o=[],a=0;a<r.length;a++)o[a]=t[i][r[a]];n.push(this.preProcessTableData(o))}this.sourceData=t,void 0!==e.callBack&&null!==e.callBack&&(void 0!==e.callBackData&&null!==e.callBackData||(e.callBackData=[]),e.callBackData.push(t),e.callBackData.push(n),this.callFunction(e.callBack,e.callBackData)),this.tableData=n,void 0!==e.noRender&&null!==e.noRender&&!0===e.noRender||(this.createTable(this.getTableName()),$("#".concat(this.getTableName(),"Form")).hide(),$("#".concat(this.getTableName())).show())}},{key:"getFailCallBack",value:function(e,t){}},{key:"getElement",value:function(e,t,n){var r=this,i=JSON.stringify(this.getSourceMapping());i=this.fixJSON(i),r.showLoader(),$.post(this.moduleRelativeURL,{t:this.table,a:"getElement",id:e,sm:i},(function(e){"SUCCESS"===e.status?(n&&delete e.object.id,this.currentElement=e.object,r.getElementSuccessCallBack.apply(r,[t,e.object])):r.getElementFailCallBack.apply(r,[t,e.object])}),"json").always((function(){r.hideLoader()})),this.trackEvent("getElement",this.tab,this.table)}},{key:"getElementSuccessCallBack",value:function(e,t){void 0!==e.callBack&&null!==e.callBack&&(void 0!==e.callBackData&&null!==e.callBackData||(e.callBackData=[]),e.callBackData.push(t),this.callFunction(e.callBack,e.callBackData,this)),this.currentElement=t,void 0!==e.noRender&&null!==e.noRender&&!0===e.noRender||this.renderForm(t)}},{key:"getElementFailCallBack",value:function(e,t){}},{key:"getTableData",value:function(){return this.tableData}},{key:"getTableName",value:function(){return this.tab}},{key:"getFieldValues",value:function(e,t){var n=this,r="",i="";void 0!==e[3]&&null!==e[3]&&(r=e[3]),void 0!==e[4]&&null!==e[4]&&(i=JSON.stringify(e[4]));var o=this.requestCache.getKey(this.moduleRelativeURL,{t:e[0],key:e[1],value:e[2],method:r,methodParams:i,a:"getFieldValues"}),a=this.requestCache.getData(o);null!=a&&"SUCCESS"===a.status&&(t.callBackData.push(a.data),null!==t.callBackSuccess&&void 0!==t.callBackSuccess&&t.callBackData.push(t.callBackSuccess),n.callFunction(t.callBack,t.callBackData));var l=function e(r){if("SUCCESS"===r.status){n.requestCache.setData(this.success.key,r);var i=t;i.callBackData=[t.callBackData[0]],i.callBackData.push(r.data),null!==i.callBackSuccess&&void 0!==i.callBackSuccess&&i.callBackData.push(t.callBackSuccess),n.callFunction(i.callBack,i.callBackData)}else"Access violation"===r.message&&alert("Error : ".concat(e.table," ").concat(r.message))};l.key=o,l.table=e[0],$.post(this.moduleRelativeURL,{t:e[0],key:e[1],value:e[2],method:r,methodParams:i,a:"getFieldValues"},l,"json")}},{key:"setAdminProfile",value:function(e){try{localStorage.clear()}catch(e){}$.post(this.moduleRelativeURL,{a:"setAdminEmp",empid:e},(function(){top.location.href=clientUrl}),"json")}},{key:"customAction",value:function(e,t,n,r,i){var o=this;n=this.fixJSON(n),i?$.post(this.moduleRelativeURL,{t:this.table,a:"ca",sa:e,mod:t,req:n},(function(e){"SUCCESS"===e.status?(r.callBackData.push(e.data),o.callFunction(r.callBackSuccess,r.callBackData)):(r.callBackData.push(e.data),o.callFunction(r.callBackFail,r.callBackData))}),"json"):$.getJSON(this.moduleRelativeURL,{t:this.table,a:"ca",sa:e,mod:t,req:n},(function(e){"SUCCESS"===e.status?(r.callBackData.push(e.data),o.callFunction(r.callBackSuccess,r.callBackData)):(r.callBackData.push(e.data),o.callFunction(r.callBackFail,r.callBackData))}))}},{key:"sendCustomRequest",value:function(e,t,n,r){t.a=e,$.post(this.moduleRelativeURL,t,(function(e){"SUCCESS"===e.status?n(e.data):r(e.data)}),"json")}},{key:"getCustomActionUrl",value:function(e,t){t.a=e;var n="";for(var r in t)t.hasOwnProperty(r)&&(""!==n&&(n+="&"),n+="".concat(r,"=").concat(t[r]));return"".concat(this.moduleRelativeURL,"?").concat(n)}},{key:"getClientDataUrl",value:function(){return"".concat(this.moduleRelativeURL.replace("service.php",""),"data/")}},{key:"getCustomUrl",value:function(e){return this.moduleRelativeURL.replace("service.php",e)}}])&&l(t.prototype,n),r&&l(t,r),a}(r.default);n.default=f},{"../api-common/RequestCache":3,"./ModuleBase":6}],5:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i={float:function(e){return!(null==e||!e.match(/^[-+]?[0-9]+(\.[0-9]+)?$/))},number:function(e){return!(null==e||!e.match(/^[0-9]+$/))},numberOrEmpty:function(e){if(""===e)return!0;return!(null==e||!e.match(/^[0-9]+$/))},email:function(e){return null!=e&&/^\s*[\w\-+_]+(\.[\w\-+_]+)*@[\w\-+_]+\.[\w\-+_]+(\.[\w\-+_]+)*\s*$/.test(e)},emailOrEmpty:function(e){if(""===e)return!0;return null!=e&&/^\s*[\w\-+_]+(\.[\w\-+_]+)*@[\w\-+_]+\.[\w\-+_]+(\.[\w\-+_]+)*\s*$/.test(e)},username:function(e){return null!=e&&/^[a-zA-Z0-9.-]+$/.test(e)},input:function(e){return null!=e&&e.length>0}},o=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tempOptions={},this.formId=t,this.formError=!1,this.formObject=null,this.errorMessages="",this.popupDialog=null,this.validateAll=n,this.errorMap=[],this.settings={thirdPartyPopup:null,LabelErrorClass:!1,ShowPopup:!0},this.settings=jQuery.extend(this.settings,r),this.inputTypes=["text","radio","checkbox","file","password","select-one","select-multi","textarea","fileupload","signature"],this.validator=i}var t,n,o;return t=e,n=[{key:"clearError",value:function(e,t){var n=e.attr("id");$("#".concat(this.formId," #field_").concat(n)).removeClass("error"),$("#".concat(this.formId," #help_").concat(n)).html("")}},{key:"addError",value:function(e,t){this.formError=!0,null!=e.attr("message")?(this.errorMessages+="".concat(e.attr("message"),"\n"),this.errorMap[e.attr("name")]=e.attr("message")):this.errorMap[e.attr("name")]="";var n=e.attr("id"),r=e.attr("validation"),i=e.attr("validation");$("#".concat(this.formId," #field_").concat(n)).addClass("error"),void 0===i||null==i||""===i?$("#".concat(this.formId," #help_err_").concat(n)).html(i):void 0===r||null==r||""===r?$("#".concat(this.formId," #help_err_").concat(n)).html("Required"):"float"===r||"number"===r?$("#".concat(this.formId," #help_err_").concat(n)).html("Number required"):"email"===r?$("#".concat(this.formId," #help_err_").concat(n)).html("Email required"):$("#".concat(this.formId," #help_err_").concat(n)).html("Required")}},{key:"showErrors",value:function(){this.formError&&(void 0!==this.settings.thirdPartyPopup&&null!=this.settings.thirdPartyPopup?this.settings.thirdPartyPopup.alert():!0===this.settings.ShowPopup&&(void 0!==this.tempOptions.popupTop&&null!=this.tempOptions.popupTop?this.alert("Errors Found",this.errorMessages,this.tempOptions.popupTop):this.alert("Errors Found",this.errorMessages,-1)))}},{key:"checkValues",value:function(e){this.tempOptions=e;var t=this;this.formError=!1,this.errorMessages="",this.formObject={};var n=function(e){var n=null,r=e.attr("name");!1!==t.settings.LabelErrorClass&&$("label[for='".concat(r,"']")).removeClass(t.settings.LabelErrorClass);var i=e.attr("id"),o=e.attr("type");if(e.hasClass("select2-focusser")||e.hasClass("select2-input"))return!0;if(jQuery.inArray(o,t.inputTypes)>=0){if(e.hasClass("uploadInput"))n=e.attr("val");else if("radio"===o||"checkbox"===o)n=$("input[name='".concat(r,"']:checked")).val();else if(e.hasClass("select2Field"))n=null!=$("#".concat(t.formId," #").concat(i)).select2("data")&&void 0!==$("#".concat(t.formId," #").concat(i)).select2("data")?$("#".concat(t.formId," #").concat(i)).select2("data").id:"";else if(e.hasClass("select2Multi"))if(null!=$("#".concat(t.formId," #").concat(i)).select2("data")&&void 0!==$("#".concat(t.formId," #").concat(i)).select2("data")){var a=$("#".concat(t.formId," #").concat(i)).select2("data");n=[];for(var l=0;l<a.length;l++)n.push(a[l].id);n=JSON.stringify(n)}else n="";else n=e.hasClass("signatureField")?$("#".concat(t.formId," #").concat(i)).data("signaturePad").isEmpty()?"":$("#".concat(i)).data("signaturePad").toDataURL():e.hasClass("simplemde")?$("#".concat(t.formId," #").concat(i)).data("simplemde").value():e.hasClass("code")?$("#".concat(t.formId," #").concat(i)).data("codemirror").getValue():e.hasClass("tinymce")?tinyMCE.get(i).getContent({format:"raw"}):e.val();var s=e.attr("validation"),c=!1;void 0!==s&&null!=s&&void 0!==t.validator[s]&&null!=t.validator[s]?c=t.validator[s](n):(c=!t.validateAll||void 0!==s&&null!=s&&"none"===s||t.validator.input(n),t.formObject[i]=n),c?(t.clearError(e,null),t.formObject[i]=n):t.addError(e,null)}},r=$("#".concat(this.formId," :input"));return r.each((function(){n($(this))})),(r=$("#".concat(this.formId," .uploadInput"))).each((function(){n($(this))})),this.showErrors(),this.tempOptions={},!this.formError}},{key:"getFormParameters",value:function(){return this.formObject}},{key:"alert",value:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){alert(t)}))}],o=[{key:"getValidationRules",value:function(){return i}}],n&&r(t.prototype,n),o&&r(t,o),e}();n.default=o},{}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=(r=e("./FormValidation"))&&r.__esModule?r:{default:r};function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.deleteParams={},this.createRemoteTable=!1,this.instanceId="None",this.ga=[],this.showEdit=!0,this.showDelete=!0,this.showSave=!0,this.showCancel=!0,this.showFormOnPopup=!1,this.filtersAlreadySet=!1,this.currentFilterString="",this.sorting=0,this.settings={},this.translations={},this.customFields=[],this.csrfRequired=!1,this.fieldTemplates=null,this.templates=null,this.customTemplates=null,this.emailTemplates=null,this.fieldMasterData=null,this.fieldMasterDataKeys=null,this.fieldMasterDataCallback=null,this.sourceMapping=null,this.currentId=null,this.currentElement=null,this.user=null,this.currentProfile=null,this.permissions={},this.baseUrl=null}var t,n,r;return t=e,(n=[{key:"init",value:function(e,t,n,r){}},{key:"setNoJSONRequests",value:function(e){this.noJSONRequests=e}},{key:"setPermissions",value:function(e){this.permissions=e}},{key:"sortingStarted",value:function(e){this.sorting=e}},{key:"checkPermission",value:function(e){return void 0===this.permissions[e]||null==this.permissions[e]||"Yes"===this.permissions[e]?"Yes":this.permissions[e]}},{key:"setBaseUrl",value:function(e){this.baseUrl=e}},{key:"setUser",value:function(e){this.user=e}},{key:"getUser",value:function(){return this.user}},{key:"setInstanceId",value:function(e){this.instanceId=e}},{key:"setCSRFRequired",value:function(e){this.csrfRequired=e}},{key:"scrollToTop",value:function(){$("html, body").animate({scrollTop:0},"fast")}},{key:"scrollToBottom",value:function(){$("html, body").animate({scrollTop:$(document).height()},"slow")}},{key:"scrollToElement",value:function(e){$(window).height()<=e.offset().top&&$("html, body").animate({scrollTop:e.offset().top},"slow")}},{key:"scrollToElementBottom",value:function(e){$(window).height()<=e.offset().top+e.height()&&$("html, body").animate({scrollTop:e.offset().top+e.height()},"slow")}},{key:"setTranslations",value:function(e){this.translations=e.messages[""]}},{key:"setTranslationsSubModules",value:function(e){this.translations=e}},{key:"gt",value:function(e){return void 0===this.translations[e]||null===this.translations[e]?e:this.translations[e][0]}},{key:"addToLangTerms",value:function(e){var t,n=localStorage.getItem("terms");if(void 0===n)t={};else try{t=JSON.parse(n)}catch(e){t={}}void 0===this.translations[e]&&(t[e]=e,localStorage.setItem("terms",JSON.stringify(t)))}},{key:"showActionButtons",value:function(){return!0}},{key:"trackEvent",value:function(e,t,n){try{void 0===t||null==t?this.ga.push(["_trackEvent",this.instanceId,e]):void 0===n||null==n?this.ga.push(["_trackEvent",this.instanceId,e,t]):this.ga.push(["_trackEvent",this.instanceId,e,t,n])}catch(e){}}},{key:"setCurrentProfile",value:function(e){this.currentProfile=e}},{key:"getCurrentProfile",value:function(){return this.currentProfile}},{key:"initFieldMasterData",value:function(e,t,n){var r;void 0!==this.showAddNew&&null!=this.showAddNew||(this.showAddNew=!0),this.fieldMasterData={},this.fieldMasterDataKeys={},this.fieldMasterDataCallback=t,this.fieldMasterDataCallbackData=n,this.sourceMapping={};var i=this.getFormFields(),o=this.getFilters();if(null!=o)for(var a=0;a<o.length;a++)(null==(r=this.getMetaFieldValues(o[a][0],i))||"select"!==r.type&&"select2"!==r.type&&"select2multi"!==r.type)&&i.push(o[a]);for(var l=[],s=[],c=null,u=null,d=0;d<i.length;d++)if(void 0!==(c=i[d])[1]["remote-source"]&&null!==c[1]["remote-source"]){var f="".concat(c[1]["remote-source"][0],"_").concat(c[1]["remote-source"][1],"_").concat(c[1]["remote-source"][2]);l.push(c),s.push(f)}else if(void 0!==c[1].form&&null!==c[1].form)for(var h=0;h<c[1].form.length;h++)if(void 0!==(u=c[1].form[h])[1]["remote-source"]&&null!==u[1]["remote-source"]){var p="".concat(u[1]["remote-source"][0],"_").concat(u[1]["remote-source"][1],"_").concat(u[1]["remote-source"][2]);s.indexOf(p)<0&&(l.push(u),s.push(p))}for(var m=0;m<l.length;m++){var v=l[m];if(void 0!==v[1]["remote-source"]&&null!=v[1]["remote-source"]){var g="".concat(v[1]["remote-source"][0],"_").concat(v[1]["remote-source"][1],"_").concat(v[1]["remote-source"][2]);this.fieldMasterDataKeys[g]=!1,this.sourceMapping[v[0]]=v[1]["remote-source"];var y={callBack:"initFieldMasterDataResponse"};y.callBackData=[g],null!=e&&(y.callBackSuccess=e),this.getFieldValues(v[1]["remote-source"],y)}}}},{key:"setShowFormOnPopup",value:function(e){this.showFormOnPopup=e}},{key:"setRemoteTable",value:function(e){this.createRemoteTable=e}},{key:"setSettings",value:function(e){this.settings=e}},{key:"getRemoteTable",value:function(){return this.createRemoteTable}},{key:"isAllLoaded",value:function(e){for(var t in e)if(!1===e[t])return!1;return!0}},{key:"initFieldMasterDataResponse",value:function(e,t,n,r){this.fieldMasterData[e]=t,this.fieldMasterDataKeys[e]=!0,null!=n&&n(),null!==this.fieldMasterDataCallback&&void 0!==this.fieldMasterDataCallback&&this.isAllLoaded(this.fieldMasterDataKeys)&&null!==this.fieldMasterDataCallbackData&&void 0!==this.fieldMasterDataCallbackData?this.fieldMasterDataCallback(this.fieldMasterDataCallbackData):null!==this.fieldMasterDataCallback&&void 0!==this.fieldMasterDataCallback&&this.isAllLoaded(this.fieldMasterDataKeys)&&this.fieldMasterDataCallback()}},{key:"getMetaFieldValues",value:function(e,t){for(var n=0;n<t.length;n++)if(e===t[n][0])return t[n][1];return null}},{key:"getThemeColors",value:function(){return["red","yellow","aqua","blue","light-blue","green","navy","teal","olive","orange","fuchsia","purple"]}},{key:"getColorByRandomString",value:function(e){var t=this.getThemeColors();return t[e.charCodeAt(0)%t.length]}},{key:"getColorByFileType",value:function(e){e=e.toLowerCase();var t={pdf:"red",csv:"yellow",xls:"green",xlsx:"green",doc:"light-blue",docx:"light-blue"};return t.docx="blue",t.ppt="orange",t.pptx="orange",t.jpg="teal",t.jpeg="teal",t.gif="green",t.png="yellow",t.bmp="fuchsia",void 0!==t[e]||null!=t[e]?t[e]:this.getColorByRandomString(e)}},{key:"getIconByFileType",value:function(e){var t={pdf:"fa fa-file-pdf-o",csv:"fa fa fa-file-code-o",xls:"fa fa-file-excel-o",xlsx:"fa fa-file-excel-o",doc:"fa fa-file-word-o",docx:"fa fa-file-word-o",ppt:"fa fa-file-powerpoint-o",pptx:"fa fa-file-powerpoint-o",jpg:"fa fa-file-image-o",jpeg:"fa fa-file-image-o",gif:"fa fa-file-image-o",png:"fa fa-file-image-o",bmp:"fa fa-file-image-o",txt:"fa fa-file-text-o",rtf:"fa fa-file-text-o"};return void 0!==t[e=e.toLowerCase()]||null!=t[e]?t[e]:"fa fa-file-o"}},{key:"getSourceMapping",value:function(){return this.sourceMapping}},{key:"setTesting",value:function(e){this.testing=e}},{key:"consoleLog",value:function(e){this.testing&&console.log(e)}},{key:"setClientMessages",value:function(e){this.msgList=e}},{key:"setTemplates",value:function(e){this.templates=e}},{key:"getWSProperty",value:function(e,t){return e.hasOwnProperty(t)?e[t]:null}},{key:"getClientMessage",value:function(e){return this.getWSProperty(this.msgList,e)}},{key:"getTemplate",value:function(e){return this.getWSProperty(this.templates,e)}},{key:"setGoogleAnalytics",value:function(e){this.gaq=e}},{key:"showView",value:function(e){null!=this.currentView&&(this.previousView=this.currentView,$("#".concat(this.currentView)).hide()),$("#".concat(e)).show(),this.currentView=e,this.moveToTop()}},{key:"showPreviousView",value:function(){this.showView(this.previousView)}},{key:"moveToTop",value:function(){}},{key:"callFunction",value:function(e,t,n){if($.isFunction(e))try{null==n?e.apply(document,t):e.apply(n,t)}catch(e){console.log(e.message)}else{var r=this[e];if($.isFunction(r))try{r.apply(this,t)}catch(e){console.log(e.message)}}}},{key:"getTableTopButtonHtml",value:function(){var e="";return this.getShowAddNew()&&(e='<button onclick="modJs.renderForm();return false;" class="btn btn-small btn-primary">'.concat(this.gt(this.getAddNewLabel()),' <i class="fa fa-plus"></i></button>')),null!=this.getFilters()&&(""!==e&&(e+=" "),e+='<button onclick="modJs.showFilters();return false;" class="btn btn-small btn-primary">'.concat(this.gt("Filter"),' <i class="fa fa-filter"></i></button>'),e+=" ",this.filtersAlreadySet?e+='<button id="__id___resetFilters" onclick="modJs.resetFilters();return false;" class="btn btn-small btn-default">__filterString__ <i class="fa fa-times"></i></button>':e+='<button id="__id___resetFilters" onclick="modJs.resetFilters();return false;" class="btn btn-small btn-default" style="display:none;">__filterString__ <i class="fa fa-times"></i></button>'),e=e.replace(/__id__/g,this.getTableName()),""!==(e=""!==this.currentFilterString&&null!=this.currentFilterString?e.replace(/__filterString__/g,this.currentFilterString):e.replace(/__filterString__/g,"Reset Filters"))&&(e='<div class="row"><div class="col-xs-12">'.concat(e,"</div></div>")),e}},{key:"getActionButtonHeader",value:function(){return{sTitle:"",sClass:"center"}}},{key:"getTableHTMLTemplate",value:function(){return'<div class="box-body table-responsive"><table cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped" id="grid"></table></div>'}},{key:"isSortable",value:function(){return!0}},{key:"createTable",value:function(e){if(this.getRemoteTable())this.createTableServer(e);else{var t=this.getHeaders();for(var n in t)t[n].sTitle=this.gt(t[n].sTitle);var r,i=this.getTableData();if(this.showActionButtons()&&t.push(this.getActionButtonHeader()),this.showActionButtons())for(var o=0;o<i.length;o++)i[o].push(this.getActionButtonsHtml(i[o][0],i[o]));r=this.getTableTopButtonHtml()+this.getTableHTMLTemplate();var a=$("#".concat(e," .dataTables_paginate .active a")).html(),l=0;void 0!==a&&null!=a&&(l=15*parseInt(a,10)-15),$("#".concat(e)).html(r);var s={oLanguage:{sLengthMenu:"_MENU_ records per page"},aaData:i,aoColumns:t,bSort:this.isSortable(),iDisplayLength:15,iDisplayStart:l},c=this.getCustomTableParams();$.extend(s,c),$("#".concat(e," #grid")).dataTable(s),$(".dataTables_paginate ul").addClass("pagination"),$(".dataTables_length").hide(),$(".dataTables_filter input").addClass("form-control"),$(".dataTables_filter input").attr("placeholder","Search"),$(".dataTables_filter label").contents().filter((function(){return 3===this.nodeType})).remove(),$(".tableActionButton").tooltip()}}},{key:"createTableServer",value:function(e){var t,n=this.getHeaders();for(var r in n.push({sTitle:"",sClass:"center"}),n)n[r].sTitle=this.gt(n[r].sTitle);t=this.getTableTopButtonHtml()+this.getTableHTMLTemplate();var i=$("#".concat(e," .dataTables_paginate .active a")).html(),o=0;void 0!==i&&null!=i&&(o=15*parseInt(i,10)-15),$("#".concat(e)).html(t);var a={oLanguage:{sLengthMenu:"_MENU_ records per page"},bProcessing:!0,bServerSide:!0,sAjaxSource:this.getDataUrl(this.getDataMapping()),aoColumns:n,bSort:this.isSortable(),parent:this,iDisplayLength:15,iDisplayStart:o};this.showActionButtons()&&(a.aoColumnDefs=[{fnRender:this.getActionButtons,aTargets:[this.getDataMapping().length]}]);var l=this.getCustomTableParams();$.extend(a,l),$("#".concat(e," #grid")).dataTable(a),$(".dataTables_paginate ul").addClass("pagination"),$(".dataTables_length").hide(),$(".dataTables_filter input").addClass("form-control"),$(".dataTables_filter input").attr("placeholder","Search"),$(".dataTables_filter label").contents().filter((function(){return 3===this.nodeType})).remove(),$(".tableActionButton").tooltip()}},{key:"getHeaders",value:function(){}},{key:"getDataMapping",value:function(){}},{key:"getFormFields",value:function(){}},{key:"getTableData",value:function(){}},{key:"getFilters",value:function(){return null}},{key:"edit",value:function(e){this.currentId=e,this.getElement(e,[])}},{key:"copyRow",value:function(e){this.getElement(e,[],!0)}},{key:"renderModel",value:function(e,t,n){$("#".concat(e,"ModelBody")).html(""),void 0!==n&&null!=n||(n=""),$("#".concat(e,"ModelLabel")).html(t),$("#".concat(e,"ModelBody")).html(n)}},{key:"renderYesNoModel",value:function(e,t,n,r,i,o){var a=this,l="#yesnoModel";void 0!==t&&null!=t||(t=""),$("".concat(l,"Label")).html(e),$("".concat(l,"Body")).html(t),null!=n&&$("".concat(l,"YesBtn")).html(n),null!=r&&$("".concat(l,"NoBtn")).html(r),$("".concat(l,"YesBtn")).off().on("click",(function(){void 0!==i&&null!=i&&(i.apply(a,o),a.cancelYesno())})),$(l).modal({backdrop:"static"})}},{key:"renderModelFromDom",value:function(e,t,n){$("#".concat(e,"ModelBody")).html(""),void 0!==n&&null!=n||(n=$("<div></div>")),$("#".concat(e,"ModelLabel")).html(t),$("#".concat(e,"ModelBody")).html(""),$("#".concat(e,"ModelBody")).append(n)}},{key:"deleteRow",value:function(e){this.deleteParams.id=e,this.renderModel("delete","Confirm Deletion","Are you sure you want to delete this item ?"),$("#deleteModel").modal("show")}},{key:"showMessage",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=this,a="";a=i?"#plainMessageModel":"#messageModel",$(a).off(),i?this.renderModel("plainMessage",e,t):this.renderModel("message",e,t),null!=n?($(a).modal({show:!0}),$(a).on("hidden.bs.modal",(function(){n.apply(o,r),$(".modal-backdrop").remove()}))):$(a).modal({backdrop:"static"})}},{key:"showDomElement",value:function(e,t,n,r,i){var o=this,a="";a=i?"#dataMessageModel":"#messageModel",$(a).unbind("hide"),i?this.renderModelFromDom("dataMessage",e,t):this.renderModelFromDom("message",e,t),null!=n?($(a).modal({show:!0}),$(a).on("hidden.bs.modal",(function(){n.apply(o,r),$(".modal-backdrop").remove()}))):$(a).modal({backdrop:"static"})}},{key:"confirmDelete",value:function(){void 0===this.deleteParams.id&&null==this.deleteParams.id||this.deleteObj(this.deleteParams.id,[]),$("#deleteModel").modal("hide")}},{key:"cancelDelete",value:function(){$("#deleteModel").modal("hide"),this.deleteParams.id=null}},{key:"closeMessage",value:function(){$("#messageModel").modal("hide")}},{key:"cancelYesno",value:function(){$("#yesnoModel").modal("hide")}},{key:"closePlainMessage",value:function(){$("#plainMessageModel").modal("hide"),$("#dataMessageModel").modal("hide")}},{key:"closeDataMessage",value:function(){$("#dataMessageModel").modal("hide")}},{key:"save",value:function(e,t){var n=new i.default("".concat(this.getTableName(),"_submit"),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(n.checkValues()){var r=n.getFormParameters();r=this.forceInjectValuesBeforeSave(r);var o=this.doCustomValidation(r);if(null==o){this.csrfRequired&&(r.csrf=$("#".concat(this.getTableName(),"Form")).data("csrf"));var a=$("#".concat(this.getTableName(),"_submit #id")).val();null!=a&&void 0!==a&&""!==a&&(r.id=a),r=this.makeEmptyDateFieldsNull(r),this.add(r,[],e,t)}else $("#".concat(this.getTableName(),"Form .label")).html(o),$("#".concat(this.getTableName(),"Form .label")).show(),this.scrollToTop()}}},{key:"makeEmptyDateFieldsNull",value:function(e){return this.getFormFields().forEach((function(t){"date"!==t[1].type&&"datetime"!==t[1].type||""!==e[t[0]]&&"0000-00-00"!==e[t[0]]&&"0000-00-00 00:00:00"!==e[t[0]]||("none"===t[1].validation?e[t[0]]="NULL":delete e[t[0]])})),e}},{key:"validatePassword",value:function(e){return e.length<8?this.gt("Password too short"):e.length>20?this.gt("Password too long"):e.match(/.*[0-9]+.*$/)?e.match(/.*[a-z]+.*$/)?e.match(/.*[A-Z]+.*$/)?e.match(/.*[\W]+.*$/)?null:this.gt("Password must include at least one symbol"):this.gt("Password must include at least one uppercase letter"):this.gt("Password must include at least one lowercase letter"):this.gt("Password must include at least one number")}},{key:"forceInjectValuesBeforeSave",value:function(e){return e}},{key:"doCustomValidation",value:function(e){return null}},{key:"filterQuery",value:function(){var e=new i.default("".concat(this.getTableName(),"_filter"),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(e.checkValues()){var t=e.getFormParameters();if(this.doCustomFilterValidation(t)){for(var n in t)t.hasOwnProperty(n)&&"NULL"===t[n]&&delete t[n];this.setFilter(t),this.filtersAlreadySet=!0,$("#".concat(this.getTableName(),"_resetFilters")).show(),this.currentFilterString=this.getFilterString(t),this.get([]),this.closePlainMessage()}}}},{key:"getFilterString",value:function(e){var t,n,r,i,o,a,l="",s=this.getFilters();for(var c in null==r&&(r=[]),e)if(e.hasOwnProperty(c)){if(o="",a=null,"select"===(r=this.getMetaFieldValues(c,s)).type||"select2"===r.type){if(void 0!==r["remote-source"]&&null!=r["remote-source"])t=r["remote-source"],"NULL"===e[c]?o=void 0!==r["null-label"]&&null!=r["null-label"]?r["null-label"]:"Not Selected":a=o=this.fieldMasterData["".concat(t[0],"_").concat(t[1],"_").concat(t[2])][e[c]];else if(n=r.source[0],"NULL"===e[c])o=void 0!==r["null-label"]&&null!=r["null-label"]?r["null-label"]:"Not Selected";else for(var u=0;u<n.length;u++)if(e[c]===r.source[u][0]){a=o=r.source[u][1];break}}else if("select2multi"===r.type){i=[];try{i=JSON.parse(e[c])}catch(e){}""!==(o=i.join(","))&&(a=o)}else""!==(o=e[c])&&(a=o);null!=a&&(""!==l&&(l+=" | "),l+="".concat(r.label," = ").concat(o))}return l}},{key:"doCustomFilterValidation",value:function(e){return!0}},{key:"resetFilters",value:function(){this.filter=this.origFilter,this.filtersAlreadySet=!1,$("#".concat(this.getTableName(),"_resetFilters")).hide(),this.currentFilterString="",this.get([])}},{key:"showFilters",value:function(e){for(var t=this.templates.filterTemplate,n="",r=this.getFilters(),i=0;i<r.length;i++){var o=this.getMetaFieldForRendering(r[i][0]);if(""===o||void 0===o)n+=this.renderFormField(r[i]);else{var a=e[o];""!==a&&null!=a&&void 0!==a&&""!==a.trim()?n+=this.renderFormField(JSON.parse(a)):n+=this.renderFormField(r[i])}}t=(t=t.replace(/_id_/g,"".concat(this.getTableName(),"_filter"))).replace(/_fields_/g,n);var l=this.generateRandom(14),s=$('<div class="reviewBlock popupForm" data-content="Form"></div>');s.attr("id",l),s.html(t),s.find(".datefield").datepicker({viewMode:2}),s.find(".timefield").datetimepicker({language:"en",pickDate:!1}),s.find(".datetimefield").datetimepicker({language:"en"}),s.find(".colorpick").colorpicker(),tinymce.init({selector:"#".concat(s.attr("id")," .tinymce"),height:"400"}),s.find(".simplemde").each((function(){var e=new SimpleMDE({element:$(this)[0]});$(this).data("simplemde",e)})),s.find(".select2Field").each((function(){$(this).select2().select2("val",$(this).find("option:eq(0)").val())})),s.find(".select2Multi").each((function(){$(this).select2().on("change",(function(e){var t=$(this).parents(".row"),n=t.find(".select2-choices").height();t.height(parseInt(n,10))}))})),this.showDomElement("Edit",s,null,null,!0),$(".filterBtn").off(),$(".filterBtn").on("click",(function(e){e.preventDefault(),e.stopPropagation();try{modJs.filterQuery()}catch(e){}return!1})),void 0!==this.filter&&null!=this.filter&&""!==this.filter&&this.fillForm(this.filter,"#".concat(this.getTableName(),"_filter"),this.getFilters())}},{key:"preRenderForm",value:function(e){}},{key:"renderForm",value:function(e){var t=[];null!=e&&void 0!==e||(this.currentId=null),this.preRenderForm(e);for(var n,r=this.templates.formTemplate,i="",o=this.getFormFields(),a=0;a<o.length;a++){var l=this.getMetaFieldForRendering(o[a][0]);if(""===l||void 0===l)i+=this.renderFormField(o[a]);else{var s=e[l];""!==s&&null!=s&&void 0!==s&&""!==s.trim()?i+=this.renderFormField(JSON.parse(s)):i+=this.renderFormField(o[a])}}r=(r=r.replace(/_id_/g,"".concat(this.getTableName(),"_submit"))).replace(/_fields_/g,i);var c=this.generateRandom(14);this.showFormOnPopup?(n=$('<div class="reviewBlock popupForm" data-content="Form"></div>')).attr("id",c):n=$("#".concat(this.getTableName(),"Form")),n.html(r),n.find(".datefield").datepicker({viewMode:2}),n.find(".timefield").datetimepicker({language:"en",pickDate:!1}),n.find(".datetimefield").datetimepicker({language:"en"}),n.find(".colorpick").colorpicker(),tinymce.init({selector:"#".concat(n.attr("id")," .tinymce"),height:"400"}),n.find(".simplemde").each((function(){var e=new SimpleMDE({element:$(this)[0]});$(this).data("simplemde",e)}));var u=this.codeMirror;u&&n.find(".code").each((function(){var e=u.fromTextArea($(this)[0],{lineNumbers:!1,matchBrackets:!0,continueComments:"Enter",extraKeys:{"Ctrl-Q":"toggleComment"}});$(this).data("codemirror",e)})),n.find(".select2Field").each((function(){$(this).select2().select2("val",$(this).find("option:eq(0)").val())})),n.find(".select2Multi").each((function(){$(this).select2().on("change",(function(e){var t=$(this).parents(".row"),n=t.find(".select2-choices").height();t.height(parseInt(n,10))}))})),n.find(".signatureField").each((function(){t.push($(this).attr("id"))}));for(var d=0;d<o.length;d++)"datagroup"===o[d][1].type&&n.find("#".concat(o[d][0])).data("field",o[d]);if(!1===this.showSave?n.find(".saveBtn").remove():(n.find(".saveBtn").off(),n.find(".saveBtn").data("modJs",this),n.find(".saveBtn").on("click",(function(){return null!=$(this).data("modJs").saveSuccessItemCallback&&void 0!==$(this).data("modJs").saveSuccessItemCallback?$(this).data("modJs").save($(this).data("modJs").retriveItemsAfterSave(),$(this).data("modJs").saveSuccessItemCallback):$(this).data("modJs").save(),!1}))),!1===this.showCancel?n.find(".cancelBtn").remove():(n.find(".cancelBtn").off(),n.find(".cancelBtn").data("modJs",this),n.find(".cancelBtn").on("click",(function(){return $(this).data("modJs").cancel(),!1}))),n.find("[mask]").each((function(){$(this).inputmask($(this).attr("mask"))})),n.find("[datemask]").each((function(){$(this).inputmask({mask:"y-1-2",placeholder:"YYYY-MM-DD",leapday:"-02-29",separator:"-",alias:"yyyy/mm/dd"})})),n.find("[datetimemask]").each((function(){$(this).inputmask("datetime",{mask:"y-2-1 h:s:00",placeholder:"YYYY-MM-DD hh:mm:ss",leapday:"-02-29",separator:"-",alias:"yyyy/mm/dd"})})),this.showFormOnPopup){this.showMessage("Edit","",null,null,!0),$("#plainMessageModel .modal-body").html(""),$("#plainMessageModel .modal-body").append(n);for(var f=0;f<t.length;f++)$("#".concat(t[f])).data("signaturePad",new SignaturePad(document.getElementById(t[f])));void 0!==e&&null!=e?this.fillForm(e,"#".concat(c)):this.setDefaultValues("#".concat(c))}else{$("#".concat(this.getTableName(),"Form")).show(),$("#".concat(this.getTableName())).hide();for(var h=0;h<t.length;h++)$("#".concat(t[h])).data("signaturePad",new SignaturePad(document.getElementById(t[h])));void 0!==e&&null!=e?this.fillForm(e):this.setDefaultValues(),this.scrollToTop()}this.postRenderForm(e,n)}},{key:"setDefaultValues",value:function(e,t){null!=t&&void 0!==t||(t=this.getFormFields()),null!=e&&void 0!==e&&""!==e||(e="#".concat(this.getTableName(),"Form"));for(var n=0;n<t.length;n++)"text"!==t[n][1].type&&"textarea"!==t[n][1].type||void 0!==t[n][1].default&&null!==t[n][1].default&&$("".concat(e," #").concat(t[n][0])).val(t[n][1].default)}},{key:"retriveItemsAfterSave",value:function(){return!0}},{key:"postRenderForm",value:function(e,t){}},{key:"dataGroupToHtml",value:function(e,t){var n,r,i,o,a=JSON.parse(e),l=t[1].html;null!=a&&void 0!==a&&void 0!==t[1]["sort-function"]&&null!=t[1]["sort-function"]&&a.sort(t[1]["sort-function"]);for(var s=$('<div id="'.concat(t[0],'_div_inner"></div>')),c=0;c<a.length;c++){for(var u in r=a[c],void 0!==t[1]["pre-format-function"]&&null!=t[1]["pre-format-function"]&&(r=t[1]["pre-format-function"].apply(this,[r])),n=(n=(n=(n=l).replace("#_delete_#",'<a id="#_id_#_delete" onclick="modJs.deleteDataGroupItem(\'#_id_#\');return false;" type="button" style="float:right;margin-right:3px;" tooltip="Delete"><li class="fa fa-times"></li></a>')).replace("#_edit_#",'<a id="#_id_#_edit" onclick="modJs.editDataGroupItem(\'#_id_#\');return false;" type="button" style="float:right;margin-right:5px;" tooltip="Edit"><li class="fa fa-edit"></li></a>')).replace(/#_id_#/g,r.id),r)void 0!==(o=r[u])&&null!=o&&"string"==typeof o&&(o=o.replace(/(?:\r\n|\r|\n)/g,"<br />")),n=n.replace("#_".concat(u,"_#"),o);void 0!==t[1].render&&null!=t[1].render&&(n=n.replace("#_renderFunction_#",t[1].render(r))),(i=$(n)).attr("fieldId","".concat(t[0],"_div")),s.append(i)}return s}},{key:"resetDataGroup",value:function(e){$("#".concat(e[0])).val(""),$("#".concat(e[0],"_div")).html("")}},{key:"showDataGroup",value:function(e,t){var n=this.templates.datagroupTemplate,r="",i=e[1].form;void 0!==t&&null!=t&&void 0!==t.id?this.currentDataGroupItemId=t.id:this.currentDataGroupItemId=null;for(var o=0;o<i.length;o++)r+=this.renderFormField(i[o]);n=(n=n.replace(/_id_/g,"".concat(this.getTableName(),"_field_").concat(e[0]))).replace(/_fields_/g,r);var a=this.generateRandom(14),l=$('<div class="reviewBlock popupForm" data-content="Form"></div>');l.attr("id",a),l.html(n),l.find(".datefield").datepicker({viewMode:2}),l.find(".timefield").datetimepicker({language:"en",pickDate:!1}),l.find(".datetimefield").datetimepicker({language:"en"}),l.find(".colorpick").colorpicker(),tinymce.init({selector:"#".concat(l.attr("id")," .tinymce"),height:"400"}),l.find(".simplemde").each((function(){var e=new SimpleMDE({element:$(this)[0]});$(this).data("simplemde",e)})),l.find(".select2Field").each((function(){$(this).select2().select2("val",$(this).find("option:eq(0)").val())})),l.find(".select2Multi").each((function(){$(this).select2().on("change",(function(e){var t=$(this).parents(".row"),n=t.find(".select2-choices").height();t.height(parseInt(n,10))}))})),this.currentDataGroupField=e,this.showDomElement("Add ".concat(e[1].label),l,null,null,!0),void 0!==t&&null!=t?this.fillForm(t,"#".concat(this.getTableName(),"_field_").concat(e[0]),e[1].form):this.setDefaultValues("#".concat(this.getTableName(),"_field_").concat(e[0]),e[1].form),$(".groupAddBtn").off(),void 0!==t&&null!=t&&void 0!==t.id?$(".groupAddBtn").on("click",(function(e){e.preventDefault(),e.stopPropagation();try{modJs.editDataGroup()}catch(e){console.log("Error editing data group: ".concat(e.message))}return!1})):$(".groupAddBtn").on("click",(function(e){e.preventDefault(),e.stopPropagation();try{modJs.addDataGroup()}catch(e){console.log("Error adding data group: ".concat(e.message))}return!1}))}},{key:"addDataGroup",value:function(){var e,t=this.currentDataGroupField;$("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).html(""),$("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).hide();var n=new i.default("".concat(this.getTableName(),"_field_").concat(t[0]),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(n.checkValues()){var r=n.getFormParameters();if(void 0!==t[1]["custom-validate-function"]&&null!=t[1]["custom-validate-function"]){if(!(e=t[1]["custom-validate-function"].apply(this,[r])).valid)return $("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).html(e.message),$("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).show(),!1;r=e.params}var o=$("#".concat(t[0])).val();""===o&&(o="[]");var a=JSON.parse(o);r.id="".concat(t[0],"_").concat(this.dataGroupGetNextAutoIncrementId(a)),a.push(r),void 0!==t[1]["sort-function"]&&null!=t[1]["sort-function"]&&a.sort(t[1]["sort-function"]),o=JSON.stringify(a);var l=this.dataGroupToHtml(o,t);$("#".concat(t[0],"_div")).html(""),$("#".concat(t[0],"_div")).append(l),this.makeDataGroupSortable(t,$("#".concat(t[0],"_div_inner"))),$("#".concat(t[0])).val(o),this.orderDataGroup(t),this.closeDataMessage(),this.showMessage("Item Added","This change will be effective only when you save the form")}return!0}},{key:"nl2br",value:function(e,t){var n="";try{for(var r=e.split(" "),i=0,o=0;o<r.length;o++)(i+=r[o].length+1)>t?(n+="".concat(r[o],"<br/>"),i=0):n+="".concat(r[o]," ")}catch(e){}return n}},{key:"makeDataGroupSortable",value:function(e,t){t.data("field",e),t.data("firstSort",!0),t.sortable({create:function(){$(this).height($(this).height())},"ui-floating":!1,start:function(e,t){$("#sortable-ul-selector-id").sortable({sort:function(e,t){var n=$(e.target);if(!/html|body/i.test(n.offsetParent()[0].tagName)){var r=e.pageY-n.offsetParent().offset().top-t.helper.outerHeight(!0)/2;t.helper.css({top:"".concat(r,"px")})}}})},revert:!0,stop:function(){modJs.orderDataGroup($(this).data("field"))},axis:"y",scroll:!1,placeholder:"sortable-placeholder",cursor:"move"})}},{key:"orderDataGroup",value:function(e){var t,n=[],r=$("#".concat(e[0],"_div_inner [fieldid='").concat(e[0],"_div']")),i=$("#".concat(e[0])).val();""===i&&(i="[]");var o=JSON.parse(i);r.each((function(){for(var e in t=$(this).attr("id"),o)if(o[e].id===t){n.push(o[e]);break}})),$("#".concat(e[0])).val(JSON.stringify(n))}},{key:"editDataGroup",value:function(){var e=this.currentDataGroupField,t=this.currentDataGroupItemId,n=new i.default("".concat(this.getTableName(),"_field_").concat(e[0]),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(n.checkValues()){var r=n.getFormParameters();if(void 0!==e[1]["custom-validate-function"]&&null!=e[1]["custom-validate-function"]){var o=e[1]["custom-validate-function"].apply(this,[r]);if(!o.valid)return $("#".concat(this.getTableName(),"_field_").concat(e[0],"_error")).html(o.message),$("#".concat(this.getTableName(),"_field_").concat(e[0],"_error")).show(),!1;r=o.params}if(this.doCustomFilterValidation(r)){var a=$("#".concat(e[0])).val();""===a&&(a="[]");for(var l=JSON.parse(a),s={},c=-1,u=[],d=0;d<l.length;d++){var f=l[d];f.id===t&&(s=f,c=d),u.push(f)}r.id=s.id,u[c]=r,void 0!==e[1]["sort-function"]&&null!=e[1]["sort-function"]&&u.sort(e[1]["sort-function"]),a=JSON.stringify(u),$("#".concat(e[0])).val(a);var h=this.dataGroupToHtml(a,e);this.orderDataGroup(e),$("#".concat(e[0],"_div")).html(""),$("#".concat(e[0],"_div")).append(h),this.makeDataGroupSortable(e,$("#".concat(e[0],"_div_inner"))),this.closeDataMessage(),this.showMessage("Item Edited","This change will be effective only when you save the form")}}return!0}},{key:"editDataGroupItem",value:function(e){for(var t=e.substring(0,e.lastIndexOf("_")),n=$("#".concat(t)).val(),r=JSON.parse(n),i={},o=0;o<r.length;o++){var a=r[o];a.id===e&&(i=a)}this.showDataGroup($("#".concat(t)).data("field"),i)}},{key:"dataGroupGetNextAutoIncrementId",value:function(e){for(var t,n=1,r=0;r<e.length;r++){var i=e[r];void 0!==i.id&&null!=i.id||(i.id=1),(t=i.id.substring(i.id.lastIndexOf("_")+1,i.id.length))>=n&&(n=parseInt(t,10)+1)}return n}},{key:"deleteDataGroupItem",value:function(e){for(var t=e.substring(0,e.lastIndexOf("_")),n=$("#".concat(t)).val(),r=JSON.parse(n),i=[],o=0;o<r.length;o++){var a=r[o];a.id!==e&&i.push(a)}$("#".concat(t)).val(JSON.stringify(i)),$("#".concat(e)).remove(),this.showMessage("Item Removed","Item removed. This change will be effective only when you save the form")}},{key:"fillForm",value:function(e,t,n){var r;null!=n&&void 0!==n||(n=this.getFormFields()),null!=t&&void 0!==t&&""!==t||(t="#".concat(this.getTableName(),"Form"));for(var i=0;i<n.length;i++)if("date"===n[i][1].type)"0000-00-00"!==e[n[i][0]]&&""!==e[n[i][0]]&&null!=e[n[i][0]]&&void 0!==e[n[i][0]]&&$("".concat(t," #").concat(n[i][0],"_date")).datepicker("setValue",e[n[i][0]]);else if("colorpick"===n[i][1].type)null!=e[n[i][0]]&&void 0!==e[n[i][0]]&&($("".concat(t," #").concat(n[i][0],"_colorpick")).colorpicker("setValue",e[n[i][0]]),$("".concat(t," #").concat(n[i][0])).val(e[n[i][0]]));else if("datetime"===n[i][1].type||"time"===n[i][1].type){if("0000-00-00 00:00:00"!==e[n[i][0]]&&""!==e[n[i][0]]&&null!=e[n[i][0]]&&void 0!==e[n[i][0]]){var o=e[n[i][0]].split(" "),a=o[0].split("-"),l=o[1].split(":");$("".concat(t," #").concat(n[i][0],"_datetime")).data("datetimepicker").setLocalDate(new Date(a[0],parseInt(a[1],10)-1,a[2],l[0],l[1],l[2]))}}else if("label"===n[i][1].type)$("".concat(t," #").concat(n[i][0])).html(e[n[i][0]]);else if("placeholder"===n[i][1].type){if(void 0!==n[i][1]["remote-source"]&&null!=n[i][1]["remote-source"]){var s="".concat(n[i][1]["remote-source"][0],"_").concat(n[i][1]["remote-source"][1],"_").concat(n[i][1]["remote-source"][2]);r=this.fieldMasterData[s][e[n[i][0]]]}else r=e[n[i][0]];if(void 0===r||null==r)r="";else try{r=r.replace(/(?:\r\n|\r|\n)/g,"<br />")}catch(e){}if(void 0!==n[i][1].formatter&&n[i][1].formatter&&$.isFunction(n[i][1].formatter))try{r=n[i][1].formatter(r)}catch(e){}$("".concat(t," #").concat(n[i][0])).html(r)}else if("fileupload"===n[i][1].type)null!=e[n[i][0]]&&void 0!==e[n[i][0]]&&""!==e[n[i][0]]&&($("".concat(t," #").concat(n[i][0])).html(e[n[i][0]]),$("".concat(t," #").concat(n[i][0])).attr("val",e[n[i][0]]),$("".concat(t," #").concat(n[i][0])).show(),$("".concat(t," #").concat(n[i][0],"_download")).show(),$("".concat(t," #").concat(n[i][0],"_remove")).show()),!0===n[i][1].readonly&&$("".concat(t," #").concat(n[i][0],"_upload")).remove();else if("select"===n[i][1].type)void 0!==e[n[i][0]]&&null!=e[n[i][0]]&&""!==e[n[i][0]]||(e[n[i][0]]="NULL"),$("".concat(t," #").concat(n[i][0])).val(e[n[i][0]]);else if("select2"===n[i][1].type)void 0!==e[n[i][0]]&&null!=e[n[i][0]]&&""!==e[n[i][0]]||(e[n[i][0]]="NULL"),$("".concat(t," #").concat(n[i][0])).select2("val",e[n[i][0]]);else if("select2multi"===n[i][1].type){void 0!==e[n[i][0]]&&null!=e[n[i][0]]&&""!==e[n[i][0]]||(e[n[i][0]]="NULL");var c=[];if(void 0!==e[n[i][0]]&&null!=e[n[i][0]]&&""!==e[n[i][0]])try{c=JSON.parse(e[n[i][0]])}catch(e){}$("".concat(t," #").concat(n[i][0])).select2("val",c);var u=$("".concat(t," #").concat(n[i][0])).find(".select2-choices").height();$("".concat(t," #").concat(n[i][0])).find(".controls").css("min-height","".concat(u,"px")),$("".concat(t," #").concat(n[i][0])).css("min-height","".concat(u,"px"))}else if("datagroup"===n[i][1].type)try{var d=this.dataGroupToHtml(e[n[i][0]],n[i]);$("".concat(t," #").concat(n[i][0])).val(e[n[i][0]]),$("".concat(t," #").concat(n[i][0],"_div")).html(""),$("".concat(t," #").concat(n[i][0],"_div")).append(d),this.makeDataGroupSortable(n[i],$("".concat(t," #").concat(n[i][0],"_div_inner")))}catch(e){}else if("signature"===n[i][1].type)""===e[n[i][0]]&&void 0===e[n[i][0]]&&null==e[n[i][0]]||$("".concat(t," #").concat(n[i][0])).data("signaturePad").fromDataURL(e[n[i][0]]);else if("simplemde"===n[i][1].type)$("".concat(t," #").concat(n[i][0])).data("simplemde").value(e[n[i][0]]);else if("code"===n[i][1].type){var f=$("".concat(t," #").concat(n[i][0])).data("codemirror");f&&f.getDoc().setValue(e[n[i][0]])}else $("".concat(t," #").concat(n[i][0])).val(e[n[i][0]])}},{key:"cancel",value:function(){$("#".concat(this.getTableName(),"Form")).hide(),$("#".concat(this.getTableName())).show()}},{key:"renderFormField",value:function(e){var t=0;if(void 0===this.fieldTemplates[e[1].type]||null==this.fieldTemplates[e[1].type])return"";var n=this.fieldTemplates[e[1].type];if(e[1].label=this.gt(e[1].label),"none"!==e[1].validation&&"emailOrEmpty"!==e[1].validation&&"numberOrEmpty"!==e[1].validation&&"placeholder"!==e[1].type&&e[1].label.indexOf("*")<0&&(["select","select2"].indexOf(e[1].type)>=0&&!0===e[1]["allow-null"]||(e[1].label="".concat(e[1].label,'<font class="redFont">*</font>'))),"select"===e[1].type||"select2"===e[1].type||"select2multi"===e[1].type){if(n=(n=n.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label),void 0!==e[1].source&&null!=e[1].source)n=n.replace("_options_",this.renderFormSelectOptions(e[1].source,e));else if(void 0!==e[1]["remote-source"]&&null!=e[1]["remote-source"]){var r="".concat(e[1]["remote-source"][0],"_").concat(e[1]["remote-source"][1],"_").concat(e[1]["remote-source"][2]);n=n.replace("_options_",this.renderFormSelectOptionsRemote(this.fieldMasterData[r],e))}}else if("colorpick"===e[1].type)n=(n=n.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("date"===e[1].type)n=(n=n.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("datetime"===e[1].type)n=(n=n.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("time"===e[1].type)n=(n=n.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("fileupload"===e[1].type){n=(n=n.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);var i=this.getCurrentProfile();t=null!=i&&void 0!==i?i.id:-1*this.getUser().id,n=(n=n.replace(/_userId_/g,t)).replace(/_group_/g,this.tab),n=(n=void 0!==e[1].filetypes&&null!=e[1].filetypes?n.replace(/_filetypes_/g,e[1].filetypes):n.replace(/_filetypes_/g,"all")).replace(/_rand_/g,this.generateRandom(14))}else"datagroup"===e[1].type||"signature"===e[1].type||"tinymce"===e[1].type||e[1].type,n=(n=n.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);return n=void 0!==e[1].validation&&null!=e[1].validation&&""!==e[1].validation?n.replace(/_validation_/g,'validation="'.concat(e[1].validation,'"')):n.replace(/_validation_/g,""),n=void 0!==e[1].help&&null!==e[1].help?(n=n.replace(/_helpline_/g,e[1].help)).replace(/_hidden_class_help_/g,""):(n=n.replace(/_helpline_/g,"")).replace(/_hidden_class_help_/g,"hide"),n=void 0!==e[1].placeholder&&null!==e[1].placeholder?n.replace(/_placeholder_/g,'placeholder="'.concat(e[1].placeholder,'"')):n.replace(/_placeholder_/g,""),n=void 0!==e[1].mask&&null!==e[1].mask?n.replace(/_mask_/g,'mask="'.concat(e[1].mask,'"')):n.replace(/_mask_/g,"")}},{key:"renderFormSelectOptions",value:function(e,t){var n="";null!=t&&void 0!==t&&!0===t[1]["allow-null"]&&(void 0!==t[1]["null-label"]&&null!=t[1]["null-label"]?n+='<option value="NULL">'.concat(this.gt(t[1]["null-label"]),"</option>"):n+='<option value="NULL">Select</option>');var r=[];for(var i in e)r.push(e[i]);!0===t[1].sort&&r.sort((function(e,t){return(e=e[1])<(t=t[1])?-1:e>t?1:0}));for(var o=0;o<r.length;o++){var a=r[o][0],l=r[o][1],s='<option value="_id_">_val_</option>';n+=s=(s=s.replace("_id_",a)).replace("_val_",this.gt(l))}return n}},{key:"renderFormSelectOptionsRemote",value:function(e,t){var n="";!0===t[1]["allow-null"]&&(void 0!==t[1]["null-label"]&&null!=t[1]["null-label"]?n+='<option value="NULL">'.concat(this.gt(t[1]["null-label"]),"</option>"):n+='<option value="NULL">Select</option>');var r=[];for(var i in e)r.push([i,e[i]]);"true"===t[1].sort&&r.sort((function(e,t){return(e=e[1])<(t=t[1])?-1:e>t?1:0}));for(var o=0;o<r.length;o++){var a=r[o][0],l=r[o][1],s='<option value="_id_">_val_</option>';n+=s=(s=s.replace("_id_",a)).replace("_val_",this.gt(l))}return n}},{key:"setCustomTemplates",value:function(e){this.customTemplates=e}},{key:"setEmailTemplates",value:function(e){this.emailTemplates=e}},{key:"getCustomTemplate",value:function(e){return this.customTemplates[e]}},{key:"setFieldTemplates",value:function(e){this.fieldTemplates=e}},{key:"getMetaFieldForRendering",value:function(e){return""}},{key:"clearDeleteParams",value:function(){this.deleteParams={}}},{key:"getShowAddNew",value:function(){return this.showAddNew}},{key:"getAddNewLabel",value:function(){return"Add New"}},{key:"setShowAddNew",value:function(e){this.showAddNew=e}},{key:"setShowDelete",value:function(e){this.showDelete=e}},{key:"setShowEdit",value:function(e){this.showEdit=e}},{key:"setShowSave",value:function(e){this.showSave=e}},{key:"setShowCancel",value:function(e){this.showCancel=e}},{key:"getCustomTableParams",value:function(){return{}}},{key:"getActionButtons",value:function(e){return modJs.getActionButtonsHtml(e.aData[0],e.aData)}},{key:"getActionButtonsHtml",value:function(e,t){var n='<div style="width:80px;">_edit__delete__clone_</div>';return n=this.showAddNew?n.replace("_clone_",'<img class="tableActionButton" src="_BASE_images/clone.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Copy" onclick="modJs.copyRow(_id_);return false;"></img>'):n.replace("_clone_",""),n=this.showDelete?n.replace("_delete_",'<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img>'):n.replace("_delete_",""),n=(n=(n=this.showEdit?n.replace("_edit_",'<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>'):n.replace("_edit_","")).replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}},{key:"generateRandom",value:function(e){for(var t=new Date,n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",i=e;i>0;--i)r+=n[Math.round(Math.random()*(n.length-1))];return r+t.getTime()}},{key:"checkFileType",value:function(e,t){var n=document.getElementById(e),r="";return n.value.lastIndexOf(".")>0&&(r=n.value.substring(n.value.lastIndexOf(".")+1,n.value.length)),r=r.toLowerCase(),!(t.split(",").indexOf(r)<0&&(n.value="",this.showMessage("File Type Error","Selected file type is not supported"),this.clearFileElement(e),1))}},{key:"clearFileElement",value:function(e){var t=$("#".concat(e));t.replaceWith(t=t.val("").clone(!0))}},{key:"fixJSON",value:function(e){return"1"===this.noJSONRequests&&(e=window.btoa(e)),e}},{key:"getClientDate",value:function(e){var t=this.getClientGMTOffset();return e.addMinutes(60*t)}},{key:"getClientGMTOffset",value:function(){var e=new Date,t=new Date(e.getFullYear(),0,1,0,0,0,0),n=t.toGMTString();return(t-new Date(n.substring(0,n.lastIndexOf(" ")-1)))/36e5}},{key:"getHelpLink",value:function(){return null}},{key:"showLoader",value:function(){$("#iceloader").show()}},{key:"hideLoader",value:function(){$("#iceloader").hide()}},{key:"generateOptions",value:function(e){var t="";for(var n in e)t+='<option value="__val__">__text__</option>'.replace("__val__",n).replace("__text__",e[n]);return t}},{key:"isModuleInstalled",value:function(e,t){return void 0!==modulesInstalled&&null!==modulesInstalled&&1===modulesInstalled["".concat(e,"_").concat(t)]}},{key:"setCustomFields",value:function(e){for(var t,n,r=0;r<e.length;r++)if("Hidden"!==(t=e[r]).display&&""!==t.data&&void 0!==t.data)try{if(void 0===(n=JSON.parse(t.data))||null==n)continue;if(2!==n.length)continue;if(void 0===n[1].type||null==n[1].type)continue;this.customFields.push(n)}catch(e){}}},{key:"addCustomFields",value:function(e){for(var t=0;t<this.customFields.length;t++)e.push(this.customFields[t]);return e}}])&&o(t.prototype,n),r&&o(t,r),e}();n.default=a},{"./FormValidation":5}],7:[function(e,t,n){"use strict";var r;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return s(this,n)}}function s(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r,i=l(s);function s(e,t,n,r){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(o=i.call(this,e,t,n,r)).cellDataUpdates={},o.modulePath="",o.rowFieldName="",o.columnFieldName="",o.rowTable="",o.columnTable="",o.valueTable="",o.csvData=[],o.columnIDMap={},o}return t=s,(n=[{key:"setModulePath",value:function(e){this.modulePath=e}},{key:"setRowFieldName",value:function(e){this.rowFieldName=e}},{key:"setTables",value:function(e,t,n){this.rowTable=e,this.columnTable=t,this.valueTable=n}},{key:"setColumnFieldName",value:function(e){this.columnFieldName=e}},{key:"getDataMapping",value:function(){return[]}},{key:"getFormFields",value:function(){return[]}},{key:"get",value:function(){this.getAllData()}},{key:"getAllData",value:function(e){var t={};t.rowTable=this.rowTable,t.columnTable=this.columnTable,t.valueTable=this.valueTable,(t=this.addAdditionalRequestData("getAllData",t)).save=void 0===e||null==e||!1===e?0:1;var n=JSON.stringify(t),r=[];r.callBackData=[],r.callBackSuccess="getAllDataSuccessCallBack",r.callBackFail="getAllDataFailCallBack",this.customAction("getAllData",this.modulePath,n,r)}},{key:"getDataItem",value:function(e,t,n){var r=n[1],i=n[0],o=n[2];return-1===t?i[e].name:this.getDataItemByKeyValues(this.rowFieldName,i[e].id,this.columnFieldName,r[t].id,o)}},{key:"getDataItemByKeyValues",value:function(e,t,n,r,i){for(var o=0;o<i.length;o++)if(i[o][e]===t&&i[o][n]===r)return void 0!==i[o].amount&&null!=i[o].amount?i[o].amount:"";return""}},{key:"getAllDataSuccessCallBack",value:function(e){for(var t=e[2],n=e[1],r=e[0],i=[],o=0;o<r.length;o++){for(var a=[],l=-1;l<n.length;l++)a[l+1]=this.getDataItem(o,l,e);i.push(this.preProcessTableData(a))}this.sourceData=t,this.tableData=i,this.setHeaders(n,r),this.createTable(this.getTableName()),$("#".concat(this.getTableName(),"Form")).hide(),$("#".concat(this.getTableName())).show(),this.csvData=[];for(var s=[],c=0;c<n.length;c++)s.push(n[c].name);s=this.modifyCSVHeader(s),this.csvData.push(s);for(var u=0;u<i.length;u++)this.csvData.push(i[u])}},{key:"modifyCSVHeader",value:function(e){return e}},{key:"getAllDataFailCallBack",value:function(e,t){}},{key:"setHeaders",value:function(e,t){var n=[];n.push({sTitle:"",sWidth:"180px;"});var r="";this.columnIDMap={};for(var i=0;i<e.length;i++)this.columnIDMap[e[i].id]=i,r=void 0===e[i].editable||null==e[i].editable||"Yes"===e[i].editable?"editcell":"",n.push({sTitle:e[i].name,sClass:r,fnCreatedCell:function(n,r,i,o,a){$(n).data("colId",e[a-1].id),$(n).data("rowId",t[o].id)}});this.headers=n}},{key:"getHeaders",value:function(){return this.headers}},{key:"createTable",value:function(e){var t,n=this.getTableData(),r=this.getHeaders();if(this.showActionButtons()&&r.push({sTitle:"",sClass:"center"}),this.showActionButtons())for(var i=0;i<n.length;i++)n[i].push(this.getActionButtonsHtml(n[i][0],n[i]));t="".concat(this.getTableTopButtonHtml(),'<div class="box-body table-responsive"><table cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped" id="grid"></table></div>');var o=$("#".concat(e," .dataTables_paginate .active a")).html(),a=0;void 0!==o&&null!=o&&(a=15*parseInt(o,10)-15),$("#".concat(e)).html(t);var l={oLanguage:{sLengthMenu:"_MENU_ records per page"},aaData:n,aoColumns:r,bSort:!1,iDisplayLength:15,iDisplayStart:a},s=this.getCustomTableParams();$.extend(l,s),$("#".concat(e," #grid")).dataTable(l),$(".dataTables_paginate ul").addClass("pagination"),$(".dataTables_length").hide(),$(".dataTables_filter input").addClass("form-control"),$(".dataTables_filter input").attr("placeholder","Search"),$(".dataTables_filter label").contents().filter((function(){return 3===this.nodeType})).remove(),$("#".concat(e," #grid")).editableTableWidget(),$("#".concat(e," #grid .editcell")).on("validate",(function(e,t){return modJs.validateCellValue($(this),e,t)})),this.afterCreateTable(e)}},{key:"afterCreateTable",value:function(e){}},{key:"addCellDataUpdate",value:function(e,t,n){this.cellDataUpdates["".concat(e,"=").concat(t)]=[e,t,n]}},{key:"addAdditionalRequestData",value:function(e,t){return t}},{key:"sendCellDataUpdates",value:function(){var e=this.cellDataUpdates;e.rowTable=this.rowTable,e.columnTable=this.columnTable,e.valueTable=this.valueTable,e=this.addAdditionalRequestData("updateData",e);var t=JSON.stringify(e),n=[];n.callBackData=[],n.callBackSuccess="updateDataSuccessCallBack",n.callBackFail="updateDataFailCallBack",this.showLoader(),this.customAction("updateData",this.modulePath,t,n)}},{key:"updateDataSuccessCallBack",value:function(e,t){this.hideLoader(),modJs.cellDataUpdates={},modJs.get()}},{key:"updateDataFailCallBack",value:function(e,t){this.hideLoader()}},{key:"sendAllCellDataUpdates",value:function(){var e=this.cellDataUpdates;e.rowTable=this.rowTable,e.columnTable=this.columnTable,e.valueTable=this.valueTable,e=this.addAdditionalRequestData("updateAllData",e);var t=JSON.stringify(e),n=[];n.callBackData=[],n.callBackSuccess="updateDataAllSuccessCallBack",n.callBackFail="updateDataAllFailCallBack",this.showLoader(),this.customAction("updateAllData",this.modulePath,t,n)}},{key:"updateDataAllSuccessCallBack",value:function(e,t){this.hideLoader(),modJs.cellDataUpdates={},modJs.getAllData(!0)}},{key:"updateDataAllFailCallBack",value:function(e,t){this.hideLoader()}},{key:"showActionButtons",value:function(){return!1}}])&&o(t.prototype,n),r&&o(t,r),s}(((r=e("./AdapterBase"))&&r.__esModule?r:{default:r}).default);n.default=u},{"./AdapterBase":4}],8:[function(e,t,n){var r;r=function(e){"use strict";function t(t,n){clearTimeout(n.timeout),e.off(window,"mouseup",n.hurry),e.off(window,"keyup",n.hurry)}e.defineOption("autoRefresh",!1,(function(n,r){n.state.autoRefresh&&(t(0,n.state.autoRefresh),n.state.autoRefresh=null),r&&0==n.display.wrapper.offsetHeight&&function(n,r){function i(){n.display.wrapper.offsetHeight?(t(0,r),n.display.lastWrapHeight!=n.display.wrapper.clientHeight&&n.refresh()):r.timeout=setTimeout(i,r.delay)}r.timeout=setTimeout(i,r.delay),r.hurry=function(){clearTimeout(r.timeout),r.timeout=setTimeout(i,50)},e.on(window,"mouseup",r.hurry),e.on(window,"keyup",r.hurry)}(n,n.state.autoRefresh={delay:r.delay||250})}))},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":10}],9:[function(e,t,n){var r;r=function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))}));var i={Backspace:function(t){var i=l(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var o=r(i,"pairs"),a=t.listSelections(),c=0;c<a.length;c++){if(!a[c].empty())return e.Pass;var u=s(t,a[c].head);if(!u||o.indexOf(u)%2!=0)return e.Pass}for(c=a.length-1;c>=0;c--){var d=a[c].head;t.replaceRange("",n(d.line,d.ch-1),n(d.line,d.ch+1),"+delete")}},Enter:function(t){var n=l(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a<o.length;a++){if(!o[a].empty())return e.Pass;var c=s(t,o[a].head);if(!c||i.indexOf(c)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),o=t.listSelections();for(var n=0;n<o.length;n++){var r=o[n].head.line;t.indentLine(r,null,!0),t.indentLine(r+1,null,!0)}}))}};function o(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),r="'"+n+"'";i[r]||(i[r]=a(n))}}function a(t){return function(i){return function(t,i){var o=l(t);if(!o||t.getOption("disableInput"))return e.Pass;var a=r(o,"pairs"),s=a.indexOf(i);if(-1==s)return e.Pass;for(var u,d=r(o,"closeBefore"),f=r(o,"triples"),h=a.charAt(s+1)==i,p=t.listSelections(),m=s%2==0,v=0;v<p.length;v++){var g,y=p[v],b=y.head,w=t.getRange(b,n(b.line,b.ch+1));if(m&&!y.empty())g="surround";else if(!h&&m||w!=i)if(h&&b.ch>1&&f.indexOf(i)>=0&&t.getRange(n(b.line,b.ch-2),b)==i+i){if(b.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(b.line,b.ch-2))))return e.Pass;g="addFour"}else if(h){var k=0==b.ch?" ":t.getRange(n(b.line,b.ch-1),b);if(e.isWordChar(w)||k==i||e.isWordChar(k))return e.Pass;g="both"}else{if(!m||!(0===w.length||/\s/.test(w)||d.indexOf(w)>-1))return e.Pass;g="both"}else g=h&&c(t,b)?"both":f.indexOf(i)>=0&&t.getRange(b,n(b.line,b.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=g)return e.Pass}else u=g}var x=s%2?a.charAt(s-1):i,C=s%2?i:a.charAt(s+1);t.operation((function(){if("skip"==u)t.execCommand("goCharRight");else if("skipThree"==u)for(var r=0;r<3;r++)t.execCommand("goCharRight");else if("surround"==u){var i=t.getSelections();for(r=0;r<i.length;r++)i[r]=x+i[r]+C;for(t.replaceSelections(i,"around"),i=t.listSelections().slice(),r=0;r<i.length;r++)i[r]=(o=i[r],a=void 0,a=e.cmpPos(o.anchor,o.head)>0,{anchor:new n(o.anchor.line,o.anchor.ch+(a?-1:1)),head:new n(o.head.line,o.head.ch+(a?1:-1))});t.setSelections(i)}else"both"==u?(t.replaceSelection(x+C,null),t.triggerElectric(x+C),t.execCommand("goCharLeft")):"addFour"==u&&(t.replaceSelection(x+x+x+x,"before"),t.execCommand("goCharRight"));var o,a}))}(i,t)}}function l(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function s(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function c(e,t){var r=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":10}],10:[function(e,t,n){var r,i;r=this,i=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,l=a&&(r?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),c=s&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),g=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),k=d&&e.match(/Version\/(\d*\.\d*)/);k&&(k=Number(k[1])),k&&k>=15&&(d=!1,s=!0);var x=y&&(c||d&&(null==k||k<12.11)),C=n||a&&l>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var T,L=function(e,t){var n=e.className,r=S(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 _(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function M(e,t){return _(e).appendChild(t)}function D(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function N(e,t,n,r){var i=D(e,t,n,r);return i.setAttribute("role","presentation"),i}function A(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function F(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function O(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function P(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(t)&&(t+=" "+n[r]);return t}T=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var E=function(e){e.select()};function B(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function $(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function I(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}m?E=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(E=function(e){try{e.select()}catch(e){}});var R=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};function H(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}R.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},R.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var W={toString:function(){return"CodeMirror.Pass"}},z={scroll:!1},j={origin:"*mouse"},U={origin:"+move"};function G(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var V=[""];function J(e){for(;V.length<=e;)V.push(q(V)+" ");return V[e]}function q(e){return e[e.length-1]}function K(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Y(){}function X(e,t){var n;return Object.create?n=Object.create(e):(Y.prototype=e,n=new Y),t&&$(t,n),n}var Z=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Z.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Q(e))||t.test(e):Q(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,n){for(;(n<0?t>0:t<e.length)&&re(e.charAt(t));)t+=n;return t}function oe(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var ae=null;function le(e,t,n){var r;ae=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ae=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ae=i)}return null!=r?r:ae}var se=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,l){var s="ltr"==l?"L":"R";if(0==a.length||"ltr"==l&&!e.test(a))return!1;for(var c,u=a.length,d=[],f=0;f<u;++f)d.push((c=a.charCodeAt(f))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var h=0,p=s;h<u;++h){var m=d[h];"m"==m?d[h]=p:p=m}for(var v=0,g=s;v<u;++v){var y=d[v];"1"==y&&"r"==g?d[v]="n":n.test(y)&&(g=y,"r"==y&&(d[v]="R"))}for(var b=1,w=d[0];b<u-1;++b){var k=d[b];"+"==k&&"1"==w&&"1"==d[b+1]?d[b]="1":","!=k||w!=d[b+1]||"1"!=w&&"n"!=w||(d[b]=w),w=k}for(var x=0;x<u;++x){var C=d[x];if(","==C)d[x]="N";else if("%"==C){var S=void 0;for(S=x+1;S<u&&"%"==d[S];++S);for(var T=x&&"!"==d[x-1]||S<u&&"1"==d[S]?"1":"N",L=x;L<S;++L)d[L]=T;x=S-1}}for(var _=0,M=s;_<u;++_){var D=d[_];"L"==M&&"1"==D?d[_]="L":n.test(D)&&(M=D)}for(var N=0;N<u;++N)if(t.test(d[N])){var A=void 0;for(A=N+1;A<u&&t.test(d[A]);++A);for(var F="L"==(N?d[N-1]:s),O=F==("L"==(A<u?d[A]:s))?F?"L":"R":s,P=N;P<A;++P)d[P]=O;N=A-1}for(var E,B=[],$=0;$<u;)if(r.test(d[$])){var I=$;for(++$;$<u&&r.test(d[$]);++$);B.push(new o(0,I,$))}else{var R=$,H=B.length;for(++$;$<u&&"L"!=d[$];++$);for(var W=R;W<$;)if(i.test(d[W])){R<W&&B.splice(H,0,new o(1,R,W));var z=W;for(++W;W<$&&i.test(d[W]);++W);B.splice(H,0,new o(2,z,W)),R=W}else++W;R<$&&B.splice(H,0,new o(1,R,$))}return"ltr"==l&&(1==B[0].level&&(E=a.match(/^\s+/))&&(B[0].from=E[0].length,B.unshift(new o(0,0,E[0].length))),1==q(B).level&&(E=a.match(/\s+$/))&&(q(B).to-=E[0].length,B.push(new o(0,u-E[0].length,u)))),"rtl"==l?B.reverse():B}}();function ce(e,t){var n=e.order;return null==n&&(n=e.order=se(e.text,t)),n}var ue=[],de=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ue).concat(n)}};function fe(e,t){return e._handlers&&e._handlers[t]||ue}function he(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=H(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function pe(e,t){var n=fe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function me(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),pe(e,n||t.type,e,t),ke(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==H(n,t[r])&&n.push(t[r])}function ge(e,t){return fe(e,t).length>0}function ye(e){e.prototype.on=function(e,t){de(this,e,t)},e.prototype.off=function(e,t){he(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ke(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function xe(e){be(e),we(e)}function Ce(e){return e.target||e.srcElement}function Se(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Te,Le,_e=function(){if(a&&l<9)return!1;var e=D("div");return"draggable"in e||"dragDrop"in e}();function Me(e){if(null==Te){var t=D("span","");M(e,D("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Te=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&l<8))}var n=Te?D("span",""):D("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function De(e){if(null!=Le)return Le;var t=M(e,document.createTextNode("AخA")),n=T(t,0,1).getBoundingClientRect(),r=T(t,1,2).getBoundingClientRect();return _(e),!(!n||n.left==n.right)&&(Le=r.right-n.right<3)}var Ne,Ae=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Fe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Oe="oncopy"in(Ne=D("div"))||(Ne.setAttribute("oncopy","return;"),"function"==typeof Ne.oncopy),Pe=null,Ee={},Be={};function $e(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ee[e]=t}function Ie(e){if("string"==typeof e&&Be.hasOwnProperty(e))e=Be[e];else if(e&&"string"==typeof e.name&&Be.hasOwnProperty(e.name)){var t=Be[e.name];"string"==typeof t&&(t={name:t}),(e=X(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ie("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ie("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Re(e,t){t=Ie(t);var n=Ee[t.name];if(!n)return Re(e,"text/plain");var r=n(e,t);if(He.hasOwnProperty(t.name)){var i=He[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 He={};function We(e,t){$(t,He.hasOwnProperty(e)?He[e]:He[e]={})}function ze(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function je(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ue(e,t,n){return!e.startState||e.startState(t,n)}var Ge=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ve(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Je(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function qe(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Ke(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Ye(e){if(null==e.parent)return null;for(var t=e.parent,n=H(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Xe(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a].height;if(t<l)break;t-=l}return n+a}function Ze(e,t){return t>=e.first&&t<e.first+e.size}function Qe(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,n){if(void 0===n&&(n=null),!(this instanceof et))return new et(e,t,n);this.line=e,this.ch=t,this.sticky=n}function tt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function rt(e){return et(e.line,e.ch)}function it(e,t){return tt(e,t)<0?t:e}function ot(e,t){return tt(e,t)<0?e:t}function at(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function lt(e,t){if(t.line<e.first)return et(e.first,0);var n=e.first+e.size-1;return t.line>n?et(n,Ve(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ve(e,t.line).text.length)}function st(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=lt(e,t[r]);return n}Ge.prototype.eol=function(){return this.pos>=this.string.length},Ge.prototype.sol=function(){return this.pos==this.lineStart},Ge.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ge.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ge.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ge.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ge.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ge.prototype.skipToEnd=function(){this.pos=this.string.length},Ge.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ge.prototype.backUp=function(e){this.pos-=e},Ge.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=I(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?I(this.string,this.lineStart,this.tabSize):0)},Ge.prototype.indentation=function(){return I(this.string,null,this.tabSize)-(this.lineStart?I(this.string,this.lineStart,this.tabSize):0)},Ge.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ge.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ge.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ge.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ge.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function dt(e,t,n,r){var i=[e.state.modeGen],o={};wt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,l=function(r){n.baseTokens=i;var l=e.state.overlays[r],s=1,c=0;n.state=!0,wt(e,t.text,l.mode,n,(function(e,t){for(var n=s;c<e;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function ft(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=ht(e,Ye(t)),i=t.text.length>e.options.maxHighlightLength&&ze(e.doc.mode,r.state),o=dt(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 ht(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ut(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Ve(o,l-1),c=s.stateAfter;if(c&&(!n||l+(c instanceof ct?c.lookAhead:0)<=o.modeFrontier))return l;var u=I(s.text,null,e.options.tabSize);(null==i||r>u)&&(i=l-1,r=u)}return i}(e,t,n),a=o>r.first&&Ve(r,o-1).stateAfter,l=a?ut.fromSaved(r,a,o):new ut(r,Ue(r.mode),o);return r.iter(o,t,(function(n){pt(e,n.text,l);var r=l.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?l.save():null,l.nextLine()})),n&&(r.modeFrontier=l.line),l}function pt(e,t,n,r){var i=e.doc.mode,o=new Ge(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&mt(i,n.state);!o.eol();)vt(i,o,n.state),o.start=o.pos}function mt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=je(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function vt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=je(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,n){return t instanceof ct?new ut(e,ze(e.mode,t.state),n,t.lookAhead):new ut(e,ze(e.mode,t),n)},ut.prototype.save=function(e){var t=!1!==e?ze(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var gt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var i,o,a=e.doc,l=a.mode,s=Ve(a,(t=lt(a,t)).line),c=ht(e,t.line,n),u=new Ge(s.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=vt(l,u,c.state),r&&o.push(new gt(u,i,ze(a.mode,c.state)));return r?o:new gt(u,i,c.state)}function bt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function wt(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Ge(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&bt(mt(n,r.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&pt(e,t,r,d.pos),d.pos=t.length,s=null):s=bt(vt(n,d,r.state,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||u!=s){for(;c<d.start;)i(c=Math.min(d.start,c+5e3),u);u=s}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);i(p,u),c=p}}var kt=!1,xt=!1;function Ct(e,t,n){this.marker=e,this.from=t,this.to=n}function St(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Tt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Lt(e,t){if(t.full)return null;var n=Ze(e,t.from.line)&&Ve(e,t.from.line).markedSpans,r=Ze(e,t.to.line)&&Ve(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==tt(t.from,t.to),l=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Ct(a,o.from,l?null:o.to))}}return r}(n,i,a),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Ct(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,o,a),c=1==t.text.length,u=q(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var h=St(s,f.marker);h?c&&(f.to=null==h.to?null:h.to+u):f.to=i}}if(s)for(var p=0;p<s.length;++p){var m=s[p];null!=m.to&&(m.to+=u),null==m.from?St(l,m.marker)||(m.from=u,c&&(l||(l=[])).push(m)):(m.from+=u,c&&(l||(l=[])).push(m))}l&&(l=_t(l)),s&&s!=l&&(s=_t(s));var v=[l];if(!c){var g,y=t.text.length-2;if(y>0&&l)for(var b=0;b<l.length;++b)null==l[b].to&&(g||(g=[])).push(new Ct(l[b].marker,null,null));for(var w=0;w<y;++w)v.push(g);v.push(s)}return v}function _t(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Mt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Dt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Nt(e){return e.inclusiveLeft?-1:0}function At(e){return e.inclusiveRight?1:0}function Ft(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=tt(r.from,i.from)||Nt(e)-Nt(t);if(o)return-o;var a=tt(r.to,i.to)||At(e)-At(t);return a||t.id-e.id}function Ot(e,t){var n,r=xt&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Ft(n,i.marker)<0)&&(n=i.marker);return n}function Pt(e){return Ot(e,!0)}function Et(e){return Ot(e,!1)}function Bt(e,t){var n,r=xt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Ft(n,o.marker)<0)&&(n=o.marker)}return n}function $t(e,t,n,r,i){var o=Ve(e,t),a=xt&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=tt(c.from,n)||Nt(s.marker)-Nt(i),d=tt(c.to,r)||At(s.marker)-At(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?tt(c.to,n)>=0:tt(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?tt(c.from,r)<=0:tt(c.from,r)<0)))return!0}}}function It(e){for(var t;t=Pt(e);)e=t.find(-1,!0).line;return e}function Rt(e,t){var n=Ve(e,t),r=It(n);return n==r?t:Ye(r)}function Ht(e,t){if(t>e.lastLine())return t;var n,r=Ve(e,t);if(!Wt(e,r))return t;for(;n=Et(r);)r=n.find(1,!0).line;return Ye(r)+1}function Wt(e,t){var n=xt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&zt(e,t,r))return!0}}function zt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return zt(e,r.line,St(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&zt(e,t,i))return!0}function jt(e){for(var t=0,n=(e=It(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function Ut(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Pt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=Et(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function Gt(e){var t=e.display,n=e.doc;t.maxLine=Ve(n,n.first),t.maxLineLength=Ut(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=Ut(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Vt=function(e,t,n){this.text=e,Dt(this,t),this.height=n?n(this):1};function Jt(e){e.parent=null,Mt(e)}Vt.prototype.lineNo=function(){return Ye(this)},ye(Vt);var qt={},Kt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Kt:qt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var n=N("span",null,null,s?"padding-right: .1px":null),r={pre:N("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=Qt,De(e.display.measure)&&(a=ce(o,e.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[],nn(o,r,ft(e,o,t!=e.display.externalMeasured&&Ye(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=P(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=P(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Me(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return pe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=P(r.pre.className,r.textClass||"")),r}function Zt(e){var t=D("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,n,r,i,o,s){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){c=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var p=d.exec(t),m=p?p.index-h:t.length-h;if(m){var v=document.createTextNode(u.slice(h,h+m));a&&l<9?c.appendChild(D("span",[v])):c.appendChild(v),e.map.push(e.pos,e.pos+m,v),e.col+=m,e.pos+=m}if(!p)break;h+=m+1;var g=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(g=c.appendChild(D("span",J(b),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((g=c.appendChild(D("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&l<9?c.appendChild(D("span",[g])):c.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&l<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||f||o){var w=n||"";r&&(w+=r),i&&(w+=i);var k=D("span",[c],w,o);if(s)for(var x in s)s.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&k.setAttribute(x,s[x]);return e.content.appendChild(k)}e.content.appendChild(c)}}function en(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var d=void 0,f=0;f<t.length&&!((d=t[f]).to>c&&d.from<=c);f++);if(d.to>=u)return e(n,r,i,o,a,l,s);e(n,r.slice(0,d.to-c),i,o,null,l,s),o=null,r=r.slice(d.to-c),c=d.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,c,u,d,f,h=i.length,p=0,m=1,v="",g=0;;){if(g==p){s=c=u=l="",f=null,d=null,g=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var k=r[w],x=k.marker;if("bookmark"==x.type&&k.from==p&&x.widgetNode)y.push(x);else if(k.from<=p&&(null==k.to||k.to>p||x.collapsed&&k.to==p&&k.from==p)){if(null!=k.to&&k.to!=p&&g>k.to&&(g=k.to,c=""),x.className&&(s+=" "+x.className),x.css&&(l=(l?l+";":"")+x.css),x.startStyle&&k.from==p&&(u+=" "+x.startStyle),x.endStyle&&k.to==g&&(b||(b=[])).push(x.endStyle,k.to),x.title&&((f||(f={})).title=x.title),x.attributes)for(var C in x.attributes)(f||(f={}))[C]=x.attributes[C];x.collapsed&&(!d||Ft(d.marker,x)<0)&&(d=k)}else k.from>p&&g>k.from&&(g=k.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==g&&(c+=" "+b[S]);if(!d||d.from==p)for(var T=0;T<y.length;++T)tn(t,0,y[T]);if(d&&(d.from||0)==p){if(tn(t,(null==d.to?h+1:d.to)-p,d.marker,null==d.from),null==d.to)return;d.to==p&&(d=!1)}}if(p>=h)break;for(var L=Math.min(h,g);;){if(v){var _=p+v.length;if(!d){var M=_>L?v.slice(0,L-p):v;t.addToken(t,M,a?a+s:s,u,p+M.length==g?c:"",l,f)}if(_>=L){v=v.slice(L-p),p=L;break}p=_,u=""}v=i.slice(o,o=n[m++]),a=Yt(n[m++],t.cm.options)}}else for(var D=1;D<n.length;D+=2)t.addToken(t,i.slice(o,o=n[D]),Yt(n[D+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Et(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Ye(q(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Wt(e,t)}function on(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new rn(e.doc,Ve(e.doc,o),o);r=o+a.size,i.push(a)}return i}var an=null,ln=null;function sn(e,t){var n=fe(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);an?r=an.delayedCallbacks:ln?r=ln:(r=ln=[],setTimeout(cn,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},a=0;a<n.length;++a)o(a)}}function cn(){var e=ln;ln=null;for(var t=0;t<e.length;++t)e[t]()}function un(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?hn(e,t):"gutter"==o?mn(e,t,n,r):"class"==o?pn(e,t):"widget"==o&&vn(e,t,r)}t.changes=null}function dn(e){return e.node==e.text&&(e.node=D("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&l<8&&(e.node.style.zIndex=2)),e.node}function fn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Xt(e,t)}function hn(e,t){var n=t.text.className,r=fn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,pn(e,t)):n&&(t.text.className=n)}function pn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=dn(t);t.background=r.insertBefore(D("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?dn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function mn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=dn(t);t.gutterBackground=D("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=dn(t),l=t.gutter=D("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(D("div",Qe(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,u=o.hasOwnProperty(c)&&o[c];u&&l.appendChild(D("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function vn(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&t.node.removeChild(r);yn(e,t,n)}function gn(e,t,n,r){var i=fn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),pn(e,t),mn(e,t,n,r),yn(e,t,r),t.node}function yn(e,t,n){if(bn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)bn(e,t.rest[r],t,n,!1)}function bn(e,t,n,r,i){if(t.widgets)for(var o=dn(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=D("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),wn(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),sn(s,"redraw")}}function wn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function kn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!A(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),M(t.display.measure,D("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function xn(e,t){for(var n=Ce(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Cn(e){return e.lineSpace.offsetTop}function Sn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Tn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=M(e.measure,D("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Ln(e){return 30-e.display.nativeBarWidth}function _n(e){return e.display.scroller.clientWidth-Ln(e)-e.display.barWidth}function Mn(e){return e.display.scroller.clientHeight-Ln(e)-e.display.barHeight}function Dn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(Ye(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Nn(e,t,n,r){return On(e,Fn(e,t),n,r)}function An(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ur(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Fn(e,t){var n=Ye(t),r=An(e,n);r&&!r.text?r=null:r&&r.changes&&(un(e,r,n,or(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Ye(t=It(t)),r=e.display.externalMeasured=new rn(e.doc,t,n);r.lineN=n;var i=r.built=Xt(e,r);return r.text=i.pre,M(e.display.lineMeasure,i.pre),r}(e,t));var i=Dn(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function On(e,t,n,r,i){t.before&&(n=-1);var o,s=n+(r||"");return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&_n(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Bn(t.map,n,r),s=o.node,c=o.start,u=o.end,d=o.collapse;if(3==s.nodeType){for(var f=0;f<4;f++){for(;c&&re(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&re(t.line.text.charAt(o.coverStart+u));)++u;if((i=a&&l<9&&0==c&&u==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():$n(T(s,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,d="right"}a&&l<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Pe)return Pe;var t=M(e,D("span","x")),n=t.getBoundingClientRect(),r=T(t,0,1).getBoundingClientRect();return Pe=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var h;c>0&&(d=r="right"),i=e.options.lineWrapping&&(h=s.getClientRects()).length>1?h["right"==r?h.length-1:0]:s.getBoundingClientRect()}if(a&&l<9&&!c&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+ir(e.display),top:p.top,bottom:p.bottom}:En}for(var m=i.top-t.rect.top,v=i.bottom-t.rect.top,g=(m+v)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(g<y[b]);b++);var w=b?y[b-1]:0,k=y[b],x={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:w,bottom:k};return i.left||i.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=m,x.rbottom=v),x}(e,t,n,r)).bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Pn,En={left:0,right:0,top:0,bottom:0};function Bn(e,t,n){for(var r,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?o=1+(i=t-l):(c==e.length-3||t==s&&e[c+3]>t)&&(i=(o=s-l)-1,t>=s&&(a="right")),null!=i){if(r=e[c+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function $n(e,t){var n=En;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function In(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Rn(e){e.display.externalMeasure=null,_(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)In(e.display.view[t])}function Hn(e){Rn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Wn(){return u&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function zn(){return u&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function jn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=kn(e.widgets[n]));return t}function Un(e,t,n,r,i){if(!i){var o=jn(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=jt(t);if("local"==r?a+=Cn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:zn());var s=l.left+("window"==r?0:Wn());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function Gn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Wn(),i-=zn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Vn(e,t,n,r,i){return r||(r=Ve(e.doc,t.line)),Un(e,r,Nn(e,r,t.ch,i),n)}function Jn(e,t,n,r,i,o){function a(t,a){var l=On(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,Un(e,r,l,n)}r=r||Ve(e.doc,t.line),i||(i=Fn(e,r));var l=ce(r,e.doc.direction),s=t.ch,c=t.sticky;if(s>=r.text.length?(s=r.text.length,c="before"):s<=0&&(s=0,c="after"),!l)return a("before"==c?s-1:s,"before"==c);function u(e,t,n){return a(n?e-1:e,1==l[t].level!=n)}var d=le(l,s,c),f=ae,h=u(s,d,"before"==c);return null!=f&&(h.other=u(s,f,"before"!=c)),h}function qn(e,t){var n=0;t=lt(e.doc,t),e.options.lineWrapping||(n=ir(e.display)*t.ch);var r=Ve(e.doc,t.line),i=jt(r)+Cn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Kn(e,t,n,r,i){var o=et(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Yn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Kn(r.first,0,null,-1,-1);var i=Xe(r,n),o=r.first+r.size-1;if(i>o)return Kn(r.first+r.size-1,Ve(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Ve(r,i);;){var l=er(e,a,i,t,n),s=Bt(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var c=s.find(1);if(c.line==i)return c;a=Ve(r,i=c.line)}}function Xn(e,t,n,r){r-=jn(t);var i=t.text.length,o=oe((function(t){return On(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=oe((function(t){return On(e,n,t).top>r}),o,i)}}function Zn(e,t,n,r){return n||(n=Fn(e,t)),Xn(e,t,n,Un(e,t,On(e,n,r),"line").top)}function Qn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=jt(t);var o=Fn(e,t),a=jn(t),l=0,s=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?nr:tr)(e,t,n,o,u,r,i);l=(c=1!=d.level)?d.from:d.to-1,s=c?d.to:d.from-1}var f,h,p=null,m=null,v=oe((function(t){var n=On(e,o,t);return n.top+=a,n.bottom+=a,!!Qn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)}),l,s),g=!1;if(m){var y=r-m.left<m.right-r,b=y==c;v=p+(b?0:1),h=b?"after":"before",f=y?m.left:m.right}else{c||v!=s&&v!=l||v++,h=0==v?"after":v==t.text.length?"before":On(e,o,v-(c?1:0)).bottom+a<=i==c?"after":"before";var w=Jn(e,et(n,v,h),"line",t,o);f=w.left,g=i<w.top?-1:i>=w.bottom?1:0}return Kn(n,v=ie(t.text,v,1),h,g,r-f)}function tr(e,t,n,r,i,o,a){var l=oe((function(l){var s=i[l],c=1!=s.level;return Qn(Jn(e,et(n,c?s.to:s.from,c?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),s=i[l];if(l>0){var c=1!=s.level,u=Jn(e,et(n,c?s.from:s.to,c?"after":"before"),"line",t,r);Qn(u,o,a,!0)&&u.top>a&&(s=i[l-1])}return s}function nr(e,t,n,r,i,o,a){var l=Xn(e,t,r,a),s=l.begin,c=l.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,f=0;f<i.length;f++){var h=i[f];if(!(h.from>=c||h.to<=s)){var p=On(e,r,1!=h.level?Math.min(c,h.to)-1:Math.max(s,h.from)).right,m=p<o?o-p+1e9:p-o;(!u||d>m)&&(u=h,d=m)}}return u||(u=i[i.length-1]),u.from<s&&(u={from:s,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Pn){Pn=D("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pn.appendChild(document.createTextNode("x")),Pn.appendChild(D("br"));Pn.appendChild(document.createTextNode("x"))}M(e.measure,Pn);var n=Pn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),_(e.measure),n||1}function ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=D("span","xxxxxxxxxx"),n=D("pre",[t],"CodeMirror-line-like");M(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function or(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+i,r[l]=o.clientWidth}return{fixedPos:ar(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function lr(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(i){if(Wt(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function sr(e){var t=e.doc,n=lr(e);t.iter((function(e){var t=n(e);t!=e.height&&Ke(e,t)}))}function cr(e,t,n,r){var i=e.display;if(!n&&"true"==Ce(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=Yn(e,o,a);if(r&&1==c.xRel&&(s=Ve(e.doc,c.line).text).length==c.ch){var u=I(s,s.length,e.options.tabSize)-s.length;c=et(c.line,Math.max(0,Math.round((o-Tn(e.display).left)/ir(e.display))-u))}return c}function ur(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function dr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)xt&&Rt(e.doc,t)<i.viewTo&&hr(e);else if(n<=i.viewFrom)xt&&Ht(e.doc,n+r)>i.viewFrom?hr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)hr(e);else if(t<=i.viewFrom){var o=pr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):hr(e)}else if(n>=i.viewTo){var a=pr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):hr(e)}else{var l=pr(e,t,t,-1),s=pr(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(on(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):hr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function fr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[ur(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==H(a,n)&&a.push(n)}}}function hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pr(e,t,n,r){var i,o=ur(e,t),a=e.display.view;if(!xt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(r>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,n+=i}for(;Rt(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function mr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function vr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function gr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var l=n.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&yr(e,l.head,i),s||wr(e,l,o)}}return r}function yr(e,t,n){var r=Jn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(D("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(D("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function br(e,t){return e.top-t.top||e.left-t.left}function wr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Tn(e.display),l=a.left,s=Math.max(r.sizerWidth,_n(e)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(D("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?s-e:n)+"px;\n height: "+(r-t)+"px"))}function d(t,n,r){var o,a,d=Ve(i,t),f=d.text.length;function h(n,r){return Vn(e,et(t,n),"div",d,r)}function p(t,n,r){var i=Zn(e,d,null,t),o="ltr"==n==("after"==r)?"left":"right";return h("after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),o)[o]}var m=ce(d,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?f:r,(function(e,t,i,d){var v="ltr"==i,g=h(e,v?"left":"right"),y=h(t-1,v?"right":"left"),b=null==n&&0==e,w=null==r&&t==f,k=0==d,x=!m||d==m.length-1;if(y.top-g.top<=3){var C=(c?w:b)&&x,S=(c?b:w)&&k?l:(v?g:y).left,T=C?s:(v?y:g).right;u(S,g.top,T-S,g.bottom)}else{var L,_,M,D;v?(L=c&&b&&k?l:g.left,_=c?s:p(e,i,"before"),M=c?l:p(t,i,"after"),D=c&&w&&x?s:y.right):(L=c?p(e,i,"before"):l,_=!c&&b&&k?s:g.right,M=!c&&w&&x?l:y.left,D=c?p(t,i,"after"):s),u(L,g.top,_-L,g.bottom),g.bottom<y.top&&u(l,g.bottom,null,y.top),u(M,y.top,D-M,y.bottom)}(!o||br(g,o)<0)&&(o=g),br(y,o)<0&&(o=y),(!a||br(g,a)<0)&&(a=g),br(y,a)<0&&(a=y)})),{start:o,end:a}}var f=t.from(),h=t.to();if(f.line==h.line)d(f.line,f.ch,h.ch);else{var p=Ve(i,f.line),m=Ve(i,h.line),v=It(p)==It(m),g=d(f.line,f.ch,v?p.text.length+1:null).end,y=d(h.line,v?0:null,h.ch).start;v&&(g.top<y.top-2?(u(g.right,g.top,null,g.bottom),u(l,y.top,y.left,y.bottom)):u(g.right,g.top,y.left-g.right,g.bottom)),g.bottom<y.top&&u(l,g.bottom,null,y.top)}n.appendChild(o)}function kr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function xr(e){e.state.focused||(e.display.input.focus(),Sr(e))}function Cr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Tr(e))}),100)}function Sr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(pe(e,"focus",e,t),e.state.focused=!0,O(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),kr(e))}function Tr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(pe(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Lr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,s=void 0,c=0;if(!i.hidden){if(a&&l<8){var u=i.node.offsetTop+i.node.offsetHeight;s=u-n,n=u}else{var d=i.node.getBoundingClientRect();s=d.bottom-d.top,!o&&i.text.firstChild&&(c=i.text.firstChild.getBoundingClientRect().right-d.left-1)}var f=i.line.height-s;if((f>.005||f<-.005)&&(Ke(i.line,s),_r(i.line),i.rest))for(var h=0;h<i.rest.length;h++)_r(i.rest[h]);if(c>e.display.sizerWidth){var p=Math.ceil(c/ir(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function _r(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Mr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Cn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=Xe(t,r),a=Xe(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=Xe(t,jt(Ve(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=Xe(t,jt(Ve(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Dr(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Mn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Sn(n),s=t.top<r,c=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,f=_n(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Nr(e,t){null!=t&&(Or(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ar(e){Or(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Fr(e,t,n){null==t&&null==n||Or(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Or(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Pr(e,qn(e,t.from),qn(e,t.to),t.margin))}function Pr(e,t,n,r){var i=Dr(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});Fr(e,i.scrollLeft,i.scrollTop)}function Er(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||si(e,{top:t}),Br(e,t,!0),n&&si(e),ri(e,100))}function Br(e,t,n){t=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 $r(e,t,n,r){t=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,di(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Ir(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Sn(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+Ln(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Rr=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),de(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),de(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Rr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Rr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Rr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Rr.prototype.zeroWidthHack=function(){var e=y&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},Rr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Rr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Hr=function(){};function Wr(e,t){t||(t=Ir(e));var n=e.display.barWidth,r=e.display.barHeight;zr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Lr(e),zr(e,Ir(e)),n=e.display.barWidth,r=e.display.barHeight}function zr(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=""}Hr.prototype.update=function(){return{bottom:0,right:0}},Hr.prototype.setScrollLeft=function(){},Hr.prototype.setScrollTop=function(){},Hr.prototype.clear=function(){};var jr={native:Rr,null:Hr};function Ur(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&L(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new jr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),de(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?$r(e,t):Er(e,t)}),e),e.display.scrollbars.addClass&&O(e.display.wrapper,e.display.scrollbars.addClass)}var Gr=0;function Vr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Gr},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function Jr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{an=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)qr(t[n]);for(var r=0;r<t.length;r++)Kr(t[r]);for(var i=0;i<t.length;i++)Yr(t[i]);for(var o=0;o<t.length;o++)Xr(t[o]);for(var a=0;a<t.length;a++)Zr(t[a])}(e)}))}function qr(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ln(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ln(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Gt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Kr(e){e.updatedDisplay=e.mustUpdate&&ai(e.cm,e.update)}function Yr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Lr(t),e.barMeasure=Ir(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Nn(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+Ln(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-_n(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Xr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&$r(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==F();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Wr(t,e.barMeasure),e.updatedDisplay&&ui(t,e.barMeasure),e.selectionChanged&&kr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&xr(e.cm)}function Zr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&li(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Br(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&$r(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!me(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=D("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n height: "+(t.bottom-t.top+Ln(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,l=Jn(e,t),s=n&&n!=t?Jn(e,n):l,c=Dr(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Er(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&($r(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}(t,lt(r,e.scrollToPos.from),lt(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||pe(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&pe(o[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Qr(e,t){if(e.curOp)return t();Vr(e);try{return t()}finally{Jr(e)}}function ei(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Vr(e);try{return t.apply(e,arguments)}finally{Jr(e)}}}function ti(e){return function(){if(this.curOp)return e.apply(this,arguments);Vr(this);try{return e.apply(this,arguments)}finally{Jr(this)}}}function ni(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Vr(t);try{return e.apply(this,arguments)}finally{Jr(t)}}}function ri(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,B(ii,e))}function ii(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ht(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?ze(t.mode,r.state):null,s=dt(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&pt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ri(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Qr(e,(function(){for(var t=0;t<i.length;t++)fr(e,i[t],"text")}))}}var oi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Mr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=_n(e),this.force=n,this.dims=or(e),this.events=[]};function ai(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return hr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mr(e))return!1;fi(e)&&(hr(e),t.dims=or(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),xt&&(o=Rt(e.doc,o),a=Ht(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(ur(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(on(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,ur(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=jt(Ve(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=mr(e);if(!l&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=F();if(!t||!A(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&A(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(t){var n=t.nextSibling;return s&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d<c.length;d++){var f=c[d];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;a!=f.node;)a=l(a);var h=i&&null!=t&&t<=u&&f.lineNumber;f.changes&&(H(f.changes,"gutter")>-1&&(h=!1),un(e,f,u,n)),h&&(_(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(Qe(e.options,u)))),a=f.node.nextSibling}else{var p=gn(e,f,u,n);o.insertBefore(p,a)}u+=f.size}for(;a;)a=l(a)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=F()&&(e.activeElt.focus(),e.anchorNode&&A(document.body,e.anchorNode)&&A(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),_(n.cursorDiv),_(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ri(e,400)),n.updateLineNumbers=null,!0}function li(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=_n(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Sn(e.display)-Mn(e),n.top)}),t.visible=Mr(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ai(e,t);r=!1){Lr(e);var i=Ir(e);vr(e),Wr(e,i),ui(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function si(e,t){var n=new oi(e,t);if(ai(e,n)){Lr(e),li(e,n);var r=Ir(e);vr(e),Wr(e,r),ui(e,r),n.finish()}}function ci(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ui(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ln(e)+"px"}function di(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ar(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function fi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Qe(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(D("div",[D("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ci(e.display),!0}return!1}function hi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function pi(e){var t=e.gutters,n=e.gutterSpecs;_(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,l=t.appendChild(D("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ci(e)}function mi(e){pi(e.display),dr(e),di(e)}function vi(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=D("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=D("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=N("div",null,"CodeMirror-code"),o.selectionDiv=D("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=D("div",null,"CodeMirror-cursors"),o.measure=D("div",null,"CodeMirror-measure"),o.lineMeasure=D("div",null,"CodeMirror-measure"),o.lineSpace=N("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=N("div",[o.lineSpace],"CodeMirror-lines");o.mover=D("div",[c],null,"position: relative"),o.sizer=D("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=D("div",null,null,"position: absolute; height: 30px; width: 1px;"),o.gutters=D("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=D("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=D("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&l<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),s||n&&g||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=hi(i.gutters,i.lineNumbers),pi(o),r.init(o)}oi.prototype.signal=function(e,t){ge(e,t)&&this.events.push(arguments)},oi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)pe.apply(null,this.events[e])};var gi=0,yi=null;function bi(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function wi(e){var t=bi(e);return t.x*=yi,t.y*=yi,t}function ki(e,t){var r=bi(t),i=r.x,o=r.y,a=e.display,l=a.scroller,c=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(i&&c||o&&u){if(o&&y&&s)e:for(var f=t.target,h=a.view;f!=l;f=f.parentNode)for(var p=0;p<h.length;p++)if(h[p].node==f){e.display.currentWheelTarget=f;break e}if(i&&!n&&!d&&null!=yi)return o&&u&&Er(e,Math.max(0,l.scrollTop+o*yi)),$r(e,Math.max(0,l.scrollLeft+i*yi)),(!o||o&&u)&&be(t),void(a.wheelStartX=null);if(o&&null!=yi){var m=o*yi,v=e.doc.scrollTop,g=v+a.wrapper.clientHeight;m<0?v=Math.max(0,v+m-50):g=Math.min(e.doc.height,g+m+50),si(e,{top:v,bottom:g})}gi<20&&(null==a.wheelStartX?(a.wheelStartX=l.scrollLeft,a.wheelStartY=l.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=l.scrollLeft-a.wheelStartX,t=l.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(yi=(yi*gi+n)/(gi+1),++gi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?yi=-.53:n?yi=15:u?yi=-.7:f&&(yi=-1/3);var xi=function(e,t){this.ranges=e,this.primIndex=t};xi.prototype.primary=function(){return this.ranges[this.primIndex]},xi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!nt(n.anchor,r.anchor)||!nt(n.head,r.head))return!1}return!0},xi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ci(rt(this.ranges[t].anchor),rt(this.ranges[t].head));return new xi(e,this.primIndex)},xi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},xi.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(tt(t,r.from())>=0&&tt(e,r.to())<=0)return n}return-1};var Ci=function(e,t){this.anchor=e,this.head=t};function Si(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=H(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=tt(l.to(),a.from());if(r&&!a.empty()?s>0:s>=0){var c=ot(l.from(),a.from()),u=it(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new Ci(d?u:c,d?c:u))}}return new xi(t,n)}function Ti(e,t){return new xi([new Ci(e,t||e)],0)}function Li(e){return e.text?et(e.from.line+e.text.length-1,q(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function _i(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Li(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+=Li(t).ch-t.to.ch),et(n,r)}function Mi(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Ci(_i(i.anchor,t),_i(i.head,t)))}return Si(e.cm,n,e.sel.primIndex)}function Di(e,t,n){return e.line==t.line?et(n.line,e.ch-t.ch+n.ch):et(n.line+(e.line-t.line),e.ch)}function Ni(e){e.doc.mode=Re(e.options,e.doc.modeOption),Ai(e)}function Ai(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ri(e,100),e.state.modeGen++,e.curOp&&dr(e)}function Fi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==q(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Oi(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Mt(e),Dt(e,n);var i=r?r(e):1;i!=e.height&&Ke(e,i)}(e,n,i,r),sn(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new Vt(c[o],i(o),r));return n}var l=t.from,s=t.to,c=t.text,u=Ve(e,l.line),d=Ve(e,s.line),f=q(c),h=i(c.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Fi(e,t)){var m=a(0,c.length-1);o(d,d.text,h),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),h);else{var v=a(1,c.length-1);v.push(new Vt(f+u.text.slice(s.ch),h,r)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(d,f+d.text.slice(s.ch),h);var g=a(1,c.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,g)}sn(e,"change",e,t)}function Pi(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;a<r.linked.length;++a){var l=r.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;n&&!s||(t(l.doc,s),e(l.doc,r,s))}}}(e,null,!0)}function Ei(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,sr(e),Ni(e),Bi(e),e.options.lineWrapping||Gt(e),e.options.mode=t.modeOption,dr(e)}function Bi(e){("rtl"==e.doc.direction?O:L)(e.display.lineDiv,"CodeMirror-rtl")}function $i(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ii(e,t){var n={from:rt(t.from),to:Li(t),text:Je(e,t.from,t.to)};return ji(e,n,t.from.line,t.to.line+1),Pi(e,(function(e){return ji(e,n,t.from.line,t.to.line+1)}),!0),n}function Ri(e){for(;e.length&&q(e).ranges;)e.pop()}function Hi(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Ri(e.done),q(e.done)):e.done.length&&!q(e.done).ranges?q(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),q(e.done)):void 0}(i,i.lastOp==r)))a=q(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=Li(t):o.changes.push(Ii(e,t));else{var s=q(i.done);for(s&&s.ranges||zi(e.sel,i.done),o={changes:[Ii(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||pe(e,"historyAdded")}function Wi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,q(i.done),t))?i.done[i.done.length-1]=t:zi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Ri(i.undone)}function zi(e,t){var n=q(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ji(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Ui(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Gi(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Ui(n[i]));return r}(e,t),r=Lt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function Vi(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?xi.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];r.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&H(t,Number(u[1]))>-1&&(q(l)[d]=c[d],delete c[d])}}}return r}function Ji(e,t,n,r){if(r){var i=e.anchor;if(n){var o=tt(t,i)<0;o!=tt(n,i)<0?(i=t,t=n):o!=tt(t,n)<0&&(t=n)}return new Ci(i,t)}return new Ci(n||t,t)}function qi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qi(e,new xi([Ji(e.sel.primary(),t,n,i)],0),r)}function Ki(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Ji(e.sel.ranges[o],t[o],null,i);Qi(e,Si(e.cm,r,e.sel.primIndex),n)}function Yi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Qi(e,Si(e.cm,i,e.sel.primIndex),r)}function Xi(e,t,n,r){Qi(e,Ti(t,n),r)}function Zi(e,t,n){var r=e.history.done,i=q(r);i&&i.ranges?(r[r.length-1]=t,eo(e,t,n)):Qi(e,t,n)}function Qi(e,t,n){eo(e,t,n),Wi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function eo(e,t,n){(ge(e,"beforeSelectionChange")||e.cm&&ge(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Ci(lt(e,t[n].anchor),lt(e,t[n].head))},origin:n&&n.origin};return pe(e,"beforeSelectionChange",e,r),e.cm&&pe(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Si(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);to(e,ro(e,t,r,!0)),n&&!1===n.scroll||!e.cm||Ar(e.cm)}function to(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),sn(e,"cursorActivity",e))}function no(e){to(e,ro(e,e.sel,null,!1))}function ro(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=oo(e,a.anchor,l&&l.anchor,n,r),c=oo(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Ci(s,c))}return i?Si(e.cm,i,t.primIndex):t}function io(e,t,n,r,i){var o=Ve(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,u="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==l.from||(c?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(u?l.to>=t.ch:l.to>t.ch))){if(i&&(pe(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var d=s.find(r<0?1:-1),f=void 0;if((r<0?u:c)&&(d=ao(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=tt(d,n))&&(r<0?f<0:f>0))return io(e,d,t,r,i)}var h=s.find(r<0?-1:1);return(r<0?c:u)&&(h=ao(e,h,r,h.line==t.line?o:null)),h?io(e,h,t,r,i):null}}return t}function oo(e,t,n,r,i){var o=r||1,a=io(e,t,n,o,i)||!i&&io(e,t,n,o,!0)||io(e,t,n,-o,i)||!i&&io(e,t,n,-o,!0);return a||(e.cantEdit=!0,et(e.first,0))}function ao(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?lt(e,et(t.line-1)):null:n>0&&t.ch==(r||Ve(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+n)}function lo(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),z)}function so(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=lt(e,t)),n&&(r.to=lt(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),pe(e,"beforeChange",e,r),e.cm&&pe(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function co(e,t,n){if(e.cm){if(!e.cm.curOp)return ei(e.cm,co)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"))||(t=so(e,t,!0))){var r=kt&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=H(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(tt(c.to,l.from)<0||tt(c.from,l.to)>0)){var u=[s,1],d=tt(c.from,l.from),f=tt(c.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(f>0||!a.inclusiveRight&&!f)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)uo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else uo(e,t)}}function uo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Mi(e,t);Hi(e,t,n,e.cm?e.cm.curOp.id:NaN),po(e,t,n,Lt(e,t));var r=[];Pi(e,(function(e,n){n||-1!=H(r,e.history)||(yo(e.history,t),r.push(e.history)),po(e,t,null,Lt(e,t))}))}}function fo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,l="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,c=0;c<l.length&&(i=l[c],n?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=l.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=l.pop()).ranges){if(r)return void l.push(i);break}if(zi(i,s),n&&!i.equals(e.sel))return void Qi(e,i,{clearRedo:!1});a=i}var u=[];zi(a,s),s.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"),f=function(n){var r=i.changes[n];if(r.origin=t,d&&!so(e,r,!1))return l.length=0,{};u.push(Ii(e,r));var o=n?Mi(e,r):q(l);po(e,r,o,Gi(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:Li(r)});var a=[];Pi(e,(function(e,t){t||-1!=H(a,e.history)||(yo(e.history,r),a.push(e.history)),po(e,r,null,Gi(e,r))}))},h=i.changes.length-1;h>=0;--h){var p=f(h);if(p)return p.v}}}}function ho(e,t){if(0!=t&&(e.first+=t,e.sel=new xi(K(e.sel.ranges,(function(e){return new Ci(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){dr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)fr(e.cm,r,"gutter")}}function po(e,t,n,r){if(e.cm&&!e.cm.curOp)return ei(e.cm,po)(e,t,n,r);if(t.to.line<e.first)ho(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ho(e,i),t={from:et(e.first,0),to:et(t.to.line+i,t.to.ch),text:[q(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:et(o,Ve(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=Mi(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=Ye(It(Ve(r,o.line))),r.iter(s,a.line+1,(function(e){if(e==i.maxLine)return l=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ve(e),Oi(r,t,n,lr(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,(function(e){var t=Ut(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)})),l&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Ve(e,r).stateAfter;if(i&&(!(i instanceof ct)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,o.line),ri(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?dr(e):o.line!=a.line||1!=t.text.length||Fi(e.doc,t)?dr(e,o.line,a.line+1,c):fr(e,o.line,"text");var u=ge(e,"changes"),d=ge(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&sn(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,r):Oi(e,t,r),eo(e,n,z),e.cantEdit&&oo(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function mo(e,t,n,r,i){var o;r||(r=n),tt(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),co(e,{from:n,to:r,text:t,origin:i})}function vo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function go(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)vo(o.ranges[l].anchor,t,n,r),vo(o.ranges[l].head,t,n,r)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(n<c.from.line)c.from=et(c.from.line+r,c.from.ch),c.to=et(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function yo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;go(e.done,n,r,i),go(e.undone,n,r,i)}function bo(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Ve(e,at(e,t)):i=Ye(t),null==i?null:(r(o,i)&&e.cm&&fr(e.cm,i,n),o)}function wo(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function ko(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Ci.prototype.from=function(){return ot(this.anchor,this.head)},Ci.prototype.to=function(){return it(this.anchor,this.head)},Ci.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},wo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Jt(i),sn(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},ko.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof wo))){var l=[];this.collapse(l),this.children=[new wo(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new wo(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ko(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=H(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new ko(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var xo=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function Co(e,t,n){jt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Nr(e,n)}xo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Ye(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=kn(this);Ke(n,Math.max(0,n.height-o)),e&&(Qr(e,(function(){Co(e,n,-o),fr(e,r,"widget")})),sn(e,"lineWidgetCleared",e,this,r))}},xo.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=kn(this)-t;i&&(Wt(this.doc,r)||Ke(r,r.height+i),n&&Qr(n,(function(){n.curOp.forceUpdate=!0,Co(n,r,i),sn(n,"lineWidgetChanged",n,e,Ye(r))})))},ye(xo);var So=0,To=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++So};function Lo(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=$(r)).shared=!1;var o=[Lo(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Pi(e,(function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Lo(e,lt(e,t),lt(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=q(o)})),new _o(o,a)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ei(e.cm,Lo)(e,t,n,r,i);var o=new To(e,i),a=tt(t,n);if(r&&$(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if($t(e,t.line,t,n,o)||t.line!=n.line&&$t(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");xt=!0}o.addToHistory&&Hi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&It(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&Ke(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Ct(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Wt(e,t)&&Ke(t,0)})),o.clearOnEnter&&de(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(kt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)dr(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)fr(c,u,"text");o.atomic&&no(c.doc),sn(c,"markerAdded",c,o)}return o}To.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Vr(e),ge(this,"clear")){var n=this.find();n&&sn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=St(a.markedSpans,this);e&&!this.collapsed?fr(e,Ye(a),"text"):e&&(null!=l.to&&(i=Ye(a)),null!=l.from&&(r=Ye(a))),a.markedSpans=Tt(a.markedSpans,l),null==l.from&&this.collapsed&&!Wt(this.doc,a)&&e&&Ke(a,rr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var c=It(this.lines[s]),u=Ut(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&dr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&sn(e,"markerCleared",e,this,r,i),t&&Jr(e),this.parent&&this.parent.clear()}},To.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=St(o.markedSpans,this);if(null!=a.from&&(n=et(t?o:Ye(o),a.from),-1==e))return n;if(null!=a.to&&(r=et(t?o:Ye(o),a.to),1==e))return r}return n&&{from:n,to:r}},To.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Qr(r,(function(){var i=t.line,o=Ye(t.line),a=An(r,o);if(a&&(In(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Wt(n.doc,i)&&null!=n.height){var l=n.height;n.height=null;var s=kn(n)-l;s&&Ke(i,i.height+s)}sn(r,"markerChanged",r,e)}))},To.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=H(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},To.prototype.detachLine=function(e){if(this.lines.splice(H(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(To);var _o=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Mo(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Do(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Pi(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==H(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}_o.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sn(this,"clear")}},_o.prototype.find=function(e,t){return this.primary.find(e,t)},ye(_o);var No=0,Ao=function(e,t,n,r,i){if(!(this instanceof Ao))return new Ao(e,t,n,r,i);null==n&&(n=0),ko.call(this,[new wo([new Vt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=et(n,0);this.sel=Ti(o),this.history=new $i(null),this.id=++No,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Oi(this,{from:o,to:o,text:e}),Qi(this,Ti(o),z)};Ao.prototype=X(ko.prototype,{constructor:Ao,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=qe(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ni((function(e){var t=et(this.first,0),n=this.first+this.size-1;co(this,{from:t,to:et(n,Ve(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Fr(this.cm,0,0),Qi(this,Ti(t),z)})),replaceRange:function(e,t,n,r){mo(this,e,t=lt(this,t),n=n?lt(this,n):t,r)},getRange:function(e,t,n){var r=Je(this,lt(this,e),lt(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ze(this,e))return Ve(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ve(this,e)),It(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return lt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ni((function(e,t,n){Xi(this,lt(this,"number"==typeof e?et(e,t||0):e),null,n)})),setSelection:ni((function(e,t,n){Xi(this,lt(this,e),lt(this,t||e),n)})),extendSelection:ni((function(e,t,n){qi(this,lt(this,e),t&<(this,t),n)})),extendSelections:ni((function(e,t){Ki(this,st(this,e),t)})),extendSelectionsBy:ni((function(e,t){Ki(this,st(this,K(this.sel.ranges,e)),t)})),setSelections:ni((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Ci(lt(this,e[i].anchor),lt(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Qi(this,Si(this.cm,r,t),n)}})),addSelection:ni((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Ci(lt(this,e),lt(this,t||e))),Qi(this,Si(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Je(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Je(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:ni((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&"end"!=t&&function(e,t,n){for(var r=[],i=et(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Di(l.from,i,o),c=Di(Li(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],d=tt(u.head,u.anchor)<0;r[a]=new Ci(d?c:s,d?s:c)}else r[a]=new Ci(s,s)}return new xi(r,e.sel.primIndex)}(this,r,t),s=r.length-1;s>=0;s--)co(this,r[s]);l?Zi(this,l):this.cm&&Ar(this.cm)})),undo:ni((function(){fo(this,"undo")})),redo:ni((function(){fo(this,"redo")})),undoSelection:ni((function(){fo(this,"undo",!0)})),redoSelection:ni((function(){fo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new $i(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Vi(this.history.done),undone:Vi(this.history.undone)}},setHistory:function(e){var t=this.history=new $i(this.history.maxGeneration);t.done=Vi(e.done.slice(0),null,!0),t.undone=Vi(e.undone.slice(0),null,!0)},setGutterMarker:ni((function(e,t,n){return bo(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&te(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:ni((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bo(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,te(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Ze(this,e))return null;if(t=e,!(e=Ve(this,e)))return null}else if(null==(t=Ye(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ni((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(S(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:ni((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(S(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:ni((function(e,t,n){return function(e,t,n,r){var i=new xo(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),bo(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Wt(e,t)){var r=jt(t)<e.scrollTop;Ke(t,t.height+kn(i)),r&&Nr(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&sn(o,"lineWidgetAdded",o,i,"number"==typeof t?t:Ye(t)),i}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Lo(this,lt(this,e),lt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Lo(this,e=lt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ve(this,(e=lt(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=lt(this,e),t=lt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),lt(this,et(n,t))},indexFromPos:function(e){var t=(e=lt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Ao(qe(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ao(qe(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(tt(o,a)){var l=Lo(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}(r,Mo(this)),r},unlinkDoc:function(e){if(e instanceof _a&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Do(Mo(this));break}if(e.history==this.history){var n=[e.id];Pi(e,(function(e){return n.push(e.id)}),!0),e.history=new $i(null),e.history.done=Vi(this.history.done,n),e.history.undone=Vi(this.history.undone,n)}},iterLinkedDocs:function(e){Pi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ae(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ni((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Qr(t=this.cm,(function(){Bi(t),dr(t)})))}))}),Ao.prototype.eachLine=Ao.prototype.iter;var Fo=0;function Oo(e){var t=this;if(Po(t),!me(t,e)&&!xn(t.display,e)){be(e),a&&(Fo=+new Date);var n=cr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),l=0,s=function(e,r){if(!t.options.allowDropFileTypes||-1!=H(t.options.allowDropFileTypes,e.type)){var a=new FileReader;a.onload=ei(t,(function(){var e=a.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++l==i){var s={from:n=lt(t.doc,n),to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};co(t.doc,s),Zi(t.doc,Ti(n,Li(s)))}})),a.readAsText(e)}},c=0;c<i;++c)s(r[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var u=e.dataTransfer.getData("Text");if(u){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),eo(t.doc,Ti(n,n)),d)for(var f=0;f<d.length;++f)mo(t.doc,"",d[f].anchor,d[f].head,"drag");t.replaceSelection(u,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Po(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Eo(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Bo=!1;function $o(){var e;Bo||(de(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Eo(Io)}),100))})),de(window,"blur",(function(){return Eo(Tr)})),Bo=!0)}function Io(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ro={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ho=0;Ho<10;Ho++)Ro[Ho+48]=Ro[Ho+96]=String(Ho);for(var Wo=65;Wo<=90;Wo++)Ro[Wo]=String.fromCharCode(Wo);for(var zo=1;zo<=12;zo++)Ro[zo+111]=Ro[zo+63235]="F"+zo;var jo={};function Uo(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Go(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=K(n.split(" "),Uo),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function Vo(e,t,n,r){var i=(t=Yo(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Vo(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Vo(e,t.fallthrough[o],n,r);if(a)return a}}}function Jo(e){var t="string"==typeof e?e:Ro[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function qo(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Ko(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=Ro[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),qo(n,e,t))}function Yo(e){return"string"==typeof e?jo[e]:e}function Xo(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&tt(o.from,q(r).to)<=0;){var a=r.pop();if(tt(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Qr(e,(function(){for(var t=r.length-1;t>=0;t--)mo(e.doc,"",r[t].from,r[t].to,"+delete");Ar(e)}))}function Zo(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Qo(e,t,n){var r=Zo(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function ea(e,t,n,r,i){if(e){var o=ce(n,t.doc.direction);if(o){var a,l=i<0?q(o):o[0],s=i<0==(1==l.level)?"after":"before";if(l.level>0||"rtl"==t.doc.direction){var c=Fn(t,n);a=i<0?n.text.length-1:0;var u=On(t,c,a).top;a=oe((function(e){return On(t,c,e).top==u}),i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=Zo(n,a,1))}else a=i<0?l.to:l.from;return new et(r,a,s)}}return new et(r,i<0?n.text.length:0,i<0?"before":"after")}jo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},jo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},jo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},jo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},jo.default=y?jo.macDefault:jo.pcDefault;var ta={selectAll:lo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),z)},killLine:function(e){return Xo(e,(function(t){if(t.empty()){var n=Ve(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Xo(e,(function(t){return{from:et(t.from().line,0),to:lt(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Xo(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Xo(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Xo(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return na(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ve(e.doc,t),r=function(e){for(var t;t=Et(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Ye(r)),ea(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),U)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),U)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ra(e,t.head):r}),U)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=I(e.getLine(o.line),o.ch,r);t.push(J(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Qr(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=Ve(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new et(i.line,i.ch-1)),i.ch>0)i=new et(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Ve(e.doc,i.line-1).text;a&&(i=new et(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(i.line-1,a.length-1),i,"+transpose"))}n.push(new Ci(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Qr(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Ar(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function na(e,t){var n=Ve(e.doc,t),r=It(n);return r!=n&&(t=Ye(r)),ea(!0,e,r,t,1)}function ra(e,t){var n=na(e,t.line),r=Ve(e.doc,n.line),i=ce(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return et(n.line,a?0:o,n.sticky)}return n}function ia(e,t,n){if("string"==typeof t&&!(t=ta[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=W}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var oa=new R;function aa(e,t,n,r){var i=e.state.keySeq;if(i){if(Jo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:oa.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),la(e,i+" "+t,n,r))return!0}return la(e,t,n,r)}function la(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Vo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Vo(t,e.options.extraKeys,n,e)||Vo(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&sn(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(be(n),kr(e)),!!i}function sa(e,t){var n=Ko(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?aa(e,"Shift-"+n,t,(function(t){return ia(e,t,!0)}))||aa(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ia(e,t)})):aa(e,n,t,(function(t){return ia(e,t)})))}var ca=null;function ua(e){var t=this;if(t.curOp.focus=F(),!me(t,e)){a&&l<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=sa(t,e);d&&(ca=r?n:null,r||88!=n||Oe||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(L(t,"CodeMirror-crosshair"),he(document,"keyup",n),he(document,"mouseover",n))}O(t,"CodeMirror-crosshair"),de(document,"keyup",n),de(document,"mouseover",n)}(t)}}function da(e){16==e.keyCode&&(this.doc.sel.shift=!1),me(this,e)}function fa(e){var t=this;if(!(xn(t.display,e)||me(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==ca)return ca=null,void be(e);if(!d||e.which&&!(e.which<10)||!sa(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return aa(e,"'"+n+"'",t,(function(t){return ia(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var ha,pa,ma=function(e,t,n){this.time=e,this.pos=t,this.button=n};function va(e){var t=this,n=t.display;if(!(me(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,xn(n,e))s||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!ba(t,e)){var r=cr(t,e),i=Se(e),o=r?function(e,t){var n=+new Date;return pa&&pa.compare(n,e,t)?(ha=pa=null,"triple"):ha&&ha.compare(n,e,t)?(pa=new ma(n,e,t),ha=null,"double"):(ha=new ma(n,e,t),pa=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),aa(e,qo(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=ta[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=W}finally{e.state.suppressEdits=!1}return r}))}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){a?setTimeout(B(xr,e),0):e.curOp.focus=F();var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey)),i}(e,n,r),c=e.doc.sel;e.options.dragDrop&&_e&&!e.isReadOnly()&&"single"==n&&(i=c.contains(t))>-1&&(tt((i=c.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,c=ei(e,(function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,he(i.wrapper.ownerDocument,"mouseup",c),he(i.wrapper.ownerDocument,"mousemove",u),he(i.scroller,"dragstart",d),he(i.scroller,"drop",c),o||(be(t),r.addNew||qi(e.doc,n,null,null,r.extend),s||a&&9==l?setTimeout((function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()}),20):i.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};s&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),de(i.wrapper.ownerDocument,"mouseup",c),de(i.wrapper.ownerDocument,"mousemove",u),de(i.scroller,"dragstart",d),de(i.scroller,"drop",c),Cr(e),setTimeout((function(){return i.input.focus()}),20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;be(t);var a,l,s=o.sel,c=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),a=l>-1?c[l]:new Ci(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new Ci(n,n)),n=cr(e,t,!0,!0),l=-1;else{var u=ga(e,n,r.unit);a=r.extend?Ji(a,u.anchor,u.head,r.extend):u}r.addNew?-1==l?(l=c.length,Qi(o,Si(e,c.concat([a]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(Qi(o,Si(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):Yi(o,l,a,j):(l=0,Qi(o,new xi([a],0),j),s=o.sel);var d=n;function f(t){if(0!=tt(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],c=e.options.tabSize,u=I(Ve(o,n.line).text,n.ch,c),f=I(Ve(o,t.line).text,t.ch,c),h=Math.min(u,f),p=Math.max(u,f),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var g=Ve(o,m).text,y=G(g,h,c);h==p?i.push(new Ci(et(m,y),et(m,y))):g.length>y&&i.push(new Ci(et(m,y),et(m,G(g,p,c))))}i.length||i.push(new Ci(n,n)),Qi(o,Si(e,s.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=a,k=ga(e,t,r.unit),x=w.anchor;tt(k.anchor,x)>0?(b=k.head,x=ot(w.from(),k.anchor)):(b=k.anchor,x=it(w.to(),k.head));var C=s.ranges.slice(0);C[l]=function(e,t){var n=t.anchor,r=t.head,i=Ve(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var o=ce(i);if(!o)return t;var a=le(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s,c=a+(l.from==n.ch==(1!=l.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=le(o,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==l.level?-1:1);s=u==c-1||u==c?d<0:d>0}var f=o[c+(s?-1:0)],h=s==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return n.ch==p&&n.sticky==m?t:new Ci(new et(n.line,p,m),r)}(e,new Ci(lt(o,x),b)),Qi(o,Si(e,C,l),j)}}var h=i.wrapper.getBoundingClientRect(),p=0;function m(t){e.state.selectingText=!1,p=1/0,t&&(be(t),i.input.focus()),he(i.wrapper.ownerDocument,"mousemove",v),he(i.wrapper.ownerDocument,"mouseup",g),o.history.lastSelOrigin=null}var v=ei(e,(function(t){0!==t.buttons&&Se(t)?function t(n){var a=++p,l=cr(e,n,!0,"rectangle"==r.unit);if(l)if(0!=tt(l,d)){e.curOp.focus=F(),f(l);var s=Mr(i,o);(l.line>=s.to||l.line<s.from)&&setTimeout(ei(e,(function(){p==a&&t(n)})),150)}else{var c=n.clientY<h.top?-20:n.clientY>h.bottom?20:0;c&&setTimeout(ei(e,(function(){p==a&&(i.scroller.scrollTop+=c,t(n))})),50)}}(t):m(t)})),g=ei(e,m);e.state.selectingText=g,de(i.wrapper.ownerDocument,"mousemove",v),de(i.wrapper.ownerDocument,"mouseup",g)}(e,r,t,o)}(t,r,o,e):Ce(e)==n.scroller&&be(e):2==i?(r&&qi(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(C?t.display.input.onContextMenu(e):Cr(t)))}}function ga(e,t,n){if("char"==n)return new Ci(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Ci(et(t.line,0),lt(e.doc,et(t.line+1,0)));var r=n(e,t);return new Ci(r.from,r.to)}function ya(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&be(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!ge(e,n))return ke(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i)return pe(e,n,e,Xe(e.doc,o),e.display.gutterSpecs[s].className,t),ke(t)}}function ba(e,t){return ya(e,t,"gutterClick",!0)}function wa(e,t){xn(e.display,t)||function(e,t){return!!ge(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function ka(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hn(e)}ma.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var xa={toString:function(){return"CodeMirror.Init"}},Ca={},Sa={};function Ta(e,t,n){if(!t!=!(n&&n!=xa)){var r=e.display.dragFunctions,i=t?de:he;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function La(e){e.options.lineWrapping?(O(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),Gt(e)),sr(e),dr(e),Hn(e),setTimeout((function(){return Wr(e)}),100)}function _a(e,t){var n=this;if(!(this instanceof _a))return new _a(e,t);this.options=t=t?$(t):{},$(Ca,t,!1);var r=t.value;"string"==typeof r?r=new Ao(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new _a.inputStyles[t.inputStyle](this),o=this.display=new vi(e,r,i,t);for(var c in o.wrapper.CodeMirror=this,ka(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ur(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 R,keySeq:null,specialChars:null},t.autofocus&&!g&&o.input.focus(),a&&l<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;de(t.scroller,"mousedown",ei(e,va)),de(t.scroller,"dblclick",a&&l<11?ei(e,(function(t){if(!me(e,t)){var n=cr(e,t);if(n&&!ba(e,t)&&!xn(e.display,t)){be(t);var r=e.findWordAt(n);qi(e.doc,r.anchor,r.head)}}})):function(t){return me(e,t)||be(t)}),de(t.scroller,"contextmenu",(function(t){return wa(e,t)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}de(t.scroller,"touchstart",(function(i){if(!me(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!ba(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),de(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),de(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!xn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,l=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new Ci(l,l):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(l):new Ci(et(l.line,0),lt(e.doc,et(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(n)}i()})),de(t.scroller,"touchcancel",i),de(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Er(e,t.scroller.scrollTop),$r(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),de(t.scroller,"mousewheel",(function(t){return ki(e,t)})),de(t.scroller,"DOMMouseScroll",(function(t){return ki(e,t)})),de(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||xe(t)},over:function(t){me(e,t)||(function(e,t){var n=cr(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=D("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),M(e.display.dragCursor,r)}}(e,t),xe(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Fo<100))xe(t);else if(!me(e,t)&&!xn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=D("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:ei(e,Oo),leave:function(t){me(e,t)||Po(e)}};var s=t.input.getField();de(s,"keyup",(function(t){return da.call(e,t)})),de(s,"keydown",ei(e,ua)),de(s,"keypress",ei(e,fa)),de(s,"focus",(function(t){return Sr(e,t)})),de(s,"blur",(function(t){return Tr(e,t)}))}(this),$o(),Vr(this),this.curOp.forceUpdate=!0,Ei(this,r),t.autofocus&&!g||this.hasFocus()?setTimeout(B(Sr,this),20):Tr(this),Sa)Sa.hasOwnProperty(c)&&Sa[c](n,t[c],xa);fi(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Ma.length;++u)Ma[u](n);Jr(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}_a.defaults=Ca,_a.optionHandlers=Sa;var Ma=[];function Da(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=ht(e,t).state:n="prev");var a=e.options.tabSize,l=Ve(o,t),s=I(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==W||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?I(Ve(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)f+=a,d+="\t";if(f<c&&(d+=J(c-f)),d!=u)return mo(o,d,et(t,0),et(t,u.length),"+input"),l.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<u.length){var v=et(t,u.length);Yi(o,p,new Ci(v,v));break}}}_a.defineInitHook=function(e){return Ma.push(e)};var Na=null;function Aa(e){Na=e}function Fa(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,l="paste"==i||e.state.pasteIncoming>a,s=Ae(t),c=null;if(l&&r.ranges.length>1)if(Na&&Na.text.join("\n")==t){if(r.ranges.length%Na.text.length==0){c=[];for(var u=0;u<Na.text.length;u++)c.push(o.splitLines(Na.text[u]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=K(s,(function(e){return[e]})));for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var h=r.ranges[f],p=h.from(),m=h.to();h.empty()&&(n&&n>0?p=et(p.line,p.ch-n):e.state.overwrite&&!l?m=et(m.line,Math.min(Ve(o,m.line).text.length,m.ch+q(s).length)):l&&Na&&Na.lineWise&&Na.text.join("\n")==t&&(p=m=et(p.line,0)));var v={from:p,to:m,text:c?c[f%c.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};co(e.doc,v),sn(e,"inputRead",e,v)}t&&!l&&Pa(e,t),Ar(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Oa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qr(t,(function(){return Fa(t,n,0,null,"paste")})),!0}function Pa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Da(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ve(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Da(e,i.head.line,"smart"));a&&sn(e,"electricInput",e,i.head.line)}}}function Ea(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:et(i,0),head:et(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Ba(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function $a(){var e=D("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=D("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Ba(e),t}function Ia(e,t,n,r,i){var o=t,a=n,l=Ve(e,t.line);function s(r){var o,a;if(null==(o=i?function(e,t,n,r){var i=ce(t,e.doc.direction);if(!i)return Qo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=le(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Qo(t,n,r);var l,s=function(e,n){return Zo(t,e instanceof et?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(l=l||Fn(e,t),Zn(e,t,l,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?s(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==r<0,f=s(n,d?1:-1);if(null!=f&&(d?f<=a.to&&f<=u.end:f>=a.from&&f>=u.begin)){var h=d?"before":"after";return new et(n.line,f,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new et(n.line,s(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),c=l?r.begin:s(r.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),r.begin<=c&&c<r.end)return o(c,l)}},m=p(o+r,r,u);if(m)return m;var v=r>0?u.end:s(u.begin,-1);return null==v||r>0&&v==t.text.length||!(m=p(r>0?0:i.length-1,r,c(v)))?null:m}(e.cm,l,t,n):Qo(l,t,n))){if(r||(a=t.line+n)<e.first||a>=e.first+e.size||(t=new et(a,t.ch,t.sticky),!(l=Ve(e,a))))return!1;t=ea(i,e.cm,l,t.line,n)}else t=o;return!0}if("char"==r)s();else if("column"==r)s(!0);else if("word"==r||"group"==r)for(var c=null,u="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||s(!f);f=!1){var h=l.text.charAt(t.ch)||"\n",p=ee(h,d)?"w":u&&"\n"==h?"n":!u||/\s/.test(h)?null:"p";if(!u||f||p||(p="s"),c&&c!=p){n<0&&(n=1,s(),t.sticky="after");break}if(p&&(c=p),n>0&&!s(!f))break}var m=oo(e,t,o,a,!0);return nt(o,m)&&(m.hitSide=!0),m}function Ra(e,t,n,r){var i,o,a=e.doc,l=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*rr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Yn(e,l,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ha=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Wa(e,t){var n=An(e,t.line);if(!n||n.hidden)return null;var r=Ve(e.doc,t.line),i=Dn(n,r,t.line),o=ce(r,e.doc.direction),a="left";o&&(a=le(o,t.ch)%2?"right":"left");var l=Bn(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function za(e,t){return t&&(e.bad=!0),e}function ja(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return za(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Ua(o,t,n)}}function Ua(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!A(r,t))return za(et(Ye(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?q(e.rest):e.line;return za(et(Ye(o),o.text.length),i)}var a=3==t.nodeType?t:null,l=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,c=s.maps;function u(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?s.map:c[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var u=Ye(i<0?e.line:e.rest[i]),d=o[a]+r;return(r<0||l!=t)&&(d=o[a+(r?1:0)]),et(u,d)}}}var d=u(a,l,n);if(d)return za(d,i);for(var f=l.nextSibling,h=a?a.nodeValue.length-n:0;f;f=f.nextSibling){if(d=u(f,f.firstChild,0))return za(et(d.line,d.ch-h),i);h+=f.textContent.length}for(var p=l.previousSibling,m=n;p;p=p.previousSibling){if(d=u(p,p.firstChild,-1))return za(et(d.line,d.ch+m),i);m+=p.textContent.length}}Ha.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){if(!me(r,e)){if(r.somethingSelected())Aa({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Ea(r);Aa({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,z),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var o=Na.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=$a(),l=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),l.value=Na.text.join("\n");var s=document.activeElement;E(l),setTimeout((function(){r.display.lineSpace.removeChild(a),s.focus(),s==i&&n.showPrimarySelection()}),50)}}Ba(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),de(i,"paste",(function(e){me(r,e)||Oa(e,r)||l<=11&&setTimeout(ei(r,(function(){return t.updateFromDOM()})),20)})),de(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),de(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),de(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),de(i,"touchstart",(function(){return n.forceCompositionEnd()})),de(i,"input",(function(){t.composing||t.readFromDOMSoon()})),de(i,"copy",o),de(i,"cut",o)},Ha.prototype.prepareSelection=function(){var e=gr(this.cm,!1);return e.focus=this.cm.state.focused,e},Ha.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ha.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ha.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=ja(t,e.anchorNode,e.anchorOffset),l=ja(t,e.focusNode,e.focusOffset);if(!a||a.bad||!l||l.bad||0!=tt(ot(a,l),i)||0!=tt(it(a,l),o)){var s=t.display.view,c=i.line>=t.display.viewFrom&&Wa(t,i)||{node:s[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&Wa(t,o);if(!u){var d=s[s.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(c&&u){var h,p=e.rangeCount&&e.getRangeAt(0);try{h=T(c.node,c.offset,u.offset,u.node)}catch(e){}h&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ha.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Ha.prototype.showMultipleSelections=function(e){M(this.cm.display.cursorDiv,e.cursors),M(this.cm.display.selectionDiv,e.selection)},Ha.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ha.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return A(this.div,t)},Ha.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ha.prototype.blur=function(){this.div.blur()},Ha.prototype.getField=function(){return this.div},Ha.prototype.supportsTouch=function(){return!0},Ha.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Qr(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Ha.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ha.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=ja(t,e.anchorNode,e.anchorOffset),r=ja(t,e.focusNode,e.focusOffset);n&&r&&Qr(t,(function(){Qi(t.doc,Ti(n,r),z),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Ha.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=et(a.line-1,Ve(r.doc,a.line-1).length)),l.ch==Ve(r.doc,l.line).text.length&&l.line<r.lastLine()&&(l=et(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=ur(r,a.line))?(t=Ye(i.view[0].line),n=i.view[0].node):(t=Ye(i.view[e].line),n=i.view[e-1].node.nextSibling);var s,c,u=ur(r,l.line);if(u==i.view.length-1?(s=i.viewTo-1,c=i.lineDiv.lastChild):(s=Ye(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function c(){a&&(o+=l,s&&(o+=l),a=s=!1)}function u(e){e&&(c(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(et(r,0),et(i+1,0),(v=+f,function(e){return e.id==v}));return void(h.length&&(o=h[0].find(0))&&u(Je(e.doc,o.from,o.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&c();for(var m=0;m<t.childNodes.length;m++)d(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),p&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;d(t),t!=n;)t=t.nextSibling,s=!1;return o}(r,n,c,t,s)),f=Je(r.doc,et(t,0),et(s,Ve(r.doc,s).text.length));d.length>1&&f.length>1;)if(q(d)==q(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],v=f[0],g=Math.min(m.length,v.length);h<g&&m.charCodeAt(h)==v.charCodeAt(h);)++h;for(var y=q(d),b=q(f),w=Math.min(y.length-(1==d.length?h:0),b.length-(1==f.length?h:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==d.length&&1==f.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var k=et(t,h),x=et(s,f.length?q(f).length-p:0);return d.length>1||d[0]||tt(k,x)?(mo(r.doc,d,k,x,"+input"),!0):void 0},Ha.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ha.prototype.reset=function(){this.forceCompositionEnd()},Ha.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ha.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ha.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return dr(e.cm)}))},Ha.prototype.setUneditable=function(e){e.contentEditable="false"},Ha.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,Fa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ha.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ha.prototype.onContextMenu=function(){},Ha.prototype.resetPosition=function(){},Ha.prototype.needsContentAttribute=!0;var Ga=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null};Ga.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!me(r,e)){if(r.somethingSelected())Aa({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Ea(r);Aa({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,z):(n.prevInput="",i.value=t.text.join("\n"),E(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),de(i,"input",(function(){a&&l>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),de(i,"paste",(function(e){me(r,e)||Oa(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),de(i,"cut",o),de(i,"copy",o),de(e.scroller,"paste",(function(t){if(!xn(e,t)&&!me(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),de(e.lineSpace,"selectstart",(function(t){xn(e,t)||be(t)})),de(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),de(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Ga.prototype.createField=function(e){this.wrapper=$a(),this.textarea=this.wrapper.firstChild},Ga.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=gr(e);if(e.options.moveInputWithCursor){var i=Jn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Ga.prototype.showSelection=function(e){var t=this.cm.display;M(t.cursorDiv,e.cursors),M(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ga.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&E(this.textarea),a&&l>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&l>=9&&(this.hasSelection=null))}},Ga.prototype.getField=function(){return this.textarea},Ga.prototype.supportsTouch=function(){return!1},Ga.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||F()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ga.prototype.blur=function(){this.textarea.blur()},Ga.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ga.prototype.receivedFocus=function(){this.slowPoll()},Ga.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Ga.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Ga.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Fe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&l>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,c=Math.min(r.length,i.length);s<c&&r.charCodeAt(s)==i.charCodeAt(s);)++s;return Qr(t,(function(){Fa(t,i.slice(s),r.length-s,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Ga.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ga.prototype.onKeyPress=function(){a&&l>=9&&(this.hasSelection=null),this.fastPoll()},Ga.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=cr(n,e),c=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ei(n,Qi)(n.doc,Ti(o),z);var u,f=i.style.cssText,h=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(u=window.scrollY),r.input.focus(),s&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&l>=9&&v(),C){xe(e);var m=function(){he(window,"mouseup",m),setTimeout(g,20)};de(window,"mouseup",m)}else setTimeout(g,50)}function v(){if(null!=i.selectionStart){var e=n.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=f,a&&l<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&l<9)&&v();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?ei(n,lo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Ga.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Ga.prototype.setUneditable=function(){},Ga.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=xa&&i(e,t,n)}:i)}e.defineOption=n,e.Init=xa,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Ni(e)}),!0),n("indentUnit",2,Ni,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ai(e),Hn(e),dr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(et(r,o))}r++}));for(var i=n.length-1;i>=0;i--)mo(e.doc,t,n[i],et(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=xa&&e.refresh()})),n("specialCharPlaceholder",Zt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){ka(e),mi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Yo(t),i=n!=xa&&Yo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,La,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=hi(t,e.options.lineNumbers),mi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ar(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Wr(e)}),!0),n("scrollbarStyle","native",(function(e){Ur(e),Wr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=hi(e.options.gutters,t),mi(e)}),!0),n("firstLineNumber",1,mi,!0),n("lineNumberFormatter",(function(e){return e}),mi,!0),n("showCursorWhenSelecting",!1,vr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Tr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ta),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vr,!0),n("singleCursorHeightPerLine",!0,vr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ai,!0),n("addModeClass",!1,Ai,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ai,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(_a),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ei(this,t[e])(this,n,i),pe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Yo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:ti((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,dr(this)})),removeOverlay:ti((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void dr(this)}})),indentLine:ti((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Ze(this.doc,e)&&Da(this,e,t,n)})),indentSelection:ti((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Da(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Ar(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s<n;++s)Da(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&Yi(this.doc,r,new Ci(o,c[r].to()),z)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=lt(this.doc,e);var t,n=ft(this,Ve(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var l=i[o[t][a]];l&&r.push(l)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var s=0;s<i._global.length;s++){var c=i._global[s];c.pred(o,this)&&-1==H(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return ht(this,(e=at(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Jn(this,null==e?n.head:"object"==typeof e?lt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Vn(this,lt(this.doc,e),t||"page")},coordsChar:function(e,t){return Yn(this,(e=Gn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Gn(this,{top:e,left:0},t||"page").top,Xe(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=Ve(this.doc,e)}else r=e;return Un(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-jt(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,l,s=this.display,c=(e=Jn(this,lt(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var d=Math.max(s.wrapper.clientHeight,this.doc.height),f=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(c=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(l=Dr(o,a)).scrollTop&&Er(o,l.scrollTop),null!=l.scrollLeft&&$r(o,l.scrollLeft))},triggerOnKeyDown:ti(ua),triggerOnKeyPress:ti(fa),triggerOnKeyUp:da,triggerOnMouseDown:ti(va),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:ti((function(e){Pa(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=lt(this.doc,e),a=0;a<t&&!(o=Ia(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:ti((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Ia(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),U)})),deleteH:ti((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Xo(this,(function(n){var i=Ia(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=lt(this.doc,e),l=0;l<t;++l){var s=Jn(this,a,"div");if(null==o?o=s.left:s.left=o,(a=Ra(this,s,i,n)).hitSide)break}return a},moveV:ti((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var l=Jn(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Ra(n,l,e,t);return"page"==t&&a==r.sel.primary()&&Nr(n,Vn(n,s,"div").top-l.top),s}),U),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=Ve(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),a=ee(o,i)?function(e){return ee(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new Ci(et(e.line,n),et(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?O(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),pe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==F()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ti((function(e,t){Fr(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Ln(this)-this.display.barHeight,width:e.scrollWidth-Ln(this)-this.display.barWidth,clientHeight:Mn(this),clientWidth:_n(this)}},scrollIntoView:ti((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Or(e),e.curOp.scrollToPos=t}(this,e):Pr(this,e.from,e.to,e.margin)})),setSize:ti((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Rn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){fr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,pe(this,"refresh",this)})),operation:function(e){return Qr(this,e)},startOperation:function(){return Vr(this)},endOperation:function(){return Jr(this)},refresh:ti((function(){var e=this.display.cachedTextHeight;dr(this),this.curOp.forceUpdate=!0,Hn(this),Fr(this,this.doc.scrollLeft,this.doc.scrollTop),ci(this.display),(null==e||Math.abs(e-rr(this.display))>.5)&&sr(this),pe(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ei(this,e),Hn(this),this.display.input.reset(),Fr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(_a);var Va="iter insert remove copy getEditor constructor".split(" ");for(var Ja in Ao.prototype)Ao.prototype.hasOwnProperty(Ja)&&H(Va,Ja)<0&&(_a.prototype[Ja]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ao.prototype[Ja]));return ye(Ao),_a.inputStyles={textarea:Ga,contenteditable:Ha},_a.defineMode=function(e){_a.defaults.mode||"null"==e||(_a.defaults.mode=e),$e.apply(this,arguments)},_a.defineMIME=function(e,t){Be[e]=t},_a.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),_a.defineMIME("text/plain","null"),_a.defineExtension=function(e,t){_a.prototype[e]=t},_a.defineDocExtension=function(e,t){Ao.prototype[e]=t},_a.fromTextArea=function(e,t){if((t=t?$(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=F();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(de(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(he(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var l=_a((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l},function(e){e.off=he,e.on=de,e.wheelEventPixels=wi,e.Doc=Ao,e.splitLines=Ae,e.countColumn=I,e.findColumn=G,e.isWordChar=Q,e.Pass=W,e.signal=pe,e.Line=Vt,e.changeEnd=Li,e.scrollbarModel=jr,e.Pos=et,e.cmpPos=tt,e.modes=Ee,e.mimeModes=Be,e.resolveMode=Ie,e.getMode=Re,e.modeExtensions=He,e.extendMode=We,e.copyState=ze,e.startState=Ue,e.innerMode=je,e.commands=ta,e.keyMap=jo,e.keyName=Ko,e.isModifierKey=Jo,e.lookupKey=Vo,e.normalizeKeyMap=Go,e.StringStream=Ge,e.SharedTextMarker=_o,e.TextMarker=To,e.LineWidget=xo,e.e_preventDefault=be,e.e_stopPropagation=we,e.e_stop=xe,e.addClass=O,e.contains=A,e.rmClass=L,e.keyNames=Ro}(_a),_a.version="5.49.2",_a},"object"==typeof n&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):r.CodeMirror=i()},{}],11:[function(e,t,n){var r;r=function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,i,o=t.indentUnit,a=n.statementIndent,l=n.jsonld,s=n.json||l,c=n.typescript,u=n.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),f=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function p(e,t,n){return r=e,i=n,t}function m(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,i=!1;if(l&&"@"==e.peek()&&e.match(h))return t.tokenize=m,p("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||i);)i=!i&&"\\"==r;return i||(t.tokenize=m),p("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return p("number","number");if("."==r&&e.match(".."))return p("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return p(r);if("="==r&&e.eat(">"))return p("=>","operator");if("0"==r&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return p("number","number");if(/\d/.test(r))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),p("number","number");if("/"==r)return e.eat("*")?(t.tokenize=v,v(e,t)):e.eat("/")?(e.skipToEnd(),p("comment","comment")):Je(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),p("regexp","string-2")):(e.eat("="),p("operator","operator",e.current()));if("`"==r)return t.tokenize=g,g(e,t);if("#"==r)return e.skipToEnd(),p("error","error");if("<"==r&&e.match("!--")||"-"==r&&e.match("->"))return e.skipToEnd(),p("comment","comment");if(f.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),p("operator","operator",e.current());if(u.test(r)){e.eatWhile(u);var i=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(i)){var o=d[i];return p(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return p("async","keyword",i)}return p("variable","variable",i)}}function v(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=m;break}r="*"==n}return p("comment","comment")}function g(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=m;break}r=!r&&"\\"==n}return p("quasi","string-2",e.current())}function y(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(c){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var l=e.string.charAt(a),s="([{}])".indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(u.test(l))o=!0;else if(/["'\/`]/.test(l))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==l&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var b={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function w(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function k(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}var x={state:null,column:null,marked:null,cc:null};function C(){for(var e=arguments.length-1;e>=0;e--)x.cc.push(arguments[e])}function S(){return C.apply(null,arguments),!0}function T(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function L(e){var t=x.state;if(x.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,n){if(n){if(n.block){var r=e(t,n.prev);return r?r==n.prev?n:new M(r,n.vars,!0):null}return T(t,n.vars)?n:new M(n.prev,new D(t,n.vars),!1)}return null}(e,t.context);if(null!=r)return void(t.context=r)}else if(!T(e,t.localVars))return void(t.localVars=new D(e,t.localVars));n.globalVars&&!T(e,t.globalVars)&&(t.globalVars=new D(e,t.globalVars))}function _(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function M(e,t,n){this.prev=e,this.vars=t,this.block=n}function D(e,t){this.name=e,this.next=t}var N=new D("this",new D("arguments",null));function A(){x.state.context=new M(x.state.context,x.state.localVars,!1),x.state.localVars=N}function F(){x.state.context=new M(x.state.context,x.state.localVars,!0),x.state.localVars=null}function O(){x.state.localVars=x.state.context.vars,x.state.context=x.state.context.prev}function P(e,t){var n=function(){var n=x.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new w(r,x.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function E(){var e=x.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function B(e){return function t(n){return n==e?S():";"==e||"}"==n||")"==n||"]"==n?C():S(t)}}function $(e,t){return"var"==e?S(P("vardef",t),ye,B(";"),E):"keyword a"==e?S(P("form"),W,$,E):"keyword b"==e?S(P("form"),$,E):"keyword d"==e?x.stream.match(/^\s*$/,!1)?S():S(P("stat"),j,B(";"),E):"debugger"==e?S(B(";")):"{"==e?S(P("}"),F,oe,E,O):";"==e?S():"if"==e?("else"==x.state.lexical.info&&x.state.cc[x.state.cc.length-1]==E&&x.state.cc.pop()(),S(P("form"),W,$,E,Se)):"function"==e?S(Me):"for"==e?S(P("form"),Te,$,E):"class"==e||c&&"interface"==t?(x.marked="keyword",S(P("form","class"==e?e:t),Oe,E)):"variable"==e?c&&"declare"==t?(x.marked="keyword",S($)):c&&("module"==t||"enum"==t||"type"==t)&&x.stream.match(/^\s*\w/,!1)?(x.marked="keyword","enum"==t?S(Ge):"type"==t?S(Ne,B("operator"),ue,B(";")):S(P("form"),be,B("{"),P("}"),oe,E,E)):c&&"namespace"==t?(x.marked="keyword",S(P("form"),R,$,E)):c&&"abstract"==t?(x.marked="keyword",S($)):S(P("stat"),Z):"switch"==e?S(P("form"),W,B("{"),P("}","switch"),F,oe,E,E,O):"case"==e?S(R,B(":")):"default"==e?S(B(":")):"catch"==e?S(P("form"),A,I,$,E,O):"export"==e?S(P("stat"),$e,E):"import"==e?S(P("stat"),Re,E):"async"==e?S($):"@"==t?S(R,$):C(P("stat"),R,B(";"),E)}function I(e){if("("==e)return S(Ae,B(")"))}function R(e,t){return z(e,t,!1)}function H(e,t){return z(e,t,!0)}function W(e){return"("!=e?C():S(P(")"),R,B(")"),E)}function z(e,t,n){if(x.state.fatArrowAt==x.stream.start){var r=n?K:q;if("("==e)return S(A,P(")"),re(Ae,")"),E,B("=>"),r,O);if("variable"==e)return C(A,be,B("=>"),r,O)}var i=n?G:U;return b.hasOwnProperty(e)?S(i):"function"==e?S(Me,i):"class"==e||c&&"interface"==t?(x.marked="keyword",S(P("form"),Fe,E)):"keyword c"==e||"async"==e?S(n?H:R):"("==e?S(P(")"),j,B(")"),E,i):"operator"==e||"spread"==e?S(n?H:R):"["==e?S(P("]"),Ue,E,i):"{"==e?ie(ee,"}",null,i):"quasi"==e?C(V,i):"new"==e?S(function(e){return function(t){return"."==t?S(e?X:Y):"variable"==t&&c?S(me,e?G:U):C(e?H:R)}}(n)):"import"==e?S(R):S()}function j(e){return e.match(/[;\}\)\],]/)?C():C(R)}function U(e,t){return","==e?S(R):G(e,t,!1)}function G(e,t,n){var r=0==n?U:G,i=0==n?R:H;return"=>"==e?S(A,n?K:q,O):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?S(r):c&&"<"==t&&x.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?S(P(">"),re(ue,">"),E,r):"?"==t?S(R,B(":"),i):S(i):"quasi"==e?C(V,r):";"!=e?"("==e?ie(H,")","call",r):"."==e?S(Q,r):"["==e?S(P("]"),j,B("]"),E,r):c&&"as"==t?(x.marked="keyword",S(ue,r)):"regexp"==e?(x.state.lastType=x.marked="operator",x.stream.backUp(x.stream.pos-x.stream.start-1),S(i)):void 0:void 0}function V(e,t){return"quasi"!=e?C():"${"!=t.slice(t.length-2)?S(V):S(R,J)}function J(e){if("}"==e)return x.marked="string-2",x.state.tokenize=g,S(V)}function q(e){return y(x.stream,x.state),C("{"==e?$:R)}function K(e){return y(x.stream,x.state),C("{"==e?$:H)}function Y(e,t){if("target"==t)return x.marked="keyword",S(U)}function X(e,t){if("target"==t)return x.marked="keyword",S(G)}function Z(e){return":"==e?S(E,$):C(U,B(";"),E)}function Q(e){if("variable"==e)return x.marked="property",S()}function ee(e,t){return"async"==e?(x.marked="property",S(ee)):"variable"==e||"keyword"==x.style?(x.marked="property","get"==t||"set"==t?S(te):(c&&x.state.fatArrowAt==x.stream.start&&(n=x.stream.match(/^\s*:\s*/,!1))&&(x.state.fatArrowAt=x.stream.pos+n[0].length),S(ne))):"number"==e||"string"==e?(x.marked=l?"property":x.style+" property",S(ne)):"jsonld-keyword"==e?S(ne):c&&_(t)?(x.marked="keyword",S(ee)):"["==e?S(R,ae,B("]"),ne):"spread"==e?S(H,ne):"*"==t?(x.marked="keyword",S(ee)):":"==e?C(ne):void 0;var n}function te(e){return"variable"!=e?C(ne):(x.marked="property",S(Me))}function ne(e){return":"==e?S(H):"("==e?C(Me):void 0}function re(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=x.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),S((function(n,r){return n==t||r==t?C():C(e)}),r)}return i==t||o==t?S():n&&n.indexOf(";")>-1?C(e):S(B(t))}return function(n,i){return n==t||i==t?S():C(e,r)}}function ie(e,t,n){for(var r=3;r<arguments.length;r++)x.cc.push(arguments[r]);return S(P(t,n),re(e,t),E)}function oe(e){return"}"==e?S():C($,oe)}function ae(e,t){if(c){if(":"==e)return S(ue);if("?"==t)return S(ae)}}function le(e,t){if(c&&(":"==e||"in"==t))return S(ue)}function se(e){if(c&&":"==e)return x.stream.match(/^\s*\w+\s+is\b/,!1)?S(R,ce,ue):S(ue)}function ce(e,t){if("is"==t)return x.marked="keyword",S()}function ue(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(x.marked="keyword",S("typeof"==t?H:ue)):"variable"==e||"void"==t?(x.marked="type",S(pe)):"|"==t||"&"==t?S(ue):"string"==e||"number"==e||"atom"==e?S(pe):"["==e?S(P("]"),re(ue,"]",","),E,pe):"{"==e?S(P("}"),re(fe,"}",",;"),E,pe):"("==e?S(re(he,")"),de,pe):"<"==e?S(re(ue,">"),ue):void 0}function de(e){if("=>"==e)return S(ue)}function fe(e,t){return"variable"==e||"keyword"==x.style?(x.marked="property",S(fe)):"?"==t||"number"==e||"string"==e?S(fe):":"==e?S(ue):"["==e?S(B("variable"),le,B("]"),fe):"("==e?C(De,fe):void 0}function he(e,t){return"variable"==e&&x.stream.match(/^\s*[?:]/,!1)||"?"==t?S(he):":"==e?S(ue):"spread"==e?S(he):C(ue)}function pe(e,t){return"<"==t?S(P(">"),re(ue,">"),E,pe):"|"==t||"."==e||"&"==t?S(ue):"["==e?S(ue,B("]"),pe):"extends"==t||"implements"==t?(x.marked="keyword",S(ue)):"?"==t?S(ue,B(":"),ue):void 0}function me(e,t){if("<"==t)return S(P(">"),re(ue,">"),E,pe)}function ve(){return C(ue,ge)}function ge(e,t){if("="==t)return S(ue)}function ye(e,t){return"enum"==t?(x.marked="keyword",S(Ge)):C(be,ae,xe,Ce)}function be(e,t){return c&&_(t)?(x.marked="keyword",S(be)):"variable"==e?(L(t),S()):"spread"==e?S(be):"["==e?ie(ke,"]"):"{"==e?ie(we,"}"):void 0}function we(e,t){return"variable"!=e||x.stream.match(/^\s*:/,!1)?("variable"==e&&(x.marked="property"),"spread"==e?S(be):"}"==e?C():"["==e?S(R,B("]"),B(":"),we):S(B(":"),be,xe)):(L(t),S(xe))}function ke(){return C(be,xe)}function xe(e,t){if("="==t)return S(H)}function Ce(e){if(","==e)return S(ye)}function Se(e,t){if("keyword b"==e&&"else"==t)return S(P("form","else"),$,E)}function Te(e,t){return"await"==t?S(Te):"("==e?S(P(")"),Le,E):void 0}function Le(e){return"var"==e?S(ye,_e):"variable"==e?S(_e):C(_e)}function _e(e,t){return")"==e?S():";"==e?S(_e):"in"==t||"of"==t?(x.marked="keyword",S(R,_e)):C(R,_e)}function Me(e,t){return"*"==t?(x.marked="keyword",S(Me)):"variable"==e?(L(t),S(Me)):"("==e?S(A,P(")"),re(Ae,")"),E,se,$,O):c&&"<"==t?S(P(">"),re(ve,">"),E,Me):void 0}function De(e,t){return"*"==t?(x.marked="keyword",S(De)):"variable"==e?(L(t),S(De)):"("==e?S(A,P(")"),re(Ae,")"),E,se,O):c&&"<"==t?S(P(">"),re(ve,">"),E,De):void 0}function Ne(e,t){return"keyword"==e||"variable"==e?(x.marked="type",S(Ne)):"<"==t?S(P(">"),re(ve,">"),E):void 0}function Ae(e,t){return"@"==t&&S(R,Ae),"spread"==e?S(Ae):c&&_(t)?(x.marked="keyword",S(Ae)):c&&"this"==e?S(ae,xe):C(be,ae,xe)}function Fe(e,t){return"variable"==e?Oe(e,t):Pe(e,t)}function Oe(e,t){if("variable"==e)return L(t),S(Pe)}function Pe(e,t){return"<"==t?S(P(">"),re(ve,">"),E,Pe):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(x.marked="keyword"),S(c?ue:R,Pe)):"{"==e?S(P("}"),Ee,E):void 0}function Ee(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&_(t))&&x.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(x.marked="keyword",S(Ee)):"variable"==e||"keyword"==x.style?(x.marked="property",S(c?Be:Me,Ee)):"number"==e||"string"==e?S(c?Be:Me,Ee):"["==e?S(R,ae,B("]"),c?Be:Me,Ee):"*"==t?(x.marked="keyword",S(Ee)):c&&"("==e?C(De,Ee):";"==e||","==e?S(Ee):"}"==e?S():"@"==t?S(R,Ee):void 0}function Be(e,t){if("?"==t)return S(Be);if(":"==e)return S(ue,xe);if("="==t)return S(H);var n=x.state.lexical.prev;return C(n&&"interface"==n.info?De:Me)}function $e(e,t){return"*"==t?(x.marked="keyword",S(je,B(";"))):"default"==t?(x.marked="keyword",S(R,B(";"))):"{"==e?S(re(Ie,"}"),je,B(";")):C($)}function Ie(e,t){return"as"==t?(x.marked="keyword",S(B("variable"))):"variable"==e?C(H,Ie):void 0}function Re(e){return"string"==e?S():"("==e?C(R):C(He,We,je)}function He(e,t){return"{"==e?ie(He,"}"):("variable"==e&&L(t),"*"==t&&(x.marked="keyword"),S(ze))}function We(e){if(","==e)return S(He,We)}function ze(e,t){if("as"==t)return x.marked="keyword",S(He)}function je(e,t){if("from"==t)return x.marked="keyword",S(R)}function Ue(e){return"]"==e?S():C(re(H,"]"))}function Ge(){return C(P("form"),be,B("{"),P("}"),re(Ve,"}"),E,E)}function Ve(){return C(be,xe)}function Je(e,t,n){return t.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return O.lex=!0,E.lex=!0,{startState:function(e){var t={tokenize:m,lastType:"sof",cc:[],lexical:new w((e||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new M(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),y(e,t)),t.tokenize!=v&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",function(e,t,n,r,i){var o=e.cc;for(x.state=e,x.stream=i,x.marked=null,x.cc=o,x.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?R:$)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return x.marked?x.marked:"variable"==n&&k(e,r)?"variable-2":t}}(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==v)return e.Pass;if(t.tokenize!=m)return 0;var i,l=r&&r.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==E)s=s.prev;else if(u!=Se)break}for(;("stat"==s.type||"form"==s.type)&&("}"==l||(i=t.cc[t.cc.length-1])&&(i==U||i==G)&&!/^[,\.=+\-*:?[\(]/.test(r));)s=s.prev;a&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var d=s.type,h=l==d;return"vardef"==d?s.indented+("operator"==t.lastType||","==t.lastType?s.info.length+1:0):"form"==d&&"{"==l?s.indented:"form"==d?s.indented+o:"stat"==d?s.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||f.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?a||o:0):"switch"!=s.info||h||0==n.doubleIndentSwitch?s.align?s.column+(h?0:1):s.indented+(h?0:o):s.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:l,jsonMode:s,expressionAllowed:Je,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=R&&t!=H||e.cc.pop()}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":10}]},{},[1]);
|
||
//# sourceMappingURL=payroll.js.map
|